Hi everyone
I am working on a ghostcar in a vehiclegame.
I am able to record and replay my inputs but somehow when I try this with my custom vehicle the inputs seem to be off.
At first I sed the vehicle preset and modyfied the blueprint of the sedan. When I test it everything is allright.
When I switch to my custom vehicle the movement is off.
My workflow:
i toggle a boolean that enables my recording.
I save the inputs of my playercharacter everysecond in an structure (Foward Input, Right Input)
When I press my recording button again, I stop recording and spawn my ghostcar and feed my structure to it as well as the ticks it took my recordung.
In my ghostcar blueprint on event tick I inrease an integer which is compared to the tick integer I got from the playercharacter. Then I use the integer to get the inde of my struct array and use it to drive my throttle and steer input.
This I do at the sedan and my custom ghost car blueprint but like I said, my custom vehicle moves different.
Has anybody an idea why? Or has anybody achieved something similar?
Greetings
Evil_Fischi
Hi Matthew,
I was saving it every tick and I had a FPS lock at 30 frames.
I wasn’t shure how the Phys X system works so I did not know if this was a bug or my fault.
Thank you for the forum link, I may missed this thread…
I will give it a try tomorrow.
Thank you
Hello Evil_Fischi,
As this is in the Bug Reports section, I’m going to focus on why this functionality isn’t working. It may be best to ask in the Blueprint Scripting or C++ Programming sections or on our if you would like help setting up this functionality.
There are two issues with trying to do a setup like this. The first is the unpredictability of the Phys X system. The Phys X system is not perfect and will vary every time you collide into something, even if you hit it at the exact same angle/speed. This applies to all physics calculations.
The second reason is that, while ticks are very rapid, they aren’t immediate. The lower your framerate, the lower your tickrate will be. At 60 fps, there is still a 16.66 (repeating) ms gap between every tick. This means that if the input is released between a tick, the recording may hit that input anywhere between 0 and 16.66 ms too late. As the framerate decreases, this becomes much more obvious.
For these two reasons, I don’t believe this kind of setup would be able to work correctly.
Also, one thing that you mentioned was “I save the inputs of my playercharacter everysecond in an structure.” Do you mean that you’re storing them on Tick or literally every second? If it’s the latter, this wouldn’t be nearly accurate enough.
It seems like some users on the forums have also looked into doing this.