Skip to content
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

Second tileset needs ID accomodation #18

Open
djasnowski opened this issue Jan 24, 2018 · 0 comments
Open

Second tileset needs ID accomodation #18

djasnowski opened this issue Jan 24, 2018 · 0 comments
Labels
core engine Issues on the client-side of the game engine. enhancement When functionality needs to be changed or updated. front end Relating to code and client-side script of the game. medium priority It would be awesome if this was done, but not very critical. medium Tasks/features that were not easy to implement -- nor hard. Just time-consuming; maybe. tools Issues and features of the tools to help build Delaford.

Comments

@djasnowski
Copy link
Member

Do you want to request a feature or report a bug?

feature

What is the current behavior?

Anytime we reference a backgroundTile, we have to accomodate the Tiled export. Like this:

https://github.com/Navarra/game/blob/6722b7d5a57643e1020b1078995e6c00d16f064e/src/core/map.js#L180-L195

https://github.com/Navarra/game/blob/6722b7d5a57643e1020b1078995e6c00d16f064e/src/core/map.js#L305

This is because Tiled has a gid and if I wanted to have a tile ID start from 0 for each tileset... well, from the creator:

You wouldn't, because you wouldn’t be able to determine from which tileset that particular tile is (not without additional knowledge at least: only you know that you have only two layers that only use a specific tileset for each).

The way to get from 253 to 0 is to subtract the “firstgid” associated with your second tileset. In the general case, this system allows a tile layer to use any number of tilesets. You can read more about this in the documentation1 (the JSON format works the same way).

Because what if each layer has associated with their own tileset?

It doesn’t matter, Tiled supports multiple tilesets per layer so it can’t change its output format to rely on there being only a single tileset per layer. It could be introduced as an option, but Tiled currently has no such option.

But, you can always implement your own map format, and teach Tiled how to read/write it by implementing either a C++ or Python Tiled plugin. Then you can simplify it as much as you like.

If this is a feature request, what is motivation or use case for changing the behavior?

Cleanliness and less-hacky way.

I think the solution may lay in the Tiled editor program that Navarra uses. But my degree of expertise is not as much as I would like. If you know of a solution, send a PR!

@djasnowski djasnowski added enhancement When functionality needs to be changed or updated. low priority Nice-to-have issues and features. medium Tasks/features that were not easy to implement -- nor hard. Just time-consuming; maybe. core engine Issues on the client-side of the game engine. front end Relating to code and client-side script of the game. tools Issues and features of the tools to help build Delaford. labels Jan 24, 2018
@djasnowski djasnowski added medium priority It would be awesome if this was done, but not very critical. and removed low priority Nice-to-have issues and features. labels Feb 26, 2018
aleks-rope pushed a commit to aleks-rope/game that referenced this issue May 8, 2020
## The devDependency [laravel-mix](https://github.com/JeffreyWay/laravel-mix) was updated from `3.0.0` to `4.0.0`.
This version is **not covered** by your **current version range**.

If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.

---

[Find out more about this release](https://github.com/JeffreyWay/laravel-mix).

<details>
  <summary>FAQ and help</summary>

  There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>

---


Your [Greenkeeper](https://greenkeeper.io) bot 🌴
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core engine Issues on the client-side of the game engine. enhancement When functionality needs to be changed or updated. front end Relating to code and client-side script of the game. medium priority It would be awesome if this was done, but not very critical. medium Tasks/features that were not easy to implement -- nor hard. Just time-consuming; maybe. tools Issues and features of the tools to help build Delaford.
Projects
None yet
Development

No branches or pull requests

1 participant