Page 3 of 6

Re: 2.5D platform

PostPosted: Thu Jan 07, 2010 2:15 am
by kaos
Its coming along nicely, especially considering I didnt get stuck this time :P
However, walking too far up causes you to fall. Perhaps make it so you collide with some invisi-wall or something...

Re: 2.5D platform

PostPosted: Thu Jan 07, 2010 10:58 pm
by Arcticus
Hey Madster
Lookin pretty slick! Have you seen my attempt at 2.5D? If you want I could find the dropbox link I have for it, it -is- however, still on the forums somewhere
Its relatively ancient by now and I haven't been able to do much on it lately. It's not a plugin or anythin. I've got most things sorted cept for a strange bug with disabling physics collisions allowing the player to walk through walls. The only other problem is the dreaded sorting with height. I CANNOT get past that, my brain just won't handle it.
I've looked at like developer's logs on isometric games and even they say it's a killer and they used a cop out solution here and there :( saddening. It's like there's an isometric sorting secret that some games have figured out, and aren't telling anyone about.

Re: 2.5D platform

PostPosted: Fri Jan 08, 2010 2:26 am
by QuaziGNRLnose

i thought of this method, but don't have it in any practical form yet. basically you factor in y and fake object height (w here?), and compare the objects distance from the camera "plane", then you just sort through closest to farthest or vice versa. no idea how well it works, but its unorthodox so you might not of though of it

Re: 2.5D platform

PostPosted: Fri Jan 08, 2010 3:16 am
by Arcticus
I think I tried something like that on my one. It kinda worked, but there were still really weird sorting errors, at least on mine, not sure about Madsters. Not telling him not to try though!!

I'm thinking it didn't work on mine because, while I have a variable stating the 'fake height' of the BOTTOM edge of the objects, I never could figure out a good way to tie in the variable that I use to show the TOP edge of each object as well. Surely you guys have seen my example? I'll try and find my link just in case some of my code can help in any way.
Ah here it is:
(sorry I don't think it's very commented :? )
I was trying a different idea for sorting in that cap, the original sorting that I fall back to when my ideas fail is in there too, just toggled off

Re: 2.5D platform

PostPosted: Fri Jan 08, 2010 4:12 am
by deadeye
[quote="Arcticus":3gax2ed4]Ah here it is:

Ah... there it is, all right. Brings back memories. The graphics are different but it's still the same confusing bastard :P. Hope you don't mind if I stay out this round, I've torn my hair out enough over that one as it is :lol:

BTW for anyone testing it out in 99.72, it's got old physics so you'll have to click on all the objects to get the collisions to work.

Re: 2.5D platform

PostPosted: Fri Jan 08, 2010 5:40 am
by Arcticus
Confusing bastard is an understatement. Oops about the physics, I didn't even think of that!
You're welcome to not help out on this anytime! lol
I would even get those moments where you've just gone to bed, about to fall asleep, then this idea HITS you and you run back to the computer to try it out ...only for it to fail

I always thought a loop that sorted by .y AND 'fake height' (kinda like how in databases how you can sort by two criteria) would do it, but I'm not 100% clever on that stuff and haven't been able to try it out to see if it would even work due to lack of knowledge on how to code such a thing. Cause right now, just plain sorting by .y works fine IF you don't want height ....

Re: 2.5D platform

PostPosted: Fri Jan 08, 2010 11:45 pm
by madster
[quote="Arcticus":2zlt77pk]I always thought a loop that sorted by .y AND 'fake height' would do it[/quote:2zlt77pk]

I tried sorting by .y + fake height multiplied by an adjustment constant, and it didn't work.
Reading around I found out too that perspective 2D games are a kind of black art.

My status so far: game sorts perfectly if everything is resting on the floor
I found out that the sorting problems are related to object size. If all objects are the same size (as with isometric tiles) sorting by .y is enough to get it right, always.
So... I might end up doing that. I still haven't tried it out.
I do not use the physics plugin, as my method works a lot with collision masks to simplify the object creation process (they're single sprites with a special collision mask).

I remember checking that example out, but the amount of objects and stuff kinda confuses me XD

Quazi: I tried measuring distance and it didn't work either. The issue is size.
In your diagram, think of 1 as really flat and horizontally long, and then put it very close to 2 and 3. Now measure the distances... you have to pick a point to measure the distance. You'll find out that depending on the point you pick to measure, the closest object can be 1, 2 or 3. :S

Kaos: yeah heheh no bounds... I guess I could set up a rect to stay in, as most games will use something like that. Also I'm thinking about setting a floor, specialy if one ends up using regular tiles, so you can cheat with the floor and avoid placing a jillion tiles there.

Re: 2.5D platform

PostPosted: Sat Jan 09, 2010 12:51 am
by Arcticus
Yeah I came to the same conclusion, if there was no height, easy sorting. Even with larger objects. The only reason I'm using physics is to get a control feel similar to that of an old game called, 'Infantry' if you dunno what that is, the same engine is used in Subspace and Chaotic Rift or whatever it's called.
I also thought that I -could- try and sorting event for EVERY SINGLE object in the game, but I tried to avoid even trying out that solution like it was the plague. I was aiming for a family based loop or nested loop that somehow sorted everything lol

Why is this so difficult? wah :(

Re: 2.5D platform

PostPosted: Sat Jan 09, 2010 2:00 am
by deadeye
Oh Jesus I gotta stop clicking on this thread.

I start thinking "hey I could try thi-" and I have to stop myself before the thought even fully forms. I just know that I'll end up trying to figure out this goddamned sorting thing again and I'll be up until 5am every night tearing my goddamned eyes out because it should be easy to do but it's NOT, IT'S THE MOST #$*&# DIFFICULT THING IN THE WORLD WHY WHY WHY :cry:

Arcticus, you evil bastard :P

Re: 2.5D platform

PostPosted: Sat Jan 09, 2010 2:07 am
by Arcticus
Hahaha I'm sorry!
Stupid 2.5d/isometric games looking so cool but being so uncreatable! :(
I'm determined to try and beat this though. I'm thinking of trying that whole 'if statement within an expression' type thing.
If only there was a oldschool software developer lurking on the forums somewhere that knew isometric code like the back of his hand.... *tries to lure oldschool software developer out of hiding*