A simple extension for `bevy-editor-pls` to support tilemap editing right inside the bevy app.

Overview

What is this

This is a simple tilemap editor plugin, that hooks right into bevy_editor_pls to work with bevy_ecs_tilemap. It works completely within its own confines and doesn't spawn any additional entities. The current aim is to provide a good enough editor to do most of the level editing tasks right inside the bevy application.

To use this plugin just add it to your app:

    app.add_plugin(TilemapEditorPlugin);

Then you should see a Tile editor option in the Open Window menu in bevy_editor_pls.

It is STRONGLY recommended to change the camera panning controls in bevy_editor_pls to exclude both left and right mouse buttons, since those are used by the editor. In the examples you can see how to override the camera panning controls to mouse's middle button.

In addition, if you have some additional components, that you attach to the tiles, you can configure a resource that tells the editor what components it should insert

    let mut registry = EditorTileDataRegistry::default();

    registry.register(
        TilemapTexture::Single(texture_handle),
        TileTextureIndex(0),
        (GrassHeight(10), GroundTag),
    );

    commands.insert_resource(registry);

Why use this?

  • As of this writing, both tiled and ldtk aren't compatible with bevy without some tinkering.
  • Debugging any sort of game without any built in tile editor is a complete pain, even with an inspector.
  • Neither tiled or ldtk really reflect the ecs-like approach of bevy_ecs_tilemap.

Known issues / intricacies

  • There is a lot of "expect()" and "unwrap()" in the code. Some of them aren't really justified and will for sure crash the app. They should be replaced with returning a Result<T, E>.
  • Currently, there's not "proper" layer support. bevy_ecs_tilemap allows emulating layers by spawning a separate tilemap for that. In other editors you can simply reorder the layers, which is easier-said-than-done when it comes to bevy, since all objects are z-coordinate ordered.
  • The plugin doesn't support tilemaps that have gone through Transforms other than mere translation.
  • Tile painting can spill out when your mouse button is still down.
  • This plugin relies on bevy_editor_pls, which is known to have some performance issues.

Features

Avaliable right now

  • Painting tiles (with extra data!)
  • Erasing tiles
  • Tile picking
  • Quering tile entity ID

Will implement in the nearest future

  • Support for other atlas formats
  • No reliance on bevy_editor_pls
  • Tilemap saving
  • Tilemap loading
  • Live tilemap resizing
  • Animation editing
  • Showing-hiding a whole tilemap in the editor
  • Taking tilemap scaling into account
  • A thin grid to make it easier to measure space in a tilemap
  • Custom tools

Will implement, but they aren't a high priority right now

  • Configurable controls
  • Spawning a tilemap
  • Taking tilemap rotation into account
  • Compatability with prefab crates like bevy_proto

