Category: Game Programming

Pencils Down

It’s finished!

Woohoo!

You can download a version to play here. A full postmortem is forthcoming…after I recuperate a bit 🙂

Here’s the readme file:

Inaria Readme File

This is a role-playing game I wrote from scratch in forty hours over the course of three months. To read more about the game’s development, please visit my weblog at https://viridiangames.com/blog !

BASIC CONTROLS

Inaria can be played with the keyboard and the mouse, or the mouse alone (sorry, there is no way to play it just with the keyboard).

You can move your character by pressing the arrow keys, using the WASD cluster, or left-clicking on the map where you want your character to go.

You can pick up items in the world by left-clicking on them. They will appear in your inventory. Left-clicking chests opens them, revealing their contents.

You can use items in your inventory by left-clicking on them. Left-clicking arms and armor equips them and gives you stat bonuses. Left-clicking potions drinks them.

The GUI pane in the bottom-right, right above the text area, is your main interface with the game. The four buttons on the left allow you to talk to, look at, pick up or attack anything or anyone in the game. The four buttons to the right of those are your spell buttons (although initially you don’t have any spells). The three buttons on the far right allow you to load, save and quit the game. All of these buttons work by left-clicking.

This game also uses smart right-clicking. Right-clicking an enemy automatically attempts to attack that enemy. Right-clicking a friendly NPC talks to that NPC.

OPTIONS

You can change the game to run fullscreen by opening the engine.cfg file and changing the line

full_screen = 0

to

full_screen = 1

I wouldn’t recommend playing around with any of the other options…they could very easily lead to crashes.

GAME TIPS

You start off with a little money, just outside a town. Run inside and visit the merchant. Buy a dagger and some leather armor; this will make you a bit more effective in combat.

When you find a dungeon entrance and go inside, look at the text displayed in the text area. This will tell you the name of the dungeon and its level. If the dungeon is significantly higher than your level, it’s probably a good idea to leave it and come back to it later.

Try talking to monsters!

The Clever Merchant in town is the only place where you can buy potions. If you’re having trouble finding them, sell all the weapons and armor you’re not using and use that money to buy more.

When you level up, clicking the muscle symbol increases your attack power, making you more likely to hit. Do NOT level up your speed, that statistic isn’t used in the game (sigh).

The game honestly is not well-balanced. I just didn’t have the time. As a result, it’s not that hard a game. If you play smart, you should beat it pretty quickly.


40-Hour RPG Update 12: 35 Hours

I think I’m ready to call myself finished with the engine. There are known bugs in it, but they aren’t severe, and I could easily blow all my remaining time on fixing them. In which case you’d get to play an RPG with one map with no enemies on it.

