2.5D platform

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Thu Jan 07, 2010 2:15 am

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...
B
4
S
1
G
5
Posts: 98
Reputation: 1,648

Post » Thu Jan 07, 2010 10:58 pm

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.
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Fri Jan 08, 2010 2:26 am


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
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Fri Jan 08, 2010 3:16 am

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:
[url:2ig8wuz3]http://dl.dropbox.com/u/1289341/REALTEST.cap[/url:2ig8wuz3]
(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
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Fri Jan 08, 2010 4:12 am

[quote="Arcticus":3gax2ed4]Ah here it is:
[url:3gax2ed4]http://dl.dropbox.com/u/1289341/REALTEST.cap[/url:3gax2ed4][/quote:3gax2ed4]

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.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Jan 08, 2010 5:40 am

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 ....
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Fri Jan 08, 2010 11:45 pm

[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

Edit:
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.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sat Jan 09, 2010 12:51 am

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 :(
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Sat Jan 09, 2010 2:00 am

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
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sat Jan 09, 2010 2:07 am

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*
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

PreviousNext

Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests