• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Replay Effect

I

IndieCrypt

Guest
Hello,

I am hear to ask if anyone knows how to create a Replay Effect... So what I want is when a player moves right for example and once a button is pressed he replays that action... But if it was more advanced like, looked at the top right, double tapped down, moved right and left clicked, would I simply just store every step into variables!?
 
T

TDSrock

Guest
That is a possibility but simpler would be to log all the inputs. As then you only need to log on a change.

As if the log shows:
Code:
time: 10 pressed: A
time: 140
you can assume the player held A from 10 to 140.
Basically, come up with a way to store it, read it and execute it.
 
S

SusiKette

Guest
You also should keep in mind that if you want to make a replay system, you also have to take care of any random values you may be rolling. Best way would be storing the RNG (Random Number Generator) seed to the replay data and feed it back to the RNG to get consistent results. GM has it's functions to get and "feed" the RNG seed number. If I remember correctly they were random_get_seed(); and random_set_seed(value);
 
  • Like
Reactions: Yal

Yal

šŸ§ *penguin noises*
GMC Elder
Another idea is to use ds_lists to just 'record' actions each step, or the stuff you need (e.g. if you want to do a Ghost replay for a racing game, record its X, Y and direction for each step). Then you can just read the values from the list when you want to replay, and not have to worry about any calculations you'd need to do if you just record inputs.
 
Top