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

65 lines
5.2 KiB
Plaintext

[video output=day058 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Using the Spatial Partition" vod_platform=youtube id=W_z9VN1m2Oo annotator=schme annotator=Miblo]
[0:28][Assets: handmade_hero_test_assets_002.zip is released]
[2:01][Recap]
[3:28][handmade.cpp: Pull in entities by chunk, rather than tile]
[5:12][Blackboard: Pulling entities into the working set]
[8:46][handmade.cpp: Figure out the CameraBounds situation]
[15:25][Make a version of MakeEntityHighFrequency to be called at the lower level]
[16:21][Introduce GetCameraSpaceP]
[17:41][Continue writing these versions of MakeEntityHighFrequency]
[20:18][Use these functions in SetCamera]
[21:41][handmade_math.h: Introduce GetMinCorner, GetMaxCorner and GetCenter]
[22:52][Debugger: Step through and see what's happening]
[24:14][handmade.cpp: Fix the Assertion in MakeEntityHighFrequency]
[24:34][Look at AddWall]
[25:51][handmade_world.cpp: Look at Subtract and ChunkPositionFromTilePosition]
[26:44][Debugger: Step in to AddWall]
[28:56][handmade.cpp: Call ChangeEntityLocation in AddLowEntity and make it pass world_position P]
[30:29][Pass the world_position P to AddPlayer and finish implementing the spatial partition]
[34:53][Run it and see what's happening]
[35:59][Debugger: Step into AddPlayer]
[36:47][handmade.cpp: Tweak AddLowEntity]
[38:02][Debugger: Continue debugging AddPlayer]
[38:37][handmade_world.cpp: Tweak ChangeEntityLocation]
[39:40][Debugger: Step through the loop in OffsetAndCheckFrequencyByArea]
[41:25][handmade.cpp: Add an assertion in OffsetAndCheckFrequencyByArea]
[42:37][Debugger: Step through and hit this assertion]
[43:34][handmade.cpp: Introduce ValidateEntityPairs]
[45:56][Debugger: The MakeEntityHighFrequency routine in SetCamera is the problem]
[47:04][handmade.cpp: Pass the correct Index to this routine]
[48:05][Run the game and note that the spatial partition is nominally working]
[48:48][handmade.h and handmade.cpp: Test the new assets]
[50:40][Run the game and find that the new trees are drawn at the wrong locations]
[51:04][handmade.cpp: Stop drawing the textured background]
[52:51][Assets: Find the base point for the tree in GIMP]
[53:37][handmade.cpp: Set the tree's alignment and do DrawRectangle as well]
[54:32][Run the game and observe our new trees in their correct positions]
[57:44][Q&A][:speech]
[58:52][Q: For zooming out, could you somehow modify MetersToPixels to make things smaller as you zoom?]
[59:39][Q: What is inline v2?]
[1:01:04][Q: Why use Emacs versus Visual Studio's IDE?]
[1:02:36][Q: Is Emacs better than Vim, or is it just preference?]
[1:03:43][Q: Do you think that how fast code runs is the best metric for good code, or do you value simplicity or extensibility as well?]
[1:05:59][Q: Why are you using Visual Studio here if you use Emacs?]
[1:06:34][@swagkitty69][Did you ever figure out a fix for Emacs whenever you try to create a new file and the patch changes?]
[1:07:03][Q: What's guiding you to make steps towards completing the game, i.e. a list of requirements for the game?]
[1:08:54][Q: Do you ever get annoyed with reading a high depth of nested for loops?]
[1:09:55][Q: Was watching some ROM hacking earlier and watching the registers and memory update in real time was really cool. Do you think a debugger for C could work as well as that?]
[1:10:39][Q: How much time do you spend outside the stream in thinking about the code and game design? If you coded eight hours a day, would you be able to code consistently with the same pace as during your stream?]
[1:11:38][Q: Can you please put in a proper PRNG before you write world gen algorithms?]
[1:12:46][Q: Do you ever feel the need to use recursive functions?]
[1:13:15][Q: Do you build with build.exe in command prompt or batch file?]
[1:14:11][Q: When you say "renderer", what exactly does that mean? If the drawing you have now isn't rendering, then at what point do we go from drawing to rendering?]
[1:15:55][Q: Have any of your friends voiced disagreement with design decisions you've made in this engine?]
[1:16:22][Q: How do you distinguish between what a lot of people might called "premature optimisation" versus ensuring a good design that allows for high performance? The difference there seems really subtle. I feel that designing for high performance is simply organising the code and writing in such a way that does not unnecessarily slow down the code and prevent future optimisations, while premature optimisation is simply optimising something because you think something will be slow without evidence]
[1:19:52][Q: 4096 random numbers]
[1:20:03][Q: Will we have positionless entities? Would something like the current price of Almond Milk futures be an entity?]
[1:20:22][Q: Will you be making a level / tile map editor for this game, for easier level creation?]
[1:20:40][Q: What is your algorithm for a collision with three and more entities?]
[1:21:21][Blackboard: Moving in 1/30th sec]
[1:23:15][Q: Do you plan to use some form of logging for debugging purposes?]
[1:23:48][Q: When you remove a LowEntity from the Chunk list, you swap another into its place. Won't that mess with references?]
[1:24:15][@happy_vertex][Even for slow frequency entities?]
[1:24:59][We have come to the end of the questions][:speech]
[/video]