Here we go...

Posted by Astryl on Oct. 16, 2011, 5:49 p.m.

Caution: Yet another pasted blog. I think my wits were about me with this one, but I know for certain that my coffee cup has been empty for at least 7 hours… *looks regretfully at the cup*… meh…

So… after transferring my previous ideas to the 'follow through in next century' bin, I continued to soldier on with something completely unrelated to the compo: My studies. These include a lot of Andre Lamothe's books, and lot's of 3D theory and trig. I'm training to become a dual OpenGL/DirectX wielder, or cyber-mage as Lamothe puts it >_>

Anyway, I always do better making stuff that has to do with what I'm learn, so I started making a new game in GM, in 3D:

And no sooner have I got the basic game working than the CPU usage starts to creep up… So I'm already optimizing desperately. Turns out it's the floor and the ceiling causing the trouble.

To fix it, I'm going to create a floor that follows the player, but aligns itself to a grid. Difficult to explain, but needless to say that the player won't notice, but I will…

I refuse to start learning how to use GMOGRE or Ultimate3D at this point, since I'm already neck-deep in new API's, mostly DirectX. Did I ever mention that I hate COM and that Microsoft are evil? Oh? Well I mentioned it now.

It's an unfortunately necessary evil though.

Explanation of COM for those who haven't tried 'soft coding.

It's evil incarnate, and also a damned good idea. It just went horribly wrong somewhere along the way.

Basically, it takes the idea of Objects from OOP, specifically the Interface. It defines an object known

as an Unkown. Got that? (It's usually defined iUnkown. So was Apple involved or did I miss something?

Anyway, you define this Unkown object and use it to 'query' for the interface of another object, using a long number known as a GUID. These are those long numbers you can find in the system registry, the ones enclosed by {}.

So basically, once you have found the interface you're looking for, you can access it like so:

object->method();

Only problem is: You don't know what's in a COM object unless you have the API documentation. So no auto-complete. Which fustrates me no-end.

OK, so enough of COM. I figured out how to do something really cool in GM; namely, hijacking the device context. :3

What this means for those without the added burden of Win32, it's basically a way to access a pointer to the rendering-window of a GM window; also, the Application instance. I've already been working on a DLL that will allow you to completely access the functionality of the Win32 API, which I doubt I'll use anyway… Oh well.

The interesting use for this is actually being able to use external libraries with your GM game, like SFML, OpenGL, DirectDraw, Direct3D etc.

Of course, I'm not about to go through the trouble of creating a wrapper for any of those libraries; if you're going to bother using them in GM, you may as well bother using them in C. >:{

And to wrap things up…

I was clicking around my backup conglomerate today, and found a long forgotten game that I felt like playing again: Warcraft 3. Brings back good memories of how I used to be mediocre at DOTA, and how I absolutely suck at it now ;_;

Comments

BP Scraps 13 years, 1 month ago

Looks like we're taking a similar approach, it'll be interesting to see how we implement it.

EDIT: Wait, this isn't for S4D, is it? lol reading noob

Cesque 13 years, 1 month ago

Quote:
To fix it, I'm going to create a floor that follows the player, but aligns itself to a grid. Difficult to explain, but needless to say that the player won't notice, but I will…

Actually, that sounds like a ridiculously simple concept :P

For my previous Halloween game, I came up with a script that drew the floor in the camera's region in 3d based on actual room tiles (so you could just use tiles for floor graphics). It was horribly buggy, but I'm pretty proud of it :)

Alert Games 13 years, 1 month ago

Quote:
Of course, I'm not about to go through the trouble of creating a wrapper for any of those libraries; if you're going to bother using them in GM, you may as well bother using them in C. >:{

A very true reason of why people dont develop things for GM!

JuurianChi 13 years, 1 month ago

Warcraft 3….

Did they ever make another?

Or is it all about that crummy MMORPG now?

Astryl 13 years, 1 month ago

This IS for Scary-Four Digits. Why else would I be bothering? :P

Also, something interesting I forgot to mention, about the Minecraft 1.9.4 pre-release:

1. Go to The End, take a bed with you

2. Place bed.

3. Click on bed.

4. ???

5. Profit!

Alert Games 13 years, 1 month ago

Did someone make a useable 3D room editor yet? There really should be one…

Castypher 13 years, 1 month ago

I saw a good 3D room editor a while back. Forgot what it was called, but it was back at the GMC if you want to go search for it.

Other than that, I really might make that myself. Shouldn't be hard or anything.

svf 13 years, 1 month ago

@Mega It's the same as the nether.

Astryl 13 years, 1 month ago

Wait… do beds blow up in the Nether too?

Also, I had a sector-based room editor I was working on, similar to Build, the Duke Nukem 3D Engine's editor, but I quite obviously couldn't finish that in time for the comp.

Oh yeah. Using GM's equivalent of what must be VBO's, I got a major performance increase: CPU usage down from 99% average to 30% average, just by stuffing the ceiling and floor into models. >_>