adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Adonthell-devel] More on z-values (was: first real map gfx)


From: cirrus
Subject: Re: [Adonthell-devel] More on z-values (was: first real map gfx)
Date: Fri, 15 Mar 2002 16:16:50 +0000

Alexandre Courbot wrote:
> 
> > The more I think about it, the more useful the z value gets. Actually,
> > there would be two distinct z values. The distance of an object from the
> > ground (let's call it 'z') and an object's height, i.e. how tall it is.
> > (let's call that 'level').
> 
> I came to about the same conclusion this morning - this will of course
> complicate things a little bit - but just a little bit, actually.
> Imagine the CPU power we use with the map engine movments currently -
> it's nothing compared to a platform game, for example.
> 
> All your post makes sense to me, actually. What would eventually happen
> is that a character could climb on crates and furnitures that are not
> too tall for him. Actually, while thinking more about the map rendering,
> I realized we'd need a Z offset. At first I only wanted to apply it to
> the different map levels, but in this case, why not applying it to
> classic map objects and characters as well? Anyway, if you want a
> character to be able to fall, you need to know his Z position too.
> 
> Another advantage of the tall parameter is that, too tall characters
> couldn't enter a door that is too small for them. Unless, of course,
> they crouch ;) (more work for our gfx guys? ^_^)
> 
> I also came to the conclusion that the water effet would be impossible
> (AFAIK) without any Z offset. Not that a Z offset will make it a piece
> of cake, though. You'd still need to draw the water in two parts, in
> this order:
> -the water that is behind the character's knees,
> -the character himself,
> -the water that is in front of the character's knees.
> 
> As the water is translucent, you can't allow yourself to draw the bottom
> part two times.
> 
> So the map renderer will have to figure out that a character is on the
> water tile, to cut it in two (or more if more than one characters are in
> the water) tiles. Honnestly, this won't be the hardest part, and I'd say
> I already know how to do it (but don't trust such fresh illusions too
> much! ;))
> 
> All in all, I like the idea very much. Let's do it. I stabilize the
> current map stuff and will continue my efforts to get it to work under
> Windows. Then the next item on my TODO list is to get this Z thing to
> work.
> 
> Will Adonthell turn into a platform game, too? ;)
> Alex.


I like this too!
So let me get this straight - a mapobject or character can have a
Z-offset, which is how many pixles he/she/it is off the ground.
Optionally objects can have a height which is how thick they are - a
table might be 28px but a layer of water or a carpet would just be 0. Is
that right?

If so what happens to the old walkability system? I guess non-walkable
tiles or masks would behave like objects of infinite height from the
ground upwards (z=0; h=infinite). This would probably be useful for
walls inside houses where we want to make sure the player has no way to
accidentally jump over them.

There is one complication I can see with the z stuff though - it gets
messy when you want to have the ground at different levels. I've
attached an image to clarify what I mean.

Imagine the lowest floor on the pic is the ground (ie: z = 0). Now say
the next light grey ground is 40px up - therefore the dark grey vertical
surface must be 40px high (this pic's probably not to scale!). What
happens when I want to put something on that floor? I'd have to place it
on te ground level "under" where I want it and give it a z offset of 40
so it appears lying on the upper floor. Now do that for the 4th floor
everything needs a 160px offset and on the screen is placed 160px below
where it will appear. You can easily see this could get very confusing
for the map designers. Imagine doing it on the top of a moutain!
I think we need a seperate z/height system for the ground and objects
values would then be relative to the ground beneath them (and could
therefore always be saved inside the mapobject which would make
mapbuilding easier). The trouble is that z offsets would be akward -
designers will always need to worry how high up their ground is supposed
to be. It's easier to think your ground is level 0 no matter whether
it's the top of a mountain or the bottom of the ocean. Perhaps we could
devise a system whereby the ground is always level 0 but you can mark
areas as being vertical and having a certain height - then the dark grey
areas in the pic would be marked as vertical with a height of 40px (in
fact specifying height shouldn't be necessary as it's just the height of
the vertical area on the screen) and everything else is assumed to be
ground. That makes placing objects on the map nice and easy - imagine a
mapedit where you can jst drag objects where you want them with the
mouse (hint hint :P) - but also lets the player 'fall' from level to the
next if he walks over the edge.

                -James
-- 
   ___    ___  ___       ___ 
  /    / /__/ /__/ /  / /__                 Reg. Linux User #148821
 /___ / / \  / \  /__/ ___/@linuxgames.com  www.twiddles.com
                                            adonthell.linuxgames.com

JPEG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]