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

Map making guide #67

Open
IoriBranford opened this issue Apr 30, 2020 · 6 comments
Open

Map making guide #67

IoriBranford opened this issue Apr 30, 2020 · 6 comments

Comments

@IoriBranford
Copy link

IoriBranford commented Apr 30, 2020

There could be a guide or spec document on how to make maps and tilesets that will work, noting things like:

  • Map file and its tileset files all must be in the root of the load path (files can't be loaded from a subdirectory of the load path).
  • Tileset image is 8-bit index color
  • Tile size is power-of-2
  • Any hardcoded memory limitations - I got "out of memory" and crashes loading a map with either too many layers or too many tilesets, not sure which, but there was still plenty of system memory left. (I haven't had time to investigate this in depth.)
@megamarc
Copy link
Owner

megamarc commented Apr 30, 2020

Yes, this is related to the "Guide" documentation section, that is mostly incomplete and needs writing. Some of the limitations are stated on the respective "Reference" section for the API calls (tileset section, bitmap section...)

Since release 2.6.0 pixel image files are not restricted to 8bpp pixel format, but instead to up to unique 255 colors (they're converted to indexed color at load time).

I'm curios about the datasets you're using to make the loader crash, no one complaied about this until now. With them I could fix the loader.

@IoriBranford
Copy link
Author

IoriBranford commented Apr 30, 2020

Here is the map that crashes with "Not enough memory".
crashexample.zip
Extract into the samples folder.

@megamarc
Copy link
Owner

The problem was an unchecked limit of 16 layers per tmx file that was causing overflow. Your map has 37 layers, never seen that. Now the limit is 64 and is tested against overflow. The example shows the background plane scrolling upwards

@megamarc
Copy link
Owner

megamarc commented May 1, 2020

Hi!
The map you sent me is very interesting. I've seen some unexpected things that gave me a lot of ideas to make advance Tilengine in ways I hadn't think about before. I'm already working on them

@megamarc megamarc reopened this May 1, 2020
@GithubPrankster
Copy link

I had difficulty with using more than 2 layers lately as well. The second one loaded from the map would often not load at all, even with a lot of fiddling. The idea was to have it be above the character, therefore occluding them, and combined with collision detection, giving the sense of being behind stuff well. However as well as not having support for collision objects from the tileset prevents more fine collision types. At best I'd need to import directly the file using a TMX C library, search for the collision objects such as rectangles, then implement myself all that.

@megamarc
Copy link
Owner

megamarc commented May 3, 2020

@GithubPrankster
May I ask you to post your question in the support forum? It's an interesting one, but it's really about how to implement a gameplay related feature, not a bug or feature request. I think what you want should be doable in Tilengine, providing your assets and source.

Example "crashexample.zip" provided by @IoriBranford now loads and displays properly in release 2.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants