Skip to content
This repository has been archived by the owner on May 7, 2022. It is now read-only.

Examples/documentation for single chuck map with origin in corner #157

Open
jbowtie opened this issue Apr 17, 2021 · 2 comments
Open

Examples/documentation for single chuck map with origin in corner #157

jbowtie opened this issue Apr 17, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@jbowtie
Copy link

jbowtie commented Apr 17, 2021

What problem does this solve or what need does it fill?

People following tutorials (such as the Rust Roguelike Tutorial) may not have a clear grasp of how chunking helps with map management, or how to convert between the coordinate system used in the tutorial to the one used by Tilemap.

Looking at the existing examples and documentation, I think the following are unclear without delving into the code itself:

  • The relationships between map, chunk, and texture dimensions.
  • Guidance on choosing a chunk size and how many to spawn initially.
  • How to work out the dimensions I need for a map that just fills particular screen or window size.

Most tutorials I've seen start with the following constraints:

  • A small, self-contained map (something like 10x10 or 80x50)
  • An origin in the top left or bottom left corner of the map (for simple conversion between tile coord and index into a vector).

These constraints get gradually lifted in later chapters or tutorials, of course, but the initial constraints make it easy to focus on learning the basics of movement, collisions, working with tiles, etc.

I think a simple example that follows these constraints, coupled with some documentation to help people understand when and how to use chunks for map management, would make this a simple transition for people following or adapting tutorials.

I don't know if this is better served with a more carefully annotated random_dungeon or a new tutorial_dungeon example that is closer to the old, single-chunk version of random_dungeon (but with an origin in the corner).

@jbowtie jbowtie added the enhancement New feature or request label Apr 17, 2021
@joshuajbouw
Copy link
Owner

There has been a bit of discussion about exactly this in general. One of the ideas is just to make chunking 100% internal and not even give the concept of it publicly at all. All you would need to worry about is simply just putting tiles in a map. I do want to get into that direction, but it'll certainly break quite a bit of people's maps.

I DO want to do something much like the Rust Roguelike Tutorial eventually.

@jbowtie
Copy link
Author

jbowtie commented Apr 18, 2021

I'm not sure you have to hide chunking completely, but having a sensible default where you don't have to think about it initially would be a better experience. That way tutorials can work their way up to it gradually.

I'm currently working my way through the roguelike tutorial (halfway through chapter 7); it maps fairly closely but I had to write a couple of functions to translate between coordinate systems because I couldn't be bothered to figure out how to move the Tilemap origin.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants