Object display order? (SOLVED)

Started by suicidal pencil, Thu 04/03/2010 06:12:17

Previous topic - Next topic

suicidal pencil

This problem kept popping up, but I could ignore it until I did the background with an object. Basically, it seems that object[a], when it is clipping of object[c], and when object[a] has a higher y value than object[c], with object[a]'s y value being higher by approx. 2/3 to 1/2 of object[a]'s y value, object[a] will clip behind object[c], no matter what object numbers they are.

It's also constant for all objects.

Here's a few examples:



This object is serving as an animated background with 78 frames. No matter what speed I put it to, it cuts the animation, and displays the first frame and doesn't change. Look where the red arrow is pointing to see it better :P



Here's one shot of one object above another.



Now here it switched up

I've looked everywhere in the help and forums, and there doesn't seem to be anything regarding this.

SSH

Objects are always drawn in their Y order, unless you deliberately change the baseline to a different value. Or you can use the "z" parameter for height: it draws the object at y+z but the baseline remains at y.

If you have something that will ALWAYS be on top, you can use a GUI for it instead.
12

suicidal pencil

Quote from: SSH on Thu 04/03/2010 06:33:02
...change the baseline to a different value....

Tried that already, it didn't solve it..

...objects do not have a z parameter, or if it is, it's not listed.

Gilbert

If you put the baseline of the plane sprite low (i.e. higher in value) enough it will be drawn in front of the coin(?).

About the animating "background" object, where do you put the code for animating it? You may have put in in say, repeatedly_execute[_always](), so that the animation is reset every frame and have only the first frame displayed. Instead, start the animation in the "enter room" event and set it to loop endlessly.

suicidal pencil

Quote from: Gilbet V7000a on Thu 04/03/2010 10:39:10

About the animating "background" object, where do you put the code for animating it?

The code is in the room_Load() function, and is set to loop without blocking

And, no matter where the baseline is put, it's always the same thing, no change in behavior

Matti

Have you set BaselineOverridden to true? Then you can set the baselines of the objects who will always be in the back to 1, the objects in front of it to 2 etc. That should definitely work.

suicidal pencil

I've scrapped the animating object as a background. It was really eating at the FPS.

QuoteHave you set BaselineOverridden to true?

I've looked everywhere for that, and can not find it. v3.1.2 SP1, by the way

Pumaman

I'm not really clear exactly what each object is set to and what the problem is.

Objects are drawn from top to bottom in Baseline order; if an object has no explicit baseline defined, its Y co-ordinate is used instead.

BaselineOverriden is a property in the editor that sets whether you are overriding an object's Y co-ordinate with an explicit baseline. At runtime this is represented by the object's Baseline property being 0.

suicidal pencil

The baselines for the objects are never set. The problem comes when the player controlled object (the black MiG-28) is "flying" over the other objects. All objects are supposed to be drawn underneath the player object, but when an object passes a certain point relative to the player object (it looks like when the bottom edge of the non-player object passes the bottom edge of the player object), the non player object will be displayed on top of the player object.

It does not hurt game play in any way, but it looks very sloppy and breaks the immersion.

aedwards00

Select the player controlled object, then in the properties window in the bottom right of AGS set "baseline overridden" to true. Then in the baseline box choose a baseline which is for example the bottom pixel of the game window (599 in an 800x600 game as an example). This should ensure that the player controlled object is drawn over the top of any other object in the game window. That is, if i understand the problem correctly.

Dualnames

Objects can be placed in Z order by using their baseline property. The bigger the baseline is, the object will appear in front of everything.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

suicidal pencil

#11
ahh, so that's why I couldn't find it; it's in the properties window (which I never use...). I thought it was accessed through the script  ::). Works like it's supposed to know, thanks.

now to figure out how to make that background animate without loss of FPS...reduced to 14 frames, but almost every pixel not covered by an object is being updated

edit: I fixed the background animation being clipped. The animating background is actually a 800x600 object being animated, but the room background is the same image as the first frame in the animation, and the object Y was off

SMF spam blocked by CleanTalk