From 21857ecbf931e4e66f0cb39fb5ec0b33f58823e6 Mon Sep 17 00:00:00 2001 From: Matt Mascarenhas Date: Mon, 30 Apr 2018 20:30:37 +0100 Subject: [PATCH] Annotate hero/code445 --- cmuratori/hero/code/code445.hmml | 60 ++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 cmuratori/hero/code/code445.hmml diff --git a/cmuratori/hero/code/code445.hmml b/cmuratori/hero/code/code445.hmml new file mode 100644 index 0000000..4cb07cb --- /dev/null +++ b/cmuratori/hero/code/code445.hmml @@ -0,0 +1,60 @@ +[video member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Cleaning Up Entity Creation" vod_platform=youtube id=hhrb6g2OPLI annotator=Miblo] +[0:01][Recap and set the stage for the day, laying out rooms in a constraint- or evaluation-based manner][:"graph topology" :"procedural generation" :speech] +[7:12][Toggle off superfluous test code in GenerateLightingPattern()][:lighting :rendering] +[9:26][:Run the game to see that we load up faster][:lighting :performance :rendering] +[9:49][Toggle off the existing test world generation code in CreateWorld()][:"procedural generation"] +[11:10][Begin to implement gen_connection][:"data structure" :"graph topology" :"procedural generation"] +[13:16][The distinction between Database and Winged-Edge :"Data Structure", with a recommendation to read 'Transaction Processing' by Jim Gray[ref + author="Jim Gray" + title="Transaction Processing: Concepts and Techniques" + isbn=9781558601901]][:"data structure" :speech] +[17:44][Spec out gen_room_connection as a linked list of connections to a single room][:"data structure" :"graph topology" :"procedural generation"] +[20:04][Spec out gen_connection itself as a linked list of its two connected rooms, with gen_room_connection as a linked list of these connections][:"data structure" :"graph topology" :"procedural generation"] +[22:10][Implement this more verbose version, introducing AddConnection() for Connect() to call, and making GenRoom() link up the rooms][:"data structure" :"graph topology" :"procedural generation"] +[28:46][Implement GenerateWorld(), and GenerateRoom() to do the old work of AddStandardRoom()][:"procedural generation"] +[41:31][Make GenerateRoom() call BeginWorldChange() and EndWorldChange(), and begin to systematise the :"entity system" inside the world generator working off a sim_region, respecifying BeginEntity() and EndEntity() as AddEntity() and PlaceEntity()][:"procedural generation"] +[58:52][Relieve EndSim() and EndWorldChange() of taking the World, and create handmade_room_gen.cpp][:"entity system" :"procedural generation"] +[1:02:16][Disable transparency compositing in GNOME 3][:admin] +[1:03:34][Pull the entity creation code from handmade_world_gen.cpp into handmade_room_gen.cpp][:"entity system"] +[1:06:24][Add TempMemory to the world_generator struct for GenerateRoom() to use, and setup the room's position and dimensions for entity :simulation purposes][:"entity system" :memory :"procedural generation"] +[1:15:45][Enable AddPlayer() to create a player entity, calling AddEntity() directly on the SimRegion][:"entity system" :"procedural generation"] +[1:19:10][Implement Layout(), initially stamping down rooms in a row][:"procedural generation"] +[1:25:43][Make CreateWorld() initialise the :camera position, introducing gen_result struct] +[1:30:55][:Run the game to see nothing] +[1:31:45][Step through CreateWorld() into GenerateRoom() and beyond to see what happens][:"procedural generation" :run] +[1:36:19][Make GenerateRoom() place its :camera entity] +[1:41:01][:Run the game to see that we're getting further, but have no entities][:camera] +[1:43:37][Make UpdateAndRenderWorld() outline the screen, sim region and world sim bounds][:"debug visualisation"] +[1:43:59][:Run the game to see that the sim region is not in our starting area][:"debug visualisation"] +[1:44:14][Enable CreateWorld() to set the StandardRoomDimension][:"procedural generation"] +[1:45:37][:Run the game to see our world][:"procedural generation"] +[1:47:24][Introduce gen_volume for gen_room and gen_connection to contain, and specify the geographical location of connections, introducing IsInVolume()][:"procedural generation"] +[1:53:31][Hardcode Layout() to knock out connection holes in the rooms][:"procedural generation"] +[1:56:25][:Run the game to see a partial knockout][:"procedural generation"] +[1:56:46][Enable GenerateRoom() to colour the connections][:"debug visualisation" :"procedural generation"] +[1:59:01][:Run the game to see the colour][:"debug visualisation"] +[1:59:22][Fix GenerateRoom() to enable IsInVolume() to test the correct tiles][:"procedural generation"] +[1:59:41][:Run the game to see our full knockouts with working :camera][:"procedural generation"] +[2:01:00][Q&A][:speech] +[2:01:23][@frostyninja][Q: Can you please fix EndWorldgen?] +[2:01:36][Make EndWorldgen() clear the TempMemoryClear()] +[2:02:06][@frostyninja][Q: The capitalisation] +[2:02:07][Rename EndWorldgen() to EndWorldGen()] +[2:02:21][@officer_kkona][@handmade_hero What is "internal" used for in C? Is it like the opposite of "extern" in C++?][:language] +[2:03:37][@danzaidan][Q: Should the light calculation always be stuck to the :camera or something else?][:lighting :rendering] +[2:04:50][@vaualbus][Q: By the way in some C++ header there is a definition of internal so your code would not work if any C++ file get included. I'm happy with that, it prevent us from get mad][:language] +[2:05:20][@myrcene][Q: What function is :camera using to interpolate between two positions right now? Bezier curve? expf?] +[2:07:13][@danzaidan][Q: How much of the world gen can be done in this pass and how much would depend on more gameplay exploration stuff?][:"procedural generation"] +[2:09:38][@sahfortv][Q: Why does the color of the room go as it does without :lighting, rather than going black?][:rendering] +[2:10:10][Compare the :lighting with and without the moonlight][:programming :rendering :run] +[2:11:10][@garryjohanson][Q: Just want to randomly suggest transactional processing as a topic for some future off-topic stream] +[2:11:18][@jamoflaw][Q: Will there be specific locations in the world - I saw you mention an orphanage yesterday - and if so how will they be handled in a generated world?][:"procedural generation"] +[2:11:45][@naysayer88][Q: How long would it take me to get up to speed on 4coder if I decide to, like, switch off the hell that is emacs?] +[2:17:06][@vateferfout][Q: Is there a reason you don't use __forceinline?][:language] +[2:17:58][@pythno][Q: Can you go over the architecture of how to generate the rooms (like with this generic config) briefly again?][:"graph topology" :"procedural generation"] +[2:18:44][@naysayer88][@cmuratori Streaming Today would be Very Doubtful] +[2:19:00][@nxsy][Q: I think they meant the unlit part. The plain diffuse / albedo bit][:lighting :rendering] +[2:19:41][@stormblaz][@handmade_hero Can you start optimizing your code as you go or when you reach major milestones, or do you need to wait for near-completion to optimize your code, and make sure you don't have useless coding lines bulking up?][:optimisation] +[2:23:21][@sahfortv][Q: Maybe something for next week, but can you make the boundary wall heights equal?][:"procedural generation"] +[2:23:33][Close out][:speech] +[/video]