Crates.io | bevy_sparse_tilemap |
lib.rs | bevy_sparse_tilemap |
version | 0.2.5 |
source | src |
created_at | 2023-08-12 05:21:39.144191 |
updated_at | 2024-07-08 21:57:30.643435 |
description | A Tilemap crate for the Bevy game engine with a focus on large map sizes and ECS sparse maps |
homepage | https://github.com/NoahShomette/bevy_sparse_tilemap |
repository | https://github.com/NoahShomette/bevy_sparse_tilemap |
max_upload_size | |
id | 942574 |
size | 247,021 |
bevy_sparse_tilemap
A Tilemap crate for the Bevy game engine with a focus on large map sizes and ECS sparse maps
ECS Sparse Tilemaps
bevy_sparse_tilemap
only spawns the minimum amount of entities neccesary and doesn't one-to-one map tiles to entities. This allows it to dodge current Bevy performance issues related to rendering and unlocks a substantially higher baseline performance for extra large maps.Tiles in
bevy_sparse_tilemap
are stored on each chunk using custom storage.bevy_sparse_tilemap
does support spawning entities mapped to specific tiles at will for when you really need to save extra information or to gain access to the ECS when needed for specific tile types.
bevy_sparse_tilemap
has a built in API to handle spawning, despawning, and accessing tiles optional entities as well as tile data.Internally this crate supports both Sparse and Dense internal storage. Both are still ECS sparse (minimal amount of entities spawned) but sparse maps don't require the user to supply data for every tile.
Multiple Map Types
bevy_sparse_tilemap
supports different map types using a generics trait based system that provides great flexibility to support many different map types.Currently supported:
- Hexagon
- Square
Massive Map Sizes
Because of the ECS Sparse nature of the crate,
bevy_sparse_tilemap
dodges current limitations in Bevy related to rendering performance issues. These limitations are what other tilemap crates run into and inhibits their performance. This allowsbevy_sparse_tilemap
to have exceptional performance as a baseline, allowing maps as large as 15k x 15k easily with smart rendering using something like bevy_fast_tilemap.
Tilemap Logic Only
This crate focuses purely on the tilemap logic and leaves the rendering to the user.
See Docs.rs for documentation on how to use bevy_sparse_tilemap
as well as brief examples.
See Github Examples for longer examples of each feature of the crate.
bevy_ecs_tilemap
?bevy_ecs_tilemap
is a fabulous crate that will probably cover most of your needs in an easier to use plugin and you
should reach for that first in most situations.
You should use bevy_ecs_tilemap
if:
bevy_ecs_tilemap
runs into performance issues around 200x200 in my testing)You should use bevy_sparse_tilemap
if:
bevy_sparse_tilemap
can reach substantially larger map sizes compared to bevy_ecs_tilemap
. (The bevy_fast_tilemap_example currently spawns a 15000x15000 tile map and runs at around 900 fps)bevy_fast_tilemap
however that is not currently a feature that is natively supported by this crate)BST Version | Bevy Version |
---|---|
0.3 | 0.14 |
0.2 | 0.13 |
0.1 | 0.13 |