Arcticus's Recent Forum Activity

  • For those that are interested, I got it working, however it didn't solve my problem so its back to the drawing board

  • So I'm trying out some arrays and I would really like to know how I would sort the following array

    array(family's Y co-ordinate, family's variable, UID if necessary)

    So far it's proving to be a killer, I've looked up some sorting algorithms but I'm not too savvy on a lot of the lingo they use to define them. The sorting algorithms that looked nice were, bubble, gnome and possibly insert, I'm not sure how they apply to multi-dimensional arrays though.

    I want the array to look something like this when it's sorted (leaving UID out for now):

    5, 0

    5, 1

    5, 3

    10, 0

    10, 6

    10, 8

    etc

    So primarily sorting by the Y co-ordinate ascending, but if any of the family have the same Y co-ordinate then sort by their private variable ascending

    Is this possible at the moment? I'm assuming its to do with a bunch of nested loops, but it's 3:20am and my brain has imploded

    Remember, I'm not that mathy, you'll have to translate into english for me

  • Don't worry guys, ITS EASY!!!!

    It only took me like .... a year

  • 1. I don't know why but the sorting is no longer working 100%. Maybe because I moved some events around, I don't know.

    The sorting seems to be working exactly how it normally does. The sorting code I came up with seems to have trouble when your player is sitting halfway between two blocks and when standing on the top corner of a box. I'm still not sure how to fix this.

    These iso demos are all looking awesome everyone!

    Any help on the sorting code would be greatly appreciated!

  • Here's my little Isometric attempt

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

    I've got some collisions going but they're not 100%

    I stole your movement code

    Coincidently, everything else wasn't copied, just happened to be incredibly similar to yours, even down to the tinting

  • I also got a more accurate ratio type thing

    Now my sorting code is:

    + System: For each Layers ordered by Layers.Bottom + Layers.Value('ZHeightBottom') + (Layers.Value('ZHeight') * (1 - (35.264 / 54.736))) Ascending

    -> Layers: Send to front

    For a 2:1 ratio like pixel art isometric, it would be:

    + System: For each ObjectName ordered by ObjectName.Bottom + ObjectName.Value('zBottom') + (Layers.Value('zTop') * (1 - (30 / 60))) Ascending

    -> ObjectName: Send to front

    The (1 - (30 / 60)) can just be replaced with 0.5, I just put it in there to show how it works.

    The difference between the two is that I'm trying out using a true isometric view angle.

    Still working on this overlap issue when standing between two blocks....

    Still hating this family bug....

    EDIT: Actually, with a bit of testing, this formula has a bit of overlap when walking on top of things hmmm......

    EDIT 2: Ironically, I'm using a different view angle to 2:1 iso, yet the 2:1 iso sorting formula works perfectly?!

  • It's pretty good hey!

    I've got my little iso demo to almost exactly where yours is.

    It's still not 100%, if you sit halfway between some blocks and raise the height, there's a bit of overlap

    Once I work out a few more things I -might- be able to fix that

    I've nearly got some crappy collisions done too, but I'm just using 8 direction behaviour lol

    Collisions should be reasonably easy for you, because you got the cool 4 directions going, I would just 'invert' the currently active movestate if overlapping an obstacle, assuming the zBottom and zHeight variables fall between the obstacle's respective variables too.

  • I'm not too sure, I'm gonna try and knock up a quick isometric demo and see if I can apply the same or similar code to it. In pixel art isometric though, instead of 0.53125, you would probably just use 0.5

    I also realised, I'm referencing from Layer.Bottom, it still works if you use Layer.Y there, in fact it doesn't seem to matter where I reference from, as long as EVERYTHING references from the same spot on the sprite

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Haha Deadeye

    Here's the updated link guys

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

    I realised the problem was that the sorting marker diamonds were moving down the Y axis as fast as the player was moving up the 'Z' axis. But in the perspective I'm using, the Y axis is 'squashed', so all I had to do was, instead of adding the ZHeight variable to the Y co-ordinate, I also had to multiply that ZHeight variable by the ratio of how much the Y axis is getting squashed if you get what I mean.

    I still don't HAVE the accurate ratio yet, gonna ring up my mathy brother, i've just put a little hack-fix in at the moment, but it still works fine.

    Oh also Deadeye could you explain how lucid's S plugin would hopefully fix this family thing? I actually think it's a problem in construct

  • 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?

Arcticus's avatar

Arcticus

Member since 23 Nov, 2007

None one is following Arcticus yet!

Trophy Case

Arcticus has no trophies yet!

How to earn trophies