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

40 lines
3.0 KiB
Plaintext
Raw Normal View History

[video member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Hybrid Tile-based Movement" vod_platform=youtube id=S5VtscjLjnk annotator=Miblo]
[0:20][Recap and set the stage for the day]
[3:52][handmade_sim_region.h and handmade_world_mode.cpp: Disassociate the hero's head and body]
[17:37][Run the game and move the head]
[18:26][handmade_world_mode.cpp: Make the body follow the head along the traversable points]
[28:45][handmade_sim_region.cpp: Introduce GetSimSpaceTraversable]
[32:02][Run the game and see the body following the head]
[34:06][handmade.cpp: Start up directly into the game, rather than the cutscene]
[36:02][Debugger: Jump into PlayWorld and investigate what's going on]
[41:46]["That's just super accidental"][quote 476]
[42:45][handmade_world_mode.cpp: Set WorldMode in PlayWorld]
[44:34][handmade.cpp: Force the start button to be pressed]
[47:02][Run the game and arrive directly at the game]
[48:43][win32_handmade.cpp: Correct the GameUpdateHz computation]
[49:59][Run the game and move at the more correct speed]
[51:12][handmade_world_mode.cpp: Make the body accelerate towards the traversable points]
[57:05][Run the game and see the body accelerate towards the head]
[59:38]["My body will track me, but it will never come to rest"][quote 477]
[1:00:10]["I want the head to snap back to the body when you stop pushing"][quote 478]
[1:00:29][Q&A][:speech]
[1:00:58][@yoonfan][When I write event-driven code, I am often forced to use dynamic memory allocation to preserve some state until it is needed by the callback. How do you deal with those situations?]
[1:03:35][@robrobby][Would the Handmade debug view enable viewing structs like world mode?]
[1:03:58][@longboolean][When moving diagonally, will it be clear to the player which way the body will go to get to the diagonal entity? Right now it seems kind of random]
[1:05:55][handmade_world_mode.cpp: Introduce DesiredDirection in order to make the body move more directly to the head]
[1:07:28][handmade_math.h: Introduce NOZ (Normalize or Zero)]
[1:12:14][Run the game and try out our new movement]
[1:12:37][handmade_world_mode.cpp: Conditionally set the closest point]
[1:14:03][Run the game and see the body stopping more close to the points]
[1:15:21][handmade_world_mode.cpp: Revert to the original movement]
[1:16:43][@chronaldragon][This may just be an illusion but it looks like the body is snapping to the corner of tiles. Usually in tile-based games, entities occupy the center of a tile. Is this intentional?]
[1:17:22][handmade_world_mode.cpp: Make MakeSimpleFloorCollision draw the tiles]
[1:18:01][Run the game, see the tiles and move around on them]
[1:18:40][@chronaldragon][At the end of Q&A, can you announce a reminder that the forums are going down shortly?]
[1:18:54][handmade_world_mode.cpp: #if 0 that tile drawing]
[1:19:08][Close up shop][:speech]
[1:20:05][Announce that the Handmade Hero forums will be going down very soon while Handmade Network launches[ref
site="Handmade Network"
url="https://handmade.network/"]][:research]
[/video]