Releases: joshuajbouw/bevy_tilemap
Bevy Tilemap 0.4.0
It is finally out! bevy_tilemap 0.4 with bevy 0.5 support.
This took a bit of work to get this done, plus had gotten quite busy during the first quarter of this year. Now back on a sane schedule!
Whats new?
- Major overhaul of the backend
- Support for 3D tilemaps with layer offsets
- A few community requested methods and features
- There are bits and pieces of the physics engine but it is not yet quite fully re-implemented yet.
- 300% FPS gains
[0.4.0] - 2021-04-08
Fixed
- Respawn panic and collision tile offsets.
- Deprecated
ncollide
replaced withncollide2
(technically this work was
postponed but worth mentioning). - Fix deprecated uses of
add_layer_with_kind
. - Fixed missing
texture_dimensions
inphysics_dungeon
.
Added
- Added 3D capabilities to the tilemap. No more being locked to a 2nd dimension!
- Added
TilemapBundle
visibility,Visible
, support which allows the
visibility to be added to the tilemap and changed for all chunks if needed. - Added
z_order
andsprite_order
fields toTile
. - Added
MissingTextureDimensions
error toTilemapError
. - Added
event
module which allows use of theTilemapChunkEvent
. - Added
auto_spawn
to theTilemap
. - Added
clear_layer
to theTilemap
which enables clearing of whole layers.
Changed
- Updated to Bevy 0.5
- Renamed
Tilemap2DPlugin
toTilemapPlugin
as now the tilemap supports both
2D and 3D. Lets not get carried away here and go beyond the 3rd dimension! Chunk
was made private as it never was meant to be public. Oops.- Changed
RawTile
to be public. Now you can see raw details of the tiles. - Made the
TilemapError
inner public. TilemapBuilder::chunk_dimensions
now requires an extra argumentdepth
. You
probably do not want to set this to 0.Tilemapbuilder::tile_dimensions
was renamed to
TilemapBuilder::texture_dimensions
. Makes it more exact, especially since
tile dimensions are coming in the next update which are totally different
(sorry, not sorry. It was you that decided to use an experimental game engine
with an experimental plugin :D.)TilemapBuilder::add_layer
now takes in the newTilemapLayer
. It does only
have 1 field right now but this is expected to change at some point. Yay being
... prepared?- As with the above,
Tilemap::add_layer
also takes in the newTilemapLayer
. Tilemap::new
now requires a width and height of the texture.- Anywhere that was required to take in a
Point2
for a tile is now aPoint3
and while this technically is breaking, this shouldn't affect the API.
Removed
Tile::new
, all fields were made public instead. That goes with all the many
terribly thought out constructor patterns that should've never existed.- Removed
render
module from public API. TilemapBuilder::auto_configure
was purged. It no longer is needed.- all deprecated methods slated to be removed this release
Thanks!
Thank you all to the contributors to this release:
@arbrog
@BrettWitty
@darthdeus
@digital7-code
@Imakoala
@themilkybit
Timothée Le Berre
@jamadazi
@joshuajbouw
Bevy Tilemap 0.3.1
Bevy Tilemap 0.3.0
This release came a little later than anticipated due to a busy holiday season. I didn't expect Bevy to release on Christmas Eve but that is ok. This is a pretty big release that was supposed to have more features included however, ran out of time. Those will come in a future version though. Sorry for those that were waiting for auto-tile.
[0.3.0] - 2021-01-11
Added
- Auto configuration of optimal chunk sizes to texture size as well as checks
to ensure that the tiles are divisible into each other had been added. This can
be enabled in theTilemapBuilder
withauto_configure
. - Auto chunk which will create new chunks automatically if you push a tile into
it. This can be enabled in theTilemapBuilder
withauto_chunk
- Optional dimension 2D and 3D API.
TilemapDefaultPlugins
was added.point
anddimension
modules were moved tobevy_tilemap_types
crate but
still accessible as normal and optional.- Example
stress_dwarves
has been added to benchmark and stress test. - Various hex orientations were added (thanks @jamadazi!).
- A hex example
random_world
was added to showcase one of the hex
orientations. Tilemap::get_tile
method was added to get a reference to a tile.Tilemap::get_tile_mut
method was added to get a mutable reference to a tile.
This should make it easier to do animations.Tilemap::tile_to_chunk_point
method is nowpoint_to_chunk_point
.tile:RawTile
is now public API but not included in the prelude as it is not
meant to be constructed.- Examples for all tile orientations.
- Library is able to work with WASM.
- Default plugin for Tilemap was introduced.
Changed
- The whole project was mostly refactored.
ChunkTilesPlugin
is nowTilemap2DPlugin
.TilemapBuilder::build()
is nowTilemapBuilder::finish()
to be consistent.- Point module was now made optional.
- Changed the
random_dungeon
example to be more like an actual implementation. Tile
had all generics removed from it.Tilemap::new_chunk
is nowTilemap::insert_chunk
to reflect the storage
internally.- It is now required to specify if chunks are to be auto created in the
TilemapBuilder
withauto_chunk
method. Tilemap::remove_tile
was renamed toclear_tile
. This makes more sense as
it may be deleted if it is a sparse tile, else it is simply cleared if it is
dense.Tilemap::contains_chunk
method was added to check if the tilemap contains a
chunk or not already.TilemapComponents
renamed toTilemapBundle
to stay inline with Bevy API.ChunkComponents
renamed toChunkBundle
to stay inline with Bevy API.- All examples were updated for latest bevy.
Removed
Point2
andPoint3
deprecations were removed.
Known Bugs
- Examples moved to its own library temporarily. This is a Bevy 0.4 issue where
you can not placebevy
into the dev-dependencies of the Cargo.toml. - Hex Y-axis is not perfectly centred.
Thanks
Thanks to the following wonderful contributors for their work on this release (in no particular order).
- @AdamWhitehurst
- @alec-deason
- @jamadazi
- @ryanleecode
- @joshuajbouw
Bevy Tilemap 0.2.2
Added
Tilemap::clear_tile
was added to easily clear a single tile.Tilemap::clear_tiles
likewise will clear an array of tiles.Point2
now implementsFrom<&Point2>
.Point3
now implementsFrom<&Point3>
.tilemap::Tilemap::set_tiles
now implements
IntoIterator<Item = ((i32, i32, i32), Tile)>
which had broken the previous
compatibility.tile::Tile
had thenon_exhaustive
derive added it now that the fields are
all public.tile::Tile
added methodswith_tint
andwith_tint_and_z_order
.chunk_update_system
was added internally to manage chunks and to get them to
update if needed.
Changed
random_dungeon
example was updated to be interactive.Tilemap::set_tiles
was changed to take in aIntoIterator<Item = Tile<P, C>
,
whereC
isInto<Color>
and P isInto<Point2>
, from
IntoIterator<Item = (i32, i32, i32), Tile>
.tile::Tile
was changed to includez_order
,sprite_index
, andpoint
.
Fieldcolor
is nowtint
. All fields were made public.tile::Tile
methodsdefault
,new
updated.ChunkDimensions
was made private, it should never of been exposed but I also
very much doubt anyone would have used it.map_system
was made private, it should never of been exposed.add_tile
was renamed toinsert_tile
.add_tiles
was renamed toinsert_tiles
.clear_tile
was renamed toremove_tile
.clear_tiles
was renamed toremove_tiles
.
Before
let z_order = 0;
let point = (1, 1, z_order)
let tile = Tile::new(0);
let tiles = vec![(point, tile)];
// defined elsewhere
tilemap.set_tiles(tiles).unwrap();
After
let point = (1, 1);
let z_order = 0;
let tiles = vec![Tile::new(point, z_order)];
// defined elsewhere
tilemap.set_tiles(tiles).unwrap();
Tilemap::set_tile
was changed to take inTile<P, C>
, whereP
is
Into<Point2>
andC
isInto<Color>
. This replaces the previous argument
P
andT
whereT
wasInto<Tile>
.
Before
let point = (9, 3, 0);
let sprite_index = 3;
let tile = Tile::new(sprite_index);
// defined elsewhere
tilemap.set(point, tile).unwrap();
After
let point = (9, 3);
let sprite_index = 3;
let tile = Tile::new(point, sprite_index);
tilemap.set_tile(tile).unwrap();
Removed
tile::Tiles
was removed as it is no longer needed as all data as been set
intoTile
to make everything easier.tile::Tiles
was removed fromprelude
.tile::Tile
methodsindex
andcolor
were removed as the fields are now
public.tile::Tile
all<Into<Tile>>
implements were removed.
Upgrade notes
This was a good release to really start using the project with something. Adding it to my own game as well as building the interactive example really was eye opening on what I needed and what was missing. This is getting really close! Unfortunately, going to have to give up on setting deprecations until there is an actual stable release when all major milestones are completed and many examples are created to handle most use-cases.
Key points
- Random Dungeon was updated to be interactive.
add_
for tiles was renamed toinsert_
to be more exact. As well asremove_
instead ofclear
.- A system was added to handle chunks and update them when appropriate.
Bevy Tilemap 0.2.1
Added
- Minimum supported rust version (MSRV) were noted to be 1.43.0 in documents.
Fixes
- Coordinates were fixed so that 0,0 is now by default the center of the area,
not the bottom left per chunk. - Coordinates outside of a single chunk were fixed so that they do not cause a
panic. - Missing doc links were fixed.
Changed
Tilemap::set_tiles
now implementsIntoIterator<Item = ((i32, i32, i32), Tile)>
which had broken the previous compatibility.
Before
let mut tiles = Tiles::default();
for y in 0..31 {
for x in 0..31 {
tiles.insert((x, y, 0), 0.into());
}
}
// Constructed Tilemap
tilemap.set_tiles(&mut tiles);
After
let mut tiles = Tiles::default();
for y in 0..31 {
for x in 0..31 {
tiles.insert((x, y, 0), 0.into());
}
}
// Constructed tilemap
tilemap.set_tiles(tiles);
Removed
Point2
implAsRef<(i32, i32)>
andAsMut<(i32, i32)>
as it is not
possible to deprecate it.
Deprecated
Point2
methods.x()
and.y()
were deprecated to be inline with glam
crate.Point3
methods.x()
,.x()
, and.z()
were deprecated to be inline with
glam crate.
Upgrade notes
Unfortunately some fairly big issues were released as more examples were being
made. These were fairly critical as they absolutely hindered the goals of the
library. These have now since been fixed. Thanks to all that pointed out the
issues.
Bevy Tilemap 0.2.0
Added
ChunkDimensions
component to help the renderer know the dimensions of a
chunk.Layer
trait was added internally to implement the same methods on layers.DenseLayer
andSparseLayer
structs were added internally to provide
different methods of storing tiles.LayerKind
enum was added to help specify what kind of layer needs to be
created.LayerKindInner
enum was added internally to help wrapDenseLayer
and
SparseLayer
.Chunk
struct was added internally to store its location and sprite layers.ChunkComponents
entity was added internally to help spawn chunks.TilemapComponents
entity was added to help spawn tilemaps.prelude
module was added versioned.ChunkMesh
was added to add meshes to rendered layers.point
module was added publicly withPoint2
andPoint3
structs which
help with various operations to do with coordinates. They are not required to
be used at all.- Render pipelines were added with GLSL shader files.
Tile
struct was added publicly which stores the index value of a texture
in a texture atlas.Tiles
a type forHashmap<(i32, i32, i32), Tile>
was added publicly. Helps
to set tiles in bulk.TilePoints
was added privately which is similar toTiles
but stores the
newPoint3
s instead.dense_tiles_to_attributes
andsparse_tiles_to_attributes
were added to
help turn layers into attributes for the renderer.Tilemap
was added with a variety of new public API to help construct new
tilemaps.TilemapBuilder
factory was added to help construct newTilemap
s.- Chunks with odd dimensions can now be spawned. (Thanks @blamelessgames!)
Changed
- Updated
random_dungeon
example to use latest features. - Changed
serde
to be and optional feature. - Changed
Dimension2
andDimension3
into a struct and changed them
extensively. They were also made into private API. - Changed
map_system
had been updated to accommodate for the newTilemap
.
Broken API
Chunk
trait was made into a struct and vastly changed as well as made
internal.WorldChunk
struct was removed entirely.WorldMap
struct was removed entirely.Tile
trait was removed and replaced with aTile
struct.coord
module was removed entirely.dimension
module was made internal.Dimension2
andDimension3
traits were made into structs and made internal.ChunkTilesPlugin
had all the generic traits removed, replaced with structs.
This makes it easier for people to use the library and encourages others to
help contribute instead of keeping all the sweet updates to themselves. In the
future, generic traits will likely be brought back.DimesionError
andDimensionResult
were made private.MapError
was renamed toTilemapError
and made private.MapResult
was renamed toTilemapResult
and made private.MapEvent
was renamed toTilemapEvent
and made private.
Upgrade Notes
The breakpocalypse is here... But with good reasons why!
This was the actual update that made tilemap into mostly what was intended to be
on release however, due to the clear early need a naive version was pushed for
v0.1.0. Before, everything was rendered from textures that were made by the CPU
for use with the GPU. Through proper research, help from the Bevy community, and
education on GLSL shaders, shaders were created to offload all the work onto the
GPU.
The huge downside though is that pretty much 98% of the API had been broken
entirely. So, extra time and effort was put in this time to ensure that the API
will be stable from now on and going forward. Proper deprecation warnings and
everything will be done from here on.
It was really considered to bring back all the API but, that would have been
too much work from here and onwards. Plus, it was warned that the API will be
broken between v0.1 and v0.2.
Key points
- No more CPU work, all on the GPU with GLSL shaders.
- Huge breaking API changes everywhere, oh my! (I warned it would happen :)...)
- All traits removed, replaced with structs for early day simplicity.
- Dense and sparse layers were added to cut down on data use and increase
performance where necessary.
Thanks
Thank you so much @alec-deason, @alexschrod and @superdump for all your feedback, suggestions
and help understanding everything needed for this release.
Bevy Tilemap 0.2.0 pre-release 1
v0.2.0-pre.1 0.1.1 -> 0.2.0-pre.1
Bevy Tilemap 0.1.1
[0.1.1] - 2020-11-04
Notes
This is mostly just a document fix minor patch with nothing else too substantial. It would have been avoided if it could have been but alas, crates does not allow you to republish the same version.
Fixes
Bevy Tilemap 0.1.0
Notes
- Rebranded from
bevy_chunk_tiles
tobevy_tilemap
. TileSetter
had apush_stack
method added to it which allows for a whole
Vec<Tile>
. This is then rendered from index 0. For example, if you want to
render a character sprite with a tile background you would push the tile in
first then add in the character after. It is recommended to track if the floor
tile in that previous example had something on top of it before or not to cut
down on pushing the floor tile twice, which is wasteful.
Added
Fixes
Bevy Chunk Tiles 0.1.0 pre-release 2
v0.1.0-pre.2 .add_default_plugins to .add_plugins Bevy api update