Won't implement

  • Editing for tilemaps other than square maps (this project already has a quite big scope. Adding suport for other tilemap types would slow things down)
  • Spawning non-tile entities (once again, it is out of the current scope I have set up and it's probably a task that shouldn't be done by this plugin)
  • Fixed file format for tilemaps (while this plugin will for sure support loading tilemaps from a file, it definitely won't be locked to any specific tilemap format)

Credits

The "pretty_tiles.png" tileset

Credit goes to: Zabin, Daneeklu, Jetrel, Hyptosis, Redshrike, Bertram. Link to the tileset's page: http://opengameart.org/content/rpg-tiles-cobble-stone-paths-town-objects

Comments
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Configuration Summary

    Based on the default config's presets, Renovate will:

    • Start dependency updates only once this onboarding PR is merged
    • Enable Renovate Dependency Dashboard creation.
    • Use semantic commit type fix for dependencies and chore for all others if semantic commits are in use.
    • Ignore node_modules, bower_components, vendor and various test/tests directories.
    • Group known monorepo packages together.
    • Use curated list of recommended non-monorepo package groupings.
    • Apply crowd-sourced package replacement rules.
    • Apply crowd-sourced workarounds for known problems with packages.

    🔡 Would you like to change the way Renovate is upgrading your dependencies? Simply edit the renovate.json in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.


    What to Expect

    It looks like your repository dependencies are already up-to-date and no Pull Requests will be necessary right away.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    This repository currently has no open or pending branches.

    Detected dependencies

    cargo
    Cargo.toml
    • bevy 0.10
    • bevy_editor_pls 0.4
    • bevy_ecs_tilemap 0.10.0
    • bevy_egui 0.20

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
  • Showing/hiding the tilemap

    Showing/hiding the tilemap

    A little quality-of-life improvement -- freeing the user from having to locate the tilemap entity to make it invisible. This can be done by simply giving them an access to tile's Visibility component in the editor window.

    opened by InnocentusLime 0
  • Editing the extra bundle

    Editing the extra bundle

    Right now all extra components/bundles that should be inserted together with the TileBundle are stored in a special registry, that can't be modified through the editor.

    Making this data editable will greatly boost the usability, freeing the user from having to edit the components manually after spawning a tile.

    P.S. It seems that to implement all that, the editor needs some reworking to work bevy's reflect module.

    opened by InnocentusLime 0
  • Make the `bevy_editor_pls` dependency optional

    Make the `bevy_editor_pls` dependency optional

    Currently the plugin relies on the platform provided by bevy_editor_pls. However, it seems that making the plugin work on its own is:

    • Not that hard to implement (assuming egui is still an required dependency)
    • Makes the editor more usable (not all bevy developers are using bevy_editor_pls)
    opened by InnocentusLime 0
  • Support for other tile atlas formats

    Support for other tile atlas formats

    Currently, this editor can only handle tilemaps who have their tileset coming from a single file (TilemapTexture::Single). To make the editor more user-friendly, all other types of atlases should be supported.

    opened by InnocentusLime 0
Owner
null
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
Ktx is a lightweight terminal-ui utility for editing Kubernetes config

ktx Ktx is a lightweight terminal-ui utility for editing the kubectl config If you work with a large infrastructure where you have to jump between clu

Maxim 5 Aug 23, 2023
Persist game settings like music volume or graphic settings in a nice toml file in the right location.

Bevy Settings The goal of this project is to store settings in a resource throughout game launches. Currently this crate supports Linux, Mac and Windo

Tobias Kriebisch 9 Feb 25, 2023
Example implementation of a 3d hexagon tile-based map editor using bevy

bevy-hex-sandbox Example implementation of a 3d hexagon tile-based map editor using bevy v0.10. smol.mov This is not a maintained project. Instead, th

David M. Lary 4 Aug 5, 2023
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
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
Discord RIch Presence in Rust, with native Bevy support

Discord Presence The root project for both Bevy Discord Presence and regular Discord Presence, both contained in the crates directory. TODO Allow invi

Juliette Cordor 22 Nov 29, 2022
RPG Dialog support for Bevy, written in pure Rust!

?? ?? Bevy x RPG Dialog ?? ?? RPG Dialog support for Bevy, written in pure Rust! bevy-rpg is a plugin crate that adds dialog functionalities to Bevy,

null 5 Jan 8, 2023
Adds support for wasm/wat assets in Bevy, and enables easier scripting

bevy_wasm_scripting Adds support for wasm/wat assets in Bevy, and enables easy scripting. This is enabled through the wasmer crate. Prepare for public

null 9 Dec 20, 2022
A feature-rich, production-ready, general purpose 2D/3D game engine written in Rust with a scene editor.

A feature-rich, production-ready, general purpose 2D/3D game engine written in Rust with a scene editor.

rg3d engine 5.4k Jan 4, 2023
Reads files from the Tiled editor into Rust

rs-tiled Read maps from the Tiled Map Editor into rust for use in video games. It is game engine agnostic and pretty barebones at the moment. Document

mapeditor.org 227 Jan 5, 2023
Work-in-Progress NES / Famicon Image Editor & Map Creator

NESImg An extremely work-in-progress tool for making NES/Famicom-compatible images. When faced with the challenge of formatting artwork in a way that

Katharos Technology 10 Nov 24, 2022
DragonOS/Linux Termial text editor

Held DragonOS/Linux Termial text editor 面向DragonOS和Linux系统的终端文本编辑器。 作者:Heyicong [email protected] 安装 默认安装路径为./install/bin/held Linux: make install

DragonOS Community 4 Apr 10, 2024
An extension to the bevy_ecs_tilemap, allowing for configurable tilesets, auto tiling, and more

bevy_ecs_tilemap_tileset A mouthful, I know. Working on a better name. An extension to the wonderful bevy_ecs_tilemap crate for Bevy, allowing for con

null 40 Dec 12, 2022
🤹‍ 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
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
Minecraft using Bevy and Bevy-Meshem

minecraft_bevy Minecraft_bevy was built to showcase bevy_meshem. After a week of developing it has: Chunk loading / unloading each chunk's mesh is bei

Adam 7 Oct 4, 2023
A Rust port of the "Heroes of Math & Mech" game. Currently macOS, Windows, Linux and iOS app. WIP.

[WIP] Герои Мата и Меха Попытка переписать известный в узких кругах текстовый квест «Герои Мата и Меха» на Rust. Ещё не закончено! Оригинальная версия

null 2 Jan 18, 2022