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

Move collision info from map making to tile set defintions #322

Open
clintbellanger opened this issue Apr 20, 2012 · 4 comments
Open

Move collision info from map making to tile set defintions #322

clintbellanger opened this issue Apr 20, 2012 · 4 comments
Labels

Comments

@clintbellanger
Copy link
Owner

Currently map makers have to define their own collision info (mark which tiles are blocking).

It will be much nicer if this information is in the tile set instead, automatically connected to each tile.

Tricky bits:

  • Secret passages would be harder to do. Not a big deal to me, I think secret passages should be handled with actual art instead.
  • Pits could need a special marking tile. These are grid spaces that aren't drawn, but still allow flying/missiles.
  • Oversized tiles might affect collision info on several grid spaces. This might need to be some kind of special struct inside a tile set def file.
  • The engine will still use a boolean 2D collision array. This will be built on map load based on the tiles. Will have to examine both the background and object tile on one grid space to determine the actual collision on that position.

There are several corner cases at work, so please discuss before attempting this change.

@clintbellanger
Copy link
Owner Author

Also see related discussion on Issue #355

@clintbellanger
Copy link
Owner Author

Look at the wood cabins as example here. They take up a 2x3 tile area, but we only bother with 4 tiles sliced into vertical pieces.

The two back-most empty tiles are "part" of the cabin and should be solid.

I'm not sure how to handle this besides still having an explicit "blocking tile" object that can be placed on maps. In this case, would it be drawn in Tiled on the object layer? Then it wouldn't even be visible in that interface, as the taller tiles in front of it are covering it.

Explicitly drawing collision info is tedious, yes, but it does work. Hm.

@igorko
Copy link
Collaborator

igorko commented Aug 3, 2012

Well, do we need that? Even Tiled uses current behavior, and maps will be written in Tiled too.

@clintbellanger
Copy link
Owner Author

Well, this feature isn't strictly necessary. The thought is that having collision built into tiles makes mapmaking easier and reduces map errors.

But this isn't a high priority because I don't see an elegant way to implement this, especially for oversized tiles. The new tile drawing algorithm allows us to easily have large square tiles (e.g. 4x4 tile area) instead of always slicing those larger tiles.

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

No branches or pull requests

2 participants