In my game I am working on you use bombs and other ablities to move and deal damage to your oppenents. I have created a system that logs the moves you do in a turn and replays them to try to recreate the same effect. Even though the moves are being recorded and played properly it is not always accurate to the orginal moves, So basically I am applying the same force to the player, who is in the position they were originally in, and the player is not ending in the same posistion. How do I fix this.
it should work on your machine but not the same on others. probably you need to figure out a simple way of doing this with more control on moving the units and recording them
It might work better to record positions and other data at regular interval (probably not FixedUpdate, as its not regular), and play those back. This will end up being about the same amount of data as recording inputs anyway.
I have considered this as a last resort but I really don’t want to because my game is a turn based game and after both player submit their turn it is supposed to play out there actions at the same time to allow for predictions and stuff.
Fixed update isn’t fixed? What should I use then
Right now it isn’t working on my pc do you have any ideas why? Do you need more information?
It plays catch-up with Update, rather than happening exactly on the fixed time step.
I think you might need to handle this as less of a playback of inputs, but as a record of events that get played back. For example, for a player moving to a particular position, rather than record those movements, you just record the end position (or maybe points on a path), and in your playback you keep moving the player until they reach that end point.
Im actually already doing this for another part of my game so I could do this if I wanted to but I dont want to use this solution because due to the nature of the game I feel it could cause problems.
I think you should be doing some tests rather than assuming.