Loading from a Map Editor

Started by
0 comments, last by Krohm 7 years, 11 months ago

I'm working on a game and I'm exploring possible ways to load data from a level editor into my game. Specifically, I'm using LibGDX to create the game, and Tiled to design the levels. I'm also going for a component-based approach - each entity added to the map in Tiled has a "components" key in the properties, which specifies a comma-separated list of files, each containing serialized component data. When the level is loaded, it loads all of the necessary files and copies the components (because I can't give the same deserialized components to different entities) to the entities that need them.

I'm also using YAML to store the serialized components at the moment, but I plan to switch to JSON. Despite this, I feel like there could be a less-convoluted way to achieve this. What other methods, if any, could I use to load a level and supply components to entities? Or is the method I am currently using okay?

Advertisement

What problem do you have with it? Having an intermediate XML/YAML/JSON representation or annotation is common. I don't quite understand the point with the deserialized components to different entities - they get instances of the same components, they cannot really get the same component. Perhaps they should? I see nothing being obviously wrong here.

Previously "Krohm"

This topic is closed to new replies.

Advertisement