pro-mos Posted May 26, 2016 Share Posted May 26, 2016 I have a table full of x and y's and z of positions. Lets say i want to move a car from point A to B using the positions table (many positions). If i used the event "onClientRender" to move the car, the car will move too fast. The other option is to use a timer of 50 ms to set the position of the car, but this makes the car move too slow and jumps a little. What else can i try? Link to comment
Anubhav Posted May 26, 2016 Share Posted May 26, 2016 use onClientRender with getTickCount Link to comment
RenanPG Posted May 28, 2016 Share Posted May 28, 2016 onClientRender interpolateBetween Link to comment
Moderators IIYAMA Posted May 28, 2016 Moderators Share Posted May 28, 2016 onClientPreRender onClientRender renders too late. Link to comment
Moderators Citizen Posted May 28, 2016 Moderators Share Posted May 28, 2016 onClientPreRender onClientRender renders too late. Well according to this diagram, both events are rendered "too late" to move an object. On both events the vehicle's position will be visually updated at the next frame and both events are triggered at the same frequency so onClientRender is totally fine. Link to comment
Moderators IIYAMA Posted May 29, 2016 Moderators Share Posted May 29, 2016 That is fine when you have a pc that can handle everything. If the map you run renders very slowly, you might end up inside the vehicle when you are standing on it. As for the amount of dx you render (depending on the handler priority), the longer the delay will be. The moment when updating the position of the player and the vehicle, it should be as close as possible to each other. Syncs should have priority over effects. If you disagree with that, it is fine. Link to comment
RenanPG Posted May 29, 2016 Share Posted May 29, 2016 I think it is easier for your purpose: (You'll need to create an object alpha 0 and attach to your car) https://wiki.multitheftauto.com/wiki/MoveObject Link to comment
Dealman Posted May 29, 2016 Share Posted May 29, 2016 How are you storing the data? I wrote a killcam of sorts for destruction derby a while back and I recall using both position, rotation and velocity. I never got around to finishing it before I left MTA, so I can't speak for its efficiency but it "replayed" vehicle movement pretty nicely. Link to comment
pro-mos Posted June 2, 2016 Author Share Posted June 2, 2016 How are you storing the data? I wrote a killcam of sorts for destruction derby a while back and I recall using both position, rotation and velocity.I never got around to finishing it before I left MTA, so I can't speak for its efficiency but it "replayed" vehicle movement pretty nicely. It's something like killcam, it just rewinds what you've done in your vehicle I'm storing the data (pos, velocity, rotation) in a table I'm using onClientRender, but it's too fast and if you use rewind over and over, the speed increases insanely for no obvious reason. Still haven't tried to use tick count with it. Link to comment
Moderators IIYAMA Posted June 2, 2016 Moderators Share Posted June 2, 2016 The most important thing when are recording MTA, is to detect (important/large) changes. You can reduce a lot of data when you do that. You want to make the data as small as possible. So when you walk one direction and the rotation and Z as doesn't change much. You can delete all points in between. Of course you can record it first and later optimise. Link to comment
pro-mos Posted June 2, 2016 Author Share Posted June 2, 2016 The most important thing when are recording MTA, is to detect (important/large) changes. You can reduce a lot of data when you do that. You want to make the data as small as possible. Great idea tho, but I think no one will face a problem with big data, except crappy computers. Link to comment
Moderators IIYAMA Posted June 2, 2016 Moderators Share Posted June 2, 2016 GTA san is limited to only 1 CPU core and MTA is also limited to 1 core. If you make your code unoptimised, new CPU's with more cores will not make a lot of difference. The Ghz per core isn't something that will be increased dramatically, so yes a little bit optimisation isn't too much to ask. I am having an Intel i7-3770K 3.50Ghz 4 cores with multithreading to virtual 8 cores. If I write very unoptimised code, I am still stuck at only 1 core. That is when my GTA san is starting to crash. Good CPU? Not for MTA and unoptimised code. And if you want to share it with your friends = download speed. 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