Game Programming and Development Tools

RevX postmortem & new version – steveth45

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
I thought I'd share my experience with the game competition, and give a little history of the game Cohort and I made.

I. Getting Started
I spent the first two days of the competition on a camping trip, the next two Cohort had misplaced his cell phone so we finally got started on Thursday, the fifth day. We decided to do an old school RPG style game involving an angel fighting demons ala Revelation 12:7,8. Cohort started working on the art side and I went to work on the programming.

II. The Engine
I decided to do the game in a 2D style but use Irrlicht with OpenGL for fast, hardware accelerated rendering. For the battle screens, I decided to use an orthogonal perspective rendering mode which means there is basically and infinite perspective where items that are closer are not larger. The render loop draws the background and the characters as billboards. This would allow us to add 3D models instead of billboards, if we chose to do so. For the font, I used a tool that comes with Irrlicht that makes a tiled bitmap out of any font. We picked fixedsys because it's low-res and has the old-school RPG feel.

III. The Map
For the world map I found Hermann Hielmann's excellent tileset and a great tile map editor called Tiled. Tiled is written in Java, so it's cross compatible. Also, it supports all different map and tile sizes, multiple tilesets at the same time, multiple layers, partially transparent layers, etc. Since Tiled is written in Java, there was no reference code in C++ for loading the map, so I had to write my own. The Tiled .tmx map format is based on XML, so I used IrrXML (made by the author of Irrlicht) to load the data. Then all I had to do was draw the map based on an offset. I used the draw2DImage() method in Irrlicht to draw each tile. Eventually I decided to encode all the data about the map I needed in the map file itself. So, I made extra layers that would not be drawn but would define where things were like places the character can't walk, where the fountains are, where the easier and more difficulty monsters are, etc.

IV. Battle Mode
By the last night of the game competition, we had all the artwork together, the map mode was working fine, font rendering, and the stats and equations for fighting, but the battle mode was messed up. I needed to slow things down so the character would attack, swing his sword, then the monster would receive damage, etc. Since the game loop is going 30 frames a second I needed a way to make the game wait. What I came up with is a battle event queue. The events consist of a type, associated values and a text string. The text you see at the bottom of the screen is the text associated with a particular event. The game only takes one item off the queue every 30 frames or one second. Certain events can trigger other events which are then placed on the queue. For example an attack event triggers an animation event which triggers an event that calculates and reports the damage given, etc. Other things trigger events. Once all the characters have made their move, the game checks to see if all the enemies are dead, adds experience points to the character and exits to the map mode.

V. Testing
I only had enough time to find the bugs and not enough time to tune the gameplay. So, the game is a little hard. Until your character wins a couple battles and starts to level up, you are fairly vulnerable to even the easier enemies. We also didn't get a chance to add plot text, save games, sound effects or music either.

Just so people, not the judges, can play the game and possibly enjoy the experience, I added a save game feature today (F5 to save, F7 to load while standing still on the map) and evened out the odds a little bit regarding the enemies. Now the game should be a little more fun. The 2.0 version is only available for download from my webpage here : http://steveth45.net/RevX_v2_1.zip . Remember, hit F5 on the map to save your game (while standing still. If you die, just load up the game again and hit F7 to load the last save. I didn't want to violate the no patches/no updates rule, so I'm not uploading the new version game to the ftp server. The judges have to play the extra difficult, no save game version.

Maybe Cohort X can chime in with some of his techniques for doing the character art.

------------------
+---------+
|steveth45|
+---------+

[This message has been edited by steveth45 (edited September 20, 2006).]

Cohort X

Member

Posts: 126
From: The Great Pacific Northwest
Registered: 09-16-2006
I don't know that there is that much to say from the art side. I spent most of the time sketching ideas that I didn't use. As far as what made it into the game...
I typically started with a sketch either on a sketch pad or a sheet of bristol board and then I either scanned it in or took a low resolution picture of it. I then inked the outlines and major details either with a dip pen in some india ink or with fine tipped roller pen and scan it in. Then I'd do some coloring in gimp on different layers. I'd use the inked layer to make a quick selection with the magic wand tool and delete the empty space on that layer and the shaded pencil layer. I left the ink layer on top and turned it into a multiply layer. I copied the shaded layer a few times and made those multiply layers. By locking the alpha pixels, these copies of the shaded layer became safe areas that I could color on without ruining the lines and shading. If I didn't like the pencil shaded effect I'd go to town with the dodge/burn tool to do lights and shadows, or I'd pick a lighter color put it on another layer and play around with smudging it until it looked alright.

Then for the moving and attack poses I'd just manipulate everything in gimp. Lots of copying flipping and smudging.

Steveth worked alot harder than I did

buddboy

Member

Posts: 2220
From: New Albany, Indiana, U.S.
Registered: 10-08-2004
you use the GIMP? sweet, so do I. as does CPUFreak. i've used the technique you mentioned before. it works pretty well, tho it took me a while to figure out how to do it =D wow, you had a lot to do Steveth. for some reason tho, when i played it, i couldn't figure it out. it was either moving really slow, or i wasn't doing something right... lol.

