[video output=day057 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Spatially Partitioning Entities" vod_platform=youtube id=nAFuhA8xqTk annotator=schme annotator=Miblo]
[1:15][Recap]
[3:11][handmade.cpp: Create more rooms]
[4:22][Debugger: Inspect GameState while traversing the world]
[7:20][Consider creating a spatial partition]
[10:55][Blackboard: Spatial partitions]
[13:59][handmade_world.cpp: Introduce ChangeEntityLocation]
[18:13][handmade_world.h: Rename AbsTile to Chunk and add ChunkSideInMeters to world]
[19:59][handmade_world.cpp: Continue writing ChangeEntityLocation]
[22:36][Discuss making FirstBlock a pointer rather than doing the block copy]
[25:02][handmade_world.cpp: Continue writing ChangeEntityLocation]
[31:56][Blackboard: Keeping the free space at the head of the list]
[33:10][handmade_world.cpp: Continue writing ChangeEntityLocation]
[37:28][Blackboard: Moving the final entry into the newly freed space]
[38:51][handmade_world.cpp: Continue writing ChangeEntityLocation]
[42:15][On spending time thinking about data structures vs memory management]
[43:18][handmade_world.h and handmade_world.cpp: Manage the memory]
[46:51][handmade_world.cpp: Update InitializeWorld and remove GetChunkPositionFor]
[48:09][Update the sense of AreOnSameTile]
[49:06][Introduce IsCanonical]
[52:06][Continue cleaning up]
[55:58][handmade.cpp: Change to using ChunkZ]
[56:53][Introduce ChunkPositionFromTilePosition]
[58:34][Write ChunkPositionFromTilePosition]
[1:02:12][Unplug and plug the keyboard back in]
[1:03:03][handmade_world.cpp: Finish cleaning up]
[1:04:14][Q&A][:speech]
[1:05:39][Q: Can you please go over the lasagne code again that goes through the linked list and moves around the entities? And can you remove the note in RecanonicalizeCoord about toroidal topology?]
[1:15:22][Q: Are you dropping frames? Things are glitchy]
[1:15:51][Q: Do you use Bink for videos?]
[1:16:17][Q: For someone who does a lot of coding, nothing seems to be going your way today, including the stream integrity]
[1:16:33][Q: What is your opinion on things like bunny-hopping or other movement mechanics that are bugs in the code, but contribute to gameplay, e.g. if there was a technique for getting speed in your game, albeit difficult? Would you keep it?]
[1:17:13][Q: What do you think about namespacing functions like Entity_GetLocation instead of GetEntityLocation?]
[1:17:50][Q: About PushStruct, isn't it true that it can actually fail if you are out of preallocated memory? So wouldn't you still have to check if your custom block allocation fails if your world gets too big?]
[1:19:04][Q: Why do you need if(Chunk) after Assert(Chunk)?]
[1:19:26][Q: Can you please explain, when you comment your code, what's the logic of having less comments on very big chunks of code?]
[1:21:37][Q: When you said the code today wasn't that performance critical, I instantly thought about a machine gun - stone thrower battle just across a chunk edge]
[1:22:01][We are done with questions][:speech]
[/video]
