cinera_handmade.network/cmuratori/hero/code/code627.hmml

58 lines
5.9 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[video output=day627 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Opening Doors with Tiles" vod_platform=youtube id=07lWGBjnhS4 annotator=Miblo]
[0:02][Welcome to the stream][:speech]
[1:05][Traverse the orphanage to our new dungeon door][:"entity system" :run]
[3:29][Our plan for doors: Q*bert style light-up tiles that unlock doors][:"entity system" :run]
[4:01][Light-up tile logic][:"entity system" :gameplay :speech]
[6:50][Create light-up door switch tiles, introducing brain_switches for brain_type to contain][:"data structure" :"entity system"]
[10:40][Introduce ExecuteBrainSwitches()][:"entity system"]
[24:42][Augment entity_traversable_point with a PrevOccupier for TransactionalOccupy() to set][:"data structure" :"entity system"]
[33:18][Traverse the orphanage][:"entity system" :run]
[33:35][Make ExecuteBrainSwitches() call TransactionalOccupy(), and handle switch state][:"entity system"]
[36:51][Rename IsEqual() to AreEqual()][:language]
[38:22][Make ExecuteBrainSwitches() depress the switches][:"entity system"]
[39:06][Make GenerateRoom() initialise a RoomSwitchBrain using AddBrain()][:"entity system" :"procedural generation"]
[47:05][Our large garden lacks a colourised tile][:"entity system" :"procedural generation" :run]
[49:29][Step into our tile colourisation path in GenerateRoom()][:"entity system" :"procedural generation" :run]
[50:17][Large orphanage rooms contain a colourised tile][:"entity system" :"procedural generation" :run]
[50:51][Make GenerateRoom() colourise our test tile faintly and add a room switch on it][:"entity system" :"procedural generation"]
[54:12][Hit a read access violation upon occupying our test switch][:"entity system" :"procedural generation" :run]
[54:42][Make ExecuteBrainSwitches() colourise occupied switches][:"debug visualisation" :"entity system"]
[57:05][Traverse the orphanage][:"entity system" :"procedural generation" :run]
[57:46][Make ExecuteBrainSwitches() only process occupation for a valid Unlock][:"entity system"]
[58:06][Our switches toggle on, but the snakes can also toggle (and get trapped on) them][:"entity system" :run]
[1:00:25][Check the door creation logic in GenerateRoom()][:"procedural generation" :research]
[1:03:07][Doors open before we've landed on their switch][:animation :"entity system" :run]
[1:04:01][Make GenerateRoom() create more test door switches][:"procedural generation"]
[1:05:17][Our squares of switches work great][:"entity system" :run]
[1:06:42][Make ExecuteBrainSwitches() spring the switches back up (but remain lit) when their occupier departs][:"entity system"]
[1:08:30][Our switches spring back up after occupation][:"entity system" :run]
[1:08:58][Possibly flawed door unlocking when a door and its switches aren't in the same sim region][:"entity system" :run]
[1:10:12][Make ExecuteBrainSwitches() only partially submerge opened doors and unlock them once][:"entity system"]
[1:11:53][We do have an already opened door][:"entity system" :run]
[1:13:23][Consider how to make brains work across sim regions][:"entity system" :research]
[1:15:17][Add a GenEntity_IsSwitch and introduce PlaceTilePattern() for GenerateRoom() to use][:"entity system" :"procedural generation"]
[1:20:53][Our door switches now don't fully work][:"entity system" :"procedural generation" :run]
[1:22:45][Make PlaceTilePattern() chain switch tiles together][:"entity system" :"procedural generation"]
[1:27:18][Hit our assertion in Layout()][:"entity system" :"procedural generation" :run]
[1:27:46][Make PlaceTilePattern() produce fewer switch tiles][:"entity system" :"procedural generation"]
[1:28:09][Hit our assertion in Layout()][:"entity system" :"procedural generation" :run]
[1:28:22][Step through PlaceRoomAlongEdge()][:"entity system" :"procedural generation" :run]
[1:29:20][Temporarily compile out PlaceTilePattern()][:"entity system" :"procedural generation"]
[1:29:29][Do not hit that assertion in Layout()][:"entity system" :"procedural generation" :run]
[1:30:09][Investigate our assertion hit in Layout()][:"entity system" :"procedural generation" :research]
[1:35:29][Prevent PlaceTilePattern() from using Entropy][:"entity system" :"procedural generation"]
[1:35:52][No longer hit that assertion in Layout(), but now hit the Query.Found one in GenerateRoom()][:"entity system" :"procedural generation" :run]
[1:36:15][Inspect our EntityGroup][:"entity system" :"procedural generation" :run]
[1:36:58][Investigate our Query.Found assertion hit in GenerateRoom()][:"entity system" :"procedural generation" :research]
[1:40:01][Step in to PlaceTilePattern() and watch AllowedDirectionsForNext][:"entity system" :"procedural generation" :run]
[1:41:46][Make PlaceTilePattern() set AllowedDirectionsForNext for every Tile][:"entity system" :"procedural generation"]
[1:42:02][No longer hit that Query.Found assertion in GenerateRoom()][:"entity system" :"procedural generation" :run]
[1:42:21][Our chained switches now work][:"entity system" :"procedural generation" :run]
[1:43:10][Plan to turn the switch chains into a list][:"entity system" :"procedural generation"]
[1:43:48][@khrob][Q: Is it worth having the renderer check if its running in debug mode or not, and dropping the number of lighting samples to make it more playable? Or is having code behave differently in debug and release modes a bad idea? (I know were not in Q&A yet, but I've gotta bounce)]
[1:45:04][@vaualbus][Q: Why is MSVC's #pragma optimize("something", on/off) on that file hard?][:language]
[1:45:48][@longboolean][Q: So if I am following you correctly, this door / switch stuff only allows for switches to trigger doors that are in the same room, or can this work for triggering things in other / multiple rooms, etc?][:"entity system"]
[1:48:04][@clb931][Could you turn it on then wrap the entire compilation unit in a pragma (turning it off) then turn it on when you need it?][:language]
[1:49:12][Thank you, everyone][:speech]
[/video]