Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In U7, you can move among floors without the function "tranport" the player to another place, as for example the first ff ones.

enter image description here

How can it tell whenever the character is moving from floor z to floor z+1? (of course, it uses stairs, but what is the logic behind this?) How does pathfinding in those cases work?

share|improve this question
up vote 1 down vote accepted

The player location is stored using an array. Three variables are used as coordinates X,Y,Z.

The X,Y are the map coordinates, while the Z is the height.

In order for the game look 2.5d when its 2d the entire the lower floor (Z-1) map is moved and has the X and Y coordinates transformed (Y-1) && (X+1). Which creates a nice illusion of 3d background. It also makes changes to the general way the 2.5d coordinate system, I do not remember how did they.

The entire process of the illusion used in 2.5d games is explained in this post, it works really similar to the U7: Perspective projection with 90 degrees between X-Y axis?.

When a player uses stairs he is simply transported, his coordinates are changed and he is transported/teleported to the ground tile the stairs lead to the right. Generally it would work the following way [x+1][y+0][z+1]

It actually isn't pathfinding. It just moves you around the tiles just like teleporting would do. There is no need for a method to avoid obstactles unless you are making a movement method to the stairs~ itself:)

share|improve this answer
And by the way, how can you tell if there is floor above your head so you can remove that part of the building to allow full view of the characters? Every time the player moves have to check tiles in higher floors? – Wolfrevo Kcats Apr 30 '13 at 9:30

As far as I remember it, U7 had a very discrete sense of height. Each stair was +1 to height. If you stack potions, you could climb anything. From a height of 1, you could move to a square that was +/-1 from it, but not something that was +/-2.

It lends itself pretty naturally to pathfinding then, you just consider any node more than +/-1 unit of height away as blocked.

share|improve this answer
So, each time one character moves, it is necessary to check over which tile is standing? – Wolfrevo Kcats Mar 31 '13 at 17:44
If objects other than the player move (eg doors can open and close by NPC!), then you always have to check each time the character moves if the next desired position is allowed. From the standpoint of pathfinding, (when you double click a destination, or try to pick up an item that is inside a closed area or unreachable) you can determine the reachability by attempting to make a path to it. – bobobobo Mar 31 '13 at 17:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.