Category: Game Programming

Subversion

MainState.cpp: What the hell? I’m versioned! And properly backed up! And the backup is even off-site! It’s like he…he cares!

I mentioned in my Inaria postmortem that I was going to stop using my PDA for code storage/transport and set up a real Subversion server. I’d put it off because I figured I’d have to see if my web host supported it, learn how to telnet into the server, install the software, create the repository, install TortoiseSVN on my machine, and then see if it all worked.

But with me starting another new project, I figured it was time, so I went to the web configuration panel for my server space that DreamHost provides me to see if DreamHost supported Subversion servers.

Not only do they support them, but there was a button there to automatically set up an Subversion server in my web space. I clicked it, and now I have a Subversion server and all my files are properly source controlled now. I’m sure they sleep much better because of it.

MainState.cpp: Damn straight!

It has occured to me that I haven’t said enough good things about DreamHost on this site. DreamHost is fantastic. The number of problems I’ve had with them is zero. Every time I look to see if a particular feature is supported, the answer is yes. And nine times out of ten, they’ve already done the work of setting up that feature for me. I will definitely be renewing my service when it expires next year. (For the record, I have the Code Monster package.)


Next Step

Okay, time to figure out exactly what I’m going to do next. I feel that I’ve got three options:

1. Star Revolution Redux. Finish Star Revolution, but with fewer features. The ground combat will be cut because it will require the most resources. Trade and alien interaction would be abstracted to menus. Players would land on planets solely to mine them or capture lifeforms. The game would then feature space combat (based on the combat prototype I’ve already written), contact with alien races, mining and trading. The game probably won’t be 3D. This isn’t too bad, but it’s only about 50% of the game I wanted to make…

2. Inaria 3D. Ryan really wants this, and honestly, so do I. But Inaria 3D would have pretty much all the problems of my original design for Star Revolution. However, it might be possible to work something up using sprites from another 3D game like Final Fantasy Tactics. A possibility, but it’ll be hard.

3. I’ve had this irrational desire to make a game in the style of Dungeon Keeper. This could very well make a very good first 3D project because of the simplicity of the 3D involved – Dungeon Keeper was actually a 2D game that was simply presented in a 3D manner.

4. One of the other projects I was considering after Inaria got finished. From these I’d probably pick either the simple real-time strategy game or the simple Master of Orion-style game. These probably wouldn’t be 3D.

In any event, no matter what I pick, I am going to be limiting myself to 40 hours again. Why? Because that actually worked. By embracing that limitation, I actually made a game (a pretty crappy game, but a game).

So, thoughts?


Cliffski’s Podcast

This is the best podcast I’ve heard in a while. It’s basically Cliff Harris talking about his work in the game development business and how he went indie.

As I listened to the podcast I took some notes, which I am posting below. These are kind of stream-of-consciousness and may not make much sense unless you listen to the podcast (which you should!) I’m basically just posting them because…well, I wrote them and I don’t want to lose them.


Yes, we got the ZX-81 here in the States; it was sold as the Timex Sinclair 1000.

Yes, we had Astrosmash here in the States! It was created here, for crying out loud, for the Intellivision!

Interesting that Cliffski calls Asteroids “the default game” that most people write first…I remember reading an article from Andre Lamothe where he says that whenever he has to learn a new game development API the first thing he does is write Asteroids in it.

I firmly believe that all the best game developers are completely self-taught. I believe this because it means that one day, I might be one of the best game developers!

Evil Genius came so, so close. It was almost a great game, it just lacked…something.

“Take the mickey out”? Good grief, you Brits and your language constructions…

Ah, the parallels continue…I was terrified on my first day at Multimedia Games (my first real programming job). Heck, that lasted for the first few months. If it hadn’t been for my friend Brendan Segraves I would never have made it. I remember when I sent my first game to test, Brendan said “Congratulations! You’re a game programmer now.” That was really nice of him and I’ll never forget it.

And this is why finishing stuff looks so damn good on the resume. You can have a PhD in applied artificial intelligence, but that does not mean you know how to make a complete game. The only thing that proves that you know how to make a complete game is having made a complete game yourself. Cliffksi was probably a more competent overall game developer than any of those guys with their fancy college learnin’, and here he actually felt unworthy to work with them! (See “the best game developers are self-taught”, above.)

“I learned what the hell source control was and I learned what the hell a debugger was” == me collapsed in paroxysms of laughter. I didn’t learn what a debugger was until my first job either.

At Gizmondo, we played poker, darts, foosball, Heroclix and Magic as well as computer games. Cliffski’s right…the environment and attitude at a proper game company is just awesome. It’s almost like belonging to a club instead of working at a company.

Yep, failure hurts. But it makes you savvy, and it’s hard to become savvy without failure, so the best thing is to simply consider it part of the process.

Well, Star Revolution looks like it’s going to turn into a fantasy combat game, so I know all about games not turning out the way you plan at the start 🙂

The Dexterity forums! I miss them; yes, IndieGamer forums are the proper successor, but the tone seems different there…

“The whole of game development is full of code hackers who do everything their way” – true. This is a natural side effect of “the best game developers are self-taught”, and Cliffski’s right – you need to read Code Complete and Effective C++ and take what they say to heart, even though it will probably be completely different from how you taught yourself to program.

Cliffski’s dancing around what he really wants to say about Lionhead…it’s unfortunate to have a story to tell and not be able to tell it.

“Terribly badly paid”? What fool wouldn’t pay his game developers properly?

Ah. I guess Peter likes to have lots of low-paid, low-skill developers instead of a small team of highly-paid, highly-skilled experts. That’s…well, completely wrong.

Wow, the parallels between Lionhead and Origin are scary…both companies had initial success, grew too fast, got overextended and then had to be bought out (Origin by EA, Lionhead by Microsoft). All that is left to the Lionhead story is the inevitable dissolution of the company.

Recruited by Maxis. Wow. And it turns out they picked him because of one of his very early games, Starlines…which has been my experience as well. You honestly never know which thing you’ve done is going to get your next job 🙂

He’s definitely got his wheel spun up, which is fantastic. He’s making the games he wants to make, he’s already got companies courting him, so if he starts having trouble making ends meet as an indie he’ll have no trouble finding another industry job…perhaps with a company that isn’t going to fold next year.

“You have to be shameless and creative about promoting your game.” Absolutely true, and it’s why I’ll probably never be humongous because…well, I just don’t feel that my games are worthy of such self-promotion 🙂 This is something Dan “Gibbage” Marshall also obviously understands.

Ah, Guildford…birthplace of Bullfrog. God, I miss Bullfrog. We were supposed to get a third Dungeon Keeper. And a third Syndicate.

Yep, design is hard when you don’t have an existing design to copy. That’s why there are so few truly new game designs.

1. You must learn proper software development and stop hacking everything.
2. You must become a good self-promoter. You must be willing to spend as much time on supporting and marketing your current games as you do making new stuff.

Well, starting a company is a HELL of a lot easier in the US than the UK…


Gibbage and Angst

Gibbage is a potentially-great little 2D platformer/shooter by Dan Marshall. Gibbage is simple and fun to play (except that the double-jump is too hard to do, in my opinion, and…I can’t seem to beat the computer).

But as I read through Dan’s blog about the development of Gibbage, I couldn’t help but notice his attitude throughout the project. Yes, there were lots of coding books hurled at poor, defenseless walls as he learned, but for the most part his posts are things like, “I’ve got a little guy! Whee!”, “I can run him around! Awesome!”, “Now there are two of them, yipee!”, “Now they can shoot each other! Brilliant!”

Basically…well, he seemed to have more fun developing Gibbage than I did writing Inaria…and a lot more than I’m having writing Star Revolution. Star Revolution in particular is turning into a real slog. I’ve got procedural textures, procedural planets, procedural cities on the planets, aliens, ground combat, space combat, trading, mining, talking and questing in this game. It is possible that I, flush with the moderate success of Inaria, bit off more than I can chew.

Now, I can see flashes of fun in the future for Star Revolution. In particular, when a friend at work pointed me at this site and I saw these pics of the starship interior molds they sell, I thought, “Wow, that’s exactly how I want SR to look!” And I can foresee putting that together inside the computer as being really fun.

But the amount of infrastructure I have to put together before I get there is just huge, and trying to get it all together is just grinding me down.

Plus I just got a really good book on DirectX and now I’m thinking about moving the whole project off of SDL and OpenGL and onto DirectX and Direct3D…


Chunky Pixels, Part II

First off, thanks for all the responses to my previous post on this subject! I’ve been doing a lot of thinking on the various ideas you guys gave me.

Dave and Wynne, the vector idea would be a really good one if the game was space-only, but since I want the player to be able to land on and walk around on planets, that kind of breaks down. So I’m looking for something else. Thanks for the idea anyway.

