A tilemap rendering crate for bevy which is more ECS friendly.

Overview

bevy_ecs_tilemap

A tilemap rendering plugin for bevy which is more ECS friendly by having an entity per tile.

Features

  • A tile per entity
  • Fast rendering using a chunked approach.
  • Layers and sparse tile maps.
  • GPU powered animations
  • Isometric and Hexagonal tile maps

Upcoming Features

  • Support for isometric and hexagon rendering done
  • Built in animation support. done see animation example
  • Texture array support
  • Layers and add/remove tiles. (High Priority) done

Screenshots

iso hex

How this works?

Quite simple there is a tile per entity. Behind the scenes the tiles are split into chunks that each have their own mesh which is sent to the GPU in an optimal way.

Why use this over another bevy tile map plugin?

Because each tile is an entity of its own editing tiles is super easy, and convenient. This allows you tag entities for updating and makes stuff like animation easier. Want to have a mining simulation where damage is applied to tiles? That's easy with this plugin:

struct Damage {
    amount: u32,
}

fn update_damage(
    mut query: Query<(&mut Tile, &Damage), Changed<Damage>>,
) {
    for (mut tile, damage) in query.iter_mut() {
        tile.texture_index = TILE_DAMAGE_OFFSET + damage.amount;
    }
}

Examples

  • accessing_tiles - An example showing how one can access tiles from the map object by using tile map coordinates.
  • animation - Basic cpu animation example.
  • bench - A stress test of the map rendering system. Takes a while to load.
  • dynamic_map - A random map that is only partial filled with tiles that changes every so often.
  • game_of_life - A game of life simulator.
  • hex_column - A map that is meshed using "pointy" hexagons.
  • hex_row - A map that is meshed using flat hexagons.
  • iso - An isometric meshed map.
  • layers - An example of how you can use multiple map entities/components for "layers".
  • map - The simplest example of how to create a tile map.
  • random_map - A bench of editing all of the tiles every 100 ms.
  • remove_tiles - An example showing how you can remove tiles by using map.remove_tile or by applying the RemoveTile tag component.
  • sparse_tiles - An example showing how to generate a map where not all of the tiles exist for a given square in the tile map.
  • visibility - An example showcasing visibility of tiles and chunks.

Running examples

cargo run --release --example map

Known Issues

  • Currently if you despawn a ton of tiles during startup chunks might not update correctly. Seems to be an ordering issue with the systems.

Asset credits

