On Game Maker and 3D

Posted by Rusky on Feb. 12, 2011, 8:24 p.m.

So, I'm doing some simple 3D graphics for my latest project. They're not strictly required but they make it look more interesting- it's essentially a top-down game, I just pulled the camera back a bit.

However, d3d_start() flips the handedness of the coordinate system. This flips the room editor upside down, which was okay for testing and I suppose for regular level design. I could have flipped the camera to the other side, but that would have screwed up depth.

Depth is effectively a built-in z variable which also happens to be used for drawing order, which works perfectly until you do anything slightly non-trivial (like flipping the camera to the other side of the z-axis). That was nice until I needed to sort drawing order independently of z value, for alpha blending and anti-aliasing.

Now I'm stuck with upside-down rooms even though I have separate z and depth. I should probably just go through with flipping the camera around by reversing all the signs again, but urgh. Why couldn't Game Maker just not flip the coordinate system so it could use depth as the z coordinate?

On a less hateful note, the lessons I'm taking from this are 1) always separate z and depth in GM 3D and 2) my own engine will not just tack on 3D as an add-on to the 2D stuff.

Also, I haven't been able to upload anything because my games are either too big or the connection is too slow for the server to get the whole thing before giving up.

Comments

Alert Games 13 years, 10 months ago

I never made a 3D game, only expiremented with examples. But this is interesting and very useful thanks.

I want there to be some easier ways to make 3D games so that I would be encouraged to make one. It seems so complicated and time consuming for an individual to do, especially to make a full game of it.

Rusky 13 years, 10 months ago

With something simple (i.e. could be 2D without changing the gameplay) like what I'm working on now, 3D really isn't all that time consuming. It's actually easier in some cases to portray things to the player that otherwise would be ugly or confusing.

For example, I have a door that opens with a switch. In 3D, I can show it opening without making it disappear, fade, rotate to a new position or anything else that would be required in 2D- I just move it up. Showing the character falling down chasms is also easier- just change the z value rather than drawing a new animation.

Of course, if you want to make a really 3D game or do anything more interesting with graphics (e.g. sane lighting, shadows, shaders) or gameplay (e.g. real 3D collisions, objects that do fancy 3D rotation like spaceships) you probably want at least a DLL and probably another tool. :/

Castypher 13 years, 10 months ago

Quote:
lolGM

colseed 13 years, 10 months ago

Quote:
lolGM
Same reaction, sorry :P

How big are the files you've been trying to upload?

Scott_AW 13 years, 10 months ago

What did I do when I came across this problem? I just dealt with it, better to deal with a flipped world then hack it and screw the camera up. I'm not sure if this is fixable, last version of GM I used was 6.

I think it was one of the reasons I started making my own map maker and related files…if I still was working on GM 3d projects…which I'm not anymore.

Oh GM, you think you can handle 3d with all your horrible limits…

Cesque 13 years, 10 months ago

Quote:
Why couldn't Game Maker just not flip the coordinate system so it could use depth as the z coordinate?

I'm pretty sure there was some reason for that, albeit probably a very stupid one. Depth still has some value on how you draw things in 3d - IIRC, it's mostly there to be confusing and fuck things up.

It takes some time to get used to GM 3d, but yeah, mixing 2d and 3d is the most horrible part. Don't step out of the line, just stick to a platformer or a Doom clone ;)

SteveKB 13 years, 10 months ago

gm+3d=lol

Cosine 13 years, 10 months ago

You just gotta believe!

Carlos508 13 years, 10 months ago
colseed 13 years, 10 months ago

O__O

That looks rather good actually.