Now I am going to reveal something. I have already decided that after I finish Star Revolution, my next project is going to be Inaria II. It’s going to have a real 3D engine, using technologies I am developing for Star Revolution. And I had already decided that I wanted a specific look for Inaria II, a look I first saw in Exult.

Two pictures in this case will be worth a thousand words. Here’s Ultima VII at double-res (640×400). (Click each image to view it at full size.)

Ah, Ultima VII.  The last truly great Ultima.

Now here’s the same scene (still at 640×400) with the HQ2X image filter applied to it:

Mmmmm.

When I first saw a version of this filter (called Scale2X) in Exult I was very attracted to it. It doesn’t make things look blurry like most filters do. The tone and composition of the scene are still very apparent, but the blockiness has been smoothed over. I especially liked what the filters did to the trees – they almost look like watercolors now.

And just for the record, here’s how Inaria I would have looked with the HQ2X filter applied to it:

Woohoo!

I had not intended to use this look for Star Revolution, and I hadn’t intended to get the look by using a filter but by composing my textures to provide the look…but the more I think about it, the more I feel that Star Revolution would benefit from the look. Hopefully I’ll get this darn combat prototype finished and can mock up some screenshots and you guys can see it for yourselves. I think it’ll give me the feeling I’m going for: high-resolution, but the world/universe almost looks like it’s made out of Lego blocks…I think that would be perfect.

I don’t think I’ve actually ever seen the HQ2X filter applied to a 3D scene before. This will be very interesting.


Chunky Pixels

While I got a significant amount of work done on the combat prototype for Star Revolution over the weekend, it still isn’t quite ready. So in the meantime, I’m polling the audience!

When I wrote Inaria, I used a 512×384 video mode. This is kind of low-res, and I did it on purpose. I wanted the pixels to be a bit…chunky. I wanted you, the player, to be able to see individual pixels. I did this because I wanted to evoke a sense of the older RPGs that I was honoring.

And last night I was reading Masters of Doom again during compiles when I came across this passage:

Richard Garriott, a.k.a. Lord British, the son of an astronaut in Texas, spoke in Middle English and created the massively successful graphical role-playing series of Ultima games. As in Dungeons and Dragons, players chose to be wizards or elves, fighting dragons and building characters. The graphics were crude, with landscapes represented by blocky colored squares: a green block, ostensibly a tree; a brown one, a mountain. Players never saw their smudgy stick figure characters attacking monsters, they would just walk up to a dragon blip and wait for a text explanation of the results. But gamers overlooked the crudeness for what the games implied: a novelistic and participatory experience, a world.

Inaria is a pointer to a pointer. Its blocky graphics are trying to evoke a previous style of game which, in turn, tried to evoke a world rather than accurately represent one.

Is that even possible nowadays? Quake started us down the road from evocation to representation and we’ve been barrelling down it for years, but will we ever arrive? And if we do, will it be possible for small teams to make the trip, or will it necessitate 50-60 people for three and a half years? That’s what Oblivion required…

And here’s the question that is pertinent to me…can we ever go back? Does this sort of evocation still work? And will it work even on newer players who have never played a game in 320×200? Who don’t know what VGA is?

Basically, I’m asking this: Do you think Star Revolution in a lower resolution will evoke older space opera RPGs, or will it just look really stupid?


Star Revolution Update 4

Finally, a new image!

It's almost tactical combat!

This isn’t really a screenshot of Star Revolution. It’s a screenshot of a prototype of the tactical combat system I’m working up. I’m going to actually release this prototype when it’s completed (I’m hoping by the end of the weekend) and let you guys rip it to bits for me. If you’ve played any turn-based tactial games in the past (Jagged Alliance, Final Fantasy Tactics, Front Mission 3 or 4, Advance Wars, etc) you shouldn’t have any trouble figuring out how the system works, but I’m hoping that the changes I’ve made will make combat go a little faster and look a little more fluid.


Spore

Spore is back in the news, now that an edited version of Wil Wright’s presentation is available on YouTube and Google Video.

We’re all gushing superlatives (myself included), but it’s actually quite difficult to overemphasize how important this game is. Games used to use generated (instead of pre-created) content all the time – read this excellent Guardian article on the creators of Elite for an instructive example. (Try to ignore the completely irrelevant Reagan and Thatcher-bashing.) They did this simply because they didn’t have enough room on their media to store all the data for their worlds.

