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

64 lines
5.2 KiB
Plaintext
Raw Permalink Normal View History

[video output=day133 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Preliminary Asset Structuring" vod_platform=youtube id=u0LjxqHmvkk annotator=Miblo]
[2:37][Recap and set the stage]
[5:19][Blackboard: "One in, One out"]
[7:46][Blackboard: Only load once!]
[9:16][Outline our tasks for the day]
[10:05][handmade.cpp: Get TopDownAlignY back in]
[12:19][Run the game to see the correct alignment]
[12:27][handmade.h: Make things only load once]
[14:05][handmade.cpp: Check to see if the asset in question is loaded]
[16:14][handmade_intrinsics.h: Introduce AtomicCompareExchangeUInt32]
[19:05][Compile and run]
[19:41][FillGroundChunk will render incorrectly if the bitmap to be composited doesn't exist]
[21:42][handmade.cpp: Only mark the ground chunk as having been filled once we know it has been]
[22:19][handmade_render_group.cpp: Introduce AllBitmapsValid (AllResourcesPresent)]
[23:50][Add MissingResourceCount to render_group]
[24:31][Problem: With ground chunks being rendered on a separate thread, they could potentially be evicted at the wrong time]
[25:49][Possible solutions to this problem]
[28:09][handmade_render_group.cpp: Introduce CleanupRenderGroup]
[30:12][handmade_render_group.h: Add game_asset_id to render_entry_bitmap]
[31:27][handmade_render_group.cpp: Introduce UnlockAsset in CleanupRenderGroup]
[32:19][Introduce LockAsset in PushBitmap]
[33:09][Assess this locking implementation and undo it]
[37:06][handmade.h: Introduce AssetState_Locked in asset_state]
[38:06][Add asset_state FinalState to load_asset_work]
[39:03][handmade.cpp: Assess what DEBUGLoadBMP is doing and consider what to do next]
[42:12][handmade.h: Expand the notion of game_asset_id to be more generic]
[43:15][Introduce asset_bitmap_info]
[44:24][Introduce asset_tag]
[45:08][Talk about creating a table of assets which provides semantic information to the code]
[46:22][handmade.cpp: Discuss how this semantic information could be used by the world generation code]
[48:09][Assets: Take a look at the art assets]
[49:06][handmade.cpp: Introduce PickBest to rank assets according to the given criteria]
[53:39][Explain how PickBest could work]
[55:50][handmade.h: Introduce asset_group]
[56:50][Get it compiling and leave it for now]
[57:20][Q&A][:speech]
[57:38][@robotchocolatedino][In PickBest, would you want other types of falloffs when computing the difference?]
[57:57][@xyane][When compiling for 64bit, shouldn't you be using _InterlockedCompareExchange64?]
[58:29][@quikligames][In your example of having 32 GB of assets uncompressed and 2 GB of space for them, are there techniques you can use to tell whether you will need more than 2 GB at one time?]
[59:44][@johnicholas][Can you summarize what you've done from the artist's perspective? Did you add a (light) obligation to the contract between the programmer and the artist?]
[1:01:02][@xyane][If you can't evict locked resources, what would be the point of streaming them over just loading them up front, and doesn't it put a restraint on the diversity of the environments you can have?]
[1:02:42][@marius_av][Shouldn't you fill Work completely before calling PlatformAddEntry for LoadAssetWork?]
[1:03:23][handmade.cpp: Move PlatformAddEntry after the switch statements in LoadAsset]
[1:04:06][@ezyfool][I may have missed this, but do you have the ability to set a hard limit on memory usage yet, e.g. so you know you can support lower memory machines?]
[1:04:49][@xyane][In a prior episode you implemented bilinear filtering. Are you going to take it a step further and implement mipmapping and trilinear filtering?]
[1:06:52][@robotchocolatedino][Will the assets loaded in from a file be stored and evicted in the same way as the ground chunks?]
[1:07:18][Song: 'Are There Questions?' by Casey Muratori]
[1:07:50][@benzih][Why only .bmp?]
[1:09:04][@soysaucethekid][The eviction stuff you're doing, is it basically garbage collection?]
[1:10:40][@zilerrezko][Will we be using AMD hair physics?][quote 114]
[1:12:07][@popcorn0x90][If you turn a bitmap black and white by altering the pixel, then would you have two copies of the bitmap? Would you delete one if you have two?]
[1:14:22][@zilerrezko][Why do people care so much about garbage collection?]
[1:14:29][@stelar7][Why use a pack-file instead of bmps? What makes it "better"?]
[1:16:21][@alephant][Earlier someone asked why reimplement virtual memory on top of the OS's virtual memory. Are we doing this just so we can have "more" virtual space?]
[1:17:45][@marumoto][Are the ground chunks going to be pre-composited when using the GPU?]
[1:18:02][@dekameel][Is there a reason why you split the character into three bitmaps?]
[1:18:12][@mrstone56][Is the rendering going to be eventually done on the GPU?]
[1:19:05][@quikligames][Are game saves going to be part of that asset pack-file, or their own pack-file?]
[1:20:23][Song: 'Q's & A's' by Casey Muratori]
[1:20:39][@mrstone56][Does porting the rendering to be done on the GPU mean you have to write a renderer completely separate to the CPU one, or is most of the groundwork done by having the CPU renderer done?]
[1:22:24][@cubercaleb][I thought you hated both DRM and cloud-based stuff (based off of Jeff and Casey Show)]
[1:24:00][Go get some ramen][:speech][quote 115]
[/video]