#bevy #gamedev #tilemap

bevy_fast_tilemap

A GPU accelerated simple tilemap for bevy

8 releases (4 breaking)

0.5.1 Aug 11, 2023
0.5.0 Jul 18, 2023
0.4.2 May 30, 2023
0.3.0 May 3, 2023
0.1.0 Apr 19, 2023

#219 in Game dev

Download history 37/week @ 2023-05-31 11/week @ 2023-06-07 7/week @ 2023-06-14 12/week @ 2023-06-21 2/week @ 2023-06-28 9/week @ 2023-07-05 23/week @ 2023-07-12 15/week @ 2023-07-19 8/week @ 2023-07-26 3/week @ 2023-08-02 53/week @ 2023-08-09 33/week @ 2023-08-16 28/week @ 2023-08-23 18/week @ 2023-08-30 25/week @ 2023-09-06 14/week @ 2023-09-13

85 downloads per month
Used in bevy_sparse_tilemap

MIT/Apache

1MB
928 lines

Fast Tilemap for Bevy

Crates.io docs

Lightning fast tilemaps for bevy.

Features

  • Very high rendering performance (hundreds of fps, largely independent of map size)
  • Tilemaps can be very large or have many "layers"
  • Rectangular and isometric (axonometric) tile maps.
  • Tiles can overlap either by "dominance" rule or by perspective
  • Optional custom mesh for which the map serves as a texture

Screenshots

iso_perspective custom_mesh

Checkout screenshots/ for more.

How it works

The whole map is rendered as a single quad and a custom shader cares for rendering the correct tiles at the correct position.

Thus each map works with two textures: One with integer data type, constructed and maintained internally for storing for each tile position which tile index should be displayed there. And the other being a tile atlas that contains all the tiles. This one should be provided by you (see assets/ for atlas examples).

As of this writing, this should be (much) faster than most other bevy tilemap implementations out there.

Limitations

  • Only tested on Windows, no WASM support
  • No direct animation support, but you can easily update the tilemap in regular intervals to achieve the same (see Animation Example)

If you dont require all of bevy_fast_tilemaps performance and are looking for an approach that supports some more tile shapes and allows to treat each tile as a separate entity, take a look at bevy_ecs_tilemap which (among others) inspired this work.

Examples

Check out the examples/ folder to get an overview. You can run the examples like this:

cargo run --example updates
cargo run --example layers
cargo run --example iso
cargo run --example iso2
cargo run --example bench
...

Bevy Compatibility

bevy bevy_fast_tilemap
0.10.1 0.1.0
0.10.1 0.2.0
0.10.1 0.3.0
0.10.1 0.4.0
0.11.0 0.5.0

Dependencies

~27–69MB
~1M SLoC