[video output=day288 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Finishing Brains" vod_platform=youtube id=aY2Lujojmg0 annotator=Miblo]
[1:00][Recap and set the stage for the day]
[2:41][handmade_sim_region.cpp: Introduce GetOrAddBrain]
[7:15][handmade_sim_region.cpp: Introduce a GetHashFromID for brain_id]
[9:03][handmade_sim_region.cpp: Remove AddEntityRaw and inline AddEntity's functionality in BeginSim]
[11:44][handmade_entity.h: Move struct brain in from handmade_sim_region.h, add an array of Parts to it, and introduce brain_hero_parts]
[16:28][Run the game and find that nothing happens]
[16:49][handmade_world_mode.cpp: Set the Head and Body for BrainHero in AddPlayer]
[17:41][Run the game and spam the world with heroes]
[20:12][Blackboard: ddP and the benefit of assigning accelerations before simulating them together]
[22:36][handmade_entity.h: Add ddP to entity]
[23:48][handmade_world_mode.cpp: Make the controller code in UpdateAndRenderWorld just get the controller that corresponds to the given hero]
[28:06][handmade_world_mode.cpp: Be Mr Slypants Slypantsyman and base the ControllerIndex in UpdateAndRenderWorld on the Brain->ID.Value][quote 486]
[29:43][handmade_entity.h: Introduce reserved_brain_id]
[31:11][handmade_world_mode.cpp: Make AddPlayer take BrainID and return void]
[33:09][Run the game and find that we can change the hero's facing direction]
[33:44][handmade_world_mode.cpp: Remove BrainID, ddP, dSword, dZ, Exited and DebugSpawn from controlled_hero in from handmade.h and make UpdateAndRenderWorld initialise them directly]
[38:20][handmade.h: Add BraidID back to controlled_hero]
[41:00][handmade_world_mode.cpp: #if 0 the Planted code in UpdateAndRenderWorld]
[42:20][Debugger: Investigate how we got into Hopping mode without a CameFrom]
[47:06][handmade_sim_region.cpp: Reenable and fix ConnectEntityPointers]
[48:29][Debugger: Break into UpdateAndRenderWorld and investigate how Occupying is being set to 0]
[49:57][Hunt this guy down before stopping][quote 487]
[50:35][handmade_sim_region.cpp: Make ConnectEntityPointers able to break on Entity->ID.Value 219]
[52:25][handmade_world.cpp: Make PackEntityIntoChunk do the same for the Source]
[54:44][handmade_world_mode.cpp: Make AddPlayer put the Body and Head in their correct BrainSlot]
[55:49][handmade_entity.h: #define BrainSlotFor in order to name the slots using pointer arithmetic]
[1:00:25][Rant on compiler vendors making programmers' lives difficult]
[1:01:32][handmade_entity.h: Introduce BrainSlotFor_ to return a brain_slot]
[1:02:31][Q&A][:speech]
[1:02:48][@fr0styninja][Can we have a look at the ctime stats so far?]
[1:04:39][@dudeinbasement1][What will we do for the "production" Assert?]
[1:04:56][@Miblo][May this brain system allow for things like two characters carrying a felled tree between them, with both of their brains controlling the movement of the tree?]
[1:07:56][@fr0styninja][Try not to make the brains self-aware. We can't have stumpy over there taking over the world]
[1:08:22][@thesizik][For brain types, why not an enum for the array indexes?]
[1:11:37][@josianmarriott][How would you go about making game entities moddable?]
[1:12:32][@josianmarriott][I was thinking defining whole new types of entities]
[1:14:20][@josianmarriott][I guess there's no way to mitigate dll security concerns?]
[1:16:00][@saticmotion][So all the brain code is now in the switch(Brain->Type). How many brains do you expect to have? What if we have 100 brains, will you keep all the code there?]
[1:16:38][We are out of time][:speech]
[/video]