Then CDs came along, and suddenly that room existed, so we (as game developers) ditched generated content for the much prettier custom-created content. Now we’ve got games on DVD, and we’ve got the opposite problem – so much room, and such high player expectations, that the content takes forever to produce, driving the cost of the game up and driving the actual game playing time down (witness all the games that can be beaten in ten hours or less).

If this game comes out and is successful, it will prove that triple-A titles can be made with generated content. Generated content will become easier and easier, and finally it’ll become another standard tool in the game development toolbox, like first-person controls and streaming levels. This is something that has been needed for a long time.


The Ground Rules

Here are the rules for my Space RPG Project (I am going with the title Star Revolution, based on Sol’s suggestion):

1. I am free to use any code I’ve already written in this project. This includes my framework and any other code from Inaria or my previous projects.

2. The game must be completed by April 30th, since I intend to do three of these projects this year.

3. This game will have sound and will feature procedurally-created planets, since I need to learn how to do that. I’ll be using FMOD for sound, it’s teh awesome and I’ve used it before.

4. This game will not use the SDL. Instead, I will be using OpenGL. This is both to learn the API better and because…

5. This game will feature 3D entities in the game world – the planets and ships will be 3D. But because 3D content creation takes so long and because I can’t simply grab pictures of aliens off the web…

6. Only programming and design will count against my forty hours – creating 3D entities and other artwork will not. Otherwise, there’d be no way for me to get the project done in the required time.

Yes, I could probably use 2D-only graphics and grab alien art out of Starflight, but I was going over the technical requirements of the game and honestly…it’s not that different from Inaria. The procedurally-generated planets were the only real difference; otherwise this game is just “Inaria in Space”. I wouldn’t learn enough from making Space Inaria, so I added the new requirements. I don’t think I’m cheating that much; if this were a “real” project, all of that art would simply be handed to me by an artist instead.

So that’s the nature of the current game. Wish me luck!


Inaria Postmortem

Around the end of October 2005, I decided to try to write a complete computer role-playing game in forty hours. I was inspired by this article by Jay Barnson on GameDev.net, Jeff Vogel‘s excellent work, and by my own love of RPGs. I am a professional game developer, but I’d never written an RPG engine and considered that a “hole” in my experience.

I picked a time limit because I’ve also been fascinated by people being forced to do the best they can with their skills under such limits; this was one reason why I wrote my Iron Gamedev article (the other reason was that I was feeling really goofy that day). And of course competions like the Ludum Dare also inspired me.

The project is now complete. You can download the game here, and the source files for both the game and the editor here. Here’s a screenshot:

Mmmm...pixels.

Now, the point of this project was to learn, not necessarily to make a complete and fun game. That said, I did want to make the game as good as it could be in the time I had. Here’s an excerpt from my original design doc with my goals:

We need four things to be able to call the project a success.

We need to create the map structure and populate it with an initial terrain layout.
We need to allow the player to walk around the map and be blocked by passability data.
We need to create monsters and have them move toward the player and attack him when they get in range.
We need to allow the player to attack back, and to have the player somehow gain in abilities when he succeeds in killing monsters.

That’s it. If we get that, we can publish it without fear of too much ridicule.

But that’s not enough. What I want is:

A map structure where every map cell is a list of critters placed on that cell. When the cell is drawn, all objects in that cell are drawn, from bottom to top. Since the terrain object will be pushed on the map on load, it will always be drawn first, on the bottom.

A map structure that contains data for map links.

An inventory and a current equipment screen.

If we get all this implemented, I will consider the experiment a resounding success.

Finally, what I’d really like is:

An overworld, three towns, two castles, and eight dungeon maps.

An overall plot, no matter how thin.

Quests and quest objects.

If we get all this implemented, I’ll be damn suprised.

Well, I didn’t get quite everything on my list done, but I’m still very surprised at how much I accomplished. I got the map structure I wanted, an inventory, buying and selling, NPCs with different AI behaviors, levelling up, one town, two castles and eight dungeons. And a very, very thin plot, but not quests or quest items.

I kept rigorous track of my time, but since I have a full-time job and a family, I wasn’t able to spend my hours over the course of a weekend or even a week or two. It took me about three months to finish the project, and I actually feel I did well completing it in that time. I am actually alloting myself four months to complete my next forty-hour project.

I would break down my time spent as follows: about five hours was spent fiddling with graphics, about thirty hours was spent writing code, and about five hours was spent creating the NPC data files and game levels.

What Went Right

Kicking it Old-School

