mapeditor / tiled

Flexible level editor
https://www.mapeditor.org/
Other
11.22k stars 1.76k forks source link

Components - assign object types as components to an object #3029

Open edin-m opened 3 years ago

edin-m commented 3 years ago

As a user, I'd like to assign different sets of properties to an object.

Problem/motivation: An object having a single type is not flexible enough. One object could have sounds, physics, and AI. Another could have trigger properties only. Basically the Components from the ECS (Entity Component System) pattern.

Idea: Similar features have been proposed and discussed. e.g. https://discourse.mapeditor.org/t/custom-property-type/5000 But they have more to do with the custom property types and the possibility of supporting components through these custom types which could maybe be nested.

It would look something like this:

Screenshot 2021-04-16 110634

edin-m commented 3 years ago

Initial work has been done and merged into wip/components.

Feel free to test it out and send feedback.

Future work will be done in separate PRs and merged into the WIP branch.

Future work (in sub-branches):

bjorn commented 3 years ago

@edin-m Thanks for the update here! Let me know if there is anything in particular you'd rather have me look at (making the ObjectReferenceItem work comes to mind).

edin-m commented 3 years ago

To anybody interested in this feature, please test it out and provide feedback. There are a couple of TODO items left.