[video member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Improving Sort Keys Part 1" vod_platform=youtube id=3KsEO5-sYBQ annotator=Miblo] [0:37][On the two kinds of Z-values necessary for presenting multiple layers of rooms to the viewer] [2:39][Recap and set the stage for the day] [6:16][handmade_render_group.cpp: Look through how the perspective transform is currently programmed] [8:07][Blackboard: Handling the "Changeover Point" between floors] [14:00][Blackboard: Sorting entities in Y and Z using a "Hotpoint Rule"] [24:45][Blackboard: Consider these cases for any possible insights] [36:23][Blackboard: Placing the sort point differently depending on whether or not the entity is upright] [39:08][handmade_render_group.cpp: Look through PushBitmap to see how it currently does the sort] [41:42][handmade_render_group.cpp: Make GetRenderEntityBasisP calculate the SortKey using a PerspectiveZ, DisplacementZ, PerspectiveSortTerm, YSortTerm and ZSortTerm] [55:58][Consider the risk of having two important points on a bitmap, and to what degree they tend to line up] [56:44][Blackboard: Sorting multi-segment bodies] [57:59][handmade_render_group.cpp: Introduce ComputeSortKey in order to facilitate correct sorting of articulated figures] [59:57][handmade_render_group.cpp: Revert changes in GetRenderEntityBasisP for the time being] [1:01:18][Run the game and see the havoc] [1:02:18][handmade_entity.cpp: Plan for handling articulated figures next week] [1:05:31][Q&A][:speech] [1:06:12][@kknewkles][Kind of didn't get it from the email - are you still up to putting a break sometime soon and make a little intro series to programming?] [1:07:18][@dr_s80][Another use case to consider for the Y- / Z-sorting: "flat" things laying on top of other "flat" things (like a rug on a floor). How would the Y-sort position be set in this case, especially if the thing on top was larger than the thing(s) it was laying on?] [1:09:03][@kknewkles][You wanted to go a bit more serious than Intro to C early on. Maybe you changed your mind since] [1:09:18][@garryjohanson][What do you think of representing entities as 3D objects to keep things simple? Like cylinders for characters, and cubes for tiles and rooms?] [1:11:06][Blackboard: Sorting rugs and floors] [1:14:44][Blackboard: Considering this in 3D] [1:17:13][@acoto87][Maybe you need to sort the objects separately in both Y and Z and then solve the conflicts if an object A is before object B in the Y-sort and in reverse order in the Z-sort?] [1:20:28][Close down, to be continued...][:speech] [/video]