Comments
  • A Rewrite

    A Rewrite

    Hello author here!

    I wrote an article about the state of tilemaps in bevy. Mostly around my experience with creating bevy_ecs_tilemap and its pitfalls. You can find it here: https://startoaster.netlify.app/blog/tilemaps/

    My main takeaway is that bevy_ecs_tilemap needs a re-write in order to facilitate a better API design. Feel free to leave any questions you have here!

    Be on the lookout for a branch called rewrite. I'll comment here as well when I push it up. This branch will track the changes I make and will be a from the ground up re-write of the entire library. Feature wise I'll be focusing on the basics and moving on to add more features as I go.

    What does this mean for the code base currently? I will no longer be accepting any PR's that add new features. This is to reduce the amount of work I'll end up needing to do during this re-write period. I will still accept bug fixes.

    If you would like to see any new features, or suggest changes to the new API design, feel free to leave them here!

    Thanks!

    enhancement help wanted code quality usability 
    opened by StarArawn 22
  • Possible rendering bug?

    Possible rendering bug?

    Hi,

    I just updated to 0.5.0 and made the necessary changes to migrate, primarily adjusting to the layer_id no longer being public and adding the texture filter helper system set_texture_filters_to_nearest to get things working again. While it is rendering the tilemap again, I have weird behaviour where some tiles seem to disappear when I translate the camera, previously everything rendered perfectly. I thought it might be related to the chunk size, but I've tried various things to no avail.

    Here is a video example of what I'm seeing, the line shouldn't suddenly appear. Any ideas?

    https://user-images.githubusercontent.com/301084/150021113-5149d6b5-1ef9-480f-a0e8-a90558fc9122.mp4

    bug 
    opened by sizeak 22
  • Hot reloading tilesets

    Hot reloading tilesets

    Using bevy_ecs_tilemap 0.5

    I seem to remember when working with bevy_ecs_tilemap pre-0.5, updating a tileset asset with asset_server.watch_for_changes() on would automatically update the rendered tilemaps in game. This doesn't seem to be working anymore. Might be on my end? Also I might be misremembering. I imagine the chunking and custom rendering stuff going on could complicate hot reloading.

    bug 
    opened by Trouv 17
  • Feature: Isometric Staggered

    Feature: Isometric Staggered

    It would be really useful to be able to select Isometric Staggered or Isometric Diamond (like the current iso example) when creating a map.

    For reference: Isometric tilemap types

    enhancement 
    opened by martinmolin 12
  • Memory Leak + Reduced Framerate in 0.7

    Memory Leak + Reduced Framerate in 0.7

    This issue appears to be related to the Tilemap plugin, but I did upgrade to bevy 0.8 and this plugin simultaneously, and it's somewhat unclear where this issue might exist.

    The code in question uses a G keypress to toggle a "debug grid" tilemap entity over the world tile map.

    #[derive(Component)]
    pub struct DebugLayer;
    
    const DEBUG_LAYER: f32 = 2.0f32;
    
    /// Handle world actions on keypress. 
    pub fn on_keypress(
        mut commands: Commands,
        mut world_debug: ResMut<WorldDebugOptions>,
        game_assets: Res<GameAssets>,
        map_config: Res<MapConfig>,
        keyboard: Res<Input<KeyCode>>,
        map_query: Query<Entity, With<DebugLayer>>)
    {
        if keyboard.just_released(KeyCode::G) {
            if world_debug.debug_grid {
                if let Ok(entity) = map_query.get_single() {
                    world_debug.debug_grid = false;
                    commands.entity(entity).despawn_recursive();
                }
            } else {
                world_debug.debug_grid = true;
                display_debug_grid(&mut commands, &game_assets, &map_config);
            }
        }
    }
    
    /// Adds the display of the debug grid, tagging with the `DebugGrid` component.
    fn display_debug_grid(
        mut commands: &mut Commands,
        game_assets: &Res<GameAssets>,
        map_config: &Res<MapConfig>)
    {
        // Grid Size is the pixel dimensions for each tile
        let tile_dimensions = map_config.tile_dimensions;
        let grid_size = TilemapGridSize{ x: tile_dimensions.x, y: tile_dimensions.y };
        let tile_size = TilemapTileSize{ x: tile_dimensions.x, y: tile_dimensions.y };
    
        // derive world map size in tiles
        let map_dims = map_config.world_dimensions * map_config.chunk_dimensions;
        let map_size = TilemapSize{ x: map_dims.x, y: map_dims.y };
    
        // debug grid tile storage
        let debug_texture = game_assets.tiles_for(TileSetType::MainWorld);
        let mut debug_tile_storage = TileStorage::empty(map_size);
        let debug_layer_entity = commands.spawn().id();
    
        fill_tilemap(
            TileTexture(0),
            map_size,
            TilemapId(debug_layer_entity),
            &mut commands,
            &mut debug_tile_storage);
    
        // Add Debug Layer
        commands
            .entity(debug_layer_entity)
            .insert_bundle(TilemapBundle {
                grid_size,
                size: map_size,
                storage: debug_tile_storage,
                texture: TilemapTexture(debug_texture),
                tile_size,
                transform: get_centered_transform_2d(
                    &map_size,
                    &tile_size,
                    DEBUG_LAYER,
                ),
                ..Default::default()
            })
            .insert(DebugLayer);
    }
    

    The map_size in this case is: 160x160 with a tile_size of 50x50. The tile images are under a non-sharable license, but I can crop the debug tiles if necessary (just let me know).

    Here's a video from one of my streams where I can demonstrate the problem occurring. I originally noticed the framerate dropping significantly when constantly toggling, and then discovered that memory tends to increase each time the grid is toggled as well.

    https://user-images.githubusercontent.com/334480/184055257-6dfc9517-e498-47fe-8c66-bbfdae9dc7e2.mp4

    I also generated a Tracy profile, which just shows that everything in bevy tends to slow down each time the grid is toggled. Here are the trace times towards the end of my test (the last 10s): image

    Here are the frame times associated with the full run: image

    I hosted the tracy-profile on google drive (it's 114mb) if you're interested: https://drive.google.com/file/d/1uHzEi_eZWyEYL-GNaQ415cLHIdX58iZM/view?usp=sharing

    Thanks again for a wonderful project. I've had an awesome experienced building my game using this plugin. The new API is highly intuitive, loving it so far.

    bug usability 
    opened by mbolt35 11
  • Reworking `TilemapMeshType`, fixing iso staggered rendering, and adding helper functions to return neighboring directions of a tile.

    Reworking `TilemapMeshType`, fixing iso staggered rendering, and adding helper functions to return neighboring directions of a tile.

    TilemapMeshType has been reworked to TilemapType.

    Helper functions have been added/updated to return neighbors, and to get the position of a tile in world space.

    Bugs in rendering of staggered iso have been fixed.

    In the process of fixing the staggered iso bugs, I have also "standardized" how iso diamond works. Maybe this is a change that is not wanted, in which case I can revert it.

    opened by bzm3r 10
  • Tile entities are leaked upon recursively despawning the Map entity

    Tile entities are leaked upon recursively despawning the Map entity

    When the Map entity is despawned with .despawn_recursive(), all tile entities belonging to that tilemap continue to exist even though they are no longer visible. As far as I can tell, this is due to the tile entities not being marked as children of the Map entity.

    bug 
    opened by forbjok 10
  • Feature request: mouse-to-tile events

    Feature request: mouse-to-tile events

    It would be nice to have mouse events translated to tiles. At the minimum, a helper function which takes mouse coordinates and returns a tile. However, even better, a system which:

    • Generates custom events for:
      • a tile was clicked (left/right/middle/other, optionally subposition)
      • hover-in
      • hover-out
      • maybe a mouse-drag event which gives a list of tiles from first (tile where the button was pressed down) + all the others passed over in order + last (tile where button was released)
      • maybe also mouse-down / mouse-up on a tile (not sure how useful that really is vs "click" outside of the drag case)
    • Provides a way to query:
      • last-clicked tile (or, list of tiles clicked since last query?)
      • currently-hovered tile
      • subposition within tile of last click (scaled to tile size in view)
      • subposition within tile of hover
      • maybe the latest mouse-drag list?

    I'm not sure how -- or if at all -- this should interact with non-tile sprites or other UI elements. I can image cases where it'd be nice to at least know that a click is "obstructed" by an object which is above the map.

    enhancement 
    opened by mattdm 9
  • Chunk (layer) visibility issue on zooming

    Chunk (layer) visibility issue on zooming

    Hello!

    I am experiencing a problem similar to that in #124. As you can see only layer 1 is experiencing this problem, not the fully filled layer 0.

    https://user-images.githubusercontent.com/97800396/155609269-931fc7ba-c9be-4a77-ac0c-8e09643e9b8c.mp4

    edit, I am very sorry, I compressed the mp4 with ffmpeg because it had over 10mb and somehow it doesn't display in firefox or chromium for me. Then I did it with an online tool, same thing. I can't play it in the browser. It works locally though, also if I download it. I know it's much to ask to download a random file from the internet.

    To explain the issue in words.

    When spawning an OrthographicBundle and having the Scale on 0.25 like so:

        let mut cam_bundle = OrthographicCameraBundle::new_2d();
        cam_bundle.orthographic_projection.scale = 0.25;
        commands.spawn_bundle(cam_bundle).insert(MainCamera);
    

    and having a system like this to change the zoom level:

    pub fn zoom_camera(
        mut query: Query<(&mut OrthographicProjection, &mut Camera), With<MainCamera>>,
        keyboard_input: Res<Input<KeyCode>>,
        mut ev_scroll: EventReader<MouseWheel>,
    ) {
        // TODO clean this up, no need to duplicate code
        if keyboard_input.pressed(KeyCode::LControl) {
            if keyboard_input.just_pressed(KeyCode::Key0) {
                for (mut project, mut camera) in query.iter_mut() {
                    project.scale = 1.0;
                    camera.projection_matrix = project.get_projection_matrix();
                    camera.depth_calculation = project.depth_calculation();
                }
            } else {
                let delta_zoom: f32 = ev_scroll.iter().map(|e| e.y).sum();
                if delta_zoom != 0.0 {
                    for (mut project, mut camera) in query.iter_mut() {
                        project.scale -= delta_zoom * 0.1;
                        project.scale = project.scale.clamp(0.25, 2.0);
    
                        camera.projection_matrix = project.get_projection_matrix();
                        camera.depth_calculation = project.depth_calculation();
                    }
                }
            }
        }
    }
    

    and a map like this:

    
    
    pub const TILE_SIZE: f32 = 16.0;
    
    pub fn build_tile_world(
        mut commands: Commands,
        asset_server: Res<AssetServer>,
        mut map_query: MapQuery,
    ) {
        let texture_handle = asset_server.load("images/tiles.png");
        // Create map entity and component:
        let map_entity = commands.spawn().id();
        let mut map = Map::new(0u16, map_entity);
        let map_settings = LayerSettings::new(
                MapSize(32, 32),
                ChunkSize(32, 32),
                TileSize(TILE_SIZE, TILE_SIZE),
                TextureSize(64.0, 64.0),
            );
    
        // Creates a new layer builder with a layer entity.
        let (mut layer_builder, _) = LayerBuilder::new(
            &mut commands,
            map_settings,
            0u16,
            0u16,
        );
    
        //layer_builder.set_all(TileBundle::default());
        layer_builder.set_all(TileBundle {
            tile: Tile {
                texture_index: 12,
                ..Default::default()
            },
            ..Default::default()
        });
    
        // Builds the layer.
        // Note: Once this is called you can no longer edit the layer until a hard sync in bevy.
        let layer_entity = map_query.build_layer(&mut commands, layer_builder, texture_handle.clone());
    
        // Required to keep track of layers for a map internally.
        map.add_layer(&mut commands, 0u16, layer_entity);
    
        let (mut layer_1_builder, _) =
            LayerBuilder::new(&mut commands, map_settings.clone(), 0u16, 0u16);
    
        layer_1_builder.set_tile(TilePos(40, 40),
            TileBundle {
                        tile: Tile {
                            texture_index: 5,
                            ..Default::default()
                        },
                        ..Default::default()
                    },
                    ).expect("failed to set tile @pos 40/40");
    
        let layer_1_entity = map_query.build_layer(&mut commands, layer_1_builder, texture_handle);
    
        map.add_layer(&mut commands, 1u16, layer_1_entity);
    
        // Spawn Map
        // Required in order to use map_query to retrieve layers/tiles.
        commands
            .entity(map_entity)
            .insert(map)
            //.insert(Transform::from_xyz(-128.0, -128.0, 0.0))
            .insert(Transform::from_xyz(0.0, 0.0, 0.0))
            .insert(GlobalTransform::default());
    }
    

    and the system for spawning new tiles on layer 1, beneath the mouse cursor:

    
    pub fn mouse_click_tile(
        mut commands: Commands, 
        mut tile_query: Query<&mut Tile>,
        mut map_query: MapQuery,
        cursor_pos: Res<CursorPosition>,
        buttons: Res<Input<MouseButton>>,
    ) {
        let tp = &cursor_pos.tile;
        let tp_vec2: Vec2 = tp.into();
    
        let tp = tp_vec2.as_uvec2();
        let tp = TilePos(tp.x, tp.y);
    
        if let Ok(tile_entity) = map_query.get_tile_entity(tp, 0u16, 1u16) {
            if let Ok(mut tile) = tile_query.get_mut(tile_entity) {
                if buttons.pressed(MouseButton::Right) {
                    if tile.texture_index == 5 {
                        tile.texture_index = 10;
                    } else {
                        tile.texture_index = 5;
                    }
    
                    map_query.notify_chunk_for_tile(tp, 0u16, 1u16);
                    commands.entity(tile_entity).insert(AABB::new_quad(tp_vec2, 16));
                }
            }
        } else {
            if buttons.pressed(MouseButton::Right) {
                map_query.set_tile(&mut commands, tp, Tile {..Default::default()},
                        0u16, 1u16).expect("failed to add tile");
            }
        }
    }
    

    on zoom level/orthographic scale 0.25 the chunk/tiles do not render all the time.

    Could it be that the culling is off?

    opened by nerdachse 8
  • Feature request: Allow texture indexing for TextureAtlases built through TextureAtlasBuilder

    Feature request: Allow texture indexing for TextureAtlases built through TextureAtlasBuilder

    Unless I am mistaken, when using a TextureAtlas built with a TextureAtlasBuilder as a tilemap's texture atlas, the Tiles' texture_indexes do not map to the TextureAtlasSprites' indexes of the same texture. This means that attempting to use indexes retrieved through texture_atlas.get_texture_index in a Tile results in unpredictable textures being displayed. And since the order of the sprites in a generated TextureAtlas cannot be known until runtime, using TextureAtlasBuilder with bevy_ecs_tilemap is infeasible. I wrote a simple example to demonstrate this issue: https://github.com/Seldom-SE/bevy_ecs_tilemap-TextureAtlas-demo.

    Perhaps a method may be added to LayerBuilder to provide a Handle<TextureAtlas>, so the TextureAtlas's indexing may be used instead. Unfortunately, this could conflict with the material_handle passed into map_query.build_layer.

    I am willing to contribute work on this, if it is desired. Thanks!

    enhancement 
    opened by Seldom-SE 8
  • Update to Bevy 0.8

    Update to Bevy 0.8

    This updates all Rust and shader code to work with Bevy 0.8. All examples seem to work fine on my system (Linux Wayland, tested with --features bevy/wayland because of https://github.com/bevyengine/bevy/issues/5524).

    opened by NeoRaider 7
  • Upgrade tiled dep and add support for image-per-tile tilesets.

    Upgrade tiled dep and add support for image-per-tile tilesets.

    This does two things:

    • Adds support for tilesets that use a separate image per tile.
    • Upgrades the tiled dependency. Should be no change in actual functionality but the 0.10 version is much easier to work with than the 0.9 version. (fixes #249 and #320).

    Here is a screenshot of the example running with this code:

    Screenshot from 2023-01-01 11-08-39

    Here is a screenshot of a map loaded with the new image-per-tile support (this file has 5 layers and each is rendered as I see it in Tiled):

    Screenshot from 2023-01-01 11-12-17

    opened by dvogel 0
  • Add `physical_tile_size` field to determine how large each tile is rendered in-world

    Add `physical_tile_size` field to determine how large each tile is rendered in-world

    As bevy_ecs_tilemap stands now, each tile's size in-world is tied to the pixel-size of the tile in the source atlas. If I however want my tiles to be of unit size or any particular scale that I require, this is not currently possible. With this pull request, a user can now set physical_tile_size to determine how large a tile should be rendered in-world.

    This should also close #337.

    opened by SirHall 0
  • Should `fill_tilemap` be adding tiles as children to the tilemap entity?

    Should `fill_tilemap` be adding tiles as children to the tilemap entity?

    fill_tilemap causes the bench command to take a very long time to load (long enough that I don't actually know). If we look at its definition in filling.rs:

    /// Fills an entire tile storage with the given tile.
    pub fn fill_tilemap(
        texture_index: TileTextureIndex,
        size: TilemapSize,
        tilemap_id: TilemapId,
        commands: &mut Commands,
        tile_storage: &mut TileStorage,
    ) {
        for x in 0..size.x {
            for y in 0..size.y {
                let tile_pos = TilePos { x, y };
                let tile_entity = commands
                    .spawn(TileBundle {
                        position: tile_pos,
                        tilemap_id,
                        texture_index,
                        ..Default::default()
                    })
                    .id();
                commands.entity(tilemap_id.0).add_child(tile_entity);
                tile_storage.set(&tile_pos, tile_entity);
            }
        }
    }
    

    The culprit from my testing has been commands.entity(tilemap_id.0).add_child(tile_entity);. Without that line the benchmark launched in a mere few seconds, not very methodical - but it works.

    One option is to take the loop, pull out the commands.entity(tilemap_id.0).add_child(tile_entity); call, switch to using add_children and place the loop inside that:

    /// Fills an entire tile storage with the given tile.
    pub fn fill_tilemap(
        texture_index: TileTextureIndex,
        size: TilemapSize,
        tilemap_id: TilemapId,
        commands: &mut Commands,
        tile_storage: &mut TileStorage,
    ) {
        let mut tilemap = commands.entity(tilemap_id.0);
        tilemap.add_children(|parent| {
            for x in 0..size.x {
                for y in 0..size.y {
                    let tile_pos = TilePos { x, y };
                    let tile_entity = {
                        parent
                            .spawn(TileBundle {
                                position: tile_pos,
                                tilemap_id,
                                texture_index,
                                ..Default::default()
                            })
                            .id()
                    };
                    tile_storage.set(&tile_pos, tile_entity);
                }
            }
        });
    }
    

    This fixes the loading issue and now bench loads quickly again. Only issue is that while perusing the other fill* functions I noticed that none of them add the newly spawned tiles as children to the tilemap entity.

    Is this an oversight, and should we be fixing all the other filler functions, is it not needed and rather should we be taking it out of fill_tilemap?

    In either case, there is a pretty simple solution to bench's loading time.

    opened by SirHall 0
  • Apparent frustrum culling bug

    Apparent frustrum culling bug

    Using my code, the tiles don't render outside of a tile x-range of roughly -480—+28 Here's my repo

    Tiles with my own outline, but not rendered by bevy_ecs_tilemap

    To reproduce: clone the repo, build, run, press 'c' to activate the free camera mode, and move around using the arrow keys to view the edges.

    I will be working on reducing it to a minimal example.

    My code uses multiple tilemaps, both for multi-layered rendering and also it uses its own chunks of 32×32 tiles that are loaded and deloaded as you move around. The visible tile range is roughly chunk x-index -15—0

    Note: this is using TilemapRenderSettings { render_chunk_size: UVec2::new(500, 32), }, which explains the strange bounds. Basically, the library doesn't seem to want to bring new chunks onscreen

    Edit: git repo fixed

    opened by sofia-m-a 2
  • Texture filtering always uses min_filter instead of individual filtering parameters

    Texture filtering always uses min_filter instead of individual filtering parameters

    Texture filtering is always set to a value of min_filter in image plugin settings, even if tiles are magnified. It should use individual parameters instead.

    bug 
    opened by JohnTheCoolingFan 2
Releases(v0.9.0)
  • v0.9.0(Nov 13, 2022)

    What's Changed

    • Add compat info about bevy-track and bevy main by @geirsagberg in https://github.com/StarArawn/bevy_ecs_tilemap/pull/312
    • Simple bug fixes by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/317
    • Fix example support for rectangular grids by @will-hart in https://github.com/StarArawn/bevy_ecs_tilemap/pull/319
    • Fix how tilemap center is calculated so that it works for all map types. by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/324
    • Update bevy-track branch to newer bevy commit by @rparrett in https://github.com/StarArawn/bevy_ecs_tilemap/pull/330
    • TileTexture Rename for clarity. by @frederickjjoubert in https://github.com/StarArawn/bevy_ecs_tilemap/pull/325
    • Disable tests in CI by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/329
    • Implement From for TileColor by @johanhelsing in https://github.com/StarArawn/bevy_ecs_tilemap/pull/333
    • Update path to fill_tilemap in comment by @johanhelsing in https://github.com/StarArawn/bevy_ecs_tilemap/pull/331
    • Added support for custom texture formats. by @StarArawn in https://github.com/StarArawn/bevy_ecs_tilemap/pull/335
    • Revising neighbor helpers for ergonomicness. Removing requirement of supplying a TileStorage element to get neighbour positions. by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/328
    • Revert change to how web examples should be run by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/338
    • Support for bevy 0.9 by @StarArawn in https://github.com/StarArawn/bevy_ecs_tilemap/pull/310
    • Add Default to TilemapArrayTexture by @Dauthdaert in https://github.com/StarArawn/bevy_ecs_tilemap/pull/339
    • Fixed warning when running the atlas feature. Make sure we CI features. by @StarArawn in https://github.com/StarArawn/bevy_ecs_tilemap/pull/340

    New Contributors

    • @geirsagberg made their first contribution in https://github.com/StarArawn/bevy_ecs_tilemap/pull/312
    • @will-hart made their first contribution in https://github.com/StarArawn/bevy_ecs_tilemap/pull/319
    • @frederickjjoubert made their first contribution in https://github.com/StarArawn/bevy_ecs_tilemap/pull/325
    • @johanhelsing made their first contribution in https://github.com/StarArawn/bevy_ecs_tilemap/pull/333
    • @Dauthdaert made their first contribution in https://github.com/StarArawn/bevy_ecs_tilemap/pull/339

    Full Changelog: https://github.com/StarArawn/bevy_ecs_tilemap/compare/v0.8.0...v0.9.0

    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Oct 10, 2022)

    Added:

    • Added support for different types of textures: Single, Vector, TextureContainer(dds, ktx2).
    • Redesigned helper functions.
    • World pos to tile position calculation.
    • Frustum Culling.
    • Allow preloading of array textures.
    • Use bevy shader imports instead of custom importing.
    • Allow users to update tile positions dynamically.

    Fixes:

    • Fixed issue where atlas tile spacing was wrong.
    • Formatting improvments(clippy, CI, etc).
    • Lots of improvements to Isometric and hexagon math.
    • Array texture interpolation fixes.

    Complete List:

    What's Changed

    • Fix issue with readme link. by @StarArawn in https://github.com/StarArawn/bevy_ecs_tilemap/pull/210
    • Impl PartialEq and PartialOrd on TilePos by @tehsmeely in https://github.com/StarArawn/bevy_ecs_tilemap/pull/211
    • Fix grid size: scale tile position by grid_size first, then, then add tile_size to get the corners by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/215
    • Fixed grid size not affecting anything. by @StarArawn in https://github.com/StarArawn/bevy_ecs_tilemap/pull/214
    • Fixed error in hex shaders. by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/223
    • fix iso_staggered tile rendering by @Affinator in https://github.com/StarArawn/bevy_ecs_tilemap/pull/230
    • General fixes to stability. by @StarArawn in https://github.com/StarArawn/bevy_ecs_tilemap/pull/219
    • Reworking TilemapMeshType, fixing iso staggered rendering, and adding helper functions to return neighboring directions of a tile. by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/228
    • Update chunk position with scale by @qazzz789 in https://github.com/StarArawn/bevy_ecs_tilemap/pull/232
    • Makes the game of life example fit on the screen better. by @StarArawn in https://github.com/StarArawn/bevy_ecs_tilemap/pull/238
    • Fixed remaining issue with staggered iso rendering. by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/240
    • Square tile shader must also take into account grid_size and tile_size separately by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/243
    • Many small fixes (clippy, etc.). by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/247
    • Set up basic CI by @alice-i-cecile in https://github.com/StarArawn/bevy_ecs_tilemap/pull/248
    • add support for render layers on tilemaps by @Piefayth in https://github.com/StarArawn/bevy_ecs_tilemap/pull/244
    • Various CI fixes by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/254
    • Tiny fix for staggered window title text by @gak in https://github.com/StarArawn/bevy_ecs_tilemap/pull/253
    • Update Cargo.toml so that bevy_winit compile does not fail on unix by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/255
    • Run cargo fmt (so that CI stops failing 😅 ) by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/256
    • Add the ability to configure the chunk size. by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/252
    • correct entity comparisons when determining chunk visibility by @Piefayth in https://github.com/StarArawn/bevy_ecs_tilemap/pull/264
    • Match column_hex shader with helper function by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/276
    • Allow users to update tile positions without despawning. by @StarArawn in https://github.com/StarArawn/bevy_ecs_tilemap/pull/271
    • Fixes issue where interpolation can cause the wrong tile to be rendered. by @StarArawn in https://github.com/StarArawn/bevy_ecs_tilemap/pull/279
    • Added a texture atlas to array texture preloader. by @StarArawn in https://github.com/StarArawn/bevy_ecs_tilemap/pull/280
    • Added filesystem-watcher bevy feature for cfg(unix). Fixed outdated comment and broken link in readme. by @theseatoad in https://github.com/StarArawn/bevy_ecs_tilemap/pull/273
    • Helpers overhaul by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/268
    • Bevy shader imports by @StarArawn in https://github.com/StarArawn/bevy_ecs_tilemap/pull/270
    • Preparing hex-neighbor renovation by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/281
    • Fixed issue where atlas vertex/fragment shader failed to compile. by @StarArawn in https://github.com/StarArawn/bevy_ecs_tilemap/pull/284
    • Merge work done in Leafwing branch to WIP branch. by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/285
    • Tilemap centering transform functions should be based on grid size, not tile size, and some small clippy lints. by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/286
    • Removed scaling of chunk index. by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/290
    • AABB-based frustum culling of RenderChunk2d. by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/288
    • Checked tile get, set and remove by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/291
    • Incremental improvements to hex functionality by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/293
    • Generating hexagonal hex maps. by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/296
    • Allow user to provide a vector of image handles, each to be used as a tile texture. by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/299
    • Texture container support by @bzm3r in https://github.com/StarArawn/bevy_ecs_tilemap/pull/306
    • Spacing fixes by @StarArawn in https://github.com/StarArawn/bevy_ecs_tilemap/pull/309
    • Updated version in cargo and updated README. by @StarArawn in https://github.com/StarArawn/bevy_ecs_tilemap/pull/311

    New Contributors

    • @tehsmeely made their first contribution in https://github.com/StarArawn/bevy_ecs_tilemap/pull/211
    • @Affinator made their first contribution in https://github.com/StarArawn/bevy_ecs_tilemap/pull/230
    • @qazzz789 made their first contribution in https://github.com/StarArawn/bevy_ecs_tilemap/pull/232
    • @Piefayth made their first contribution in https://github.com/StarArawn/bevy_ecs_tilemap/pull/244
    • @gak made their first contribution in https://github.com/StarArawn/bevy_ecs_tilemap/pull/253
    • @theseatoad made their first contribution in https://github.com/StarArawn/bevy_ecs_tilemap/pull/273

    Full Changelog: https://github.com/StarArawn/bevy_ecs_tilemap/compare/v0.7.0...v0.8.0

    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(Jan 8, 2022)

    Changes:

    • Texture arrays with a fallback for regular atlases.
    • Better isometric support
    • Cleaned up API.
    • Proper tile flipping
    • Lots of bug fixes!
    • WASM support
    • A ton more I can't seem to remember...
    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(May 27, 2021)

    Changes:

    • New API for interfacing with tile maps, layers, and tiles.
    • Isometric staggered/diamond modes
    • Chunk culling(tiles not on screen aren't rendered!)
    • Batch creation mode which can quickly spawn a million tiles.

    Bugfixes

    • Iso and Hex rendering modes now properly position chunks.
    • Many others.
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(May 6, 2021)

    New stuff:

    • Improved rendering by meshing chunks in the vertex shader.
    • Chunk vertices are now calculated across threads instead of 1 thread.
    • GPU Animations
    • Chunk Camera Culling
    • Tile visibility
    • More examples
    • Better docs
    • Cargo fmt code.
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(May 6, 2021)

  • v0.1.0(Apr 29, 2021)

Owner
John
John
wecs (wckd-ecs) is a simple ECS library suitable for general use.

wecs wecs (wckd-ecs) is a simple ECS library heavily based on bevy_ecs. Motivation As part of my "Road to Rust GameDev" journey, I wanted to learn how

João Victor 9 Jul 2, 2023
A tilemap library for Bevy. With many algorithms built in.

Bevy EntiTiles A tilemap library for bevy. Notice that the crate is still in need of optimization. So don't use this in your formal projects. Strongly

443eb9#C 3 Nov 7, 2023
🤹‍ 2D sprite rendering extension for the specs ECS system

specs-blit 2D sprite rendering extension for the Specs ECS system. All sprites are loaded onto a big array on the heap. Example // Setup the specs wor

Thomas Versteeg 8 Aug 14, 2022
🏷️ Markers for Bevy ECS Entities

Bevy ECS Markers Adds the support for marking entites and fetching them in queries Example View the whole example here #[derive(EntityMarker)] enum Pl

Chopped Studio 2 Dec 23, 2022
Minimalistic implementation of entity kinds for Bevy ECS.

Bevy ?? Kindly This crate is a minimalistic implementation of Kinded Entities for Bevy game engine. In summary, it allows the user to define, construc

null 10 Jan 26, 2023
Bring Bevy's ECS to Godot4

bevy_godot4 Bring the design power of Bevy's ECS to the mature engine capabilities of Godot 4. WARNING: This crate is very early in development, and i

JR 4 May 8, 2023
A simple type safety solution for Bevy ECS.

?? Moonshine Kind A simple type safety solution for Bevy ECS. Overview An Entity is a generic way to reference entities within Bevy ECS: #[derive(Comp

null 8 Nov 3, 2023
Vulkan and Rust rendering~game engine which creation is covered with YouTube videos

Vulkan and Rust rendering~game engine which creation is covered with YouTube videos

小鳥 11 Dec 4, 2022
Proof-of-concept of getting OpenXR rendering support for Bevy game engine using gfx-rs abstractions

Introduction Proof-of-concept of getting OpenXR rendering support for Bevy game engine using gfx-rs abstractions. (hand interaction with boxes missing

Mika 52 Nov 14, 2022
A light-weight Anchor-Offset based 2D sprite rendering system for the bevy engine.

Bevy AoUI A light-weight anchor-offset based 2D sprite layout system for the bevy engine. Bevy AoUI provides a light-weight rectangular anchor-offset

Mincong Lu 4 Nov 22, 2023
Specs - Parallel ECS

Specs Specs Parallel ECS Specs is an Entity-Component System written in Rust. Unlike most other ECS libraries out there, it provides easy parallelism

Amethyst Engine 2.2k Jan 8, 2023
High performance Rust ECS library

Legion aims to be a feature rich high performance Entity component system (ECS) library for Rust game projects with minimal boilerplate. Getting Start

Amethyst Engine 1.4k Jan 5, 2023
Creative Coding Framework based on Entity Component System (ECS) written in Rust

creativity creativity is Creative Coding Framework based on Entity Component System (ECS) written in Rust. Key Features TBA Quick Start TBA How To Con

Chris Ohk 9 Nov 6, 2021
A direct ecs to low-level server implementation for Godot 4.1

godot_ecs What if Godot 4.1 and Bevy got married? Well, you'd get one interesting duo of data driven goodness. In Development This crate is not produc

null 5 Oct 6, 2023
Just when you thought Bevy couldn't get more ergonomic, Bvy shows up to change the game.

Just when you thought Bevy couldn't get more ergonomic, Bvy shows up to change the game. Is this a joke? You decide. Does it work? You can bet your As

Carter Anderson 40 Oct 28, 2022
This tool allows you to open one or more notebooks in Visual Studio and go hog wild exploring your systems in Bevy.

Bevyrly Bevy is rly useful, but requires some hygiene! Pronounced as /ˈbɛvə(ɹ)li/, derives from Old English, combining befer ("beaver") and leah ("cle

null 4 Feb 28, 2024
Minecraft-esque voxel engine prototype made with the bevy game engine. Pending bevy 0.6 release to undergo a full rewrite.

vx_bevy A voxel engine prototype made using the Bevy game engine. Goals and features Very basic worldgen Animated chunk loading (ala cube world) Optim

Lucas Arriesse 125 Dec 31, 2022
bevy-hikari is an implementation of voxel cone tracing global illumination with anisotropic mip-mapping in Bevy

Bevy Voxel Cone Tracing bevy-hikari is an implementation of voxel cone tracing global illumination with anisotropic mip-mapping in Bevy. Bevy Version

研究社交 208 Dec 27, 2022
Bevy Simple Portals is a Bevy game engine plugin aimed to create portals.

Portals for Bevy Bevy Simple Portals is a Bevy game engine plugin aimed to create portals. Those portals are (for now) purely visual and can be used t

Sélène Amanita 11 May 28, 2023