------------------

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
Budd, you just walk around the map and when the enemies attack, you have two choices: attack or pray. When you attack, you have to select the enemy by the transparent square closest to them. This is done by clicking with the mouse. That's about all you need to know. If you get the version on my webpage, you can save your game by hitting F5 while standing still on the map and load by hitting F7. Watch your HP, pray if you need to. The goal is to relight the seven lampstands and defeat Satan, represented by a large, red dragon hiding in a cave in the northern region of the map.

------------------
+---------+
|steveth45|
+---------+

ArchAngel

Member

Posts: 3450
From: SV, CA, USA
Registered: 01-29-2002
I kept dying, so I stopped playing and just wept.

oh, how my failures weigh down my shoulders.
woe is me.

------------------
"Patience, my good citizen, patience. It's bad enough to rob a man of his dream"
-Sydney Carton, Tale of Two Cities
Soterion Studios

Jari

Member

Posts: 1471
From: Helsinki, Finland
Registered: 03-11-2005
It was difficult indeed and because this is not my game genre I didnt play much. But I am impressed how you made it from scratch since it's technically well done!

------------------
1Jo 2:9-10 He that saith he is in the light, and hateth his brother, is in darkness even until now. 10 He that loveth his brother abideth in the light, and there is none occasion of stumbling in him.
Joh 17:26 And I have declared unto them thy name, and will declare it: that the love wherewith thou hast loved me may be in them, and I in them.

[VoHW] (Help needed) [Blog] - Truedisciple (mp3)

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
quote:
Originally posted by ArchAngel:
I kept dying, so I stopped playing and just wept.


The first couple battle are difficult until you get to level 2. I got to level 10 on the competition version, and then level 16 on v2.1 with the save games.


------------------
+---------+
|steveth45|
+---------+

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
quote:
Originally posted by jari:
It was difficult indeed and because this is not my game genre I didnt play much. But I am impressed how you made it from scratch since it's technically well done!


Thank you very much.

------------------
+---------+
|steveth45|
+---------+

Cohort X

Member

Posts: 126
From: The Great Pacific Northwest
Registered: 09-16-2006
in version one if you use all your skill you've got about a 1:3 chance of surviving to level 2. once you hit level two you should be able to make it to the end if you don't try to advance too far at a time.
SSquared

Member

Posts: 654
From: Pacific Northwest
Registered: 03-22-2005
Yes! Good work. I'm sure you learned a lot. It's the nice beginnings to something bigger and better. Any future plans along this similar line?
steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
quote:
Originally posted by SSquared:
Yes! Good work. I'm sure you learned a lot. It's the nice beginnings to something bigger and better. Any future plans along this similar line?

Actually, yes. I don't think I'll spend any more time on RevX, specifically, but I am happy with the codebase I've created. One nice thing about using a tile map editor with multiple layers is that I could define much of the game in the map itself. I'd like to take that code and extend it. Also, since the tile editor I used, Tiled, is open source, I could extend it to be able to add more pertinent or specific information to the map. The enemies, associated images, and their stats were hard coded into the main.cpp file of the game, but I could easily offload that to an XML file. In fact, all the specifics for a game could be described in an XML file. I could write a C# frontend for that XML file, so you could edit the variables for a game easily without having to recompile the source code.

In other words, I've been thinking about turning it into a general RPG-making tool that anyone could use. I read an article about data-driven game development where you define as little as possible about the game in the source code, and allow the game data to define the game. That's why some games can be modded into almost anything you want, because all the gameplay is defined in scripts and data files.

------------------
+---------+
|steveth45|
+---------+

SSquared

Member

Posts: 654
From: Pacific Northwest
Registered: 03-22-2005
Excellent! Yes, I was doing data-driven as well, although I didn't quite complete it. My intent was for anyone to come along and easily create a map with obstacles and even create new pieces rather easily. All of my data is wrapped up in code, though. Eventually, I was hoping to get to a file-based system.

Unfortunately, the data-driven stuff is about 75% working. I didn't have time to finish it and so ended up writing a few specific cases in the code...things like, "If this is an archer then his attack is only this specific thing"....blehhhhhh....that's what I was trying to get away from. If I ever finish this project, all of the data will be embedded in the type of piece itself. Then someone can easily define their own piece with movements, attacks, etc. Supply a new image and there ya have it! A newly customized game piece without changing any code.

HanClinto

Administrator

Posts: 1828
From: Indiana
Registered: 10-11-2004
Hey Steveth!

Wow, so I played your new version of the game, and I must say I'm impressed!

I actually worked my way all the way up to face THE DRAGON -- and -- needless to say, I got pretty stomped.

So I screwed around with the default.sav, and then went back to face the dragon. He usually did 0 damage, but every once in a while he got a hit on me for 1. I thwacked him for somewhere between 200 and 600 each time, and finally was able to kill him. Yay.

I got up to level 15 via legit methods, but man -- those Dark Stumblers are *tough*.

Great job on the re-release, Steve!

quote:
Originally posted by steveth45:
In other words, I've been thinking about turning it into a general RPG-making tool that anyone could use. I read an article about data-driven game development where you define as little as possible about the game in the source code, and allow the game data to define the game. That's why some games can be modded into almost anything you want, because all the gameplay is defined in scripts and data files.

I've been learning that trying to make code so generic that it can be used for anything is the same as saying that the code is good for nothing. I think it's a fine art to learn how to make your code flexible enough such that you can modify your game easily, but make it specific enough so that there isn't a lot of bloated framework that gives your engine capabilities it's never going to need.

--clint