Handmade Hero»Forums»Code
Tom Montgomery
4 posts
[Day 23] Do input record/playback in game layer?
Is there a reason that the record/playback of input needs to be done in the win32 layer, rather than in the game layer? We seem to be recording the game_input struct, and we have debug functions to do file access, so it feels like this only needs to be done once, rather than for each platform. I'm still catching up, and so I realise I may have missed something that comes later, or just something obvious that stops you doing this.

If different platforms played back at the same frame rate etc, you could maybe even use files created on one to playback in another, although that might not really be needed unless you create a load of 'tests' for your game.
Mārtiņš Možeiko
2559 posts / 2 projects
[Day 23] Do input record/playback in game layer?
I think this is because we don't need to record/playback input on all platforms. For example, most likely Casey won't be recording input on Raspberry Pi and Android. Recording input is only for tuning purposes which should be done on platform you are most comfortable developing and debugging. So there is no need to complicate architecture so it can accommodate input recording/playback in cross-platform way.
Tom Montgomery
4 posts
[Day 23] Do input record/playback in game layer?
Makes sense, especially if the game code runs similarly on each platform. Guess I'm just used to having to test different platforms to ensure they behave the same during tests.
Casey Muratori
801 posts / 1 project
Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.
[Day 23] Do input record/playback in game layer?
We will probably move some of the playback functionality up a bit once we have more than one platform layer, but it would be premature to do so at present.

- Casey