Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Limitations of fake elevation #1910

wjt started this conversation in General
Discussion options

Currently Threadbare does not have any real concept of height. Apparently-elevated sections of levels like this:

image

are in fact flat tiles that have collision shapes that prevent walking through them:

image

(Actually we can see from the collision debug info that the middle 2 tiles are the wrong ones. They should have collision shapes only at the edges.)

Periodically we run into the limitations of doing this. For some examples:

  • @manuq tested whether it is possible to grapple up or down a cliff. No – Prototype: Grapple to climb #1904 – and without having a third dimension it is not possible to both grapple up/down cliffs, and also have puzzles which require hooking a needle to get round a cliff corner.
    • This also means we can only grapple across water if the two sides are at ground level. If the two sides have cliff edges between them: no dice.
  • If ink-drinkers are on top of a cliff, they have to be very carefully positioned so that the spawn point for their projectiles is off the cliff. Otherwise the projectile gets stuck on top of the cliff. Occasionally you can see this in some of the levels in the game.
  • You cannot walk behind raised areas. In the screenshots above, you should conceptually be able to walk behind the top row of cliff tiles, but you cannot.
  • It is not possible to have a bridge that you can both walk under, and walk across:
    image
    because:
    • Visually, the bridge has to be on a higher z-index for the player to walk under it, but once you have done this (and adjusted the cliffs and other level-1 tiles accordingly) the player is now underneath them.
      image
    • Ignoring the visuals, there is nothing in the physics to stop the player walking down under the bridge, then right to walk off the right edge of the bridge
  • And surely other problems not yet enumerated here

These problems are not insurmountable. One approach people take is to have different physics layers for walls at different elevations; then they move the player in and out of those layers as they move up and down. Or you can enable and disable collisions on different tilesets based on the player's layer.

Any approach to adding/faking a third dimension in a 2D game adds complexity to the code & more importantly complexity for the level designer. So far we have chosen the path of less complexity, sacrificing the things above.

The question to discuss is, is this the right trade-off? (One example: Minit, which has a couple of special-cases for ladders but otherwise has the same simplification: the world is flat, even if it looks like it's not.)

You must be logged in to vote

Replies: 1 comment

Comment options

I'll be adding here what I see in existing similar games for reference.

Stardew Valley: elevation is like ours: a visual aesthetic feature + collisions. Rather than a functional, multi-layered pseudo-3D mechanic. The game actually operates on a flat grid. There are areas initially disconnected by high elevation. The player can't be partially seen behind an elevation. Effects like rain or shadows are an overlay and work regardless of the elevation.

The Legend of Zelda: A Link to the Past: . There are bridges that can both be walked under and walked across (the problem depicted above is solved). Link can fall from an upper level to a lower level. While falling, player input is disabled. Also Link can change from a lower level to an upper level by climbing a ladder. While climbing the ladder, the player input is disabled. Levels do not necessarily match with tilemap layers (a bit confusing). Also some tiles in the same layer can be drawn above the sprites and some can be drawn below them (this is how Link can partially go behind the house at the beginning). This can be seen in an emulator by turning layers on/off (the SNES had 4 tilemap layers + one sprite layer). Also note that the perspective of this game is a bit weird: all 4 sides of a cliff or wall are facing the camera.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /