First let me say that I'm new to programming, so if I'm asking stupid questions, sorry.
I've been working on a game on linux, in C with SDL, and trying to implement some of the tricks/ideas that Casey shares throughout the series. I'm still very, very early in the series.
I just got up to episode 23, Looped Live Code Editing, where he saves the players input to disk and plays it back. I'm not sure how to do this with SDL and I very much would like to figure out how to do it since not only will it help speed up testing things, but I could potentially use it in game since I'm planning on having time travel mechanics .
Casey just writes his memory block to disk and it seems to handle recording the inputs itself. I'm not handling memory in exactly the same way as Casey though. I keep everything in a large GameState struct and malloc that at the start, so I don't think I can save/load the way he does? Please correct if I'm wrong, because his way does look much easier.
I have saving/loading working by going through each member of GameState, and write/read it to disk. I'm not sure how to do this with SDL events though.
How do I write an SDL event to file? And when reading it back in, how will the game know the timing on each event?
I'm either missing something or over thinking things! Thanks for any help.