PDA

View Full Version : Big oops.......



Chesso
08-01-2007, 10:31 AM
I just realised something.....

I'm using an RPG type player sprite (45 degree angle thing) but the objects are drawn and treated as if it was a Top-Down game lmao.....

I like the character I have now, but doing the objects this way is now starting to see odd....

Ok so I could do it fully RPG looking sort of style.... then again, how on earth am I going to have him both walking infront of, and behind objects :|, and how would I stop him from doing both at the same time.......

My head hurts LOL.

jasonf
08-01-2007, 10:38 AM
You're talking about writing an isometric 3D engine?

How many times is that wheel going to get re-invented on this site? ;):lol:

Chesso
08-01-2007, 10:45 AM
mmm isometric is different I believe.

I'm talking average SNES rpg kind of way, not AOE II Isometric tiling :P.

As in I use square shapes that stay as squares not turn them into diamon shape and join them.

Well you know what I mean.

jasonf
08-01-2007, 11:02 AM
I see what you mean. Just your sprites have 45 degree animations.
No problem.

The problem of walking in front of some objects and behind others can be sorted by Z-Order.

Basically, make sure you draw objects which are behind the sprite first, then the sprite, then the objects which are in front.

Chesso
08-01-2007, 11:06 AM
Oh no, that's not a problem.

It's the problem of walking infront of and behind the one and same object depending on whether the player is coming from the which direction.

Well just think of a rock in that style, you need to walk behind and infront of it.

In RPG style, it *appears* to have real bottom (well think of the area of the base of the bottom of the object) if the player is a bit higher, then he'll go behind, if lower, he'll go infront.

But I may actually be able to get away with bomberman style :P, as he only walks infront of things, not behind them (except for enemies, so still a bit hmm on that one).

JernejL
08-01-2007, 12:48 PM
Ok so I could do it fully RPG looking sort of style.... then again, how on earth am I going to have him both walking infront of, and behind objects :|, and how would I stop him from doing both at the same time.......

My head hurts LOL.

you mean the perspective or depth? if you mean depth then you just sort the sprites by distance from camera.

Chesso
08-01-2007, 12:53 PM
Depends on what you mean by a camera lol this only 2D :P.

I'd hate to be playing with collisions and such with 3D ouch.

Huehnerschaender
08-01-2007, 02:30 PM
Hmmm... I hope I understand you right.

each object should have a collisionshape. I think in most cases a rectangle or circle is enough.

When you test your player if he collides with an object, test his feet area only to see if his feet are colliding with the object. If the feet are above the collision shape of the tested object, draw the object in front of the player. If the players feet are below, the player is in front of the object.

So basically, the collisionshape of each object is half the height of the objects bitmap itself when view from an 45¬? angle.

Hope you understand what I mean. Don't test the whole player, just his lower part, depending on your view. A screenshot would be nice to help you detailed....

Greetings,
Dirk

DraculaLin
08-01-2007, 06:34 PM
It's too bad,why you always want to modify the 'BoundsRect' ?
You don't consider test tile,dummy tile...etc.

But here a sample perfect to solve the problem.
This way is also easy,simple than modify BoundsRect.
http://www.afterwarp.net/forum/attachment.php?attachmentid=494&d=1145473991

It use Asphyre but the sprite engine is the same as DelphiX.

Chesso
09-01-2007, 02:57 AM
I devised myself an even simpler solution, and after having a little play with AOEIII it just popped into my head....


If Not (Y + 5 >= Sprite.Y) Then
Begin
// Do our normal collision checking.
End;

// Check if any objective(s) have been met.
If (........


So the top part basically tells it to ignore 5 pixels below the sprites top position, which happens to be head.

Seems to work perfectly atm.

If I do end up having some type(s) of enemies in the game, I'm not sure how I will handle walking behind them (and always changing the Z value) but I should be able to figure something out (have a couple of ideas).

Chesso
09-01-2007, 03:07 AM
Haha oops again, spoke way too soon.

That will not work quite so well on different sized objects :P.

Guess I better figure something else out lol.