Added Tile Properties

It took me a while to sort out the new file format for the terrain objects but I’ve now got a simple machine/human readable format which I can reuse for the monster and item files. Now that I’ve done this I’ve thinking of splitting game objects into 3 different areas – terrain, monsters and items. The map/item format is very simplistic just now so will probably need to be expanded at some point.
As always I’m wasting time changing little image files instead of sticking with a handful of basic tiles and adding features to the editor and game. Anway I finally added some properties for the different types of terrain in the game. Decided to leave out animation and visibility for tiles just now. For now I’ve kept it very simple with tiles having a small number of properties:

  • Tile no – the image number from the tile sheet
  • Name – a text description for look commands
  • Passable – can the tile normally be walked through
  • Map link – does the tile offer an entrance or exit to another map level (E.g. staircase)

I’d like to really start making Demons Eye feel more like a game. I might add a player status and inventory pages and some simple console style messages. It would also be nice to be able to have a bit of simple treasure hunting and combat!

Bitmap Fonts

Added some bitmap font functions. SFML already has good font support for many popular types of font built into it but I was wanting to use a simple fixed-width bitmap font. The font in the picture is from Alternate Reality: The Dungeon. A simple map loader has been added (loading in an Ultima 5 map in the picture) but I still need to add a save function.

New Tiles

As I now have a working map viewing program I decided to change the temporary Ultima tiles and map for the David Gervais tileset. For those not familiar with this tileset they are a very large colletion of tiles designed for Angband originally (I think). OK so this screenshot couldn’t be more boring if I tried but it does demonstrate a larger view area and also illustrates the use of transparent tiles which just took me a few minutes to work out using SFML.

Behind the scenes I’ve also started adding additional tiles to the game. Basically I have one large image which holds all the 32×32 pixel tiles for the map, items and monsters and SFML can be told to use just a small portion of the image to make up each tile. Now that I’m up and running with coding the SFML side of things seems very easy to use.

Next thing is to setup different properties for tiles such as whether they are passable, water etc. I also need a more interesting map!

Demon’s Eye

As you may have seen in the previous screenshots my CRPG game is now provisionally known as Demon’s Eye. This is based on an adventure game I started writing about five years back. Not a very original title but it’s better than calling the project CRPG! Send me your suggestions if you’ve got a better title in mind.

A Simple Map – 4hrs

It’s been a while since my last post so what have I been up to? After a slow start I’ve finally started to make a bit of progress. I’d decided to start my coding by putting together a very simple editor which would allow me to start creating maps and building up features as I went along such as item handling and encounters. I really like the idea of a combined editor/play environment so that I can build and test quickly.

So I built up a simple tile sheet which would be displayed at the side of the screen and would be used to select tiles with your left and right mouse buttons. The rest of the screen would be taken up with a large viewport onto the current map. You would be able to scroll around quickly and use the mouse buttons to place tiles onto the map. This seemed like a sensible place to start and not too difficult or time consuming to code. That was the theory anyway.
I failed to account for my inexperience of using SFML and the time it would take me to get into the swing of starting a new project. It took me a number of hours to sort out various bugs in my display code and work out how to do various simple display tasks properly in SFML. As I started making myself more comfortable with SFML and getting back into coding, the focus shifted away from the editor to just getting a simple map format setup and a tiled map view displayed on the screen. This was frustrating as the code is short and straightforward but you have to remember that I’m not much of a programmer. Anyway eventually I got my simple view onto the screen using the Ultima IV tileset and a map of the town of Moonglow (also from Ultima IV).

This simple example lets you move around the map using the cursor keys and sets up map boundaries. In the example I used an 11×11 map window like Ultima IV but I’ll be making this much larger so you’ll see a much larger portion of the map at one time. It was satisfying to finally see something vaguely game-like on the screen even if there is currently nothing to do. I’m currently thinking through the possibilities for the rest of the display. This will most likely feature character and inventory information on the right hand side in a column with a rectangular message window running along the bottom of the screen . At a resolution of 800×600 that should still leave plenty of space for the tiled map.

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.