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

CRPG Visuals – My thoughts

One of the challenges of creating a CRPG for the Commodore 64 is deciding what sort of visual style I would like for the game. I’m working with an overhead view as I think that plays well to the C64’s capabilities and I’m a big fan of top down games such as the Ultima series and Legacy of the Ancients.

Ultima IV on the C64

Whilst my options with the C64 are more limited than modern machines, I still have many decisions to make on the visuals front (putting aside my lack of artistic talent for a moment).

The C64 has a number of display modes with a maximum screen resolution of 320 x 200 pixels (or 40 x 25 character cells) in a choice of 16 colours. If I’m willing to sacrifice the horizontal resolution of the display then I can increase the number of colours I can use in each 8 x 8 pixel “character” cell from 2 colours to 4 colours but this will double the horizontal size of each “pixel”. You can see this in the image below. You also have the choice of bitmap versus character modes. This is a big over simplification of the capabilities of the machine but will hopefully suffice for this post.

Gauntlet on the C64 – Illustrating the use of multi-colour mode (image from MobyGames)

Currently I’m using character mode to redefine the 256 character set with my own characters and then piece them together to build up maps on the screen. The player moves around the map and can move to other map sections when the end of the current map is reached.

If I required more colour in each character cell I could use multi-colour mode but this tends to make the graphics look more “chunky”. If I require more detailed graphics then I could use bitmap mode but at the cost of additional memory (8Kb for a full 320×200 screen).

One of the other challenges I’m facing is trying to make interesting displays with individual character cells which are only 8 x 8 pixels wide. Now the Ultima games and most CRPGs of the 1980’s typically used 4 character cells to build each of it’s map tiles, doubling the resolution of each tile but halving the number of tiles you can display on screen. The Ultima display also kept the party icon centred in the map display with the map being redrawn around the player after every move.

Combat in Ultima IV illustrating the use of 16 x 16 pixel tiles

One of the things I like about using the individual characters as tiles rather than 2 x 2 characters per tile, is that it allows me to display more of the map on screen at a time but at the loss of some graphical detail. I’ve started playing around with some of the redefined characters and colours in the CBM PRG Studio screen editor which is great for creating simple graphics and prototyping screen displays. Programming single characters as tiles is also a lot easier for me as well and will perform more smoothly in play.

Playing around with some redefined characters and colours to build an on-screen map

I’ve included a sample image above of my brief sketches so far. Regardless of what screen mode and tile size I eventually use I’m also likely going to use the C64’s sprites as a means of adding higher resolution images for the player character, NPCs and monsters. These have the benefit of being independent of the screen display so can have their own colours, hires or multi-colour mode option so can be used to add some further interest to the display.

Creating a Commodore 64 CRPG in 2019

At the age of 11 I became the proud owner of a Commodore 64 home computer and before long, started to draw out dozens of game designs on paper. Whilst I wrote some initial BASIC coding for many of these, it usually wasn’t long before I hit some roadblock and moved onto the next idea. Many years later the Commodore 64 was sold but it kept a special place in my heart and my desire to create a game for the computer never really went away.

Roll on 2019 and I received a C64 Mini as a Christmas present. Opinions vary on this system but personally I think it’s a great recreation of the system, especially since the firmware has been updated to allow the use of the thousands of disk images available online via a USB stick.

I had been playing around with the CC65 C cross compiler for a number of months. This allows you to write C code which can then be cross compiled to a Commodore 64 executable. Whilst I thought this was great in many ways my C code wasn’t as fast as I expected it to be and I struggled to understand how to deal with some of the memory management that CC65 requires. It just didn’t feel the same as programming the C64 with its original BASIC or with machine code (which I’ve dabbled briefly with).

I made a decision to switch over to the CBM PRG Studio which I found to have a number of nice features built in including support for BASIC and assembly language programming, character set editor and a screen editor as well as many others.

The map using some redefined, thinner lines for the City walls

Much to my delight I was able to fairly quickly put together a machine code program and gradually add to it – displaying a map on the screen, reading the keyboard, moving a player character around the map and redefining the default character set. I also found that my code ran very quickly – amazingly so compared to my BASIC programming I did about a year ago. My map below displays in an instant whereas my BASIC program took more than a minute to display and colour a smaller map. Most importantly of all I’m having a lot of fun putting this together.

The game running with the thicker walls, making use of some of the C64’s built-in characters

The game itself is not a million miles away from one of those early C64 games I started writing all those years ago. It currently presents a map of a City which you can move around exploring various locations (above and below ground). Currently the game is set on a single 40×20 “cell” map but I may expand the City map to flip to another 40×20 section when the map border is reached. The player is currently shown on the map as an @ – as in a roguelike game. I’ll work on some more interesting graphics and visuals once I have some more gameplay features implemented.

I’ll shortly be adding some characters, places to visit and items but I’m pleased with the progress I’m making and I’ve managed to sort out all my assembly challenges to date without too much pain, though it’s a very different way of coding for someone who is more familiar with C or C++. Content wise don’t be too surprised if there is a bit of Ultima or Alternate Reality type inspiration in the game. It’s very straightforward to play C64 games on a modern PC using an emulator like Vice so accessibility for players isn’t really a concern for me just now. The game is still in its early stages but I have a good idea in my head where I want to go with it next.

Alternate Reality Remake Projects

As many of you will know I’m no longer working on development of my Alternate Reality:The City & The Dungeon remake, Alternate Reality X. This was written in C++ and used the SFML library and ran under Microsoft Windows. I may spend a bit of time to fix a few bugs with my last release (based on requests on the ARX forums), to leave the final release of ARX in a more playable and less buggy form.

From early 2018 an AR fan used my source code to put together a couple of revised builds of ARX (which are available for download from his website link below) . He has since created a brand new Java based Alternate Reality remake which I’ll refer to as the AR Java Edition to avoid confusion with my earlier ARX.

The AR Java Edition is a far more code complete remake of AR than my own ARX, based on the updates on his webpages. He’s finished a lot of the functionality which I hadn’t and has gone back to the original 6502 assembly language to better understand how the original games worked.You can check out the updates, videos and screenshots over at:

http://www.landbeyond.net/arx/index.php

From his recent webpage updates it sounds like he’s now very close to a fully complete conversion of the City. Hopefully we’ll be able to try the Java Edition fairly soon.

As for myself I’ve started to put together a new CRPG project which is heavily inspired by the classic 8bit CRPGs of the 1980s. I’ve been learning a lot about old technology and systems and having a lot of fun in the process. More about this project shortly.

Update – August 2018

Hi there!

As many of you will be aware or guessed I have been dealing with some major changes in my life for some time now which meant I wasn’t posting on the blog or able to work on any game development. I won’t bore you with the details but despite still having some big challenges to deal with, I’m in a positive position and very happy. A big thanks to everyone who asked about me or sent me messages of support, these were greatly appreciated.

Due to those things going on in real life, Alternate Reality X (ARX) wasn’t getting the attention I wanted to give to it. I was also finding it hard to update the old code base which I originally began back in 2009!

Anyway, an enthusiastic AR fan has since built a new Java based Alternate Reality which you can read about here on his website. He hasn’t posted any updates for a couple of months but he has some videos of new features on the site and it looks like he’s added a lot of new features and functionality that were missing from ARX. Hopefully we will get to play the first Java edition of AR soon.

I’m planning some new, smaller game projects of my own in the coming months but I’ll post separately about those.

Alternate Reality X – Release 0.82 Available!

Alternate Reality X – Release 0.82 is now available for download from: www.crpgdev.com/downloads. This release focuses on fixing a number of bugs which players have reported following recent releases.

  • Fixed – Group encounter messages out of sync with their damage
  • Fixed – Group encounter attacks out of sequence
  • Fixed – Fixed encounters not updating correctly (e.g. ghost in Well Lit Area)
  • Fixed – Fixed encounters not leaving weapons or treasure
  • Fixed – City Smithy items selling for minus value at Dwarven Smithy
  • Fixed – Troll Tyrant / Goblin Lord – wrong monster types appearing
  • Fixed – Troll Tyrant / Goblin Lord – didn’t leave ring halves
  • Fixed – Guild names and locations not all correct in City
  • Fixed – Character indicator on large map not in correct position
  • Fixed – Legend on large map not aligned for different window sizes
  • Added – Mercenaries and Paladins Guilds now in City
  • Code – Spells moved into separate source files

 

PC Upgrades and thanks

I’d been using an old PC for some time. It was several years old with a small case design for a specific motherboard / hardware combination and struggled with some of the fairly basic things I wanted to do including my game development. My son upgraded his PC over Christmas and gifted me his old motherboard and processor (pictured below) which I thought I would use as this would probably be a decent upgrade over my existing PC.

 

 

My existing PC case was no good so I thought I would use some Patreon and PayPal funds to buy an expandable PC case which I could use now and in the future and make use of my “new” motherboard and processor. I’d like to be able to use a full size video card at some point in the future, though it’s not essential for my current game development.

I looked at several case designs but opted for a CIT model I found on Amazon and ordered a 500W power supply to go with it. These arrived quickly and I was able to install everything without too many problems (though the power cables to the motherboard were a bit short). I transferred a couple of old hard drives into the handy caddies in the new case and my existing Windows 10 install booted up fine despite switching from an Intel to AMD processor / motherboard – an unexpected bonus. I also added a mini wi-fi dongle to the PC which is working great for networking compared to my old NetGear stick. The PC and case seem to be working really well and a nice upgrade from my old set up. The on-board AMD Radeon HD 8470D video is good after the old Intel graphics I was using.

There are still a few further upgrades I’ll buy at a later date such as a larger monitor (the 24″ one I have in my day job helps a lot) and a better chair (but not an expensive one). An SSD at some point would be great but this is way down my priority list.

 

 

In addition I spent time reorganising the room that I want to use for carrying out game development as it had become a dumping ground for the family and I could barely reach the desk – hardly conducive to productive game development! Still a bit crowded with other items but at least its tidy now. I need to do some negotiation with other family members to empty the room further so I can add a bit of storage for my game development notes, programming books etc.

Major thanks to those Patrons and PayPal supporters who’ve supported my efforts and helped fund some of these items. Greatly appreciated. The upgraded PC set up and improved working space will feed directly back into improving my game development output over the coming weeks and months.