Can we stretch a layer? Isometric 3D engine

Get help using Construct 2

Post » Sat May 02, 2015 4:49 pm

So I had an epiphany yesterday. This sums it up:

Image

My idea caught fire on twitter and already there's an engine for Game Maker. Have a look:
https://twitter.com/FireCamp_games/status/594500636927983616

An isometric 3D engine out of an (easy to code) planometric grid is easy, if we can stretch a layer's height.

I gave it a try with @r0j0hound 's Canvas plugin. I used 2 canvases. I don't know if it's overkill, and I'm doing something wrong anyway, because there's a lot of cropping going on.

However I'm going from this ortho view:

Image

To this: (what the engine looks like after the canvas transformation)
Image

with no strange isometric calculations. Collisions and Z-order should also be super-easy, as I'm basically working on an orthographic 2D image.

Here's the CAPX

The downside of course is this doesn't work for pixelart. But I think you clever people might find it useful
Last edited by christina on Sun May 03, 2015 8:03 am, edited 1 time in total.
B
28
S
12
G
4
Posts: 193
Reputation: 4,581

Post » Sat May 02, 2015 5:01 pm

Well that's nifty
B
9
S
2
Posts: 54
Reputation: 638

Post » Sat May 02, 2015 5:11 pm

Neat CAPX!

Best game ever BTW... well, besides Ultima6 that is :)
B
71
S
14
G
1
Posts: 151
Reputation: 4,974

Post » Sat May 02, 2015 6:00 pm

Well there's an offset for x, and y for isometric movements so its not really isometric.
If you could scale the layout height , or layer's height, then it might give a true representation.
There are a few other issues with a single image as well, z order, blocking, etc.

Edit also keep in mind all your images would have to be rotated, and scaled before import.
Image ImageImage
B
168
S
50
G
163
Posts: 8,220
Reputation: 105,059

Post » Sat May 02, 2015 6:27 pm

@newt So it's a crap idea? What do you suggest?

Edit: I was thinking we could keep track of the purple square sprite's *actual* screen coordinates and angle, and slap a proper isometric sprite on top, above the canvas transformations
B
28
S
12
G
4
Posts: 193
Reputation: 4,581

Post » Sat May 02, 2015 6:40 pm

Its a feature request at best.
As in @Ashley can I have layers with separate width and height scale?
Scale is somewhat complicated already changing just the height makes it harder.
10x10 /2 = 5x5,10x5 /2 = 5x2.5
Then apply that to a matrix....

Edit:
Also you would want it as just for layers, as you would want regular layers for gui, etc.
But that makes it even more complicated, as you would have to keep track of the layout to layer xy's for each layer.

Sorry but the strange isometric calculations are the best way.
This is one of the better explanations:
http://clintbellanger.net/articles/isometric_math/
Image ImageImage
B
168
S
50
G
163
Posts: 8,220
Reputation: 105,059

Post » Sat May 02, 2015 6:59 pm

@newt I get it. I don't really need layers with separate width and height scale. The canvas trick seems to work ok. So why is it a bad idea? Look at what it inspired someone to make: https://twitter.com/FireCamp_games/status/594500636927983616


Thanks for the cool iso article :)
B
28
S
12
G
4
Posts: 193
Reputation: 4,581

Post » Sat May 02, 2015 7:14 pm

Well as I said in my first post the iso movement is different from regular movement. Up or down has to be half of what it is for right or left.

Then a single image just isn't a good option. It wastes memory for another thing.

Plus you still have to solve z order the same old way.
Image ImageImage
B
168
S
50
G
163
Posts: 8,220
Reputation: 105,059

Post » Sat May 02, 2015 7:51 pm

@Newt what are you talking about?

Ok maybe I need to explain it better.
You make an orthographic game that looks like Ultima above (or chess) on one layer. Not one image, that's just my test. You make a proper tileset. Floor tiles, walls, characters, everything.
Movement and Z order are easy, since it's orthographic. The higher the Y and X, the higher the Z order. It's solved, the same way Ultima solves it. You don't have to do anything else.

Then you draw everything on two canvases, one rotates what you see by 45 degrees, the other squashes the rotated version to 50% height. The end result is isometric.

Yes, you will need to make all your vertical sprites (walls, characters) vertically stretched by 200%, so they survive the squash. And you have to know where they're facing so you can choose the appropriate animation.

But other than that, you get basically free 3D. No?
B
28
S
12
G
4
Posts: 193
Reputation: 4,581

Post » Sat May 02, 2015 8:24 pm

Nope.
Those objects will still have to be placed to isometric offsets.
Image ImageImage
B
168
S
50
G
163
Posts: 8,220
Reputation: 105,059

Next

Return to How do I....?

Who is online

Users browsing this forum: Madave96, RobertMKD and 7 guests