Handmade Hero»Episode Guide
Improving Collision Volumes and the Camera
?
?

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:02Recap and set the stage for the day
0:02Recap and set the stage for the day
0:02Recap and set the stage for the day
4:34Run the game to see our debug collision volumes, and determine to implement room-based collision volumes
4:34Run the game to see our debug collision volumes, and determine to implement room-based collision volumes
4:34Run the game to see our debug collision volumes, and determine to implement room-based collision volumes
8:32handmade_entity.h: Add CollisionVolume to the entity struct and propagate that change
8:32handmade_entity.h: Add CollisionVolume to the entity struct and propagate that change
8:32handmade_entity.h: Add CollisionVolume to the entity struct and propagate that change
17:30handmade_sim_region.cpp: Introduce EntityOverlapsEntity(), remove EntitiesOverlap() and continue propagating CollisionVolume
17:30handmade_sim_region.cpp: Introduce EntityOverlapsEntity(), remove EntitiesOverlap() and continue propagating CollisionVolume
17:30handmade_sim_region.cpp: Introduce EntityOverlapsEntity(), remove EntitiesOverlap() and continue propagating CollisionVolume
23:47handmade_math.h: Introduce a version of HasArea() that takes a rectangle3, and continue propagating the entity struct change
23:47handmade_math.h: Introduce a version of HasArea() that takes a rectangle3, and continue propagating the entity struct change
23:47handmade_math.h: Introduce a version of HasArea() that takes a rectangle3, and continue propagating the entity struct change
35:12Run the game to see that the volumes are being offset unnecessarily
35:12Run the game to see that the volumes are being offset unnecessarily
35:12Run the game to see that the volumes are being offset unnecessarily
35:35handmade_entity.cpp: Prevent UpdateAndRenderEntites() from calling DrawVolume()
35:35handmade_entity.cpp: Prevent UpdateAndRenderEntites() from calling DrawVolume()
35:35handmade_entity.cpp: Prevent UpdateAndRenderEntites() from calling DrawVolume()
35:57Run the game to see that we are back to something relatively sane
35:57Run the game to see that we are back to something relatively sane
35:57Run the game to see that we are back to something relatively sane
36:17handmade_entity.cpp: Enable UpdateAndRenderEntites() to colour the collision volumes according to whether they are colliding
36:17handmade_entity.cpp: Enable UpdateAndRenderEntites() to colour the collision volumes according to whether they are colliding
36:17handmade_entity.cpp: Enable UpdateAndRenderEntites() to colour the collision volumes according to whether they are colliding
36:58Run the game to see our properly bounded rooms
36:58Run the game to see our properly bounded rooms
36:58Run the game to see our properly bounded rooms
38:34handmade_world_mode.cpp: Make AddStandardRoom() only bias the floor tiles upwards
38:34handmade_world_mode.cpp: Make AddStandardRoom() only bias the floor tiles upwards
38:34handmade_world_mode.cpp: Make AddStandardRoom() only bias the floor tiles upwards
40:08Run the game to see what that looks like
40:08Run the game to see what that looks like
40:08Run the game to see what that looks like
43:21handmade_world_mode.cpp: Make PlayWorld() increase the TypicalFloorHeight, run the game to see how that height feels and note a graphical artefact when going downstairs
43:21handmade_world_mode.cpp: Make PlayWorld() increase the TypicalFloorHeight, run the game to see how that height feels and note a graphical artefact when going downstairs
43:21handmade_world_mode.cpp: Make PlayWorld() increase the TypicalFloorHeight, run the game to see how that height feels and note a graphical artefact when going downstairs
46:41handmade_world_mode.cpp: Try to increase the tile size, and decrease the hero size in an effort to combat that clipping artefact when on the stairs
46:41handmade_world_mode.cpp: Try to increase the tile size, and decrease the hero size in an effort to combat that clipping artefact when on the stairs
46:41handmade_world_mode.cpp: Try to increase the tile size, and decrease the hero size in an effort to combat that clipping artefact when on the stairs
48:51Run the game and consider fixing the problem by moving the camera over to the stairs
48:51Run the game and consider fixing the problem by moving the camera over to the stairs
48:51Run the game and consider fixing the problem by moving the camera over to the stairs
49:25handmade_world_mode.cpp: Temporarily make AddStandardRoom() generate the stairwell in the centre and run the game to see that the artefact does not occur
49:25handmade_world_mode.cpp: Temporarily make AddStandardRoom() generate the stairwell in the centre and run the game to see that the artefact does not occur
49:25handmade_world_mode.cpp: Temporarily make AddStandardRoom() generate the stairwell in the centre and run the game to see that the artefact does not occur
52:47handmade_sim_region.cpp: Consider giving the camera a physical location in the world, which gets unpacked into the sim region
52:47handmade_sim_region.cpp: Consider giving the camera a physical location in the world, which gets unpacked into the sim region
52:47handmade_sim_region.cpp: Consider giving the camera a physical location in the world, which gets unpacked into the sim region
57:18Blackboard: Camera Target Position
57:18Blackboard: Camera Target Position
57:18Blackboard: Camera Target Position
58:54handmade_sim_region.cpp: Construct the notion of a camera target position in UpdateCameraForEntityMovement()
58:54handmade_sim_region.cpp: Construct the notion of a camera target position in UpdateCameraForEntityMovement()
58:54handmade_sim_region.cpp: Construct the notion of a camera target position in UpdateCameraForEntityMovement()
1:02:16Run the game and note that the camera is currently unable to articulate to the game where it is trying to view
1:02:16Run the game and note that the camera is currently unable to articulate to the game where it is trying to view
1:02:16Run the game and note that the camera is currently unable to articulate to the game where it is trying to view
1:03:08handmade_sim_region.cpp: Make UpdateCameraForEntityMovement() position the camera in a sim region
1:03:08handmade_sim_region.cpp: Make UpdateCameraForEntityMovement() position the camera in a sim region
1:03:08handmade_sim_region.cpp: Make UpdateCameraForEntityMovement() position the camera in a sim region
1:04:31handmade_world_mode.cpp: Make UpdateAndRenderWorld() set the SimulationCenter based on the camera target
1:04:31handmade_world_mode.cpp: Make UpdateAndRenderWorld() set the SimulationCenter based on the camera target
1:04:31handmade_world_mode.cpp: Make UpdateAndRenderWorld() set the SimulationCenter based on the camera target
1:07:40Run the game and consider how best to locate the camera in the world
1:07:40Run the game and consider how best to locate the camera in the world
1:07:40Run the game and consider how best to locate the camera in the world
1:12:38handmade_world_mode.h: Add OffsetZ to the game_camera struct for UpdateCameraForEntityMovement()
1:12:38handmade_world_mode.h: Add OffsetZ to the game_camera struct for UpdateCameraForEntityMovement()
1:12:38handmade_world_mode.h: Add OffsetZ to the game_camera struct for UpdateCameraForEntityMovement()
1:13:40Run the game to see that the focusing still works
1:13:40Run the game to see that the focusing still works
1:13:40Run the game to see that the focusing still works
1:14:02handmade_sim_region.cpp: Enable UpdateCameraForEntityMovement() and UpdateAndRenderWorld() to lock the camera to the hero's location
1:14:02handmade_sim_region.cpp: Enable UpdateCameraForEntityMovement() and UpdateAndRenderWorld() to lock the camera to the hero's location
1:14:02handmade_sim_region.cpp: Enable UpdateCameraForEntityMovement() and UpdateAndRenderWorld() to lock the camera to the hero's location
1:17:36Run the game to see the camera following the hero
1:17:36Run the game to see the camera following the hero
1:17:36Run the game to see the camera following the hero
1:19:10handmade_sim_region.cpp: Introduce the notion of a SpecialCamera region in UpdateCameraForEntityMovement()
1:19:10handmade_sim_region.cpp: Introduce the notion of a SpecialCamera region in UpdateCameraForEntityMovement()
1:19:10handmade_sim_region.cpp: Introduce the notion of a SpecialCamera region in UpdateCameraForEntityMovement()
1:22:03handmade_world_mode.cpp: Enable AddStandardRoom() to create a collision volume which triggers the SpecialCamera
1:22:03handmade_world_mode.cpp: Enable AddStandardRoom() to create a collision volume which triggers the SpecialCamera
1:22:03handmade_world_mode.cpp: Enable AddStandardRoom() to create a collision volume which triggers the SpecialCamera
1:28:46Run the game to see our collision volume
1:28:46Run the game to see our collision volume
1:28:46Run the game to see our collision volume
1:29:35handmade_world_mode.cpp: Temporarily disable the familiars, and extend the collision volume upwards
1:29:35handmade_world_mode.cpp: Temporarily disable the familiars, and extend the collision volume upwards
1:29:35handmade_world_mode.cpp: Temporarily disable the familiars, and extend the collision volume upwards
1:30:51Run the game to try triggering that collision volume
1:30:51Run the game to try triggering that collision volume
1:30:51Run the game to try triggering that collision volume
1:34:29Q&A
🗩
1:34:29Q&A
🗩
1:34:29Q&A
🗩
1:35:59kknewkles Hi Casey! Two questions: 1) How come RAD aren't owning every avenue of compression in existence, like video codecs? and 2) Will Handmade Hero at some point be beautifully, 2D-animated like the excellent, excellent Hollow Knight, that everyone should play, by the way?
🗪
1:35:59kknewkles Hi Casey! Two questions: 1) How come RAD aren't owning every avenue of compression in existence, like video codecs? and 2) Will Handmade Hero at some point be beautifully, 2D-animated like the excellent, excellent Hollow Knight, that everyone should play, by the way?
🗪
1:35:59kknewkles Hi Casey! Two questions: 1) How come RAD aren't owning every avenue of compression in existence, like video codecs? and 2) Will Handmade Hero at some point be beautifully, 2D-animated like the excellent, excellent Hollow Knight, that everyone should play, by the way?
🗪
1:39:31sausagesuperb Why don't you search and replace for the new short sexy data types
🗪
1:39:31sausagesuperb Why don't you search and replace for the new short sexy data types
🗪
1:39:31sausagesuperb Why don't you search and replace for the new short sexy data types
🗪
1:39:41kknewkles That was Shovel Knight! Hollow Knight is a new game!
🗪
1:39:41kknewkles That was Shovel Knight! Hollow Knight is a new game!
🗪
1:39:41kknewkles That was Shovel Knight! Hollow Knight is a new game!
🗪
1:40:190xdeadbeefh Is the camera for this game gonna be plenty smart or just a little smart? In this staircase I imagine you might want to measure the velocity of the player to not have it affect the camera if the player is rushing straight past
🗪
1:40:190xdeadbeefh Is the camera for this game gonna be plenty smart or just a little smart? In this staircase I imagine you might want to measure the velocity of the player to not have it affect the camera if the player is rushing straight past
🗪
1:40:190xdeadbeefh Is the camera for this game gonna be plenty smart or just a little smart? In this staircase I imagine you might want to measure the velocity of the player to not have it affect the camera if the player is rushing straight past
🗪
1:41:22handmade_sim_region.cpp: Prevent the camera from panning to the staircase unless the hero is traversing the stairs
1:41:22handmade_sim_region.cpp: Prevent the camera from panning to the staircase unless the hero is traversing the stairs
1:41:22handmade_sim_region.cpp: Prevent the camera from panning to the staircase unless the hero is traversing the stairs
1:42:21Run the game to see how that works
1:42:21Run the game to see how that works
1:42:21Run the game to see how that works
1:43:07macielda Is the Debug Text draw order still inverted? It seems so by the looks of the Debug text. Is the profiler still working?
🗪
1:43:07macielda Is the Debug Text draw order still inverted? It seems so by the looks of the Debug text. Is the profiler still working?
🗪
1:43:07macielda Is the Debug Text draw order still inverted? It seems so by the looks of the Debug text. Is the profiler still working?
🗪
1:43:41teamrandb Greetings Casey! Last week during the wonderful Handmade Chat you demonstrated how to dynamically create code in memory. You have mentioned in the past how you do a fair bit of meta-programming and I always envisioned that you would generate C / C++ code to files. When you tackle meta-programming, do you write out to disk first and then have it compiled? Do you do it all in memory similar to what you did last week? Combination of both?
🗪
1:43:41teamrandb Greetings Casey! Last week during the wonderful Handmade Chat you demonstrated how to dynamically create code in memory. You have mentioned in the past how you do a fair bit of meta-programming and I always envisioned that you would generate C / C++ code to files. When you tackle meta-programming, do you write out to disk first and then have it compiled? Do you do it all in memory similar to what you did last week? Combination of both?
🗪
1:43:41teamrandb Greetings Casey! Last week during the wonderful Handmade Chat you demonstrated how to dynamically create code in memory. You have mentioned in the past how you do a fair bit of meta-programming and I always envisioned that you would generate C / C++ code to files. When you tackle meta-programming, do you write out to disk first and then have it compiled? Do you do it all in memory similar to what you did last week? Combination of both?
🗪
1:45:28jezzi23 Hey Casey. I was messing around with 4x4 matrix multiplication implementations and whipped out ten variations, some of which naive and others more optimal with SIMD. Out of curiosity I performance tested them all on MSVC, clang and gcc. I was very surprised by the results as the compilers seem to be doing very different things for this simple task. For example, on gcc the naive versions sometimes beat what I thought would be optimal SIMD (seems like it was able to output better intrinsics) but on clang it was the opposite. MSVC seems to have failed at unrolling a loop and all implementations were crap except for a manually unrolled SIMD version. I realize this is a rathole of a problem but is this really where we're at in terms of the philosophy of "write once and let each compiler do the best thing for the platform"? Any thoughts?
🗪
1:45:28jezzi23 Hey Casey. I was messing around with 4x4 matrix multiplication implementations and whipped out ten variations, some of which naive and others more optimal with SIMD. Out of curiosity I performance tested them all on MSVC, clang and gcc. I was very surprised by the results as the compilers seem to be doing very different things for this simple task. For example, on gcc the naive versions sometimes beat what I thought would be optimal SIMD (seems like it was able to output better intrinsics) but on clang it was the opposite. MSVC seems to have failed at unrolling a loop and all implementations were crap except for a manually unrolled SIMD version. I realize this is a rathole of a problem but is this really where we're at in terms of the philosophy of "write once and let each compiler do the best thing for the platform"? Any thoughts?
🗪
1:45:28jezzi23 Hey Casey. I was messing around with 4x4 matrix multiplication implementations and whipped out ten variations, some of which naive and others more optimal with SIMD. Out of curiosity I performance tested them all on MSVC, clang and gcc. I was very surprised by the results as the compilers seem to be doing very different things for this simple task. For example, on gcc the naive versions sometimes beat what I thought would be optimal SIMD (seems like it was able to output better intrinsics) but on clang it was the opposite. MSVC seems to have failed at unrolling a loop and all implementations were crap except for a manually unrolled SIMD version. I realize this is a rathole of a problem but is this really where we're at in terms of the philosophy of "write once and let each compiler do the best thing for the platform"? Any thoughts?
🗪
1:53:31macielda I remember you mentioned at some point that you were really interested in Salt & Sanctuary. Have you played it? Did you work on that game?
🗪
1:53:31macielda I remember you mentioned at some point that you were really interested in Salt & Sanctuary. Have you played it? Did you work on that game?
🗪
1:53:31macielda I remember you mentioned at some point that you were really interested in Salt & Sanctuary. Have you played it? Did you work on that game?
🗪
1:53:51wordisnull Can you please explain once more why you kept CameraOffsetZ? Is it for movement beetwen tilemaps or for something else?
🗪
1:53:51wordisnull Can you please explain once more why you kept CameraOffsetZ? Is it for movement beetwen tilemaps or for something else?
🗪
1:53:51wordisnull Can you please explain once more why you kept CameraOffsetZ? Is it for movement beetwen tilemaps or for something else?
🗪
1:54:05Blackboard: Encoding the location the camera is looking at
1:54:05Blackboard: Encoding the location the camera is looking at
1:54:05Blackboard: Encoding the location the camera is looking at
1:56:07m0re85 If it's too off-topic I'll ask tomorrow during pre-stream, follow up on devirtualization: Your main criticism about virtual functions was the overhead you get from the indirection, so with devirtualization would you consider using them, or are there any other downsides compared to tagged unions?
🗪
1:56:07m0re85 If it's too off-topic I'll ask tomorrow during pre-stream, follow up on devirtualization: Your main criticism about virtual functions was the overhead you get from the indirection, so with devirtualization would you consider using them, or are there any other downsides compared to tagged unions?
🗪
1:56:07m0re85 If it's too off-topic I'll ask tomorrow during pre-stream, follow up on devirtualization: Your main criticism about virtual functions was the overhead you get from the indirection, so with devirtualization would you consider using them, or are there any other downsides compared to tagged unions?
🗪
1:58:19Close it down with a plug of AsafGartner's searcher1
📖
1:58:19Close it down with a plug of AsafGartner's searcher1
📖
1:58:19Close it down with a plug of AsafGartner's searcher1
📖