New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update supported TMX Format to 1.2 #150

Open
steffen-wilke opened this Issue Jul 23, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@steffen-wilke
Copy link
Collaborator

steffen-wilke commented Jul 23, 2018

Since originally implementing .tmx support for the LITIengine, there were some major changes implemented that we need to support.

We need to go through the TMX Changelog and extend our framework by everything that is now supported.

On Templates:
The LITIengine only supports importing template files (.tx) to the engine as Blueprint.
MapObjects that were added from a template in the Tiled editor and directly reference an external template from the filesystem are currently unsupported.

@TheRamenChef

This comment has been minimized.

Copy link
Collaborator

TheRamenChef commented Jul 25, 2018

Will this include support for maps encoded using JSON?

@steffen-wilke

This comment has been minimized.

Copy link
Collaborator

steffen-wilke commented Jul 26, 2018

I think I'm going to investigate this when working on the issue. Although, I don't like the idea of the engine depending upon some json library it will be beneficial to provide json support. Maybe, it would be suitable to implement an extension project for this, which would provide the functionality.
On the other hand e.g. Google Gson is a very commnly used library and a dependency should not be that bad.

steffen-wilke added a commit that referenced this issue Sep 28, 2018

Infinite map almost working now.
Currently smaller layers are not rendered correctly because they don't provide the same dimension as the largest tile layer.

Issue #150

steffen-wilke added a commit that referenced this issue Sep 28, 2018

Implement support to render infinite maps.
- The litiengine renders infinite maps as one big map that wraps all the chunks of the tile layers
- It is now possible to load and render infinite maps in the engine.
- TODO: Offset mapobject and image layers.

Issue #150

steffen-wilke added a commit that referenced this issue Sep 28, 2018

Implement support for infinite maps
- Extend layers with a backreference to their map
- Extend mapobjects with a backreference to their layer
- Since the litiengine handles infinite maps a bit different than the tiled editor (the map in the engine always has an explicit boundary and the tiles start from 0,0), the mapobjects need to account for this when presenting their coordinates.
  The mapobject coordinates are serialized in the original tiled manner and the engine incorporates the chunk offset when dealing with infinite maps.

This is not the prettiest solution but dropping the assumption that a map has a boundary would imply rewriting very large parts of the engine which is why I decided against it. In the LITIengine, the tiles of a map always start at 0,0  while infinite maps in the tiled editor might provide tile locations "outside of the maps bounds" (i.e. there are no bounds to the map anymore which is completely contradictory to the way the LITIengine works).
For this reason, the LITIengine translates the Tiled Infinite Maps to a large map that wraps all the chunks.

Issue #150

steffen-wilke added a commit that referenced this issue Sep 28, 2018

Implement support for infinite maps
- Copy constructors now use the actual class type as input argument
- Imagelayers now support the chunk offset for infinite maps.

Issue #150

@steffen-wilke steffen-wilke added this to the v0.4.14 milestone Oct 1, 2018

@steffen-wilke steffen-wilke changed the title Update supported TMX Format to 1.1 Update supported TMX Format to 1.~~1~~2 Nov 17, 2018

@steffen-wilke steffen-wilke changed the title Update supported TMX Format to 1.~~1~~2 Update supported TMX Format to 1.2 Nov 17, 2018

@steffen-wilke steffen-wilke modified the milestones: v0.4.14, v0.5.0-beta Dec 8, 2018

@TheRamenChef

This comment has been minimized.

Copy link
Collaborator

TheRamenChef commented Dec 18, 2018

I'd like to implement the JSON maps myself, but I'm pretty much clueless with Gradle and I have no idea how to add the GSON dependency. @steffen-wilke, could you add a branch with the dependency added?

@steffen-wilke

This comment has been minimized.

Copy link
Collaborator

steffen-wilke commented Dec 20, 2018

@TheRamenChef done with 44130d5
A new branch json-maps has been created.

@TheRamenChef

This comment has been minimized.

Copy link
Collaborator

TheRamenChef commented Dec 21, 2018

Thank you! It works fine.

steffen-wilke added a commit that referenced this issue Jan 17, 2019

steffen-wilke added a commit that referenced this issue Jan 18, 2019

Add support for additional MapObject properties
- Add support for the point element
- Add support for the ellipse element
- Add support for the polygon element
- Make it possible to load MapObjects that don't have type specified. There is currently no default implementation on this because the engine can't possibly guess what the developer wants to do with MapObjects that don't have a related Entity type.
Issue #150
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment