Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

[MMF2] How to make a 2.5D engine?


Airaxen

Recommended Posts

I know there are many simple tutorials out there for that 2.5 engine sorta in the vein of Sonic 3D Blast. But the ones I've encountered are too simple and don't do much else other than to jump up and down in that z-axis.

I want to be able to have a full platforming experience like a 2D platformer for the most part but that extra depth into the background/foreground. I also want put in that streets of rage or double dragon (whatever analogy works) fighting engine as well, so things flying through the air and all that was another factor.

I looked at some isometric engine tutorials which were the closest thing I could find but they also weren't what I was after and honestly quite over my head in the math. I tried thinking of an associated array for the level sort of mapping everything out in x, y and z coordinates but couldn't figure out how to handle say placing the entire level and the background into that array or how to handle collisions. Would anyone be willing to help with thinking on how this engine would be made?

Link to comment
Share on other sites

I'd say that the most accurate way is to actually make a Vector3-based coordinate system for your world (X, Y, Z) and, for rendering, just convert it to a 2D point according to the camera (in your case, an isometric perspective - which represents a camera in 30 degrees approximately).

According to this post I found in StackOverflow....

Here's a very general answer. Say the camera's at (Xc, Yc, Zc) and the point you want to project is P = (X, Y, Z). The distance from the camera to the 2D plane onto which you are projecting is F (so the equation of the plane is Z-Zc=F). The 2D coordinates of P projected onto the plane are (X', Y').

Then, very simply:

X' = ((X - Xc) * (F/Z)) + Xc

Y' = ((Y - Yc) * (F/Z)) + Yc

If your camera is the origin, then this simplifies to:

X' = X * (F/Z)

Y' = Y * (F/Z)

You might wanna take this into consideration.

It might not be a problem to handle what is in front of what too.

As for collisions, you might want to handle it using collision boxes, pretty much the way you'd do in a 3D game. Maths are maths, doesn't matter how you see them. The result will always be printed onscreen the way you specify it.

Link to comment
Share on other sites

Honestly, if you can't think of all the things you need to do to handle this sort of thing yourself, you aren't ready to take on this kind of project. Isometric is tricky and it's trickier in a program that doesn't really have the editors to handle it. Your questions are far too general to make any suggestions and MMF2 in particular doesn't have any tools which would equip you for working on an isometric engine. You would pretty much be stuck faking all the image work and then having to programatically create all of your level geometry that is actually used for collision.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...