More Commodore 64 CRPGs

Was it really September 2019 when I last posted here? Wherever you are I hope you, your family and friends are healthy and safe during the current COVID19 pandemic. I’m working remotely from home during this time which has its challenges but have done quite a bit of CRPG development since last year.

I’ve been focusing on creating a CRPG for the Commodore 64 computer. It’s my all time favourite despite its age and I find working within its limitations and restrictions a (mostly) enjoyable challenge. There are basically 2 C64 projects I have in development.

One game is currently called “Demon’s Isle” and is a classic Ultima style game with an overhead view and tile based maps. It’s a couple of months since I worked on it but I’ve lots of ideas on how to improve it technically to make it smoother and provide more graphic variety.

The other game doesn’t really have a title, although I have considered “The Citadel”. It’s a first person, single character game in the style of The Bard’s Tale, Legacy of the Ancients and Alternate Reality. Most of my time here has been working out how to make creating the map wall sets easy and quick to transfer into game builds. I have 2 brief videos on my YouTube channel illustrating the first person view but development has advanced quite a lot since the last video. I’m making steady progress with regular improvements and adding new features.

Both projects are written in a mixture of C code (using the CC65 compiler, assembler and linker) and 6502 assembly language. I am using assembly language for those parts of the game which need some additional speed such as the first person 3D view and overhead map view. These have both been significantly improved with 6502 code since my last video.

Exploring the streets

For “The Citadel” I’m currently using the C64’s multi-colour character mode which allows a mixture of multi-colour (4 characters per cell) and high resolution characters on a single screen but with a number of colour restrictions. I’ve successfully made use of raster interrupts to split the screen to use a mixture of display modes which gives me some further flexibility when it comes to display options such as more colours on screen and access to more than 256 character definitions on screen at the same time for drawing the 3D views as well as special location portraits.

My main concern just now is running out of memory before the game is well enough advanced. There are lots of areas I can recover memory from though and I haven’t implemented any sort of compression schemes as of yet.

Alternate Reality: A Return to Xebec’s Demise?

In early 2018 I came to the realisation that I probably wouldn’t be able to contribute much time to working on my port of Philip Price’s Alternate Reality (AR) series which I’d called Alternate Reality X (ARX). My last public release was on 21st May 2017 and personal issues had to take priority. Around the same time an enthusiastic AR fan made some changes to my ARX code and then started a brand new AR port written in Java. You can follow his progress at his webpage and on his YouTube channel where he posts update videos regularly. He’s put a lot of work into the project and I look forward to playing it when it’s available.

However, Looking back over my past blog posts and my journey developing ARX, I couldn’t help but feel a nagging desire to work on an AR related project of my own again. My time is still limited and I want to continue work on my own Commodore 64 game project though I have no hard deadline that I’m working towards on that project. Anyway I have a number of AR related ideas that I’m considering.

Enhance the original games

When I started ARX a number of AR fans expressed a desire for enhanced and expanded versions of the original 8bit games running on their original hardware. For me this would be the Commodore 64 and Atari 800. There are a number of positives about this approach and it would allow me to build on my recent experiences with 6502 assembly and coding for the Commodore 64. It has the major benefit that the games are already complete and I can just focus on enhancements without having to recreate code! It would also be an opportunity to hopefully unravel some of the mysteries of Alternate Reality that have eluded players for over 30 years by looking more deeply into the code and mechanics.

However, Not everyone wants to run games on old hardware. To address this I think it would be feasible to package up any enhanced versions with a suitable emulator to make for a smooth, single click experience on a modern operating system. There would of course be nothing to stop players from using their old hardware if they have access to it or emulator of choice on modern systems.

Writing for older systems does lead to some limitations that I think for me could actually be a positive. The hardware and storage restrictions mean I won’t go off on any tangents or wild goose chases, helping me to stay focussed on the core gameplay and playability. I have lots of ideas of features and improvements I would like to add.

This would be a challenging project with a high learning curve for me. Fortunately in 2019 we have a wealth of information, online communities and tools to help us understand the games and speed up modern development for these systems.

New scenarios

One option with a lot of crossover with the project above would be to build new scenarios using the core code from The City or The Dungeon as the basis for a new scenario. It should be feasible to replace the data for graphics, maps, locations, encounters etc with new content. Obviously some new game logic would be required as well for quests and special locations. Opening up and creating The Arena and The Palace within the existing areas within the game maps would also be a possibility.

Revive Alternate Reality X

If I were to consider this then I would be taking some time to review what I had done before and probably strip away lots of the code and partially coded features to make for a more solid foundation. This would take some time. I would probably remove the option for the enhanced graphics and focus solely on gameplay and new features. This doesn’t mean there wouldn’t be new graphics and sounds, just that they would be in keeping with the original 8bit style (or with minor improvements).

I would probably modify the code to make it straight C to give me the option of porting it back to the 8bit machines using CC65 as I wasn’t really doing any “proper” C++ coding anyway. The disadvantage of this approach is that I would have to recreate code from the original game’s 6502 assembly code or through observed behaviour through gameplay.

I’d welcome your thoughts or any other ideas you have that I haven’t mentioned.

My Commodore 64 CRPG – August 2019 Update

Though I haven’t posted here on the blog since April, I’ve been busy working away on my Commodore 64 CRPG. Since I last posted I became a little side-tracked learning how to code certain things on the C64 as well as considering some different game styles.

At one point I was interested in creating some sort of CRPG / Adventure / Choose Your Own Adventure hybrid. I still like this idea but I eventually came back to the idea of doing a more traditional tile based CRPG – I think this is still my favourite style of CRPG although I was also tempted to go for an Alternate Reality or Bards Tale first person view – maybe next time!

I spent quite a lot of time experimenting with the various graphic modes on the C64, coding up examples thinking about their pros and cons which I’ve discussed here previously. I also worked out how to locate and reserve space for graphics and screen displays using CC65. This is the C programming environment for 8bit systems I’m using. It also includes a full assembler so I can freely mix my C and assembly language code as required in a single project. I’m only using it for the C64 currently, but it also supports platforms such as the Atari 8bit and Apple II machines. It’s taken me a bit of effort to get to grips with it but I’m enjoying working with it now.

I also spent some time using the tools in the C64 VICE emulator ( http://vice-emu.sourceforge.net/ ) and the CharPad software ( https://www.subchristsoftware.com/charpad.htm ) to analyse how some of the C64 games I liked worked and used the C64 to build their displays. Some like Alternate Reality use a mixture of modes with raster interrupts to split the screen, Ultima IV a single high-resolution bitmap screen and Legacy of the Ancients the C64’s character mode. As mentioned these can all make the game look different as well as provide different levels of flexibility, use of colour and use different amounts of memory.

In the end I’ve settled for using the C64’s character mode, initially with just high-resolution characters rather than multi-color mode. This mode allows you to display up to 256 unique characters on the screen at a time across the 1000 cells which make up the display (40 x 25 characters). Using CharPad these characters can be made up into tiles ( 2 x 2 in my case) and then used to build up a map. I can use all the C64’s 16 colours on the screen but I’m limited to a single colour on a common background for each screen location. I plan to get around the limited number of characters by loading in additional character sets for different regions.

CharPad – Showing characters, tiles and a map in progress

Using CharPad I can now export my characters, tiles and map into binary files which I’m loading into my C64 program. Currently the tiles are heavily Ultima influenced but I’ll try and make them more unique as time and my limited artistic skill allows! I also hope to make use of the C64’s sprites for characters and possibly encounters. On the C64 you are limited to 8 of these without more complicated sprite-multiplexing coding which I suspect may be a bit of a challenge for me. Next time I’ll tell you a bit more about the game as it currently stands and pose a few questions I’d like to get your thoughts on.

Moving around the map in my C64 CRPG

C64 Bitmap mode…or not?

I’ve been experimenting a little bit with the bitmap modes on the C64. As mentioned previously there are a choice of high resolution (320×200) or multi-color (160×200) bitmap modes on the C64. There are various pros and cons with these two bitmap modes as well as with using the other character based modes the C64 offers.

Bitmap mode – 2 colours per 8×8 pixel cell

Standard or high resolution bitmap mode shown above has the advantage of giving you the full 8×8 pixels per character cell on the screen but you are limited to only a single foreground and background colour in each 8×8 cell. A full screen uses 8K of memory plus 1K for the colour information.

Multi-color bitmap mode – 4 colours per 8×8 character cell

Multi-color bitmap mode has the advantage of allowing you to have up to 4 colours per 8×8 character cell (one of which is a shared background colour) but has the disadvantage of reducing the horizontal resolution in half, displaying double width pixels. It also uses 9K of memory in total but needs an extra 1K for the additional colour information.

Memory usage for both these modes could likely be reduced by 1-2K by using a split screen mode with a text display at the bottom – think Ultima 2 or any of the many graphic adventure games of the 1980s. Many C64 games used a split screen like this to mix modes on a single screen, saving memory and improving display speed.

My initial tests with these bitmap modes are proving quite slow to display compared to my earlier character based version. This is hardly surprising as drawing a single 16×16 pixel tile on the screen will now involve writing at least 40 bytes to the display (characters and colour information) as opposed to just 8 bytes. I’ll give it some further thought and do some more drawing in the various modes before deciding to see if I feel the additional flexibility is worth the increased memory usage and reduction in speed.

C64 RPG Display Choices

An example of mixing multi-color and high-res characters on a single screen

Since my last post I’ve been experimenting with using the Commodore 64’s multi-color character mode. This mode allows you to display 4 different colours in each 8×8 pixel character cell but with the loss of horizontal resolution. Each “pixel” in multi-color mode is effectively made up of 2 horizontal pixels – this sometimes leads to the slightly “chunky” look of some C64 graphics in games. 1 colour is the background, 2 colours are set universally for each character using registers and the other comes from the C64’s screen colour RAM (one colour per character cell on screen).

A C64 multi-color character – Note the 4×8 “pixels” rather than 8×8

It’s possible to use a mixture of multi-color mode characters with standard high-res characters on a single screen. This is done by setting bit 3 of each character cell’s color memory – the value of this bit determines whether a character on the screen is in standard high-res mode or multi-color mode. The downside of this is that you have a more limited selection of colours. Colour values of 0-7 in the colour RAM will display a high res character, 8-15 a multi-color mode character. This means you can’t use colours 8-15 in your display other than as one of the 3 universal colours – so no light red, shades of gray, light green etc (colours on the right hand side below).

The C64’s 16 colour palette (taken from Pixcen)

I’ve done a bit of experimentation with Pixcen and produced a few sample multi-color tiles but it took me a while to understand how the colour limitations work and I find the loss of horizontal resolution hard to work with, and I have little artistic skill to start with! I also need to work out what my graphics development process is. Pixcen seems to be a good enough utility but I think there may be other tools which might suit me better. Some form of C64 graphic, tile and map editor might be required.

So I have a real balancing act to consider, deciding on whether to use multi-color mode (losing resolution and colour choice) or just stick to using high-res characters but having the limitation of a single colour per cell. I’m aware that I could use one of the C64’s bitmap modes which provides the programmer with control of individual on-screen pixels with greater colour flexibility but from what I’ve read that will use a lot of memory (8K just for the bitmap data) and would potentially be slower than using characters. Let me know your thoughts.

New Developments

Here’s the latest image from my Commodore 64 RPG. I’ve added some additional tiles (from Ultima IV) as placeholders and to give me something to work with whilst coding game functionality.

The Ultima IV tiles and C64 character set are temporary.

Additional placeholder tiles and a basic screen layout

I now need to add some additional maps to the game with working entrances and exits, initially just a town and a dungeon. I need to give some serious thought to map sizes and how I want to manage the wilderness map. Games such as Ultima IV and V would load sections of their wilderness map into memory as required but I’m not sure my map needs to be as large. I’d also like to add some basic combat with those red monsters on the wilderness map and some basic interaction with some example town NPCs.

I’m urgently feeling the need for some map editing tools. Whilst I could create some windows tools for these I’m considering making the tools run on the C64 as there will be a number of similar coding routines. There’s no shortage of things to keep me busy with this project and so far I’ve not run into any serious problems – memory and floppy disk space do concern me though…

Graphics Editing

I’ve spent a bit of time looking at Windows based tools to enable me to easily put some new graphics into the C64 game. Previously I was exporting a simple binary file from the character editor in CBM PRG Studio which works ok but isn’t really geared towards larger bitmap graphics than tiles or sprites. A few of them were ok but for now I’m going to use Pixcen.

Pixcen has a nice pixel zoom mode which I like

I’ve added a few Ultima style tiles just to get a better idea of the display in use. These are just placeholders so I can hopefully spent a bit of time working on a more original look for my CRPG.

Some Ultima IV tiles for an example

Revising the map display

Since my last post I’ve made some fairly significant changes to the on screen map display for my C64 CRPG. Firstly I’ve changed the display from a full screen map to a window onto the map. In addition I’ve changed the code to display each map tile using 4 characters rather than a single one.

An Ultima style view of the larger map. The green areas represent “off map” areas.

Ignoring my example “tiles” above which are using characters to get the initial map and tile code working correctly, this is working very well for my initial attempt. Once I had this working I expanded the view.

A larger map view for consideration

Here’s a slightly modified version with a simple “water” type tile and a highlight to represent a player tile. I’m finding that my code changes are coming along nicely now that I’m using C code again so that’s been a very positive change without the performance drop that I was concerned about.

Some simple water tiles and a highlight for a player icon

Despite appearances the characters that make up the display are set up to be easily replaced with redefined characters. I’ll put some simple tiles in just to provide a better idea of how the display with look. I’m very pleased with how quickly some of these changes are coming along which has surprised me a lot.