I do not know if it is readily apparent to the casual observer, but things have been very exciting in the
Small Cave Games these last few weeks.
Over the last few weeks we have gotten our animated models going, optimized a lot of code to achieve a 60 frames per second benchmark. We have gotten some awesome models in place by our talented artist and rig-meister. Plus we have added a ton of polish to make this game feel much more comfortable, natural and pleasing to you, the player. (I talk about you – yes, you specifically – in a lot in the comments within the game code. I say things like:
“The player must select one of these”,
“The player will want to throw their controller if I don’t change this section”, or
"the player is not only good looking, but smart and talented as well" all over the place.) We have finalized our inventory screen (see screenshots in previous blogposts) and have made it intuitive, informative and visually appealing. We have even added some preliminary intelligence to some characters, and they can chase you around the screen.
In fact, I would dare say that we have made more tangible progress over the past 4 weeks than we have made during the previous 4 months. Maybe 6-8 months.
Notice that I distinguish “tangible” progress. We are currently at a point in the development of the game where there is a lot of front-end work going on. That is to say everything we are working on now will be visible by the user. And the reason the progress and momentum is currently so satisfying is due to the solid foundation of the back-end. That is, all the stuff you do not see. I went to great lengths in the design phase of the back-end to ensure that front-end development would be a snap. And it is paying off now.
The back end of the engine is almost so boring that I do not want to write about it. It is not boring to develop (in fact, I really enjoyed developing the back end to this game), but from a player’s perspective, it is probably very much like taking the cover off of your computer and looking at all the boards and storage devices. You know it is there, you know it is all important, but unless you work in there, you would just as soon leave the cover on your CPU and surf the
intarwebs.
As it turns out, a very large part of designing (if not necessarily implementing) the back end of the engine was the development of a level editor, or a “Region” editor as I have been calling it (because our “levels” are not necessarily region-based, and region traversal is non-linear). About halfway through the design phase the tile-engine, an idea occurred to me that I should make it easier for the game’s level designer – that would be Carl – to design these regions, or else making regions is going to be unbelievably tedious, and unnecessarily complex. Since I am loading in the regions as content objects using the
XNA Content Pipeline, the regions need to be designed in XML. And who wants to look at raw XML all day long? Not me.
It also occurred to me that if designing levels is an extremely unpleasant process, then the final results may suffer because of that. That is to say nothing of our sanity. I know that after pasting in the XML codes for the 5,000th Large Rock, I would probably snap and my poor neighbor would end up on the 6:00 news saying: “He was such a quiet guy. He mostly kept to himself. I don’t know what happened”.
So Carl and I thought it would be a good idea to develop a separate application that would allow you to design game regions, and be able to save them in a format that the game already uses. Our RegionEditor was born.
The region editor, unlike the game itself, is currently written in C++ and uses
Managed DirectX (MDX), as opposed to
XNA. I decided to use MDX instead of XNA because MDX doesn’t have the
annoying VertexShader/PixelShader 1.1 requirements. This requirement was a serious hindrance earlier on in development because my computer was older than my oldest child, and the video card in it was even older than that – I have since upgraded to a newer model, but we kept the MDX software in place, in case we get a developer with a video card that is incapable of dealing with XNA.
I decided to write the editor in
C++ because C++ is my native tongue. I prefer to write in C++, I write more efficient code in C++, I write code faster in C++ (believe it or not), and because the editor started life as a Win32 native app (using the native DirectX library) rather than a .NET app. I ended up switching to .NET and MDX for one very small (seemingly insignificant) reason. .NET has a PropertyGrid control built in and Win32 does not, nor were there any non-MFC freebies that I could find, and I didn’t have time to write a good one myself.
Here’s what it looks like now.

I think it looks pretty good, and it is definitely going to be easier to work with than straight raw XML data.
At first, this was a 2D editor. Instead of the 3D terrain in the workspace above, there was a 2D map. When you placed, say, a character on the map, you would get a little icon that indicated there was a character there. (Actually, you would get a hand-drawn circle to indicate there was a character there, and attached to the circle was a hand-drawn arrow indicating the direction the character would be facing when the region was invoked). In the 2D editor, characters and objects look identical except for coloring. The only way you can tell what type of object is specified by a given selection you have to refer to the property grid.
The 2D editor is functional, and that is what we are currently using to perform preliminary designs on a few levels. However, there are several mighty drawbacks to using a 2D editor.
First and foremost is the scaling of objects. If you want two adjacent rocks, you really have no way to tell if the rocks are too close together or too far apart, except for educated guesses and luck. Also rotation is a crap shoot. Oftentimes, especially with rocks, outlying vertices have wildly varying distances to the object’s centroid.
That could be fixed with clever manipulation of 2D sprites – and that is what I was going to do, except for the next drawback: A 2D editor simply cannot give you a good feel for what the final 3D level is actually going to look like. If you look at a map of
New York City, you will see all the streets and avenues represented on the map. You can see Broadway on the map, and you can see 42nd Street and you can see Central Park – but in no way does looking at a map compare with standing on Lexington Ave. and E 85th Street buying a hot-dog and listening to a cab driver telling the squeegee guy to go !#%@ himself. The only way to overcome this problem was to create a 3D editor with the ability to actually enter the world and manipulate it.
The last problem, but by no means the least important, is the fact that using the 2D editor with lame visuals is almost as tedious as working on raw XML. As I mentioned before, if creating levels is an excruciating task, then the quality of the levels will suffer for it. Both Carl and I wanted an editor that would not only be intuitive and efficient, but also make designing levels a pleasant (even fun) experience.
I should have the first real draft of this region editor ready this weekend, and if all goes well, Carl will be cranking out areas left and right by Monday morning. This should bode well for screen shots that appear here. Right now the regions that we’ve shown you in screenshots have been designed in the 2D editor or are edited by hand in Notepad. With a fully functional 3D editor in place, we should be able to crank out stuff that is really pretty and have fun doing it.
Ok – I have babbled enough. I have a game to write.