2.5D platform

This forum is currently in read-only mode.
  • Madster:

    This is really an impressive development for Construct. Even your quickly sketched prototype is really inspiring. I wish you all speed in completing this endeavor.

    Now, to make things even more complicated: Could "depth" be simulated by a combination of drawing smaller platforms, (in the distance), complete with a kind of haze or fog to simulate depth of field and by assigning 3 of the move directions, (the ones that move the player "into" the scene), to player animations that scale down in size, (the player gets smaller as he moves "into" the scene)?

    Just thinking too much.

    Psmith

  • hey thanks! I like encouragement :3

    I'll break it down:

    • drawing smaller platforms (in the distance) / player gets smaller as he moves "into" the scene: There's an issue with this. If platforms get smaller as they move away, they'll grow further apart. So I'd have to take perspective into account, adjusting their position. But if I'm doing perspective, I'd also need to be aware of camera position so everything gets adjusted correctly.... so while it could be done, I'm not looking into it right now. Resizing stuff works perfectly though, so no problem there. I even considered allowing rotation of the scene, but the platforms themselves cannot rotate as they are flat sprites, so you would probably fall off them while standing still, which would be awkward.
    • haze or fog to simulate depth of field: Using an effect, this would be done with a single action. You could even go all the way and use my Blur Motion effect and do actual field of view, though it would still be flat so wide platforms would have to be avoided.
    • assigning keys: You'll have the 3 coordinates used to get and set as you please

    Edit: updated the demo with DoF... was easy (for some reason though I couldn't set the effect via family, had to do it object by object... the effect tab and actions did show up but then I couldn't set the values.. bug?)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Plan for wall pushout (already detecting collision)

    -----------------

    grab the position from the previous frame oldp, the new position p

    loop checking if oldp+((p-oldp)*x) is colliding, where x is a factor

    the factor would start at 0.5, if not colliding it adds half the current factor, if its colliding, it would substract half the current factor

    and then I'd repeat until I hit a fixed threshold for (p-oldp)*x (one unit, probably)

    and if at the end of the loop it's still colliding, I'd just set the position to oldp.

    If it works, I'll post another update

    Edit: it worked! Wall collision working

    http://octavoarte.cl/25d_concept.exe

    TODO:

    Collision from below (right now it just goes through and lands on top of platforms)

    Slopes

    Edit2: crashes reported with framerates below 20, loop goes infinite even though it's capped with a counter.... which is strange, will do isolated tests. If "while" is bugged doesn't matter, as behavior won't use events

  • Updated the demo with art from Kaos.

    Collision works properly from all sides now.

    Still can't get sorting right, might have to set standard tile sizes.

  • Looking really good

    Looking forward to the final version

  • Its coming along nicely, especially considering I didnt get stuck this time

    However, walking too far up causes you to fall. Perhaps make it so you collide with some invisi-wall or something...

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

  • <img src="http://dl.dropbox.com/u/1010927/Untitled.png">

    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

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

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

    (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

  • Ah here it is:

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

    Ah... there it is, all right. Brings back memories. The graphics are different but it's still the same confusing bastard

    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.

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

  • I always thought a loop that sorted by .y AND 'fake height' would do it

    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.

  • 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

  • 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

    Arcticus, you evil bastard

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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)