[video output=day340 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Cleaning Up World / Sim-Region Interactions" vod_platform=youtube id=WvM38blp5QI annotator=Miblo] [0:08][Welcome back after having moved to the Molly Rocket offices] [0:45][On switching to a full 3D pipeline] [9:58][todo.txt: Consult the TODO list] [11:53][Blackboard: Sim Region and World] [14:27][Blackboard: Creation] [16:26][Consider how the entity (un)packing currently works] [19:00][handmade_sim_region.cpp: Pull in the entity packing functionality from handmade_world.cpp] [22:54][handmade_world.cpp: Rename PackEntityIntoChunk() and PackEntityIntoWorld() to overloaded UseChunkSpace() functions] [24:43][handmade_world_mode.cpp: Consider allowing many entities to be stuffed into a sim region] [27:24][handmade_world_mode.cpp: Simplify BeginEntity() and EndEntity()] [29:05][handmade_sim_region.cpp: Introduce CreateEntity()] [30:07][handmade_sim_region.h: Add a NullEntity to the sim_region struct for CreateEntity() to use if we've hit the MaxEntityCount] [33:30][handmade_sim_region.cpp: Consider how to insert the entity into the hash table] [36:25][handmade_sim_region.cpp: Reorganise BeginSim() to only add an entity if there's room for it] [37:54][handmade_sim_region.cpp: Introduce AddEntityToHash() for CreateEntity() to call] [40:56][handmade_world_mode.cpp: Introduce AllocateEntityID() for BeginEntity() to call] [41:34][handmade_world_mode.cpp: Make PlayWorld() create a dummy sim region for BeginSim() and EndSim() to use] [47:01][Run the game and see what we've destroyed] [48:30][handmade_world_mode.cpp: Make AddPlayer() set and unset the creation region] [49:16][Run and investigate what else is failing] [50:17][handmade_sim_region.cpp: Make TransactionalOccupy() check that we have a desired traversable_reference] [52:18][Step into EndSim() and inspect the Region and Entity] [56:15][handmade_sim_region.cpp: Consider removing ChunkDelta from EndSim()] [1:00:22][Step back into EndSim() and inspect the DestE and Entity] [1:01:11][handmade_world.cpp: Prevent UseChunkSpace() from taking a sim_region] [1:02:09][Q&A][:speech] [1:03:16][handmade_sim_region.cpp: Comment out the MaxEntityVelocity assertion in MoveEntity(), run the game and continue investigating] [1:04:35][handmade_sim_region.cpp: Make GetSimSpaceTraversable() only operate if it has an Entity, run the game and see the cool] [1:05:24][@snoringtortoise][Did you resolve the kerning / horizontal advance for kanji characters? I found when implementing it myself on OSX (at the font table level) that Arial doesn't actually have kanji in it. It seems Windows (and Mac - the higher level APIs like CoreText) load multiple font files for you if it detects that you are trying to load a codepoint that is outside the range of a particular font file] [1:07:24][handmade_sim_region.cpp: Look through EndSim()] [1:09:02][@cyberpunkhobo][Can you explain what the idea is behind using a zero-sized sim region bounds?] [1:10:12][Run the game and note how everything is gravitating towards that lower-left area] [1:11:48][handmade_world_mode.cpp: Make EndEntity() correctly compute the Entity->P] [1:14:01][Run the game and see that we're a little better] [1:17:18][Consider why other entities are able to traverse the trees, while we aren't] [1:19:08][@invinciblechaz][I've just started watching this stream. How often have you needed to refactor major parts of your code?] [1:27:35][@thenoble1][Is the ms counter in the corner the render time for the frame?] [1:30:18][build.bat: Switch to -O2, run the game and consult the profiler] [1:32:11][@nxsy][Need OpenGL query timers] [1:32:50][@phort99][I was about to ask what would happen if one of those snakey guys got themselves stuck in a corner, but I see one already did] [1:34:59][@snoringtortoise][Off-topic: Since there wasn't any sound in the pre-stream, are there any sneak peaks regarding HandmadeCon you can give us?] [1:38:21][todo.txt: Add the trees on traversables bug to the TODO list] [1:39:10][Close it down][:speech] [/video]