Here’s what I’ve gotten done:

  • Buying
  • Loading
  • Dying (death is now fatal)
  • The Smite spell
  • Getting objects (you must now be next to an object)
  • Moving with the mouse (left click in the direction you wish to move
  • Smart right-clicking (right-clicking an object picks it up; right-clicking a friendly talks to it, and right-clicking a monster attacks it)
  • Hit marker
  • Missile marker (buggy, but I don’t have time to fix it)

What’s left:

  • Make the two remaining town maps
  • Make the eight dungeon maps
  • Make the final boss castle map
  • Tweak the monsters

I’ll probably start with the overworld, then do the final castle. Then I’ll do as many dungeons as I can. If I get all the dungeons done, I’ll do the other towns (you really only need one town, as Diablo proved). I believe that the project is still on track.


40-Hour RPG Update 9: 22 Hours

I am on a roll today.

Smashy smashy!

Again, much done in a short time. You’ll notice I changed the layout of the screen. The text area was just too small; all of this game’s personality is going to come through the text, so I need to be able to get as much of it on the screen as possible. I got unstupid about my button arrangement – I don’t know why I thought I needed three lines for that; two not only gives me more space but I think the buttons look much better in their logical groups. I also finally took the white flash off the rest of the icons, also making them look better.

But then I had a problem – I need enough space for my inventory. I need a 128×128 block to represent the sixteen items the player can have in his backpack. (Yeah, it’s like World of Warcraft…it’s also like Ultima VI!) Moving the GUI buttons up infringed on that space, so I found a way to compress the character data at the top of the screen using icons I found on the web. One side effect of this is that my tile sheet is now bigger than 256×256. I’m willing to give up that limitation; I need those icons, and I’m going to need more icons in the future.

What else? Oh, yeah, combat! You can now take swipes at NPCs, and NPCs can take swipes at you (if they are hostile to you). An NPC’s attitude toward you is separate from their movement AI, so I can have NPCs that just wander around, hitting you if they happen to get near you, or NPCs that seek you out to put the beat down on you. I can even have NPCs that just stand there and can only hit you if you come into range (the Carnivorous Mushroom is one of these).

Next I need inventory, picking up items, buying and selling. Which means I need to figure out exactly what the merchants in town are going to sell.


40-Hour RPG Update 8: 20 Hours

I am now halfway through the project. Combat is still not in, which is a concern, but I’m not anticipating any real problem with it. The subsystem I’m anticipating having all the problems with is the inventory.

Anyway, looking and talking both work, and NPCs now either stand still (if they are merchants or the king), wander around (if they are townspeople) or wander around until you get close, then hunt you down mercilessly (if they are monsters). See?

That baby dragon just will not get off my ass.

Let’s do a quick assessment. Here’s what I’ve gotten done in twenty hours:

  • Gathered and created the necessary tile graphics; created the background
  • Game framework (mostly created before I started, but put to the test for the first time on this project)
  • Basic map structure with passability data
  • Basic player structure
  • Basic NPC structure
  • Basic item structure
  • In-game lists for NPCs and items which “float” over the map
  • A simple but functional map editor
  • Simple bitmap font system
  • Designed the basic character advancement and combat systems
  • Created the NPCs and monsters for the game
  • Created a simple GUI system and the specific GUI for my game
  • Player movement, looking and talking
  • NPC movement updates based on data-driven AI flags

My remaining tasks, in order of increasing difficulty:

  • Saving and loading (very important)
  • Map links
  • Creating the remaining town maps
  • Creating the overworld map
  • Creating the dungeon maps
  • Creating the end boss’s castle map
  • Combat
  • Spells
  • Inventory
  • Equipping of items
  • Buying and Selling

Can I do it all? Keep tuning in to find out! If I do, the game is going to end up being a very simplistic game based on a fairly complete RPG engine. I don’t think I could have asked for more in forty hours.


Visual Studio Express

You probably already know this, but just in case you didn’t: Microsoft is making the Express versions of its Visual Studio development software free for a year. These are full-featured compilers for the Visual Basic, C++, C# and J# programming languages, and yes, you can make commercial software with them.

I don’t know why Microsoft hasn’t been doing this all along. One of the reasons I am where I am today was because I found a book that had a learning edition of Visual C++ 6 on it. The learning edition put a “Not for Commercial Use” popup at the beginning of every program you made for it, but was otherwise full-featured, giving me very valuable experience that later got me my first programming job. I always wondered why they didn’t make that edition available for free download from their web site.

Of course, this is probably Metrowerks’ worst nightmare, and this will probably coax the last few Borland users into the arms of the behemoth. Still, when the behemoth makes it easier to learn software development and reduces the development cost of making commercial software, you can’t help but be a little grateful.


I Must Be Crazy…

I’m actually thinking about what my next 40-hour project will be. Even though I don’t have this one half-finished yet. I’ve got a couple different ideas: a 40-hour space opera RPG, a 40-hour real-time-strategy game, a 40-hour Master of Orion-style game or a 40-hour Civilization-style game. Maybe I should put up a poll 🙂


40-Hour RPG Update 2: 7 Hours

What a difference two hours can make!

Woo!

It’s actually looking rather gamish! While I already have all my terrain types defined, I don’t have a map yet. I think I’m going to have to spend a few hours writing a map editor, especially if I intend to shoot for the moon and have an overworld, towns and dungeons.

There’s also no input yet, but that’ll come quickly once I have a map to actually walk around on.

One thing I’m realizing is that I’m at a disadavantage because I’m using C++, and not something lighter and faster to develop with like PyGame. But the whole point of this is to get my skilz up, so I’m willing to put up with it.


40-Hour RPG Update 1: 5 Hours

Well, I am now five hours into my 40-hour RPG-

Oh, so you finally decided to do some work on this project, huh?

Okay, just who the hell are you, anyway?

I’m your superego. You know, the part of your brain that nags at you constantly about what you should be doing. You know damn well that you should have worked on this project over the weekend, but what did you do? You spent the whole weekend playing Soul Calibur III!

Really. Isn’t the superego the “parent” aspect of consciousness?

Why, yes it is! I’m surprised that you-

[BANG]

AUUUUGH!

Oooh, looks like you won’t be “parenting” any more.

You…gasp…you can’t do this to me!

In the end, it’s my brain, so…yes. Yes I can.

I’ll be back! You can’t get rid of me! They’re tricksy, false hobbitses! We must have the Precious!

Yeah, yeah. Now that that’s taken care of, let’s talk about the game!

I hit my first roadblock early on. I had expected that assembling the tiles off their various pages into one tile bitmap would take about an hour. It ended up taking three hours and fifteen minutes, partially because the Angband tiles I liked didn’t have the terrain symbols I needed, and I couldn’t find any others that I really liked. Yes, I wasted time Photoshopping some tiles together when ones I found on the net could have been used. I just didn’t like how they looked, and I want this game to be as good as it can be (I also don’t want it to look like every other quickie RPG out there). I don’t think the time was completely misspent.

I was then able to work up a map structure and a tile structure so that I could start putting the map on the screen. I don’t have any map data yet, so until I get some, here’s a look at the tileset I chose.

Tiles!

You may notice that I’ve only got 56 tiles so far…I’m reserving some because I know that as the project progresses the need for new tiles will come up.

Picking the tiles also dictated a lot of the game design. I tried to pick the most interesting monster tiles I could find, and to cover the basics of weapons, items and armor. Plus, I just couldn’t help but include four spell tiles in the game; hopefully I’ll actually have time to code those spells.

My next task will be to put together the overworld map and allow the player to scroll around it. I also need to finalize what the game’s GUI is going to look like.


More Thoughts…

No music or sound effects. Sorry, just don’t have the time.

Mouse control is iffy. I really, really want it. It’ll make the game much easier to play. But a keyboard-only control scheme would be much easier to program. If I don’t use the mouse, people won’t be able to play my game without a thorough reading of the instructions to figure out what key does what. That makes it too much like a Roguelike. But supporting the mouse means I either have to come up with a rudimentary GUI system or find and figure out an existing one – and I have to do this BEFORE I can actuallly get started on my game.

I’m deliberately limiting myself to a single 256×256 tile file. Since the tiles I’m planning on using are 32×32, this means I’ll have 64 tiles to work with. That doesn’t sound like a lot, but my tiles won’t be animating, and heck, Ultima III was made with only 64 tiles.


Okay, I’m Going To Do It.

I’m going to do a 40-hour RPG. The 40 hours will not be contiguous, I’ll probably use them all up over the course of the next two weeks or so (give me a break, I’ve got three kids). I will be keeping rigorous track of my time, and I will be posting my creation at the 40-hour mark, no matter how hideous it is.

How will I do this, you ask? Well, I’ll probably fail spectacularly like I did last time (when I got so interested in terrain generation that I burned up 8 hours just on that, making it impossible to continue). But this time I think I have a better plan.

First, I’m going to spend some time polishing up my game framework. This won’t count against my time, since it’s the same framework I’ll be using on every future game I make. I’ll make sure the framework supports everything I need before I start, so I don’t waste precious time coding something like GUI buttons when I should be laying down dungeon corridors. It’s based on the SDL, so that’ll make things even faster.

Second, I’m going to steal every resource I can. While the game will be graphical, it’ll be tile-based, and I’m going to use one of the free tilesets I’ve found on the web. I’m leaning towards the Angband graphics on this page. They’ve got a nice little retro-cutsey feel to them (though not TOO kawaii).

I’ll also be using maps from online map resources, like this one. I’ll also be researching lots of stuff off of rec.games.roguelike.development to speed up development.

Third, I’m going to keep the scope as limited as I can. The player will only control one character (this makes me cry; I SO want to do a tactical combat RPG). The game will consist of linked 2D tile maps for overworld, town and dungeons. All maps will be the same size and use the same code. I’ll write a very quick and dirty map editor to speed content creation. There will be an inventory system, but it will be quick and dirty, and the player won’t be putting bags inside of bags. Dungeons will be 2D overhead mazes or collections of rooms, like a Roguelike. Will they be randomly generated? That would be awesome; don’t know if I’ll have time. The game I’m envisioning will basically be a cross between a Roguelike and Ultima III.

I’m also considering releasing a 40-hour version, and then giving myself another 40 hours to add more features and also releasing an improved 80-hour version.