Bonsai

Time between vehicle/player sync

Recommended Posts

Hey,

I need to get the positions of vehicles that are occupied by players clientside.

But as soon as they are far away, those positions are not accurate anymore.

Actually, they just don't change for about 1500 ms before they are updated again.

I changed the "lightweight_sync_interval" in the server config file to 200 ms, but that didn't help.

So, is there a solution to get the actual values, or does only the server have them at any time?

 

Bonsai

Share this post


Link to post

I'm assuming MTA uses prediction and/or interpolation for vehicles to minimize network load, probably in co-junction with whether they're streamed in or not.

Tried getting the position via the server(the server should know where they are at any given time) and then passing it on to clients, alternatively maybe using element data? Not the most efficient way of doing things, but works for testing purposes.

Is this something you need to do every frame?

Edited by Dealman
  • Like 1

Share this post


Link to post

Yeah, its needs to be done every frame, thats how I noticed that the positions just dont update for some time.

Thats why I can't pass it to the clients or do it serverside.

Share this post


Link to post

Tried looking at some of the custom radars available and see how they sync things?

Other than that, all I can really think of is getElementData. If I recall correctly you can get the posX, posY and posZ values via their element data. Though, I don't really see why this would be updated differently.

  • Like 1

Share this post


Link to post

On radars, at least custom ones, not sure about the default one, you can see how the blips stop moving smooth when players have a certain distance.

I tried getting positions serverside just for testing, which is completely impossible due to timers being way off. I was using 50ms but it took usually around 80ms for a function to be executed. Not sure if thats normal, the server was pretty idle, so I guess it is normal. But I was only doing that to check the positions anyway.

It seems to be impossible to get accurate positions of non streamed in vehicles.

It might somehow work for vehicles in SA, but on maps the positions probably cant be right, since the objects are streamed out aswell, so the vehicles dont actually move on them, but fly around.

Share this post


Link to post

Then I'm not quite sure, I don't really have the ability to reliably test this on my end at the moment. Best bet is if one of the higher-ups shed some light on this subject, such as @ccw. :)

What exactly is it you need this for? Might help to come up with a solution/workaround. One thing is always predicting where they're going using the position, velocity and rotation I suppose - but prediction is a pain to try and get half-decent.

Share this post


Link to post

Try setting:
bandwidth_reduction to maximum
lightweight_sync_interval to 200

Share this post


Link to post
13 hours ago, ccw said:

Try setting:
bandwidth_reduction to maximum
lightweight_sync_interval to 200

I'm a bit curious since I don't know how bandwidth_reduction works, but wouldn't having a lower setting be better for more frequent updating? Or do they work in co-junction somehow?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.