Handmade Hero»Forums»Code
Shazan Shums
159 posts
Some day I will make quality software. Programming FTW.
Implementing looped code editing in any project
Any basic guidelines to follow to implement looped live code editing..
Please explain.. I am a beginner
Mārtiņš Možeiko
2562 posts / 2 projects
Implementing looped code editing in any project
Edited by Mārtiņš Možeiko on
Looped live code editing consists of two parts - live game code reloading and looped state playback.

For live game code reloading it really depends on structure of your game. If you do what HH does - keeps memory allocation in platform layer and keeps all game code in dll, then it is as straight forward as reloading dll file.
See Day 22 video: https://hero.handmade.network/episode/win32-platform/day022

Looped state playback requires to record game state + input (to memory or file, doesn't matter):
a) at beginning of recording save all game state
b) record every input per frame
c) at loop end start repeating playback.
Playback consists of restoring game state and then replay recorded input, while ignore real input.
For more info watch Day 23 video: https://hero.handmade.network/episode/win32-platform/day023