63 lines
7.3 KiB
Plaintext
63 lines
7.3 KiB
Plaintext
[video member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Debugging Missing Parent Pointers" vod_platform=youtube id=2YF5klxWgxg annotator=Miblo]
|
|
[0:01][Recap and set the stage for the day][:speech]
|
|
[0:33][Show off our sprite Y-displacement solution (replacing Z bias)][:"entity system" :run]
|
|
[3:06][Make UpdateAndRenderWorld() pan the debug :camera along its own axes (rather than those of the regular game camera)]
|
|
[9:47][Try out our debug :camera panning, and determine to finalise our asset alignment for accurate :sorting and axis-correct snapping][:"entity system"]
|
|
[17:34][Set up to snap assets together by their alignment points][:"entity system" :research]
|
|
[25:48][Ensure that the alignment points slide along the tilted pane][:"entity system" :run]
|
|
[27:01][Snapping children to their parent][:"entity system" :research]
|
|
[28:48][Demonstrate that we are not snapping sprites together in Z][:"entity system" :run]
|
|
[30:32][Define sprite alignment and snapping: Sprite stacks snap together naturally when at the centre of the scene, and tilt when at the edges][:"entity system" :run]
|
|
[35:56][Aligning the sprite stack for the scene centre before snapping according the stack's actual position][:"entity system" :research]
|
|
[39:31][Remove ZBias and BaseP offset from SpriteValuesForUpright(), and instead make its caller UpdateAndRenderEntities() perform the offset][:"entity system"]
|
|
[41:47][See that the sprite stack is aligned as before][:"entity system" :run]
|
|
[41:58][Temporarily prevent UpdateAndRenderEntities() from applying the sprite offset][:"entity system"]
|
|
[44:21][Find that we unexpectedly do not snap sprites directly][:"entity system" :run]
|
|
[44:39][Investigate why our sprites are not snapped directly][:"entity system" :research]
|
|
[47:29][Aligning sprites to 0, 0, 0 in world-space][:blackboard :"entity system"]
|
|
[51:24][Temporarily make SpriteValuesForUpright() snap sprite directly][:"entity system"]
|
|
[51:57][Find that our sprites are snapped directly, and Z-fighting][:"entity system" :run]
|
|
[52:58][Enable UpdateAndRenderEntities() to offset sprites in Y as SpriteValuesForUpright() used to][:"entity system"]
|
|
[54:49][Crash in FindAlign() with an "Access violation" error, and investigate it][:asm :run]
|
|
[58:11][Reverse engineer the optimised assembly code generated for FindAlign()][:asm :run]
|
|
[1:07:05][Find that UpdateAndRenderEntities() evaluates a non-zero ParentAlignType before going on to pass the bitmap with a ParentAlignType of 0 to FindAlign()][:asm :run]
|
|
[1:11:45][Reverse engineer the optimised assembly code surrounding that ParentAlignType check in UpdateAndRenderEntities()][:asm :run]
|
|
[1:19:15][TEST - Logical Compare[ref
|
|
site="Intel"
|
|
page="Intel 64 and IA-32 Architectures Software Developer Manuals"
|
|
url=https://www-ssl.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html]][:isa :research]
|
|
[1:21:25][Continue to reverse engineer the ParentAlignType check in UpdateAndRenderEntities(), to see that ecx gets overwritten after the check][:asm :run]
|
|
[1:23:27][Investigate why ParentAlignType is evaluated to 259][:asm :run]
|
|
[1:32:39][Consult our source of ConnectPiece() where ParentAlignType is set, and note that this entity's first piece should not have a non-zero, but valid ParentAlignType][:research]
|
|
[1:36:15][Possible causes for our non-zero ParentAlignType][:research]
|
|
[1:43:40][Reverse engineer the optimised assembly code generated for AddCat()][:asm :run]
|
|
[1:54:17][Consider the nastiness of our bug][:run]
|
|
[1:55:25][Add an assertion in UpdateAndRenderEntities() to guard against our first piece, non-zero ParentAlignType bug]
|
|
[1:56:50][Q&A][:speech]
|
|
[1:58:22][@noxnode][Q: How do you like the progress of [~hero Handmade Hero] so far?]
|
|
[2:01:23][@jim0_o][Q: Will you add 3D primitives as :collision proxies or something like that?]
|
|
[2:01:30][@aidsjorb][Q: You've mentioned in the past you climb as a form of exercise. Have you seen Free Solo yet?]
|
|
[2:01:37][@rippinwaffles][Q: Not related to the problem at hand, but on the subject of assembly, did you have a chance to look at the burst compiler demo from Unity's GDC 2019 keynote and, if so, what's your take on it? I thought it looked cool but don't know enough to be able to really have an informed opinion on it][:language]
|
|
[2:04:13][@Miblo][Q: Couple of days late, but now that we're hopping in Z, how about adding water so the hero can go swimming?]
|
|
[2:06:12][@clysmic][Q: (Not a question). Hi [@cmuratori Casey]. On Monday I am starting my first day of work at a medium sized game studio after working for Microsoft for a few years. Just wanted to say thanks to you (among others) for the inspiration and education that made this career change possible for me]
|
|
[2:06:48][@rooctag][Q: It was a good demo about how a bug can mess up the schedule and get you two hours of info, but sadly nothing...]
|
|
[2:09:22][@bulmanator][Q: Hey [@cmuratori Casey], the way you think / teach how to think about matrices has helped me understand the transformation pipeline a lot better. There is just one thing that I think I am missing. At one point you put the :camera's coordinates into clip space \[-1, 1\] so I was wondering how you scale world units to make sure things aren't huge on screen?][:mathematics]
|
|
[2:16:07][Projecting a 3D world onto a 2D screen][:blackboard :camera]
|
|
[2:22:14][Understanding scaling in terms of the film-back's distance from the aperture][:blackboard :camera]
|
|
[2:31:18][@0lpbm][Q: I think in a pinhole camera, the focal length is 0 and the focal point is the actual pinhole itself][:camera]
|
|
[2:31:41][Document the FocalLength in PerspectiveProjection()][:camera]
|
|
[2:32:46][@rippinwaffles][Q: Going to the perspective question: So mathematically, you are recreating the space bounded by the near and far clip frame in the space "defined" by the lens and the focal length? So if you could imagine one pixel as being a vector from the lens to some point, you are literally just doing a magnitude scale. If that's the case, then how do you handle the fact that you're mapping a curved surface onto a plane?][:camera]
|
|
[2:34:29][@bulmanator][Q: What you said made sense and I think I get it. Thank you very much! I'm going to mess around with it to get things scaled the way I like it][:camera]
|
|
[2:35:01][@ttbjm][Q: How much do curved monitors complicate this?][:camera]
|
|
[2:35:56][Projecting onto a curved monitor][:blackboard :camera]
|
|
[2:38:49][Recommend '3D Rasterization: A Bridge between Rasterization and Ray Casting'[ref
|
|
author="Tomáš Davidovič, Thomas Engelhardt, Iliyan Georgiev, Philipp Slusallek, Carsten Dachsbacher"
|
|
title="3D Rasterization: A Bridge between Rasterization and Ray Casting"
|
|
url=http://cg.ivd.kit.edu/publications/p2012/3dr/gi2012.pdf]][:camera :research]
|
|
[2:41:36][@rippinwaffles][Q: I'm imagining the "true" surface as being an arc with radius=focal length but you're mapping that arc onto a flat rectangular screen (assuming it's not a curved monitor)][:camera]
|
|
[2:42:00][Projecting onto a flat surface][:blackboard :camera]
|
|
[2:45:03][@ormone88][Q: If I wanted to create seamless terrains, starting from a cube-like tile map, what algorithm should I look into? Is Marching Cubes a viable approach?][:"mesh building"]
|
|
[2:45:22][@rippinwaffles][Q: I was thinking that you'd want to solve the problem that you'd get a differential zooming, but it seems like that's not too much of an issue][:camera]
|
|
[2:48:00][Close things down][:speech]
|
|
[/video]
|