Readers with good memories may recall that well over a year back I got hold of a Vectrex 32. This is effectively a mini computer on a cartridge that can be used to run BASIC programs on a Vectrex. My first thought was of course to port Akalabeth since all those line graphics are a perfect fit for a vector screen. Life soon got in the way and I managed all of about 3 brief sessions coding, much of which was spent learning the ropes. The ropes are now well and truly forgotten but it’s time this project got finished off so I intend to pick it up again until I at least have something playable. First, a look at where I actually got to.
Luckily, I never clear out my PC desktop and all the code is still sat there untouched since boxing day 2016. The last thing I was working on was the initial text/menus at the beginning of the game. You would imagine this would be quick and easy but placing text on the screen has to be done one line at a time with all the coordinates being set manually. It was a bit of a pain as I recall but I got further than I remembered with it. With no keyboard, the interface is going to be clunky but I’ve got all the text on screen for the shop and a currently broken means to select things to buy. I didn’t have any means to exit from this shop so I’ve added that in for the purposes of trying everything out.
In the time I did spend on this, I concentrated on the graphics since that is the fun part. The overhead world is pretty much all there. I’d created a random world builder for this based on the original code and can walk around it. I can’t go back into a shop or chat with Lord British as of yet. You can see where the idea for tile graphics in Ultima 1 might have come from in this section since it is effectively tile graphics in a 3×3 grid.
There was no means to enter a dungeon either as I’d just bypassed the dungeon code when adding the world map. I made some changes to fix this at which point things started breaking. A load of painful debugging later, I managed to figure it out (a shared variable name). This is the problem with picking up a project a year down the line especially in BASIC which I’m not used to. I am relearning my own code but you really need to have a clear picture of it in your head given just how unstructured the language is.
The dungeon is just a predefined array for now with one of each monster kicking around a load of corridors. The beauty of using vector graphics comes into play here as there is no actual 3D programming going on whatsoever. I simply have an array with scaling factors for each block in front of the player and a routine to draw any given object. I then apply the scaling factor when drawing the object to shrink the graphics by the appropriate amount to place it that many blocks away. The disadvantage of vector graphics comes in as well in that it can all get a bit flickery. As with the overhead map, all I can do is move around.
No doubt I’m forgetting something but my checklist to get a playable game is :-
- Sort out dungeon generation.
- Implement ladders, traps.
- Get the player stats in place and inventory.
- Get the monsters to move around and attack the player.
- Implement combat.
- Add in Lord British and the quests
The only job I’m not sure about how to tackle is the first one. I’m seriously tempted to bypass it altogether and just hardcode some levels.
Here’s a bit of video of Vecalabeth in action (and yes it really does buzz that much). The flickering is if anything worse in real life. It’s something I’m probably going to have to live with as the platform is even more limited than the Apple II was. I don’t reckon it’s looking too bad though. It moves faster than the original Apple II version ever did and is recognisably Akalabeth at the very least. Let’s see if I can make it actually playable over the next week.