[video output=day226 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Handling Multiple Metagame Modes" vod_platform=youtube id=2X6A70ONyO0 annotator=insofaras]
[0:03][Intro, plans]
[1:19][Description of the 'meta-game' elements that Handmade Hero needs]
[4:54][Setting up, compiling and running the current state of the game]
[6:21][Choosing the first programming task for today]
[7:30][Reviewing the cut-scene code]
[11:36][Adding the concept of game modes]
[14:32][Adding a union to game_state to hold individual state for each game mode]
[16:54][Changing UpdateAndRenderGame to dispatch to other functions based on the current game mode]
[21:33][Modifying the cut-scene code to use the new game mode concept]
[25:37][Begin implementing the switching between game modes]
[27:27][Changing the WorldArena in the game_state to ModeArena, to be used by all game modes]
[29:34][Determining how parameters will be passed to game modes when switching between them]
[31:03][Letting the caller of SetGameMode do the initialization of the new mode, to avoid having to pass unnecessary parameters]
[33:40][Creating an arena in the World struct, for exclusive use by the main World game mode, instead of having it use the arena in the game_state struct]
[35:46][Exposing the SetGameMode function, and updating PlayIntroCutscene and PlayTitleScreen to use the ModeArena]
[36:18][Making world based functions use the new world-specific arena]
[37:21][Finish implementing the game mode switch statement in UpdateAndRenderGame]
[38:34][Adding initialization code for the world-specific arena]
[41:06][Re-organising the main World game code to be in functions specific to the new World game mode]
[44:01][Running the game to see how the new code is working]
[45:02][Separating out the persistent elements of game_state from those specific to the World game mode]
[48:23][Moving things around to more appropriate files and to appease the compiler]
[53:59][Changing many world-specific functions to work with a game_mode_world struct instead of the game_state struct]
[1:01:46][Adjusting the creation of memory arenas in the initialization code]
[1:05:14][Fixing the remaining compile errors]
[1:06:41][Out of time, running the game with the world mode currently inaccessible until the cleanup work is completed at a later date]
[1:07:08][Q&A][:speech]
[1:08:07][@actbinary][How do the memory areas work?]
[1:08:31][@blah238][Well since no one's asking, have you heard about AMD open sourcing a lot of their GPU stuff?]
[1:09:48][@XEnDash][Should the world mode changing be prefetched like the cut-scenes changing?]
[1:10:21][@elxenoaizd][So by 'meta-game' do you mean like the pre-game stuff?]
[1:10:31][@thehappypumpkin][Hi! I just finished my first semester of computer science in school! Just learned some basic Java, but I was wondering on if you have any tips moving forward. Also, do you know of any colleges that have good computer science departments?]
[1:11:18][@evraire][Sorry slow night, the chat erupted into a flame war over the exclusion of option menus in games \:-P]
[1:11:36][@Culver_Fly][I wonder if there's a specific reason you put the 3 game_mode structs into a union?]
[1:11:48][@elxenoaizd][So I have this generic USB controller that's not being detected by XInput, any ideas how to go about detecting it? Use DirectInput? Or try to use an Xbox controller emulator or something?]
[1:12:53][Wrap up][:speech]
[/video]
