[video output=day448 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Explicitly Placed Room Connections" vod_platform=youtube id=_ctZUqPtWF4 annotator=Miblo]
[0:05][Recap and set the stage for the day manually laying out rooms to nail down the room placement API][:speech]
[2:29][Describe our conceptualisation of min / max in gen_volume][:research]
[4:17][Fill Rules for Tile Maps][:blackboard :mathematics]
[11:33][Correctly picking our fill rules][:blackboard :mathematics]
[14:46][Consider the clipping asymmetry in PlaceRoom()][:geometry :research]
[17:44][Compare our room placement with and without the +1 minimum apron clipping][:geometry :programming :run]
[18:16][Redefine Min and Max from gen_volume to include their bounds, introducing gen_point struct and GetDim() for IsMinimumDimensionsForRoom() to call][:geometry]
[32:41][Make GenerateRoom() and IsInVolume() obey the new fill rule, pulling the room generation code out into handmade_gen_math.h and .cpp][:geometry :"procedural generation"]
[39:15][Fix up PlaceRoom() to obey our new fill rule][:geometry :"procedural generation"]
[42:47][Step in to PlaceRoomInVolume() to see what it produces][:geometry :"procedural generation" :run]
[43:45][Make Layout() obey the fill rule for the initial room placement][:geometry :"procedural generation"]
[44:37][Step in to GenerateRoom(), then see that the world is correctly created][:geometry :"procedural generation" :run]
[46:11][Orphanage Architecture][:blackboard :"graph topology"]
[50:59][Setup CreateOrphanage() to explicitly connect rooms][:"graph topology"]
[53:06][Articulating connections around a room][:blackboard :"graph topology"]
[54:18][Determine to introduce an extended version of Connect()][:speech :"graph topology"]
[55:40][Refined Orphanage Architecture][:blackboard :"graph topology"]
[57:31][Make CreateOrphanage() connect our rooms as per the diagram][:"graph topology"]
[1:00:17][Rearticulating connections as Y-low to Y-high (not counterclockwise)][:blackboard :"graph topology"]
[1:02:37][Continue to make CreateOrphanage() connect our rooms][:"graph topology"]
[1:04:45][Consider prescribing the size of our rooms][:geometry :speech]
[1:06:24][Introduce SetSize() for CreateOrphanage() to call explicitly on all our rooms][:geometry]
[1:10:57][Implement a version of Connect() that connects A explicitly to B][:"graph topology"]
[1:13:47][Implement SetSize(), augmenting gen_room to contain a gen_v3 RequiredDim][:geometry]
[1:19:26][Determine to rewrite Layout() such that we can place adjoining rooms][:"graph topology" :speech]
[1:22:24][Enable Layout() to place all unplaced neighbouring rooms, introducing PlaceRoomsAlongEdge() and GetDirectionForRoom()][:"graph topology"]
[1:32:53][Implement GetDirectionForRoom() for CouldGoDirection() to call][:"graph topology"]
[1:35:23][Implement PlaceRoomsAlongEdge(), introducing GetBoxIndexFromDirMask() and a version of CouldGoDirection() that takes a TestMask instead of Dim and Side][:"graph topology"]
[1:48:37][Aligning rooms to the min and max edges][:blackboard :geometry]
[1:49:38][Enable PlaceRoomsAlongEdge() to align rooms to the min and max edges][:"graph topology"]
[1:56:44][:Run the game and hit an assertion in GetOtherRoom()][:"graph topology"]
[1:58:24][Fix up a Connect() call in CreateOrphanage()]
[1:58:36][:Run the game and hit our assertion in PlaceRoomsAlongEdge()][:"graph topology"]
[1:59:43][Remove that invalid assertion from PlaceRoomsAlongEdge()][:"graph topology"]
[2:00:00][:Run the game to see that it does run properly][:"graph topology"]
[2:00:27][Q&A][:speech]
[2:00:53][@vateferfout][Q: Your edge axis is wrong. It gives the direction of the connection, not the axis the connected rooms should align to][:"graph topology"]
[2:02:05][Fix PlaceRoomsAlongEdge() to correctly set the EdgeAxis and AxisA][:"graph topology"]
[2:03:29][@areriff][Q: Can the connection be fashion in such a way it forms a long empty corridor / stair up or down to connect two rooms?]
[2:03:54][@pajpiart][Q: You mentioned a few streams ago that the xbox 360 controller has a crap potentiometer. Do you have an example of a controller with a good one?]
[2:04:24][@datoh][Q: Have you thought to use a constraint solver algo for room layout?]
[2:04:41][@areriff][Q: Can the Hero have the ability to "Dig" the ground and fall through the floor to the room below it?]
[2:05:26][Wrap it up][:speech]
[/video]
