Entity Packing and Unpacking
?
?

Keyboard Navigation

Global Keys

[, < / ], > Jump to previous / next episode
W, K, P / S, J, N Jump to previous / next timestamp
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 and Index Controls

a
w
s
d
h j k l


Esc Close menu / unfocus timestamp

Quotes and References Menus and Index

Enter Jump to timestamp

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:00Recap and set the stage for the day continuing our entity system simplification
🗩
0:00Recap and set the stage for the day continuing our entity system simplification
🗩
0:00Recap and set the stage for the day continuing our entity system simplification
🗩
1:53Recap our sim_region and entity ID removal considerations
📖
1:53Recap our sim_region and entity ID removal considerations
📖
1:53Recap our sim_region and entity ID removal considerations
📖
5:19Consider simplifying the UpdatableBounds and BrainHash out of the sim_region struct
📖
5:19Consider simplifying the UpdatableBounds and BrainHash out of the sim_region struct
📖
5:19Consider simplifying the UpdatableBounds and BrainHash out of the sim_region struct
📖
6:56Remove sim_region, entity_hash and brain_hash, and GetHashFromID()
6:56Remove sim_region, entity_hash and brain_hash, and GetHashFromID()
6:56Remove sim_region, entity_hash and brain_hash, and GetHashFromID()
7:39Reacquaint ourselves with our IterateAllEntities() call sites
📖
7:39Reacquaint ourselves with our IterateAllEntities() call sites
📖
7:39Reacquaint ourselves with our IterateAllEntities() call sites
📖
9:06Clear out handmade_sim_region.h
9:06Clear out handmade_sim_region.h
9:06Clear out handmade_sim_region.h
9:24Remove AddBrain(), AllocateEntityID() and MarkOccupied()
9:24Remove AddBrain(), AllocateEntityID() and MarkOccupied()
9:24Remove AddBrain(), AllocateEntityID() and MarkOccupied()
10:05Move MarkBit() and IsEmpty() from handmade_sim_region.cpp to handmade.cpp
10:05Move MarkBit() and IsEmpty() from handmade_sim_region.cpp to handmade.cpp
10:05Move MarkBit() and IsEmpty() from handmade_sim_region.cpp to handmade.cpp
10:43Remove GetHashFromID() and GetEntityByID_()
10:43Remove GetHashFromID() and GetEntityByID_()
10:43Remove GetHashFromID() and GetEntityByID_()
11:00Move EntityOverlapsRectangle() and EntityOverlapsEntity() from handmade_sim_region.cpp to handmade_entity.cpp
11:00Move EntityOverlapsRectangle() and EntityOverlapsEntity() from handmade_sim_region.cpp to handmade_entity.cpp
11:00Move EntityOverlapsRectangle() and EntityOverlapsEntity() from handmade_sim_region.cpp to handmade_entity.cpp
11:44Remove GetOrAddBrain(), AddEntityToHash(), MapIntoSimSpace() and RegisterEntity()
11:44Remove GetOrAddBrain(), AddEntityToHash(), MapIntoSimSpace() and RegisterEntity()
11:44Remove GetOrAddBrain(), AddEntityToHash(), MapIntoSimSpace() and RegisterEntity()
11:59Move BeginWorldChange(), CreateEntity() and DeleteEntity() from handmade_sim_region.cpp to handmade_world.cpp
11:59Move BeginWorldChange(), CreateEntity() and DeleteEntity() from handmade_sim_region.cpp to handmade_world.cpp
11:59Move BeginWorldChange(), CreateEntity() and DeleteEntity() from handmade_sim_region.cpp to handmade_world.cpp
13:54Move IsRoom() from handmade_sim_region.cpp to handmade_entity.cpp
13:54Move IsRoom() from handmade_sim_region.cpp to handmade_entity.cpp
13:54Move IsRoom() from handmade_sim_region.cpp to handmade_entity.cpp
14:14Remove RegisterEntity()
14:14Remove RegisterEntity()
14:14Remove RegisterEntity()
14:35Move TileIsOpen(), TileIsOccupied(), TransactionalOccupy(), OverlappingEntitiesExist(), closest_entity, GetClosestEntityWithBrain(), GetClosestEmptyTileTo(), FindRandomOpenTile() and FindAdjacentOpenTile() from handmade_sim_region.cpp to handmade_world.cpp
14:35Move TileIsOpen(), TileIsOccupied(), TransactionalOccupy(), OverlappingEntitiesExist(), closest_entity, GetClosestEntityWithBrain(), GetClosestEmptyTileTo(), FindRandomOpenTile() and FindAdjacentOpenTile() from handmade_sim_region.cpp to handmade_world.cpp
14:35Move TileIsOpen(), TileIsOccupied(), TransactionalOccupy(), OverlappingEntitiesExist(), closest_entity, GetClosestEntityWithBrain(), GetClosestEmptyTileTo(), FindRandomOpenTile() and FindAdjacentOpenTile() from handmade_sim_region.cpp to handmade_world.cpp
15:14Move the entity iterator – FindNextEntity(), IterateAllEntities() and Advance() – from handmade_sim_region.cpp to handmade_world.cpp
15:14Move the entity iterator – FindNextEntity(), IterateAllEntities() and Advance() – from handmade_sim_region.cpp to handmade_world.cpp
15:14Move the entity iterator – FindNextEntity(), IterateAllEntities() and Advance() – from handmade_sim_region.cpp to handmade_world.cpp
15:33Move UpdateCameraForEntityMovement() from handmade_sim_region.cpp to handmade_world_mode.cpp
15:33Move UpdateCameraForEntityMovement() from handmade_sim_region.cpp to handmade_world_mode.cpp
15:33Move UpdateCameraForEntityMovement() from handmade_sim_region.cpp to handmade_world_mode.cpp
15:45Reflect on our sim_region removal
🗩
15:45Reflect on our sim_region removal
🗩
15:45Reflect on our sim_region removal
🗩
16:00Delete handmade_sim_region.{cpp,h}
🗹
16:00Delete handmade_sim_region.{cpp,h}
🗹
16:00Delete handmade_sim_region.{cpp,h}
🗹
16:38Remove the late sim_region from the entity code, moving DeleteEntity() from handmade_world.cpp to handmade_entity.cpp
16:38Remove the late sim_region from the entity code, moving DeleteEntity() from handmade_world.cpp to handmade_entity.cpp
16:38Remove the late sim_region from the entity code, moving DeleteEntity() from handmade_world.cpp to handmade_entity.cpp
18:56Perform the easy removals of sim_region from UpdateAndRenderEntities()
18:56Perform the easy removals of sim_region from UpdateAndRenderEntities()
18:56Perform the easy removals of sim_region from UpdateAndRenderEntities()
19:43Note our need to replace the final use of sim_region in UpdateAndRenderEntities() with a pre-pass gathering all local entities
📖
19:43Note our need to replace the final use of sim_region in UpdateAndRenderEntities() with a pre-pass gathering all local entities
📖
19:43Note our need to replace the final use of sim_region in UpdateAndRenderEntities() with a pre-pass gathering all local entities
📖
20:20Note our new need to move entities between spatial partition nodes
📖
20:20Note our new need to move entities between spatial partition nodes
📖
20:20Note our new need to move entities between spatial partition nodes
📖
21:46Remove the forward-declaration of FillUnpackedEntity() from handmade_entity.h
21:46Remove the forward-declaration of FillUnpackedEntity() from handmade_entity.h
21:46Remove the forward-declaration of FillUnpackedEntity() from handmade_entity.h
22:03Reacquaint ourselves with AdvanceEntityStats()
📖
22:03Reacquaint ourselves with AdvanceEntityStats()
📖
22:03Reacquaint ourselves with AdvanceEntityStats()
📖
22:16Lament our lack of sleep and need for caffeinated coffee and / or sugar
🗩
22:16Lament our lack of sleep and need for caffeinated coffee and / or sugar
🗩
22:16Lament our lack of sleep and need for caffeinated coffee and / or sugar
🗩
23:03Consider the discontinuity arising from distant, active entities wanting to interact with inactive entities
📖
23:03Consider the discontinuity arising from distant, active entities wanting to interact with inactive entities
📖
23:03Consider the discontinuity arising from distant, active entities wanting to interact with inactive entities
📖
26:26Enable UpdateAndRenderEntities() to gather all local entities, making it take the world and a rectangle3, not a sim_region
26:26Enable UpdateAndRenderEntities() to gather all local entities, making it take the world and a rectangle3, not a sim_region
26:26Enable UpdateAndRenderEntities() to gather all local entities, making it take the world and a rectangle3, not a sim_region
27:09Turn off phone
🗹
27:09Turn off phone
🗹
27:09Turn off phone
🗹
27:23Introduce our regional entity iterator: IterateEntityInBounds()
27:23Introduce our regional entity iterator: IterateEntityInBounds()
27:23Introduce our regional entity iterator: IterateEntityInBounds()
29:28Consider fixed- vs floating-point precision for our entity iteration
📖
29:28Consider fixed- vs floating-point precision for our entity iteration
📖
29:28Consider fixed- vs floating-point precision for our entity iteration
📖
30:39Change UpdateAndRenderEntities() to take a world_position and v2 Radius, not a rectangle3
30:39Change UpdateAndRenderEntities() to take a world_position and v2 Radius, not a rectangle3
30:39Change UpdateAndRenderEntities() to take a world_position and v2 Radius, not a rectangle3
31:19Introduce world_region for UpdateAndRenderEntities() to take
31:19Introduce world_region for UpdateAndRenderEntities() to take
31:19Introduce world_region for UpdateAndRenderEntities() to take
31:52Rename IterateEntitiesInBounds() to IterateEntitiesIn(), taking a world_region
31:52Rename IterateEntitiesInBounds() to IterateEntitiesIn(), taking a world_region
31:52Rename IterateEntitiesInBounds() to IterateEntitiesIn(), taking a world_region
32:48Reacquaint ourselves with world_sim
📖
32:48Reacquaint ourselves with world_sim
📖
32:48Reacquaint ourselves with world_sim
📖
36:17Remove world_sim, and the sim_region * from world_generator
36:17Remove world_sim, and the sim_region * from world_generator
36:17Remove world_sim, and the sim_region * from world_generator
36:44Unify AddEntity() as an overload of CreateEntity(), both taking a world and world_position, not a sim_region
36:44Unify AddEntity() as an overload of CreateEntity(), both taking a world and world_position, not a sim_region
36:44Unify AddEntity() as an overload of CreateEntity(), both taking a world and world_position, not a sim_region
40:04Move the CreateEntity() functions from handmade_entity.cpp to handmade_world.cpp
40:04Move the CreateEntity() functions from handmade_entity.cpp to handmade_world.cpp
40:04Move the CreateEntity() functions from handmade_entity.cpp to handmade_world.cpp
40:17Make CreateEntity() pass the world and world_position, not the late sim region's World, to AcquireUnpackedEntitySlot(), removing AddEntity()
40:17Make CreateEntity() pass the world and world_position, not the late sim region's World, to AcquireUnpackedEntitySlot(), removing AddEntity()
40:17Make CreateEntity() pass the world and world_position, not the late sim region's World, to AcquireUnpackedEntitySlot(), removing AddEntity()
40:51Embark on setting up the world storage
📖
40:51Embark on setting up the world storage
📖
40:51Embark on setting up the world storage
📖
41:37Switch entity_block_storage to be a union
41:37Switch entity_block_storage to be a union
41:37Switch entity_block_storage to be a union
41:46Describe packed_entity_block and unpacked_entity_block
📖
41:46Describe packed_entity_block and unpacked_entity_block
📖
41:46Describe packed_entity_block and unpacked_entity_block
📖
43:51Structure ChunkX and ChunkY as a v2s Chunk in world_position
43:51Structure ChunkX and ChunkY as a v2s Chunk in world_position
43:51Structure ChunkX and ChunkY as a v2s Chunk in world_position
44:18Consider relieving entities of storing their containing chunk information
📖
44:18Consider relieving entities of storing their containing chunk information
📖
44:18Consider relieving entities of storing their containing chunk information
📖
45:29Remove NullPosition() and the world_position overload of IsValid()
45:29Remove NullPosition() and the world_position overload of IsValid()
45:29Remove NullPosition() and the world_position overload of IsValid()
46:17Fix up accesses of our structured Chunk in world_position
46:17Fix up accesses of our structured Chunk in world_position
46:17Fix up accesses of our structured Chunk in world_position
47:17Reacquaint ourselves with the TILE_CHUNK_SAFE_MARGIN
📖
47:17Reacquaint ourselves with the TILE_CHUNK_SAFE_MARGIN
📖
47:17Reacquaint ourselves with the TILE_CHUNK_SAFE_MARGIN
📖
49:25Remove TILES_PER_CHUNK and reposition TILE_CHUNK_SAFE_MARGIN
49:25Remove TILES_PER_CHUNK and reposition TILE_CHUNK_SAFE_MARGIN
49:25Remove TILES_PER_CHUNK and reposition TILE_CHUNK_SAFE_MARGIN
50:02pfizzyenator I believe it was arbitrary
🗪
50:02pfizzyenator I believe it was arbitrary
🗪
50:02pfizzyenator I believe it was arbitrary
🗪
50:38Consider the TILE_CHUNK_SAFE_MARGIN
📖
50:38Consider the TILE_CHUNK_SAFE_MARGIN
📖
50:38Consider the TILE_CHUNK_SAFE_MARGIN
📖
51:19Reduce TILE_CHUNK_SAFE_MARGIN from INT32_MAX / 64 to INT32_MAX - 1024
51:19Reduce TILE_CHUNK_SAFE_MARGIN from INT32_MAX / 64 to INT32_MAX - 1024
51:19Reduce TILE_CHUNK_SAFE_MARGIN from INT32_MAX / 64 to INT32_MAX - 1024
53:21Reacquaint ourselves with the bulk allocation of world chunks
53:21Reacquaint ourselves with the bulk allocation of world chunks
53:21Reacquaint ourselves with the bulk allocation of world chunks
56:04Enable GetWorldChunk() to allocate memory for the chunks, structuring the ChunkX and ChunkY as a Chunk in world_chunk
56:04Enable GetWorldChunk() to allocate memory for the chunks, structuring the ChunkX and ChunkY as a Chunk in world_chunk
56:04Enable GetWorldChunk() to allocate memory for the chunks, structuring the ChunkX and ChunkY as a Chunk in world_chunk
59:31Remove RemoveWorldChunk()
59:31Remove RemoveWorldChunk()
59:31Remove RemoveWorldChunk()
1:00:50Remove stale code from CreateWorld()
1:00:50Remove stale code from CreateWorld()
1:00:50Remove stale code from CreateWorld()
1:02:21Update accesses of the world_position Chunk in MapIntoChunkSpace()
1:02:21Update accesses of the world_position Chunk in MapIntoChunkSpace()
1:02:21Update accesses of the world_position Chunk in MapIntoChunkSpace()
1:02:35Change the world_position overload of Subtract() to operate in fixed-point
1:02:35Change the world_position overload of Subtract() to operate in fixed-point
1:02:35Change the world_position overload of Subtract() to operate in fixed-point
1:04:30Consider our world-level multithreading ticketing scheme
📖
1:04:30Consider our world-level multithreading ticketing scheme
📖
1:04:30Consider our world-level multithreading ticketing scheme
📖
1:06:36Remove the ticket_mutex from the world
📖
1:06:36Remove the ticket_mutex from the world
📖
1:06:36Remove the ticket_mutex from the world
📖
1:07:30Thoughts on humidifiers
🗩
1:07:30Thoughts on humidifiers
🗩
1:07:30Thoughts on humidifiers
🗩
1:08:29Note the existence of MoveEntityToNewPosition()
📖
1:08:29Note the existence of MoveEntityToNewPosition()
📖
1:08:29Note the existence of MoveEntityToNewPosition()
📖
1:09:03Consider the relative difficulty of determining which chunks to pack
📖
1:09:03Consider the relative difficulty of determining which chunks to pack
📖
1:09:03Consider the relative difficulty of determining which chunks to pack
📖
1:10:29Consider maintaining rectangles bounding all unpacked entities, resizing as we pack distant entities
📖
1:10:29Consider maintaining rectangles bounding all unpacked entities, resizing as we pack distant entities
📖
1:10:29Consider maintaining rectangles bounding all unpacked entities, resizing as we pack distant entities
📖
1:14:24Augment world with a rectangle2i UnpackedRegions array
1:14:24Augment world with a rectangle2i UnpackedRegions array
1:14:24Augment world with a rectangle2i UnpackedRegions array
1:16:05Mentally sketch out the least recently used chunk packing scheme
📖
1:16:05Mentally sketch out the least recently used chunk packing scheme
📖
1:16:05Mentally sketch out the least recently used chunk packing scheme
📖
1:17:45Reacquaint ourselves with UseChunkSpace()
📖
1:17:45Reacquaint ourselves with UseChunkSpace()
📖
1:17:45Reacquaint ourselves with UseChunkSpace()
📖
1:19:25Inline ClearWorldEntityBlock() in UseChunkSpace()
1:19:25Inline ClearWorldEntityBlock() in UseChunkSpace()
1:19:25Inline ClearWorldEntityBlock() in UseChunkSpace()
1:20:45Introduce EnsureFreeBlockExists() for UseChunkSpace() to call, renaming the latter to UsePackedSpace()
1:20:45Introduce EnsureFreeBlockExists() for UseChunkSpace() to call, renaming the latter to UsePackedSpace()
1:20:45Introduce EnsureFreeBlockExists() for UseChunkSpace() to call, renaming the latter to UsePackedSpace()
1:22:08Unify the sizes of packed_entity_block and unpacked_entity_block
1:22:08Unify the sizes of packed_entity_block and unpacked_entity_block
1:22:08Unify the sizes of packed_entity_block and unpacked_entity_block
1:25:57Yearn to programmatically size struct members
💢
1:25:57Yearn to programmatically size struct members
💢
1:25:57Yearn to programmatically size struct members
💢
1:26:43Update accesses via packed_entity_block_header, and make UsePackedSpace() use Chunk->FirstPacked
1:26:43Update accesses via packed_entity_block_header, and make UsePackedSpace() use Chunk->FirstPacked
1:26:43Update accesses via packed_entity_block_header, and make UsePackedSpace() use Chunk->FirstPacked
1:27:54Image Jai to support relative sizing of struct members
🗩
1:27:54Image Jai to support relative sizing of struct members
🗩
1:27:54Image Jai to support relative sizing of struct members
🗩
1:29:00infinite_entropy_ Isn't he shooting guns today?
🗪
1:29:00infinite_entropy_ Isn't he shooting guns today?
🗪
1:29:00infinite_entropy_ Isn't he shooting guns today?
🗪
1:29:19Update accesses via packed_entity_block_header
1:29:19Update accesses via packed_entity_block_header
1:29:19Update accesses via packed_entity_block_header
1:29:37Unify packed_entity_block and unpacked_entity_block as a generic entity_block, splitting HasRoomFor() out as HasRoomForPackedBytes() and HasRoomForUnpackedEntityCount()
1:29:37Unify packed_entity_block and unpacked_entity_block as a generic entity_block, splitting HasRoomFor() out as HasRoomForPackedBytes() and HasRoomForUnpackedEntityCount()
1:29:37Unify packed_entity_block and unpacked_entity_block as a generic entity_block, splitting HasRoomFor() out as HasRoomForPackedBytes() and HasRoomForUnpackedEntityCount()
1:32:50Update EnsureFreeBlockExists() and UsePackedSpace() to use our new entity_block
1:32:50Update EnsureFreeBlockExists() and UsePackedSpace() to use our new entity_block
1:32:50Update EnsureFreeBlockExists() and UsePackedSpace() to use our new entity_block
1:34:21Respecify UseChunkSpace() as a world_position overload of UsePackedSpace()
1:34:21Respecify UseChunkSpace() as a world_position overload of UsePackedSpace()
1:34:21Respecify UseChunkSpace() as a world_position overload of UsePackedSpace()
1:35:15Simplify world_chunk *Old out of AddToFreeList()
1:35:15Simplify world_chunk *Old out of AddToFreeList()
1:35:15Simplify world_chunk *Old out of AddToFreeList()
1:37:02Consider doing UsePackedSpace() inline in EnsureChunkIsPacked()
📖
1:37:02Consider doing UsePackedSpace() inline in EnsureChunkIsPacked()
📖
1:37:02Consider doing UsePackedSpace() inline in EnsureChunkIsPacked()
📖
1:40:18Remove both overloads of UsePackedSpace(), and inline the world_chunk one in EnsureChunkIsPacked()
1:40:18Remove both overloads of UsePackedSpace(), and inline the world_chunk one in EnsureChunkIsPacked()
1:40:18Remove both overloads of UsePackedSpace(), and inline the world_chunk one in EnsureChunkIsPacked()
1:41:28Determine to make EnsureChunkIsPacked() loop over each unpacked chunk
📖
1:41:28Determine to make EnsureChunkIsPacked() loop over each unpacked chunk
📖
1:41:28Determine to make EnsureChunkIsPacked() loop over each unpacked chunk
📖
1:42:59Make EnsureChunkIsPacked() loop over each unpacked chunk, packing the entities and discarding their blocks
1:42:59Make EnsureChunkIsPacked() loop over each unpacked chunk, packing the entities and discarding their blocks
1:42:59Make EnsureChunkIsPacked() loop over each unpacked chunk, packing the entities and discarding their blocks
1:46:18Implement EnsureChunkIsUnpacked() based on EnsureChunkIsPacked(), introducing ChunkIsValid()
1:46:18Implement EnsureChunkIsUnpacked() based on EnsureChunkIsPacked(), introducing ChunkIsValid()
1:46:18Implement EnsureChunkIsUnpacked() based on EnsureChunkIsPacked(), introducing ChunkIsValid()
1:51:48Consider distinguishing between the creation of an entity in an unpacked chunk, and in one in the process of being unpacked
📖
1:51:48Consider distinguishing between the creation of an entity in an unpacked chunk, and in one in the process of being unpacked
📖
1:51:48Consider distinguishing between the creation of an entity in an unpacked chunk, and in one in the process of being unpacked
📖
1:53:31staythirsty90 Hey, I'm thinking it through!
🗪
1:53:31staythirsty90 Hey, I'm thinking it through!
🗪
1:53:31staythirsty90 Hey, I'm thinking it through!
🗪
1:53:37Finish implementing EnsureChunkIsUnpacked()
1:53:37Finish implementing EnsureChunkIsUnpacked()
1:53:37Finish implementing EnsureChunkIsUnpacked()
1:55:10Introduce UseBlockSpace(), respecifying entity_block in terms of a UsedByteCount
1:55:10Introduce UseBlockSpace(), respecifying entity_block in terms of a UsedByteCount
1:55:10Introduce UseBlockSpace(), respecifying entity_block in terms of a UsedByteCount
2:02:51Simplify EnsureChunkIsPacked() to use UseBlockSpace()
2:02:51Simplify EnsureChunkIsPacked() to use UseBlockSpace()
2:02:51Simplify EnsureChunkIsPacked() to use UseBlockSpace()
2:04:23Update CreateEntity() to use GetWorldChunk(), EnsureChunkIsUnpacked() and UseBlockSpace()
2:04:23Update CreateEntity() to use GetWorldChunk(), EnsureChunkIsUnpacked() and UseBlockSpace()
2:04:23Update CreateEntity() to use GetWorldChunk(), EnsureChunkIsUnpacked() and UseBlockSpace()
2:06:44Glimpse into the future working on entity iteration
🗩
2:06:44Glimpse into the future working on entity iteration
🗩
2:06:44Glimpse into the future working on entity iteration
🗩
2:07:04Reorganise CreateEntity() above the entity iteration code
2:07:04Reorganise CreateEntity() above the entity iteration code
2:07:04Reorganise CreateEntity() above the entity iteration code
2:07:36Call it there with thoughts on deleting and tightening code, and a plug of Molly Rocket's 25% Off Everything sale1
🗩
2:07:36Call it there with thoughts on deleting and tightening code, and a plug of Molly Rocket's 25% Off Everything sale1
🗩
2:07:36Call it there with thoughts on deleting and tightening code, and a plug of Molly Rocket's 25% Off Everything sale1
🗩