Forums
Opponent starts early in replay - Printable Version

+- Forums (https://www.vdrift.net/Forum)
+-- Forum: Community (https://www.vdrift.net/Forum/forumdisplay.php?fid=3)
+--- Forum: Bugs (https://www.vdrift.net/Forum/forumdisplay.php?fid=7)
+--- Thread: Opponent starts early in replay (/showthread.php?tid=593)



Opponent starts early in replay - thelusiv - 03-31-2007

Playing around tonight I tried recording a replay in single race mode, driving the CT against the NS on Barcelona. I sucked for 2 laps but came back in the 3rd and beat the NS. I spun out once when way ahead and ended up backwards on the road in reverse watching the NS catch up and pass me...then when I played the replay, the NS starts way before my car, is in front of my car when I spin, and wins (even though my time is lower than him), and is sorted first on the results screen. It seems to me that the opponent is getting started long before the player in replays.It could be because the opponent's recording starts after the player recording, but both are started at the same time. Anybody have any ideas why this might be? I haven't looked closely at the AI replay recording code or the replay playback code yet, will soon.


- rookie1 - 03-31-2007

Actually the record reply function does not record AI driver's play at all. At least this is what I know unless someone has changed the reply code. I think when you replay a record single race game, the game just create the AI driver and drive as if it's a single race game.

I'm not sure why the opponent car start earlier though. Could it be because the brake holding code at the start of the race was not effective when it's a reply?


- thelusiv - 04-03-2007

So, any idea how to fix this? I haven't had much chance to look at it again, I think Joe might have fixed something small related to this, but not sure.


- joevenzon - 04-03-2007

The best way would be to record replay data for the AI. This would be made easier if we refactored the code a bit.


- thelusiv - 04-03-2007

I remember that in network games the replays seemed to get all the cars recorded, can we make that work for AI too?


- flo - 02-10-2010

This thread is a bit old, nevertheless I'm interested to replay the AI driver. If I record a "single race", only the human driver is shown in the replay and no AI driver at all.

Any suggestion, maybe to simply set a pointer to the AI car, within the "replay.StartRecording" function?

flo


- joevenzon - 02-11-2010

In game.cpp, adjust the calls to replay.StartRecording and replay.RecordFrame to pass the AI car's information instead of the local player's information.


- flo - 02-11-2010

Great, that worked!
Is it possible to play "*.vdr" file out off VDrift, respectiveley burn it to DVD or is it, as I supose, just a text file, VDrift reads-out data?


- joevenzon - 02-11-2010

It's a binary file with data about control inputs and car state, so unfortunately no, nothing but VDrift will play it.