Arcticus's Forum Posts

  • I'd just like to inform you all that ...... I SOLVED IT!!!!!!

    I've still gotta tweak a few things mathematically till its as accurate as I would like, but it works EFFING BRILLIANTLY

    Edit: However I have not been able to fix the family 'bug' when trying to sort a family of different objects

  • Here's the link

    http://dl.dropbox.com/u/1289341/REALTEST.cap

    It's the same link as the older ones, i just keep updating it.

    deadeye, thanks for the effort and welcome back to this terrible problem I'm also making all the heights multiples of 32 and what you described it's pretty much what I'm already doing.

    And since the boxes seemed to be sorting fine, I tried out what would happen if I could control one, just too see how well the sorting works. and it's still not 100% perfect, there's still a little bit of clipping when i jumped directly behind a box, so I'll need to tweak the formula a little. In terms of level layout though, the way it is, it looks pretty good.

    I still think its probably a family thing that's making it so other objects don't sort

  • I cleaned it up a little further now, I made a little debug mode where you can see what's going on if you hold down C, just so its not so messy to look at.

    Anyway, small breakthrough. It would seem, no matter HOW i organise the box objects, they seem to get sorted CORRECTLY!!!! Yet anything else in the same family does not, in fact, in the case of the player jumping whilst behind a box, he will appear behind it on the way up, and in front of it on the way down?!

    Which leads me to believe that it could possibly be something wrong with the way families are handled in 'for each (ordered)' loops. Any opinions devs?

    TLDR version: The boxes are sorting perfectly, other things in the same family aren't. Possible family bug?

  • Ok so I realised some of that code was redundant

    The new current sorting loop is this:

    + System: For each Layers ordered by Layers.Bottom + Layers.Value('ZHeightBottom') + Layers.Value('ZHeight') Ascending

    -> Layers: Send to front

    I updated the link and cleaned up some code

    Now this SHOULD work!!!! (Ironically, it's a better implementation of the code one of the devs originally gave me months ago that I thought wouldn't work)

    I've put little diamonds attached to each sprite that shows 'where' in the sorting each object is, and by looking at it, you know it should work but for some weird reason its not

    Why do the diamond sprites line up exactly right but the sorting doesn't, when its the EXACT same code?!!?

  • Here's an updated link (well actually it's the same one with updated cap )

    http://dl.dropbox.com/u/1289341/REALTEST.cap

    I've got little diamond sprites representing the Y co-ordinate where each object SHOULD be sorted. I've used the same maths in a for each ordered loop that sorts all the objects. In my eyes, the math works out and it SHOULD work but dammit, it ain't. here's the sorting event in case you need it:

    + System: For each Layers ordered by ((Layers.Bottom - (Layers.Value('ZHeight') - Layers.Value('ZHeightBottom'))) + Layers.Value('ZHeight')) + Layers.Value('ZHeight') Ascending

    -> Layers: Send to front

    I'll attempt to translate that into english, basically, assuming each object is a '3 dimensional' cube, it takes the front-bottom edge of the sprite, finds the front-top edge of the sprite, adds the distance from the top to ground level, then adds that value again. Basically, I made a 2d side on version of this and it works perfectly.

    This does not work and i believe it should, i am THIS close to solving this lol! but I need some help plz

  • Hey chiptunes are the newest craze

    EDIT: For some reason I read that as you didn't like my tune cause it was retro! I should have got more sleep...

  • Construct theme ey?

    Something like this?

    http://dl.dropbox.com/u/1289341/ConsTheme.mp3

  • But I have X, Y and a fake Z axis. Every object has variables that determine it's top and bottom edge which determines it's height, the width is already there, I was just sayin my objects don't have a depth variable. When I say depth I meant, for example, the distance between the front bottom edge to the rear bottom edge. I don't have that variable cause I didn't see a huge need for it as I have invisible colliders underneath everything anyway.

  • Mine have height and width, just not depth..... would that really affect the sorting though?

  • Thanks heaps for filling me in, however it's not working properly :S

    Is it ascending or descending? Neither really work for me lol

    when you say 3dheight and tallness, is the 3dheight how far it 'bottom side' is off the ground or how far the 'top side' of the object is from the ground? I'm assuming tallness means bottom edge to top edge.

    I'm using nothing but cube shaped objects at the moment and it really isn't looking good lol

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Is that for slopes? It looks like slopes to me. Thanks a lot for the explanation though, I probably really need it. I'm sorry though, I meant could you explain the expression you used for your sorting, I tried doing it myself but I don't think i understood entirely what you were doing.

    Are you comparing it to like a 'plane' where the camera is or are you comparing it to 0 on the Y axis?

    When you said point of origin, what does that refer to? Sorry I'm so dense, I suck at maths lol

    I would really love to know how to fix this sorting problem. thanks heaps

  • As I'm not quite that good at maths, I'm not sure how to calculate the distance in the way you mentioned...

    Do you think you could enlighten me a little? It should still work fine as the sorting and physics movement are completely separate really, although the angle I'd be using is 35.264

  • Yes please please please tell me how you did it

  • hey that's pretty good, I gotta find out how you did those slopes too

    What exactly are you doing in terms of sorting? I didn't quite understand entirely, hopefully what you did will work on my one. I'm about to try another method right now actually, just as an idea I had, probably won't work like all the other ideas lol

  • Yeah without the 'Z' axis, sorting is cake. It just goes to the whole other side of the difficulty spectrum when you wanna add the 'Z'

    You may have noticed, with height, I found it a lot easier to have one variable for the 'bottom' edge and another for the 'top' edge of the sprite just to make comparisions one hell of a lot easier. Plus you can use them to tell if something is standing on top of something else etc. I STILL can't however work out an equation that takes into account the actualy Y axis and the two Height variables that sorts them. That picture at the start of this thread was the only one I've thought of so far that had all three elements, if only it wasn't wrong...

    Double sad, I need more brains.