2.5D implementation

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: 2.5D implementation

Post by Robin »

Jasoco wrote:At the risk of being stupid and an idiot because it goes against every 3d game ever made, but I always prefer to refer to X and Y as being the floor and Z being the height of the room. It always seemed weird to have Z be north and south and Y being above and below. Just seems stupid and I blame iD Software even though they probably didn't come up with it, but I need a scapegoat to blame and they were the first to come to mind. i.e., the ground in that game would be X and Y and the Z would be the characters jumping or on stairs position above the ground level.

So basically, in my adventure game engine, X and Y are the left, right, up and down of my map and "elevation" is the Z coordinate for when placing scenery or having a flying enemy. Makes much more sense this way to me and doesn't require me to edit my project to replace all the Y's with Z's.
I think your way of doing things is intuitive in your Adventure engine, since it's mostly top-down. For almost-side scrollers, Z for depth make more sense, since Y is closely related to height there.
Jasoco wrote:Also, Robin, your new code seems to work just as well too. Using it for now unless I hit the same bug I had before. Hopefully it works perfect because I like how much less space it takes.
:3
Help us help you: attach a .love.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: 2.5D implementation

Post by bartbes »

If my memory serves me, mathematically y is up/down (as in height), and because of games people started using z for height (because maps were drawn top-down, and when later drawn 'from the ground', the axes are positioned differently).
User avatar
Jasoco
Inner party member
Posts: 3727
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: 2.5D implementation

Post by Jasoco »

Robin wrote:
Jasoco wrote:At the risk of being stupid and an idiot because it goes against every 3d game ever made, but I always prefer to refer to X and Y as being the floor and Z being the height of the room. It always seemed weird to have Z be north and south and Y being above and below. Just seems stupid and I blame iD Software even though they probably didn't come up with it, but I need a scapegoat to blame and they were the first to come to mind. i.e., the ground in that game would be X and Y and the Z would be the characters jumping or on stairs position above the ground level.

So basically, in my adventure game engine, X and Y are the left, right, up and down of my map and "elevation" is the Z coordinate for when placing scenery or having a flying enemy. Makes much more sense this way to me and doesn't require me to edit my project to replace all the Y's with Z's.
I think your way of doing things is intuitive in your Adventure engine, since it's mostly top-down. For almost-side scrollers, Z for depth make more sense, since Y is closely related to height there.
I'm talking more along the lines of games like DOOM. For some reason X is east and west and Z is north and south and Y is up and down. Makes no sense in that game, but that's how they refer to it. And it's not even like Z simply means depth, since as soon as you aren't facing North, Z is no longer in front of you.

On a straight side-scroller where it only goes left and right and up and down, Z would be for objects layered on the screen. (Hence Z-order.) From far in the distance to right in front of the camera. See also: Parallax layers.

I guess for a game like the one in the OP either way could work. The way I'd do it is X and Y for ground and Z for height off the ground.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: 2.5D implementation

Post by TechnoCat »

X and Y create a plane on the blackboard. The Z-axis comes straight in and out of the blackboard's surface.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests