mapeditor / mapeditor/tiled

Properties on polyline nodes

Open
#1,728 0 comments 1 reaction 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

As requested on the forum, it would sometimes be useful to be able to associate arbitrary data with the nodes of a polygon.

The information could be stored as follows in the TMX format:

<object id="5" name="guard" type="NPC" x="22" y="361">
   <polyline points="-3,120 87,91 154,96 181,16 273,-1">
      <node index="2">
         <properties>
            <property name="foo" value="100"/>
            <property name="bar" value="200"/>
         </properties>
      </node>
   </polyline>
</object>

For the implementation though, it will be a little complicated because the nodes in a polygon are just floating-point coordinates, whereas everything that can have properties derives from Tiled::Object. And deriving polygon nodes from that class would of course bloat the storage requirements for a polygon, unless the properties would be stored in some other way (but that adds complexity to the Properties view).

It may be that this use-case is better solved by connecting objects (#707).

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

Start with the TMX example and the issue's description of polygon nodes, Tiled::Object, and the Properties view; no files or tests are named. Compare storing node properties with the connecting-objects alternative in issue #707, then establish the storage and UI approach before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev, 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.