2D Tile Editor

Project information

  • Type: Tool made for a custom engine
  • Engine/Language: Custom Engine, C++
  • Date: May 2024
  • Team Size: Solo
  • Duration: 2 weeks
Tool

2D Tile Editor

May 2024
BUas

2D tile editor made with ImGui for the WASP custom engine (student team project). Supports creating custom collisions

Project Overview

I was in a team of 7 programmers and we had to create a custom engine. One of the tools that we needed for it was a 2D tile editor, so I made one using ImGui.

The requirements were that the user should be able to create, save, and load a tilemap, create custom collisions, generate a mesh with collisions that can be placed in the level.

The user can also scroll, zoom in, zoom out, and resize the map.

Tile editor in action - create a tilemap with custom collisions and place it in the level

Tile Editor Functionality

Users begin by selecting a tileset file and specifying its dimensions (rows and columns), along with the desired level size. The editor allows for intuitive "painting" of the level by selecting and placing tiles, as well as erasing them when necessary. Additional features include scrolling, zooming in and out, and resizing the map to accommodate various design requirements.

Tilemap editor

Collision Editor Features

The Collision Editor facilitates the creation of polygon-based collision shapes. Users can define these shapes by placing points to form polygons, completing the shape upon connecting to the starting point. The editor also offers functionality to select existing polygons and modify them by adding, moving, or removing points, providing flexibility in collision design.

Collision editor

Mesh Generation and Integration

Once a tilemap is saved, it can be imported into the level editor, where a mesh with corresponding collisions is generated. Utilizing an Entity Component System (ECS) architecture, the tool creates a parent entity containing a mesh constructed from the tiles' vertices and indices. For each collision polygon, a child entity is generated with a polygon collision component, ensuring accurate collision representation within the game environment.

The generated mesh placed in the level

Project Features

  • Responsive Design
  • Tilemap Creation
  • Custom Collision Design
  • Save and Load Functionality
  • Mesh Generation with Collisions

Technologies Used

WASP Custom Engine C++ ImGui