Search This Blog

Tuesday, September 26, 2017

Retro 3d fps in Construct 3






*Update... I'm now using actual ray casting for the walls, but still the 2d sprite frames for the other objects like trees and grave stones. 









I made a simple ra-casting style 3d fps "engine" using Construct 3 with no plugins just Construct 3 events and some clever use of sprite animations.

My son wanted to know if I could add 3d capability to a roguelike game for Construct.  I can easily with Construct 2 using the 3js plugins, however

1. Publishing a game to android is a pain for me in Construct 2 and it's a breeze in C3.  Easy peasy.
2.  It's very satisfying to make all the 3d on my own and it have it even work badly.  It works!  I didn't think it would even work.
3.  Threre's a cool really retro feel to it that you don't get with a modern engine.  Something is magical about tricking a 2d engine into doing 3d ish things.





The way it works is I make a block in Milkshape, export it to a direct x object then use a program called "SpriteMe"  which can be seen in action here:

https://www.youtube.com/watch?v=yC05ACgSbtA

and I make it spin 90 degrees and capture about 1 frame for every degree.  This makes a roughly 90 frame animation.   Then with a little math inside Construct 3, it picks the frame depending on the angle it is to the pov.

Combine that with scaling based on the distance from the POV and you have some playable, primitive looking pseudo 3d!

That takes care of blocks but what about things like bullet holes or rounded paintings or small windows?  For those I just make them thinner when you get more of an angle to them.  If you're facing straight on they're wide, if you're looking at them at an angle they get thinner.

After lots of trial and error math it works.

...