jackdelahunt/Eiram

A deep dive into chunking

Closed this issue · 0 comments

Chunks are the method used by a world generator to divide maps into manageable pieces. Many games do this but they all take their own approach to it based on their use case.

Minecraft

The Minecraft wiki goes into depth on how the game handles chunks. Most of the details may not be needed as they can be specific to Minecraft but there are a few things to take away from it.

The wiki links to the spawn chunks page, these are the chunks that are loaded at the begining of the game when the player joins. Having some mechanism to load chunks without the need of a player can be useful and this is where tickets come in.

The wiki describes multiple types of tickets but the main ones that interest me are the start ticket and the player ticket. These are used to tell a chunk what it needs to do and for how long. This can be something useful to look into.

Eiram

Chunking will be quite important in Eiram. My idea for chunking will be as follow, using a single world object it will generate chunk objects based on the players position. This maybe changed to include the ticket system that the Minercaft wiki explained if the functionality is needed.

The work will not generate a unity gameObject per chunk as this can slow generation down and a tilemap attached to the world can act as the tile palette.