Skip to content

Chunk Manager #5

@alexanderfast

Description

@alexanderfast

There is a maximum size for a TileMap (depending on MeshMode, max texture size for SingleQuad and max vertex count if QuadGrid). To get around this limitation a ChunkManager class should be added.

It's main responsibility is to automatically and under-the-hood split up the TileMap into several chunks, thus circumventing the above limitations.

It should support three ChunkModes which will most likely be three implementations/classes. Those are (names obviously subject to change):

Single Chunk

For use when the above limitations doesn't become a problem, easier to understand and work with for newcomers experimenting with the code.

Fixed Size

For use when the above limitations do become a problem and the TileMap needs to be split. The number and size of chunks are known upfront making it somewhat easy to work with.

Flexible Grid

For use when the TileMap becomes so large that it's impossible to keep it all instantiated at once. There needs be methods of loading and unloading chunks. This also supports the use-case of "infinite worlds". Like MineCraft, the first time a chunk is visited it's generated, when the player walks away it's unloaded, when the player returns it's reloaded (not re-generated).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions