The Map Editor

First thing I’m planning to work on is putting together a simple map editor. This will allow me to outline some of the main data structures in the game – maps, tiles, items and monsters. It will also give me some hands on experience of working with SFML. I’m intentionally going to keep the game and editor designs and layouts very similar to minimise creating different sets of code for very similar functions. I quite like the idea of building the editor and game engine as a single program so that I can switch between designing and playing with a couple of key presses, hopefully speeding up game development. Editor features will likely include:

  • Variable map sizes (max. 256×256) – plenty big enough in my opinion
  • On-screen tile display for tile selection
  • Map links – link overworld to towns etc
  • Load, Save, Play options
  • Small tile versions available for overview mode
  • Properties for tiles?

I’m in two minds as to whether tile/object properties should be editable through the editor – this might be too much work for me. I’ll have a think about it anyway. Game data will be stored in simple text files for the time being – probably comma separated.

CPRG Outline

Before I start attempting to code this I thought it was worth listing the type of features and stylistic elements that I’d like my Ultima-style game to have. I’m sure some of these features will change over time but here’s a rough outline to begin with:

  • Single player character rather than party (this may change)
  • Individual maps for overworld, towns and dungeons (as opposed to the Ultima 6, all one scale/one map model)
  • Detailed, non-generic maps that aren’t too big
  • Combat on current map rather than separate “combat” maps
  • Simple to use interface (both keyboard and mouse ideally)
  • Player character and encounter inventories
  • Quest journal to keep track of current tasks and quests etc
  • Graphical inventory
  • Tile graphics (using David Gervais excellent tiles)

There are loads of other features that I’m wanting to include but these should give you a rough idea of what sort of design I’m aiming for.

Ultima-style CRPG

For many years I’ve been a big fan of the Ultima games and have always wanted to create a game of my own in a similar style. A couple of recent events have finally made me decide to actually start coding one of my own. The first was the release of the Simple and Fast Multimedia Library (SFML) which I think will be ideal for the sort of games I’m trying to create. The second was reading this article on Retro Remakes. The article is about writing an Ultima style game in a fixed 40 hour timescale. The game is called Inaria and further details can be found here.

I’ve always had a preference for the earlier Ultimas such as IV, V and VI. For some reason I’ve never really got into VII which is generally considered to be the best. With my own game I’ll be looking to incorporate what I think are the best features from the various ultimas along with ideas from more recent commercial RPGS and home brew roguelikes. I’ve always liked the style of these games which are usually characterised by simple 2D tiled graphics, a large world map and numerous towns and dungeons to explore. Other similar games include Wasteland, Phantasie and Questron.

Simple and Fast Multimedia Library 1.0

I’ve been having a look at the Simple and Fast Multimedia Library (SFML) and it seems quite interesting. You can find out more about it at:

To quote from the website:

SFML is a portable and easy to use multimedia API written in C++. You can see it
as a modern, object-oriented alternative to SDL.SFML is composed of several
packages to perfectly suit your needs. You can use SFML as a minimal windowing
system to interface with OpenGL, or as a fully-featured multimedia library for
building games or interactive programs.

I’ll keep my eye on this one as it looks very promising and has some nice built in features. I’ve been looking for something that offers a balance between the low level of SDL and the higher level of say Allegro and SFML looks about the right balance for me.

Rogue’s Gallery

Spent some time at the weekend collecting more Encounter images and preparing them for use in the current release. My method for capturing these is pretty tedious but doesn’t take too long as there aren’t too many different encounter graphics and some are reused for different types of encounter. I basically save screenshots from within the Atari800Win emulator, cut out the encounter image, double it’s size to fit a 64×128 pixel OpenGL texture and then remove any unwanted background. In future I’ll need to capture the additional animation frames that many encounters have but for now encounters aren’t animated.

I also had a play with some of the Eye of the Beholder graphics I’ve used previously but I think I’ve decided not to use these as they are limited in number leaving many AR encounters without updated graphics. Here are a couple of examples anyway.

Currently I’m creating black and white masks for each encounter image but I’m hoping that I might be able to do away with this possibly by using OpenGL’s display lists. The AR font is drawn using this method and seems to work fine and doesn’t require any manually created masks. Browsing round the web I found a program called GraphicsGale Free Edition which is a sprite editor that might be useful for hand editing of the original AR encounter graphics.

I’ll need to set aside a lot of time if I end up hand editing all these original images…

Gate Sequence Fixed

Finally managed to get the counters appearing in the right place on the gate sequence. Basically there are a number of different counters spinning round at different speeds. Pressing a key freezes the numbers and these become your character stats within the game. It also determines how much silver you start the game with.
It didn’t take very long to fix once I managed to understand the code – that’s the problem with using my old code from a few years back. I also tweaked the random numbers for the stats as they seemed a bit low and added in the “You are now joined.” message. Added in the original sound effects for this sequence. I will come back to this part of the game in the future but now feel that I can move onto something else.

Development Tools

I’ve recently made the switch from the freeware Dev C++ environment to Microsoft Visual Studio 2005. Dev C++ has served me well during the time that I’ve been playing around with this AR project but I decided to give Visual Studio a try and it seems to have worked well so far. I was really only using a bit of the functionality of Dev C++ but one feature that it didn’t seem to have was an option for “folding” bits of code that you’re not working on. Visual Studio also seems to be creating dramatically smaller executables. However these larger exe sizes in Dev C++ might have just been down to the compilation defaults which I didn’t play with much. Visual Studio also seems to have caught a number of errors which went unnoticed by Dev C++. Again possibly down to different configurations. I’m still barely using any of the facilities within Visual Studio. An experienced programmer could probably show me lots of things I should be using to make life easier. Still not sat down and tried to familiarise myself with the debugger. I still think Dev C++ is very good and would recommend it to anyone looking for a free, easy to use option for programming. Dev C++ also has stacks of pre-packaged libraries called devpacks that can be downloaded for things like SDL, OpenGL etc. You can download these from here.

I’m not a programmer by trade though I’ve done bits of programming since I got my first computer back in the 1980s (a Commodore 64 which I wanted because it had 64k of memory which seemed to more than the alternatives at the time). I’ve also done bits of programming through study and work but nothing substantial. I did hold the job title “Programmer” for a few months but moved into a different area that I preferred. Most of the AR project code is probably not very well written. I’m planning to release the source code and VS2005 project files with the next release so if anybody wants to suggest any improvements or ways of making things easier or simpler feel free! I’m planning to spend some time tidying up the code before then. The display code in particular could probably be tidied up a lot and needs some fixes to stop ghostly arches appearing through supposedly solid walls. I know what the problem is here so can hopefully fix it without too many problems.

I’ve done some more work on the character creation gate sequence but I think it will take me a while to get it to the stage where I can say it’s completed. As you can see in the screenshot the counters are roughly in the right place but don’t look right yet.

The next thing I would like to look at is setting up “zones” on the Dungeon map. The zones will identify rectangular areas on the map where different graphic wall sets should be used. I believe this is how the original game worked. If you’re unfamiliar with the original different areas had different graphics to identify them – Egyptian hieroglyphs in the Hall of the Adept, ice walls in the Crystal Caverns and so on. I’d also like to setup different light levels for different zones as this should be relatively easy to do as I’m using OpenGL. These light levels could then be adjusted if you’re carrying a torch or wearing a Helm of Light or one of the countless other light sources in the game. Currently the demo lacks atmosphere as all the corridors and rooms have the same wall textures. I also plan to use the various zones to determine which monster encounter table should be used. A few years back Ken Jordan (one of the original programmers of The Dungeon) posted some information, maps and data files for the Dungeon and he said these contained the zone information. I’ve not decoded these but if anybody has I’d be grateful if you’d let me know – I like to use the original game data where possible.