mapeditor / mapeditor/tiled

Idea for a new tool: creating complex object shapes without the use of polygons.

Open
#1,899 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
12.9k
Forks
2k
Avg merge
4h 27m
Merged PRs (30d)
8

Description

Current situation
The polygon tool is now used to draw enclosed shapes in any form, but I guess we can improve the usability in cases where the shape actually consists of multiple 'single tile sized' objects connected to each other.

For example in the use case below, it can be drawn with the polygon tool, but because it has holes it requires to have some intersecting & diagonal lines. The output is also relatively hard to parse if you would like to know which tiles indices do actually have the defined object.

"polygon":[ { "x":0, "y":0 }, { "x":96, "y":0 }, { "x":96, "y":48 }, { "x":128, "y":48 }, { "x":128, "y":96 }, { "x":80, "y":96 }, { "x":80, "y":80 }, { "x":80, "y":64 }, { "x":64, "y":64 }, { "x":64, "y":80 }, { "x":80, "y":80 }, { "x":80, "y":112 }, { "x":32, "y":112 }, { "x":32, "y":96 }, { "x":0, "y":96 }, { "x":48, "y":48 }, { "x":64, "y":48 }, { "x":64, "y":16 }, { "x":48, "y":16 }, { "x":48, "y":48 }, { "x":0, "y":96 }],

screen shot 2018-03-03 at 12 30 15

Suggestion
What I would like to suggest is to create a tool which is limited to just the tile grid (as defined in the map). This tool would allow you to create an tile-sized objects, which can extend by drawing additional tile-sized objects on any border.

I can imagine the output format in one of the following two different options (taking the screenshot above as example):

Option 1:
An array of 'booleans' where every boolean tells you if the tile is used or not. The length of this array would always be the width * height in tiles. Our example object has a (calculated) width of 8 and a calculated height of 7 and would result in the following output:
tiles = [ 1,1,1,1,1,1,0,0, 1,1,1,0,1,1,0,0, 1,1,1,0,1,1,0,0, 1,1,1,1,1,1,1,1, 1,1,1,1,0,1,1,1, 1,1,1,1,1,1,1,1, 0,0,1,1,1,0,0,0 ]

Option 2:
An array of tile locations. Every location would be the delta tiles relative to the objects position. For example the following output would be the one for just the first row of tiles of the example object:
tiles = {{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no implementation files, entry points, or tests. Start by locating the existing polygon tool and the code that serializes map objects, then compare the proposed tile-grid interaction and output formats with current editor conventions. Done would require an agreed design, implemented tool behavior, serialized output, and coverage for the example shape.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.