Handmade Hero»Episode Guide
Implementing Move Queues
?
?

Keyboard Navigation

Global Keys

[, < / ], > Jump to previous / next episode
W, K, P / S, J, N Jump to previous / next marker
t / T Toggle theatre / SUPERtheatre mode
V Revert filter to original state Y Select link (requires manual Ctrl-c)

Menu toggling

q Quotes r References f Filter y Link c Credits

In-Menu Movement

a
w
s
d
h j k l


Quotes and References Menus

Enter Jump to timecode

Quotes, References and Credits Menus

o Open URL (in new tab)

Filter Menu

x, Space Toggle category and focus next
X, ShiftSpace Toggle category and focus previous
v Invert topics / media as per focus

Filter and Link Menus

z Toggle filter / linking mode

Credits Menu

Enter Open URL (in new tab)
0:01Recap and set the stage for the day moving the glove
🏃
0:01Recap and set the stage for the day moving the glove
🏃
0:01Recap and set the stage for the day moving the glove
🏃
0:34Describe our sketched out move patterns and queues, and stats
📖
0:34Describe our sketched out move patterns and queues, and stats
📖
0:34Describe our sketched out move patterns and queues, and stats
📖
5:25Walk through our move queue enqueuing code in ExecuteBrainHero()
📖
5:25Walk through our move queue enqueuing code in ExecuteBrainHero()
📖
5:25Walk through our move queue enqueuing code in ExecuteBrainHero()
📖
7:38Demo the brain-directed movement synchronisation
🏃
7:38Demo the brain-directed movement synchronisation
🏃
7:38Demo the brain-directed movement synchronisation
🏃
8:59Consider move queue-directed movement integrity
🏃
8:59Consider move queue-directed movement integrity
🏃
8:59Consider move queue-directed movement integrity
🏃
11:41Our facing direction is wrong when pressing Up
🏃
11:41Our facing direction is wrong when pressing Up
🏃
11:41Our facing direction is wrong when pressing Up
🏃
11:57Investigate why our facing direction is wrong
📖
11:57Investigate why our facing direction is wrong
📖
11:57Investigate why our facing direction is wrong
📖
12:30Make ExecuteBrainHero() compute the FacingDirection with the ATan2 of the X vector
12:30Make ExecuteBrainHero() compute the FacingDirection with the ATan2 of the X vector
12:30Make ExecuteBrainHero() compute the FacingDirection with the ATan2 of the X vector
12:51Our facing direction remains wrong
🏃
12:51Our facing direction remains wrong
🏃
12:51Our facing direction remains wrong
🏃
13:05Investigate why our facing direction is wrong
📖
13:05Investigate why our facing direction is wrong
📖
13:05Investigate why our facing direction is wrong
📖
13:42Make ExecuteBrainHero() compute the FacingDirection with the ATan2 of y / x of the X vector
13:42Make ExecuteBrainHero() compute the FacingDirection with the ATan2 of y / x of the X vector
13:42Make ExecuteBrainHero() compute the FacingDirection with the ATan2 of y / x of the X vector
13:54Our facing direction is now correct
🏃
13:54Our facing direction is now correct
🏃
13:54Our facing direction is now correct
🏃
14:07Consider where the glove should sit
🏃
14:07Consider where the glove should sit
🏃
14:07Consider where the glove should sit
🏃
16:43Determine to put the glove on the hero's tile, and not occupy tiles it passes through
📖
16:43Determine to put the glove on the hero's tile, and not occupy tiles it passes through
📖
16:43Determine to put the glove on the hero's tile, and not occupy tiles it passes through
📖
24:52Make ExecuteBrainHero() move the glove without transactionally occupying tiles
24:52Make ExecuteBrainHero() move the glove without transactionally occupying tiles
24:52Make ExecuteBrainHero() move the glove without transactionally occupying tiles
26:29Our glove doesn't move with us
🏃
26:29Our glove doesn't move with us
🏃
26:29Our glove doesn't move with us
🏃
26:55Investigate why the glove doesn't move
📖
26:55Investigate why the glove doesn't move
📖
26:55Investigate why the glove doesn't move
📖
28:00Move without hitting extra keys, and the glove still not following us
🏃
28:00Move without hitting extra keys, and the glove still not following us
🏃
28:00Move without hitting extra keys, and the glove still not following us
🏃
28:11Break into the "glove at rest" branch in ExecuteBrainHero()
🏃
28:11Break into the "glove at rest" branch in ExecuteBrainHero()
🏃
28:11Break into the "glove at rest" branch in ExecuteBrainHero()
🏃
29:58Step through UpdateAnimation()
🏃
29:58Step through UpdateAnimation()
🏃
29:58Step through UpdateAnimation()
🏃
33:03Reacquaint ourselves with UpdateAnimation()
📖
33:03Reacquaint ourselves with UpdateAnimation()
📖
33:03Reacquaint ourselves with UpdateAnimation()
📖
34:23Check that the glove's animation data doesn't get overwritten
📖
34:23Check that the glove's animation data doesn't get overwritten
📖
34:23Check that the glove's animation data doesn't get overwritten
📖
36:46Break into AddPlayer() for the glove's entity ID (10845), then see what UpdateAnimation() does to that entity
🏃
36:46Break into AddPlayer() for the glove's entity ID (10845), then see what UpdateAnimation() does to that entity
🏃
36:46Break into AddPlayer() for the glove's entity ID (10845), then see what UpdateAnimation() does to that entity
🏃
44:38Find that UpdateAndRenderEntities() sets Entity->GroundP
📖
44:38Find that UpdateAndRenderEntities() sets Entity->GroundP
📖
44:38Find that UpdateAndRenderEntities() sets Entity->GroundP
📖
47:23Remove GroundP from entity
47:23Remove GroundP from entity
47:23Remove GroundP from entity
49:28Entities are now in different locations
🏃
49:28Entities are now in different locations
🏃
49:28Entities are now in different locations
🏃
49:54Our glove follows us, but does not animate
🏃
49:54Our glove follows us, but does not animate
🏃
49:54Our glove follows us, but does not animate
🏃
51:03Investigate why the glove does not animate
📖
51:03Investigate why the glove does not animate
📖
51:03Investigate why the glove does not animate
📖
52:50Fix ExecuteBrainHero() to set the Glove's tMovement to 0
52:50Fix ExecuteBrainHero() to set the Glove's tMovement to 0
52:50Fix ExecuteBrainHero() to set the Glove's tMovement to 0
53:10Our glove follows us, animating smoothly
🏃
53:10Our glove follows us, animating smoothly
🏃
53:10Our glove follows us, animating smoothly
🏃
53:46Determine to offset the glove's location relative to the player
📖
53:46Determine to offset the glove's location relative to the player
📖
53:46Determine to offset the glove's location relative to the player
📖
54:40Try making AddPlayer() offset the glove in X
54:40Try making AddPlayer() offset the glove in X
54:40Try making AddPlayer() offset the glove in X
55:13Our glove is offset in X
🏃
55:13Our glove is offset in X
🏃
55:13Our glove is offset in X
🏃
55:26Try making AddPlayer() offset the glove in Z
55:26Try making AddPlayer() offset the glove in Z
55:26Try making AddPlayer() offset the glove in Z
55:56Our glove is offset in Z
🏃
55:56Our glove is offset in Z
🏃
55:56Our glove is offset in Z
🏃
56:10Increase the glove's X offset from 0.25 to 0.5 in AddPlayer()
56:10Increase the glove's X offset from 0.25 to 0.5 in AddPlayer()
56:10Increase the glove's X offset from 0.25 to 0.5 in AddPlayer()
56:18Our glove offsetting doesn't respect its parent entity's facing direction
🏃
56:18Our glove offsetting doesn't respect its parent entity's facing direction
🏃
56:18Our glove offsetting doesn't respect its parent entity's facing direction
🏃
59:47Traverse the dungeon admiring the lighting
🏃
59:47Traverse the dungeon admiring the lighting
🏃
59:47Traverse the dungeon admiring the lighting
🏃
1:01:28mallesbixie With a fixed offset from the actual position, animating would get hard, I guess
🗪
1:01:28mallesbixie With a fixed offset from the actual position, animating would get hard, I guess
🗪
1:01:28mallesbixie With a fixed offset from the actual position, animating would get hard, I guess
🗪
1:02:19Determine to dequeue moves off the move queue
📖
1:02:19Determine to dequeue moves off the move queue
📖
1:02:19Determine to dequeue moves off the move queue
📖
1:03:42Enable UpdateAndRenderEntities() to dequeue moves off the move queue, augmenting entity with a MoveQueueIndex
1:03:42Enable UpdateAndRenderEntities() to dequeue moves off the move queue, augmenting entity with a MoveQueueIndex
1:03:42Enable UpdateAndRenderEntities() to dequeue moves off the move queue, augmenting entity with a MoveQueueIndex
1:08:31The game still runs
🏃
1:08:31The game still runs
🏃
1:08:31The game still runs
🏃
1:08:43Make UpdateAndRenderEntities() draw move queues
1:08:43Make UpdateAndRenderEntities() draw move queues
1:08:43Make UpdateAndRenderEntities() draw move queues
1:10:52See no move queue drawings
🏃
1:10:52See no move queue drawings
🏃
1:10:52See no move queue drawings
🏃
1:11:02Make UpdateAndRenderEntities() elevate the move queue drawing above the ground
1:11:02Make UpdateAndRenderEntities() elevate the move queue drawing above the ground
1:11:02Make UpdateAndRenderEntities() elevate the move queue drawing above the ground
1:11:28Still see no move queue drawings
🏃
1:11:28Still see no move queue drawings
🏃
1:11:28Still see no move queue drawings
🏃
1:11:30Make AddPlayer() set the Glove->Stats.MaxMoveGroupCount to 1, and ExecuteBrainHero() reset Glove->MoveQueueIndex to 0 when with the body
1:11:30Make AddPlayer() set the Glove->Stats.MaxMoveGroupCount to 1, and ExecuteBrainHero() reset Glove->MoveQueueIndex to 0 when with the body
1:11:30Make AddPlayer() set the Glove->Stats.MaxMoveGroupCount to 1, and ExecuteBrainHero() reset Glove->MoveQueueIndex to 0 when with the body
1:13:41Still see no move queue drawings
🏃
1:13:41Still see no move queue drawings
🏃
1:13:41Still see no move queue drawings
🏃
1:13:50Scour ExecuteBrainHero() for bugs
📖
1:13:50Scour ExecuteBrainHero() for bugs
📖
1:13:50Scour ExecuteBrainHero() for bugs
📖
1:14:23Break in to ExecuteBrainHero() to find the glove's stats are not set
🏃
1:14:23Break in to ExecuteBrainHero() to find the glove's stats are not set
🏃
1:14:23Break in to ExecuteBrainHero() to find the glove's stats are not set
🏃
1:15:07Change AddPlayer() to set the Glove->BaseStats.MaxMoveGroupCount to 1
1:15:07Change AddPlayer() to set the Glove->BaseStats.MaxMoveGroupCount to 1
1:15:07Change AddPlayer() to set the Glove->BaseStats.MaxMoveGroupCount to 1
1:15:35Break in to ExecuteBrainHero() to find the glove's stats remain not set
🏃
1:15:35Break in to ExecuteBrainHero() to find the glove's stats remain not set
🏃
1:15:35Break in to ExecuteBrainHero() to find the glove's stats remain not set
🏃
1:15:51accumulate entity stats
1:15:51accumulate entity stats
1:15:51accumulate entity stats
1:16:20Love insobot, and feel like insofaras needs to use GPT-3 and have insobot do everything
🗩
1:16:20Love insobot, and feel like insofaras needs to use GPT-3 and have insobot do everything
🗩
1:16:20Love insobot, and feel like insofaras needs to use GPT-3 and have insobot do everything
🗩
1:17:05Make AdvanceEntityStats() acquire the Entity->BaseStats
1:17:05Make AdvanceEntityStats() acquire the Entity->BaseStats
1:17:05Make AdvanceEntityStats() acquire the Entity->BaseStats
1:17:31Break in to ExecuteBrainHero() to find the glove's stats are now set, and move queue boxes are drawn
🏃
1:17:31Break in to ExecuteBrainHero() to find the glove's stats are now set, and move queue boxes are drawn
🏃
1:17:31Break in to ExecuteBrainHero() to find the glove's stats are now set, and move queue boxes are drawn
🏃
1:18:11Make ExecuteBrainHero() locate the move queue drawings relative to its entity's occupying position
1:18:11Make ExecuteBrainHero() locate the move queue drawings relative to its entity's occupying position
1:18:11Make ExecuteBrainHero() locate the move queue drawings relative to its entity's occupying position
1:19:35Our move queue drawings work pretty well
🏃
1:19:35Our move queue drawings work pretty well
🏃
1:19:35Our move queue drawings work pretty well
🏃
1:19:44Determine to make the glove return to the body after punching
📖
1:19:44Determine to make the glove return to the body after punching
📖
1:19:44Determine to make the glove return to the body after punching
📖
1:21:14technicbeam People always wonder when insobot is going to become sentient
🗪
1:21:14technicbeam People always wonder when insobot is going to become sentient
🗪
1:21:14technicbeam People always wonder when insobot is going to become sentient
🗪
1:21:48Our move pattern rotates properly
🏃
1:21:48Our move pattern rotates properly
🏃
1:21:48Our move pattern rotates properly
🏃
1:21:55Investigate why the glove doesn't return to the body after punching
📖
1:21:55Investigate why the glove doesn't return to the body after punching
📖
1:21:55Investigate why the glove doesn't return to the body after punching
📖
1:22:18Fix the glove reset condition in ExecuteBrainHero()
1:22:18Fix the glove reset condition in ExecuteBrainHero()
1:22:18Fix the glove reset condition in ExecuteBrainHero()
1:22:34Our glove now returns after punching
🏃
1:22:34Our glove now returns after punching
🏃
1:22:34Our glove now returns after punching
🏃
1:22:55Increase Glove->BaseStats.MaxMoveGroupCount from 1 to 2 in AddPlayer()
1:22:55Increase Glove->BaseStats.MaxMoveGroupCount from 1 to 2 in AddPlayer()
1:22:55Increase Glove->BaseStats.MaxMoveGroupCount from 1 to 2 in AddPlayer()
1:23:11We can chain punches, but the pattern direction is off
🏃
1:23:11We can chain punches, but the pattern direction is off
🏃
1:23:11We can chain punches, but the pattern direction is off
🏃
1:23:30Investigate why the second punch's direction is off
📖
1:23:30Investigate why the second punch's direction is off
📖
1:23:30Investigate why the second punch's direction is off
📖
1:25:03technicbeam Have fun reading it, if you can find a copy. It's gotta be, what, 40 years old at least by now?
🗪
1:25:03technicbeam Have fun reading it, if you can find a copy. It's gotta be, what, 40 years old at least by now?
🗪
1:25:03technicbeam Have fun reading it, if you can find a copy. It's gotta be, what, 40 years old at least by now?
🗪
1:25:12Gain insight into the chained punching direction
🏃
1:25:12Gain insight into the chained punching direction
🏃
1:25:12Gain insight into the chained punching direction
🏃
1:25:32Try using a WentDown input event in ExecuteBrainHero()
1:25:32Try using a WentDown input event in ExecuteBrainHero()
1:25:32Try using a WentDown input event in ExecuteBrainHero()
1:26:16technicbeam The Adolescence of P-11
🗪
1:26:16technicbeam The Adolescence of P-11
🗪
1:26:16technicbeam The Adolescence of P-11
🗪
1:26:29We have HalfTransitionCount but not WentDown in game_button_state
1:26:29We have HalfTransitionCount but not WentDown in game_button_state
1:26:29We have HalfTransitionCount but not WentDown in game_button_state
1:27:20Make ExecuteBrainHero() also factor in the HalfTransitionCount to its attack checks
1:27:20Make ExecuteBrainHero() also factor in the HalfTransitionCount to its attack checks
1:27:20Make ExecuteBrainHero() also factor in the HalfTransitionCount to its attack checks
1:27:55We can chain punches in the correct directions
🏃
1:27:55We can chain punches in the correct directions
🏃
1:27:55We can chain punches in the correct directions
🏃
1:29:15Consider the definition of collision
📖
1:29:15Consider the definition of collision
📖
1:29:15Consider the definition of collision
📖
1:30:31Change ExecuteBrainHero() to give the glove a 1-step attack pattern
1:30:31Change ExecuteBrainHero() to give the glove a 1-step attack pattern
1:30:31Change ExecuteBrainHero() to give the glove a 1-step attack pattern
1:30:53Try our simple punch
🏃
1:30:53Try our simple punch
🏃
1:30:53Try our simple punch
🏃
1:31:07Introduce SetAnimation() for the ExecuteBrain*() functions to call, augmenting entity with a dtMovement
1:31:07Introduce SetAnimation() for the ExecuteBrain*() functions to call, augmenting entity with a dtMovement
1:31:07Introduce SetAnimation() for the ExecuteBrain*() functions to call, augmenting entity with a dtMovement
1:36:50That all looks fine
🏃
1:36:50That all looks fine
🏃
1:36:50That all looks fine
🏃
1:37:04Switch UpdateAndRenderEntities() to use the new Entity->dtMovement
1:37:04Switch UpdateAndRenderEntities() to use the new Entity->dtMovement
1:37:04Switch UpdateAndRenderEntities() to use the new Entity->dtMovement
1:37:26Our glove doesn't move
🏃
1:37:26Our glove doesn't move
🏃
1:37:26Our glove doesn't move
🏃
1:37:40Consider where and how to set the glove's dtMovement
📖
1:37:40Consider where and how to set the glove's dtMovement
📖
1:37:40Consider where and how to set the glove's dtMovement
📖
1:40:58Let UpdateAndRenderEntities() also move entities if their dtMovement is 0
1:40:58Let UpdateAndRenderEntities() also move entities if their dtMovement is 0
1:40:58Let UpdateAndRenderEntities() also move entities if their dtMovement is 0
1:41:23Our glove now moves
🏃
1:41:23Our glove now moves
🏃
1:41:23Our glove now moves
🏃
1:41:33Increase the glove's animation speed from 4 to 8 in ExecuteBrainHero()
1:41:33Increase the glove's animation speed from 4 to 8 in ExecuteBrainHero()
1:41:33Increase the glove's animation speed from 4 to 8 in ExecuteBrainHero()
1:41:53Our glove punches faster
🏃
1:41:53Our glove punches faster
🏃
1:41:53Our glove punches faster
🏃
1:42:44mallesbixie Would the attack pattern define the speed?
🗪
1:42:44mallesbixie Would the attack pattern define the speed?
🗪
1:42:44mallesbixie Would the attack pattern define the speed?
🗪
1:43:23Make UpdateAndRenderEntities() set the Entity->dtMovement, and AddPlayer() the glove's BaseStats.Speed
1:43:23Make UpdateAndRenderEntities() set the Entity->dtMovement, and AddPlayer() the glove's BaseStats.Speed
1:43:23Make UpdateAndRenderEntities() set the Entity->dtMovement, and AddPlayer() the glove's BaseStats.Speed
1:45:13Our glove still punches faster
🏃
1:45:13Our glove still punches faster
🏃
1:45:13Our glove still punches faster
🏃
1:45:16Toggle to the 3-step attack pattern in ExecuteBrainHero()
1:45:16Toggle to the 3-step attack pattern in ExecuteBrainHero()
1:45:16Toggle to the 3-step attack pattern in ExecuteBrainHero()
1:45:43Try out our fast-slow-fast punch
🏃
1:45:43Try out our fast-slow-fast punch
🏃
1:45:43Try out our fast-slow-fast punch
🏃
1:46:24spacenaming There is a function to determine if the button was pressed this frame (named WasPressed)
🗪
1:46:24spacenaming There is a function to determine if the button was pressed this frame (named WasPressed)
🗪
1:46:24spacenaming There is a function to determine if the button was pressed this frame (named WasPressed)
🗪
1:46:29Call it for today with a glimpse into the future doing damage and collapsing down to grid
🗩
1:46:29Call it for today with a glimpse into the future doing damage and collapsing down to grid
🗩
1:46:29Call it for today with a glimpse into the future doing damage and collapsing down to grid
🗩