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.
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.
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.
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.
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.
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.
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.
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.
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.
Since my last post I’ve revisited the CC65 cross compiler which you can use to write C programs on 6502 based systems such as the Commodore 64, Apple II and Atari 8bit.
I had been using CC65 for a few months, sketching out the beginnings of a C64 CRPG but had run into problems managing the memory configuration required for custom graphics. I’d moved onto using CBM PRG Studio and programming in 6502 assembly code which meant my code ran very quick but I was finding was slowing down my development time compared to using C in the past.
Now I’m not much of a programmer in any sense of the word but I probably have the most experience of using the C language overall so I was finding 6502 assembly language time consuming to use and my game development time is very limited and I’m not really trying to do anything fancy technically by the standards of C64 games.
There is a lot of documentation online for CC65 but I was lacking an example of how to do a simple custom character set and use code overlays for swapping code in and out of the C64’s 64K of memory from disk. Most of the famous CRPGs I grew up with such as Ultima and Alternate Reality use this method to make the most of the machine’s limited memory by modern standards. I just couldn’t get this to work and gave up frustrated.
I noticed this week that CC65 had been used to create some of the code in Ultima IV Remastered for the C64. After this I came across a CC65 example online that included both a custom character set and code overlays and worked out how to compile it with a custom linker file. This determines how the memory map for the program is set up and where any external data files or graphic data should go. Once I had this working it was relatively easy to load in my modified character set and recreate my map code in C, display it on the screen and have a player marker move around the example map. I also was able to automate my compilation process with a single key press from within Notepad++ and run the resulting program in the Vice emulator which felt pretty smooth.
The main reason I was originally attracted to CC65 was that I love the idea of using C and being able to then reuse the code on other 6502 based platforms as well as modern PCs and operating systems. CC65 also has special support for some systems including the C64 so that you reference the C64 hardware directly within your C code. As CC65 includes a full assembler in its tool chain, you still have the option of using assembly language within your C program where extra performance is needed and tweaking the generated code. I’ll post more about CC65 in a future post; where to get it and provide a brief example and possibly a video of how to do the things I was struggling with in the hope they help others get started.
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.
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 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.
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:
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.
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 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
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.