Bonsai Posted September 24, 2016 Share Posted September 24, 2016 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 Link to comment
Dealman Posted September 24, 2016 Share Posted September 24, 2016 (edited) 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 September 24, 2016 by Dealman 1 Link to comment
Bonsai Posted September 24, 2016 Author Share Posted September 24, 2016 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. Link to comment
Dealman Posted September 26, 2016 Share Posted September 26, 2016 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. 1 Link to comment
Bonsai Posted September 28, 2016 Author Share Posted September 28, 2016 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. Link to comment
Dealman Posted September 28, 2016 Share Posted September 28, 2016 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. Link to comment
MTA Team ccw Posted September 28, 2016 MTA Team Share Posted September 28, 2016 Try setting:bandwidth_reduction to maximumlightweight_sync_interval to 200 Link to comment
Dealman Posted September 29, 2016 Share Posted September 29, 2016 13 hours ago, ccw said: Try setting:bandwidth_reduction to maximumlightweight_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? Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now