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

79 lines
7.0 KiB
Plaintext

[video output=day221 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Implementing Multi-layer Cutscenes" vod_platform=youtube id=JOoqeKB9lx4 annotator=Miblo]
[0:48][Assets: intro_art.hha is released]
[3:03][Introduce this art pack]
[4:13][handmade_file_formats.h: Add our new asset types and tags to asset_type_id and asset_tag_id]
[5:08][Blackboard: CutScene Art]
[9:16][Recompile and see that we're running as expected]
[11:18][Blackboard: Calculate how much space the cutscene requires]
[12:01][handmade.cpp: Increase the amount of memory allocated for the assets]
[13:01][handmade_cutscene.cpp: Start writing the cutscene code]
[14:14][handmade_cutscene.cpp: Introduce RenderCutScene]
[19:43][handmade.cpp: #include "handmade_cutscene.cpp"]
[20:12][handmade.cpp: Call RenderCutScene and introduce UpdateAndRenderGame]
[24:04][Compile and run and hit an assertion in CheckArena]
[25:02][handmade.cpp: Do EndTemporaryMemory before CheckArena]
[25:25][Compile and confirm that this is now correct]
[25:40][handmade.cpp: Toggle from UpdateAndRenderGame to RenderCutScene]
[26:06][Debugger: Step into RenderCutScene and ensure we're getting a bitmap]
[26:58][handmade_cutscene.cpp: Pass a height to PushBitmap and see the cutscene in action]
[27:20][handmade_cutscene.cpp: Tweak the size and encounter a bug in the debug stuff]
[27:58][build.bat: Turn off HANDMADE_INTERNAL]
[28:16][handmade_cutscene.cpp: Tweak that size until the image fits the screen, and add layers to the scene]
[29:49][What we did today][quote 328]
[30:11][Blackboard: Positioning the layers in space]
[32:12][handmade.h: Introduce CutSceneTime]
[32:49][handmade_cutscene.cpp: Pass CutSceneTime to RenderCutScene and slowly zoom the camera]
[37:40][Run the game and see the cutscene in action]
[38:01][build.bat: Temporarily compile in -O2]
[38:33][Note that the image has no depth to it]
[39:06][handmade_cutscene.cpp: Position the layers in Z based on their LayerIndex]
[40:43][See the parallax effect]
[41:39][handmade_cutscene.cpp: Work on the layers' positioning]
[42:59][handmade_cutscene.cpp: Introduce LayerPlacement]
[44:38][handmade_cutscene.cpp: Special-case the sky background]
[46:50]["Hey, look! It did what I expected!][quote 329]
[47:59][handmade_cutscene.cpp: Place the layers]
[57:03][Note that the only problem we have left is that we're zooming towards nothing]
[57:43][handmade_cutscene.cpp: Introduce CameraOffset and set the focus point]
[1:00:31][Q&A][:speech]
[1:01:31][@AlephAnt][Would you normally want to get the position / scale for each layer from the artist? If so, how would you go about doing that?]
[1:03:19][@StrickenDown][I am new to programming and know intermediate Java only. Can you explain what you use emacs for if you're using Visual Studio?]
[1:03:49][@cubercaleb][I think you should move the skylight up a tad bit]
[1:04:10][@garlandobloom][I feel like we should have some deep voice narration. "Down in the valley..."]
[1:04:31][@Ownageinacannn][Did you ever have trouble while learning to program? I'm currently getting my rump handed to me in my Java class]
[1:05:29][@elxenoaizd][Will we ever load png files? If so, will we be writing our own loader or use stb_image.h? I read that it's tricky to load pngs or no?]
[1:05:54][@dsJimEnez][Will your cutscenes be coded like this, or be setup as data in a separate file?]
[1:06:21][@broxx909][Do you need to know in-depth linear algebra to do this?]
[1:06:42][@elxenoaizd][You mentioned your codebase is mostly independent for the most part: does that include random number generation or do you use the C library for that?]
[1:07:12][@elxenoaizd][How do you handle 3D audio in your other engines and games? OpenAL or you implement something yourself?]
[1:07:57][@garlandobloom][The sky-light just has a gap at the top was all]
[1:08:14][handmade_cutscene.cpp: Move the sky light a touch closer]
[1:08:34][@Jayp2][Have you talked further with Pat Wyatt about coming on the stream, or is that postponed for when networking becomes relevant? I thought his talk was very interesting in particular]
[1:09:11][@CaptainKraft][Is this code going to be for a cinematic in the game or are you just testing the functionality now?]
[1:09:23][@Kaminate][Should I use uint32_t over u32?]
[1:09:39][@blah238][What do you think about adding lighting effects to the cutscene, like a flickering or pulsing of the candlelight in the welcome sign?]
[1:10:18][@elxenoaizd][I meant the image format before we pack them in asset. I understand we're currently using BMP]
[1:10:57][@insofaras][For adding more cutscenes or modding, wouldn't it make more sense to keep the parallax constants somewhere in the hha file?]
[1:11:58][@cubercaleb][Don't you need to link to user32, gdi32 and opengl32 for a few things?]
[1:12:32][@elxenoaizd][If you're writing OpenGL stuff, do you use GLEW or write your own extension loader and load the function pointers yourself?]
[1:12:41][@Longboolean][You could make a 2D VR game, just room with a giant video wall]
[1:12:56][@btnGames][Off-topic: Thank you for HandmadeCon, I have watched it twice already]
[1:13:02][@PurposelyDrifting][Not a question. Just wanted to thank you for doing HandmadeCon! And glad to see you back doing Handmade Hero]
[1:13:44][@fwe4][Any plans for crude lighting and shadow support for things like lightposts?]
[1:14:15][@groggeh][Will you show all content creation on stream too? Watching you spend hours doing cutscenes might not be fun][quote 330]
[1:16:12][@btnGames][Out of interest, if you wanted to implement a zoom that curved to the contours of the hill (forward, drop, forward), would you still look to implement that in code or look at a visual tool for something like that?]
[1:18:01][@theGeekPirate][Thanks for the stream, Casey]
[1:18:06][@Ownageinacannn][Did you have to study algorithms in depth or did you learn from on-hand experience?]
[1:19:21][@groggeh][Is VSYNC part of the renderer? At least on my end on the stream there is quite a bit of tearing. Not sure if that is the stream or not]
[1:21:00][@CaptainKraft][Have any of the responses to your questions at HandmadeCon affected your approach to certain problems?]
[1:21:48][@btnGames][Was the snowman intentionally looking down to indicate a feeling of sadness, or am I reading too much into it?]
[1:23:06][@ciutchism][Has a programming problem ever stumped you? Even after googling and or collaboration?][quote 331]
[1:24:55][@alephant][That's a good quote]
[1:25:06][On using metrics to determine which implementation is the most appropriate for a given situation]
[1:26:41][@elxenoaizd][When you were an intermediate programmer how often is it that you used Google to help you look up solutions to hard problems? Or do you always try to first approach it yourself?]
[1:26:58][@ChronalDragon][It may be obvious but there is an entire class of programmers that seem to think otherwise]
[1:27:12][@CaptainKraft][Did you notice the triforce in the windows?]
[1:27:43][@Pseudonym73][One of my mentors used to say that there should be a book called "Algorithms, Data Structures, and Tradeoffs"]
[1:28:01][Wrap things up][:speech]
[/video]