Demon’s Isle v2.0 – C Programming on the C64

A couple of years back I did some work on programming the Commodore 64 in C using CC65. I recently took another look at one of these C64 CRPG projects and posted a brief video:

I’ve started working on this again and have lots of ideas about how to expand it next. Not sure I’ll keep the exact graphic style and screen layout but we’ll see. I plan to have another video out in the next couple of weeks. It’s likely that I’ll use another development approach rather than sticking with CC65. I find myself struggling a bit with juggling memory segments for resources such as graphics characters and data files.

One thing I’m still unsure about is whether I would prefer to make it a single character game such as Questron or a party based game like Ultima IV. The style of combat is also something I’m thinking, some games using the same map you move around on with others opting for a dedicated “zoomed in” combat map. What are your thoughts?

General update – March 2021

Belated Happy New Year. I hope that you, your family and friends are well and keeping safe during these difficult times.

It’s been a long time since I posted even though I have been up to various retro computing activities on and off since I last posted in November 2020. It’s almost 12 months that I’ve been working remotely now which brings with it challenges around space and separating home and personal life but I count myself as very lucky in that I am able to work remotely and still do my job. I know others have not been so lucky.

Since I last posted I began re-working my old Alternate Reality X (ARX) code on the Pi 400. I started to restructure the code to try and make it much tidier especially around the display routines and game loops. So instead of having lots of different display and game loops for different things I was moving code into a single over-arching loop with a number of different states depending on whether you were exploring, in an encounter or at the main menu. I made quite a bit of progress with this but it was hard going moving some very old code around which often broke many other parts of the game. I also added an option to scale the window size with a key press; X1, X2 and so on based on your preference.

I’m not really sure I had a clear endgame with this re-working of ARX such as a public release or whether I would use the reworked framework as the basis for an Alternate Reality inspired game. Part of this was me just wanting to make ARX a lot better organised from a coding perspective – more for personal satisfaction that anything else. I haven’t done any further work on this since the end of 2020 but I’d like to get back into some coding on this soon and try to bring this project to some sort of logical conclusion.

Alternate Realith: The City box art

I’ve done some retro gaming and emulation on the Raspberry Pi 400 and also tried out various alternative operating systems on the Pi 400 such as Twister OS – https://twisteros.com. One problem I have with the Pi is keeping track of what is on each of my MicroSD cards – bring back 3.5” floppy disks! At least you could put a label on them.

As many long time readers may know I’m a Commodore Amiga fan and after my Amiga emulation above I went ahead and bought an Amiga 600 from eBay which I’ve been spending some time working on and trying to get to the point where I can maximise my enjoyment on it gaming and possibly some light development. Not my favourite Amiga model by a long stretch but it does have the smallest physical footprint (important for me just now) and does have some features that make it very useable in 2021. Maybe I should have gone for an Amiga 1200 but they cost a lot more. I’ll post about this separately.

My “new” Amiga 600 running Workbench 2.1
Ultima VI – The False Prophet running on the Amiga 600

I plan to post more frequently in the coming weeks and months but feel free to drop me a note if there are any interesting retro gaming / computing things you’ve been up to or think I might be interested in. Take care.

More Pi?

I’ve recently bought a Raspberry Pi 400 which I am planning to use for most of my coding projects going forward. If you’re not familiar with this, it is a Pi single board computer but integrated into a keyboard with the relevant ports accessible at the rear very much like the classic computers that you know I love such as the Commodore 64, Amiga 500 and Atari 800.

I opted for the desktop bundle which includes the main Pi 400 computer / keyboard combo as well as a wired mouse, SD card, micro HDMI to full HDMI cable and a USB C power supply. It also comes with a nice beginners guide book which is in full colour. The keyboard isn’t bad and very compact. The Pi 400 has a faster ARM processor than it’s predecessors and 4Gb of memory as opposed to the 1Gb my Pi 3B+ had so some things which were a bit slow for me are that bit smoother on the Pi 400.

The only slight annoyance just now for me is that the composite/audio jack present on the earlier Pi’s is not included on the Pi 400 so I can’t connect up my recently purchased speakers without a HDMI to VGA splitter which isn’t producing a great picture on my monitor. I’ll maybe just pick up a monitor with an audio out jack for my speakers.

I’ve been very busy with work recently so not had a lot of time for my coding projects but I have a number in progress that I’m really excited about. I’ll not say anything else about these just now until I have a bit more to show.

The easy to use Raspberry Pi Linux environment is working quite nicely for my coding efforts but I’m very focused on ensuring that any coding I do is easily portable to other systems such as Microsoft Windows so I am continuing to use C/C++ with SFML, both of which are very easily set up on the Pi. I found Code::Blocks a little unstable on the Pi 3B+ but haven’t experienced any issues with it on the Pi 400 yet. I’ve also been using the Geany editor which comes pre-installed in Pi OS but requires a little bit more set up for me than Code::Blocks. SFML is extremely easy to set up on the Pi compared to Windows.

I’m looking forward to some enjoyable emulation on this version of the Pi such as some Commodore Amiga and classic DOS games and also in trying out some of the other operating system choices that are available such as desktop release of Ubuntu.

C64 CRPG: Adding a map

Since I last posted I’ve been doing most of my game development on a Raspberry Pi 3B+ under Raspberry Pi OS . There has been a little bit of a learning curve with getting this set up and some of the utilities I was using aren’t available under Linux but overall it’s working quite well. One of my biggest frustrations was getting a usable version of the Vice C64 emulator running. I failed to compile it successfully from source and ended up installing it using the PiKiss utility (https://github.com/jmcerrejon/PiKISS). Vice doesn’t seem to perform very well on my Raspberry Pi so I would appreciate any suggestions anyone can provide in how to improve its performance.

My Raspberry Pi 3B+

Most of my work on “The Citadel” has involved reorganising memory again. I’ve not successfully managed to move all my graphics into the top 16K of memory. The Commodore 64’s VIC-II chip can only see 16K of memory at a time and this top 16K of memory includes other things including the Kernel ROM. Usually these need to be “switched out” in order to access the RAM underneath but the VIC-II can apparently see the RAM underneath for character sets, the screen, bitmap graphics and sprites – very useful as I can continue to use the C64’s KERNEL routines such as print a character, screen the screen etc but also make use of the RAM underneath for graphics. This means that CC65 can use a contiguous block of RAM, around 50K just for program code and other data. This also means I was able to simplify my linker configuration file (as shown in my previous post) and remove all the segment references which have been a bit of a distraction when I’ve been using CC65.

The C64 Programmers Reference Guide

I’ve moved the other data files such as map and wallset data onto a C64 disk image and I’m loading these into memory when the game starts. This seems to be working well and my program file is now down to around 15K leaving plenty of space for extra game code.

I’ve also added the feature of switching between the 3D view and an overhead map. Currently this just shows the half the map (32×16 locations) regardless of where you have explored but I’m going to modify this so that the map only becomes visible as you explore. So you can now move around the map either in the 3D view or in an overhead view. I need to think this through a bit as both views need to have their purpose and be useful. I thought the game should switch into 3D view when you have an encounter or enter a shop (if you’re not already in this view).

Moving around the map in overhead view

I also plan to make the map more interesting in terms of better use of characters and colour rather than just using simple blocks. I think I can now focus on adding some gameplay and have a brief playable demo out soon with some initial encounters and combat included.

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.