Emulating an old Ultima-style RPG was the right tack to take. If I’d tried to write a 3D RPG, I simply would have gotten overwhelmed and probably quit. The feature set I wanted fell into the “tough but doable” range and made for a perfect forty-hour challenge.

Using the SDL

I wouldn’t have completed what I did if I had not used the SDL and instead just used DirectDraw. End of story. I cannot imagine why someone would not want to use it for a project like this, it was so easy to use and saved me so much time.

Grabbing Graphics off the Web

All the items, monsters and NPCs in the game came from this page of free RPG tiles. This was a lifesaver – if I’d had to create the graphics myself, not only would they have looked like crap, I would have burned so much time on them that I would not have had any chance of completing my goal. As it was, I could not find any decent terrain tiles that I liked, so I ended up grabbing a lot of the ones I used out of Ultima VI. This cost me at least two hours, unfortunately.

Making an Editor

I spent about five hours making an editor for the engine – you can see a screenshot of it here and it’s included with the source package linked above. I think this may have been my smartest move. I ended up spending far too much time on the code and far too little on the maps (see What Went Wrong, below), but if I hadn’t had the editor I probably wouldn’t have gotten more than one or two maps into the game.

Using my PDA to Sync Projects

I have an Asus A620 PocketPC-based PDA. I love it, and one of the things I use it for is to keep projects synched between work and home. This way I was able to work on my project at work, sync my PDA, take it home, sync it at home, and pick right up where I left off. Now that I’ve got some webspace, though, I’ll probably set up a Subversion server to make it even easier, and give me real source control features like versioning.

Blogging the Process

This was vital. The fact that I knew people were watching kept me going when I got really tired of the project 🙂 I’d like to thank my friends Ryan Clark and Tom Mauer from work who tracked the progress of the project with interest, as well as Andrew Wooldridge and Gianfranco Berardi who linked to me, and to Sol who piped up with helpful suggestions when I mentioned I was using his tutorials.

What Went Wrong

Hoo boy, where to start?

Well, first, here’s a screenshot of the most visually interesting bug I encountered during development:

I'm walking on mouths.

Multiple Mistakes with the Editor

I made two huge mistakes with the editor. First off, I made it too early in the project. I made the editor when I felt I needed map data to work on, but once I had the map I then added lots of features to the map structure…which the editor then didn’t support. I had to add the map level number, map name and map links all by hand. The editor still saved me time, but it could have been even better if I’d just made a temp map by hand to work on, finalized my map data structure, and then made the editor.

My second mistake was a doozy. I split the editor off into its own project, instead of simply creating a new editor source file in the base project. By splitting the editor off, I ensured that all maps would have to be moved from the editor folder to the actual game folder before they could be tested – and then moved back if additional work was needed. Maps quickly got out of date and filenames got confused. I finally fixed this by putting a hardcoded path into the editor source so that it saved and loaded from the game folder, a terribly hacky solution.

Secondly, I ensured that all the changes to the source files I made while writing the editor had to be merged back over to the game project, and then changes made there had to be merged back into the editor…it was just bad. Still much better than no editor at all, but these mistakes caused me to eat up time that could have been spent making the maps better. Which leads me to…

Too Much Time on Infrastructure, Not Enough on Content

Now…this is a thing that went wrong, but in the end, this was a learning exercise, not an attempt to make a publishable game. I wanted the game to be as good as it could be, but in the end the quality of the game is not that important.

That said, the game could have been twice as good with just one or two more hours spent on the content – and I’d have had those hours if I’d both planned better and not made those boneheaded mistakes with the editor. There are features in the engine that the player will never see…because I didn’t have time to write content that uses them. Yay!

Schizophrenic Source Code

I almost didn’t want to post the source…in just about every case, I started doing things the “right” OOP-ish way, and then reverted to procedural programming when time got tight.

For instance, there is an NPC class. Great! Do I subclass from that for all my NPC types so that I can program in individual unique NPC actions? Nope, I simply use that one class and have the Update() function determine the NPC’s type and perform actions based on a classically bad switch/case statement. The input code is atrocious; I’m doing tons of stuff there that have nothing to do with input. I felt like crying when I put the code to draw the hit marker and projectile marker inside the input function with their own frame pumps…but it was either do that or cut them completely. I guess I can console myself with at least knowing that it was bad.

Conclusion

Despite all of that, I do consider the project a success. I learned a lot and created a fair amount of code that can and will be reused for other projects. And I’m planning on doing three more of these forty-hour learning exercises over the course of the next year.