Saturday, August 22, 2015

Week 6: Porting to OpenGL, and GUI woes

The last two weeks have been spent converting the engine to OpenGL. I decided the advantages of doing this mostly outweighed the pain of switching from blitting to 3D, and all that entails.

It's been a mostly smooth process, although it'll probably take more than a few more refactoring passes before the engine is as clean as it once was. The way you do blit-style graphics and the way you do modern Core OpenGL is two fairly orthogonal methods with different data-piping needs.

Midway through this week I decided that my crunky home made GUI didn't cut it, and started looking for an alternative. At first I tried CEGUI, which seemed promising.  I read a few forum posts and the like that warned me against using it, but I figured "how hard can it be"... After struggling for an absolutely unreasonable amount of time to get even the simplest things to play nice with my other rendering--there's a severe lack of documentation of which preconditions the GL3 renderer for CEGUI expect, and which states it will alter--I came to the conclusion: Fuck this shit.

I abandoned CEGUI. Decided it just wasn't worth the time. Instead, I switched to IMGUI, which by comparison is a dream to work with. It does what you tell it to. Nothing more, nothing less.  Had all my existing GUI screens converted in an hour.

So this is where I'm at right now. Not 100% there yet, but mostly.




Click to enlarge

Friday, August 7, 2015

Week 4: A*, AI, ARPG

In the beginning of this week, I was messing around with adding better pathfinding to the game. A* did the trick. Here's an early video where I played around with leading an NPC around a generated map.


The heuristic function I used wasn't very good at that point, and I'm fairly certain my A* implementation had a bug or two at this stage, so the NPC gets stuck even in places he shouldn't. But, overall, it worked. I later got the point where I could do RTS-style click-and-command control over the NPC.

Made me think, if I kept the level design relatively sane, I could probably create reasonably competent AI allies. But just having allies is a bit boring if they're all the same. So I figured the best thing to do about that is to give them different abilities and equipment affinities, so switching between them to approach various problems would makes sense.

My current line of thinking is having three different classes:

  • A ninja/acrobat style character that can double-jump, blink, and relies mainly on mobility, for closing up and sniping high value monsters.
  • An engineer that can summon turrets, robots, UAVs, whatever on cooldown.
  • A heavy weapons guy that relies on equipment such as grenades, rocket launchers, flame throwers, mainly acting as crowd control.

That's still just vague designs at this point. What I do have, however, is the ability to control a team of characters that all look exactly the same, with an AI that is mildly frustrating at points. And items, equipment slots, and some stats.

Although for this to work out I need more monster diversification. Right now I have melee zombies. That's it. And that's just a matter of killing them faster than they walk. Not very fun.

Adding equipment and an inventory drove the need to develop a menu system. It's still pretty crude, but mostly functional.

So without further ado, here's two game play videos, one where the AI plays relatively nice, and one where it doesn't...





As you can no doubt see, the ladders pose serious trouble for my NPCs. Should be reasonably fixable though. It's not something I've spent a lot of time working on yet. I may or may not have to add "Creepy Watson"-teleportation as well.

In closing, this week I also re-learned the lesson that one shouldn't write C++ code when tired. The code will be incredibly buggy, and you will spend twice as long fixing the mess...

Saturday, August 1, 2015

That Game I'm Making

The last month or so, I've been working on a little C++ project: An old-school platform game with some new-school additions. It doesn't yet have a name, so it's just "That Game I'm Making" so far.

I'm building it from scratch in C++14 with SDL, blitting every texture like it's 1995. I may migrate to OpenGL eventually, depending on how well the blit-krieg approach scales. We'll simply have to see about that.

I'll attach some relatively recent video of how the game looks today. This is from an experiment with a hybrid maze and cellular automata algorithm I've been working on. It's still a work in progress, but I'll try to write more once I work out some of the kinks.





This is an older video showcasing some of the more recent mobs



As will be abundantly clear to anyone who has played Commander Keen, that is my main stylistic inspiration, although combat-wise it's probably closer to Duke Nukem 2. In summary, I really like ID Software's old pre-DooM creations, and that whole shareware age aesthetic in general :-)

At this point, the game design is fairly undecided. I like the idea of a Terraria-style procedurally generated world, but I want more emphasis on combat and none of that crafting nonsense. More Borderlands, less Minecraft. I'm also looking for a way to negotiate a procedurally generated map. Having the whole Flappy Bird air-jumping I enabled in the first video looks a bit silly.

I'm also drawing all of the assets myself, which is arguably a bigger challenge than the actual programming at this point, although I'm slowly improving in my spriting abilities.