Trouble with pseudo Z axis

For questions about using Classic.

Post » Fri Oct 03, 2008 12:14 am

I'm trying that method now, I still can't quite get it right though
I'm about to try a differiing variable system though, cause at the moment, the player's ZHeight variable is at the level of the player's 'feet' whereas the terrain's ZHeight is the top of the obstacle, so I'm about to try using one variable for the bottom of the player, and one for the top, and see if i get any better results
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Fri Oct 03, 2008 12:40 am

Okay, so I was getting ready to test out some stuff in your cap and I moved some boxes around to make it easier to jump onto the big box. I found a little bug...



If you jump onto the big box, and then walk over the edge to drop onto the small box, he doesn't drop. He just floats in midair until the detector is clear of all the box colliiders.

Anyway, I haven't really started tinkering with the Z sort issues yet, I'll let you know if I have any success.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Oct 03, 2008 3:22 am

I just can't wrap my head around this problem. I've been trying for a few hours now and I just can't seem to get it working at all. The closest I got looked okay until you walked off the far side of a box, but the player would still be in front of the box until it hit the floor.

I'm sorry man. I gave it my best shot, but if I spend any more time on this I'll go completely insane. Good luck though. I hope someone else can help you out better than I can.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Oct 03, 2008 4:09 am

Heheh thanks for trying anyways deadeye, you're a legend, at least you helped with the collisions and found a bug i gotta work on ;)
Still if anyone has any idea how to get the Sprite layering to work, TELL ME :D
I can KINDA get it with the way Ash suggested, but it needs tweaking
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Fri Oct 03, 2008 10:05 pm

the trick for your zbuf problem is comparing the y coordinates of the boxes on their respective zhieght(from their base)then comparing the height of the stacked boxes and performing the layering from the bottom up(in z height) doing your zbuf for the base first, then for the progressively higher layers

im not sure excactly how to do this, but im working on it atm
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Fri Oct 03, 2008 10:21 pm

well it works, but i found a prob with it which im trying to fix, things on the ground layer can never be infront of things on the high layer so a tall object will get clipped, the only other way i could forsee this being fixed is by having a for each by sprite y for each ground level box, and then using subevents to sort through each of the ground level sprite's z children, from the bottom up, there for making the base of these z heights the bottom of the stack catch mah drift?
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Sat Oct 04, 2008 12:15 am

I sort of get what you mean, it's similar to the method i'm trying at the moment, which is basically a nested loop:
for "layers" from 0 to 128 (or maximum Height)
---For each terrain
------If private value ZHeight = loop index of "Layers" --- bring to front

but i think with tall/floating objects i will run into the same problem you have
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Sat Oct 04, 2008 9:22 am

Another problem someone might be able to help me with is the 'Pick by largest private variable' thing.

Here's the cap of my game so far, if you press V it'll go into like a debug mode (which i haven't made a toggle sorry lol) anyway when you mouse over the red things, if you hover over more than one it's supposed to choose the one with the highest ZHeight variable, and it's coded to do so, yet it only picks the highest one on some of them, others it won't choose the highest one until it's the only one being overlapped
[url:l36klm4g]http://www.mediafire.com/?wjduyyurz2m[/url:l36klm4g]

annoying

i made a quick example using the EXACT same code and it worked fine, i put it in here and it doesn't work, i dunno why
[url:l36klm4g]http://www.mediafire.com/?tdtwodmmntu[/url:l36klm4g]
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Sat Oct 04, 2008 12:36 pm

Sorry bout all the posts, but I figured out why it's not working, the pick by largest variable wasn't doing ANYTHING when in the same event as an 'is overlapping' event, you don't even need it there, the program was using UID's by the looks of it to determine which object's height had priority
So i fixed the problem, just make the high terrain first, smaller bits last
But really, if there's a 'pick by highest variable' event in an 'is overlapping' event, shouldn't the variable override the UID?

...and now i'm back to the sprite ordering problem again...
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Wed Oct 08, 2008 1:37 pm

Sorry, i know it isn't really forum ettiquette to post four times in a row, but i still really need help with this :(
So far the best results i've got have been with:

For each Blue ordered by Blue.Y + Blue.Value('ZHeightBottom') ascending

which gets the X,Y layering working great, as long as i don't stand on anything :P
if there is any way of combining that above code with this code:

For each Blue ordered by Blue.Value('ZHeightBottom') ascending

which gets the 'Z' layering working great

Because both effects are what i want, but i want them at the same time, for now i only know how to apply them separately
i'm desparate! this is like the last (maybe second last...) bug for me to iron out in my engine so i can start on concept, art and story
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

PreviousNext

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests