I'm back! I've done lots of studying stuff I had to do, so I'm mostly free again and I'm starting working on the game again.
I've managed to improve the graphics a lot for a last few weeks and I'll show a screenshot once I polish everything. It's a pretty big step forward!
Let's talk about tiles and 3/4 perspective though. This is a problem which haunted me for a long time...
As I've said previously, there are two ways I could store tile info:
"3d" approach was the thing I've experimented with. I could set x, y and z coordinates for each tile to be able to handle different heights easily.
While the "3d" approach makes sense, it's pretty hard to work with, because it's very hard to place tiles and think about all the different heights. It totally makes sense in isometric games. 3/4? Not much.
My game isn't going to be very "height based" after all. 3/4 perspective is not very suitable for such gameplay.
There are number of things I want to discuss with everyone because there are lots of ways to manage height in 3/4 perspective and some downsides to a method I'm going to implement (maybe someone will give me some good ideas!)
Suppose I have a tile map like this:
It's possible to walk under the bridge and on the bridge. There can also be a situation like this:
So, there's a need to establish proper drawing order of tiles and objects. Right now I can think of a simple solution: entities and tiles will have z coordinate. For example if the entity is standing on the grass, its z is 0 and if it's higher, it's z = 1 (or more).
Tiles in the red rectangle will have z = 1:
Here's how renderer will draw stuff:
draw tiles with z = 0
draw entities with z = 0
draw tiles with z = 1
draw entities with z = 1
etc...
This is probably how most SNES games did it. Here's a screenshot from The Legend of Zelda: A Link to The Past where layers are clearly visible!
And this approach works okay in most of the cases... unless there are characters which are more than two tiles high (or some animations like the one on the previous screenshot). They'll be drawn incorrectly, for example in situations like this:
I don't have a solution to this problem and unless I came up with something, I'll just prevent these situations from happening by not placing entities at such places.
And now for collision. It may vary from one z level to another. For example, for entities which have z = 0 it'll look like this:
(If tile is unmarked, it means that it's walkable, if it's marked by X, it means that tile is completely unwalkable)
When the player starts to climb the ladder, entity's z changes from 0 to 1 and another collision rules work for it, they look like this:
Here arrows show directions in which entity can move while standing on the tile. Red lines show "walls" with which entity will collide, so it'll work as needed. (I've got this idea from various posts on RPG Maker forums, he-he)
So, maybe there are other ways to do similar stuff? Or is my way of doing things alright? What do you think?