Featured

Major Shift to More Traditional Approach

Intro graphic

Oh hai there! I know it’s been a hot minute since I have said any.. almost 2.5 years in fact! Life has been lifing and keeping me very busy – but I have been quietly working in the shadows. For those who don’t see my posts for the Ultima Dragons on Facebook – I will fill you in.

I have been building Ultima V Redux with the Unity engine since it’s inception. That means using C# and ultimately building in a 3D game world. Focus was put on the 3D aesthetic and enhanced UI controls. As I move forward I have shifted to a more bare bones game engine called Ebitengine (https://ebitengine.org/) based on the Go programming language. This a primarily 2D engine – but is far easier and less complicated to work with.

Over the past 9 months, I have somewhat quietly been redeveloping the core components in Ebitengine. I am still far from complete, and do not have as much functionality as I left off with my Unity project – but the development is much faster because many of the difficult details of “how Ultima V works under the hood” have already been solved. For example I spent close a month in my spare time getting the conversation engine up and running originally – but only ~8 hours so far for almost the same result.

Serpents Hold

So what is done so far?

A few things – but lots to go of course! A heavy focus on basic world and basic functionality have been the focus. I am largely following the same order I implemented with the my first attempt.

Having a walk around West Britanny
  • Core gameplay loop and movement
  • Lighting fully functional – with expanded screen size (16:9)
  • Title screen fully animated
  • Basic save game loading from “original save files”
  • Enemy generation
  • Overworld/underworld and “small maps” fully traversable
  • Friendly NPCs generating and following all schedules
  • Overworld monsters automatically generating (no combat yet)
  • Boardable carpets, ships, frigates and skiffs
  • Basic commands – Look, Klimb, Open, Jimmy, Push, Board, X-it, Get
  • Quit/Escape menu basics plumbed
  • Text based Debug console with autocomplete for quicker access to debug functionality

What you see is a essentially something that begins to resemble a game – but isn’t yet a game. You can move around the world, see the world moving without too much concern for you yet.

Using the debug tools to spawn a frigate – which then bounces around Britain a bit

So what’s next?

I have my eyes set on what I call the core functions that still remain, these include –

  1. NPC conversations (reading conversation data is done – now to plumb to UI – 50% done) (Talk)
  2. World tile and time passage effects – ie. poison over time, lava injuries, falling down grates
  3. Inventory UI – both Use and view
  4. Z-Stats – show party details
  5. Looking at signs in the game world
  6. Shoppe Keepers – purchase goods from them

Much of these are UI based – which is admittedly one of the more difficult components in the new game engine – so doing them one after another is likely smart so that I can avoid ‘re-learning’ everytime I build one.

Conclusion

So, I ask you to be patient as I continue to try and sneak in development time in my spare time. I know I have been working on this for years – but visions change over time – and mine certainly has.

Bonus Section – Why Brad!?! Why!?!

I know many folks may feel like this is a step backwards – I hope to help you understand my thinking. You may disagree – but guess what!? I had a ton of people disagree about my 3D approach too, so I suppose I can’t please everyone 🙂

The Unity Complexity Problem

Here is what happened… I wanted to build a remake of Ultima V, I wanted that remake to be in a voxelated 3D world. I also wanted to separate game logic from the Unity engine itself – this resulted in two different source code repositories – one for game logic, and the other for the Unity presentation. On the surface this was a good idea – folks would be theoretically be able to pick up the game logic package and build on it without the Unity component.

HOWEVER this created never ending list of technical challenges. Trying to synchronize the result generated from one – into the other was difficult. I did succeed – it did work – but everytime some went funny, or didn’t work as expected, the troubleshooting was extremely tricky. It got to the point where I was actively avoiding certain efforts because I knew the troubleshooting would be so damn tricky.

The 3D Problem

Given that 3D was one of the main factors for starting this project – it does feel like a shame that it constantly got in the way of a good time.

A 3D game that knows it’s 3D is less difficult in some ways than what I was doing. I was faking out a 2D environment in a 3D space. I had a world where the Avatar would be on top of grass, which in the OG U5 would have just been a black box around the Avatar.

Note there is no black box around the Avatar – you see what is underneath

Now layer on lighting levels, shadows and perspectives and thing got a lot trickier. I had an entire system that I build just to account for the layering and the micro-adjustments of different models to make sure they stacked on top of each other correctly.

Similar to the complexity problem previously discussed – I had it largely working – but it was finicky and I loathed troubleshooting it. It took me away from the game world and game logic itself.

Note the odd angles on some of the assets like the castle – that is how I would make it “look good” in the 3D world when looked at from a normal perspective.

The “I want it to work without maintenance for a long time” Problem

Unity is an ever changing beast – it is large with frequent updates and support windows for each major release. Everytime a new version would come out I would try an upgrade. Sometimes it would break stuff and I would spend hours troubleshooting – sometimes a bug would present itself in a month or two.

If you look at the other popular Ultima remakes like Exult and Nuvie you will see they use SDL as a base. What does this mean? It means they use a more bare bones library which is likely to live for a very long time. This translates very little additional work required to be done to maintain compatibility in the future. I always worried that I would built something cool – and then in 2 or 3 years it would no longer function on modern OSes for one reason or another. This may be incorrect or naive – but I know the process for upgrading to a newer Unity version was too risky for long term running of the software.

So… I didn’t want to use SDL, because I didn’t want to write C++ – I wanted to write something simpler and something I was passionate about. So I chose Ebitengine and GoLang. Go is a popular compiled language that can compile for any of the major OSes, and Ebitengine is so bare bones that I feel confident that it will keep living for a very long time.

Bonus Conclusion

So… In short – I wanted a simpler engine, to build a simpler game world. The complexity of Unity and 3D world were getting in the way of the core game experience, so I made the difficult decision to reset. There is no going back now 😉

Featured

Milestone: Specific Behaviours and Graphics Overhaul – February 2023

In true “me” fashion – I have waited a half year to update officially on my progress!

The point and purpose of this update was to begin to really nail down some of the more specific behaviours in the game. The original Ultima V game engine had about 80% of the game run from generic run code, while the other 20% was extremely specific based on often very specific circumstances. These require custom AIs (not ChatGPT level stuff lol) and often custom code stuck in odd places.

Two new graphics perspectives were added – a new 3D perspective that is not isometric and a top down enhanced classic style. An optional change in perspective was EASILY my most requested feature. I sincerely hope this encourages more fans to consider the game in the future.

A small but very important update to combat map triggers was added. This ensured all combat maps were testable and able to be completed

Lastly there was an initial kick at dungeons. Loading them and navigating them in a crude fashion. There is much more to go – but this first step was long overdue!

New Graphic Modes

Enhanced Classic Mode

This mode is meant to satisfy the classic gamers who love the 2D style top down perspective. Under the hood it still uses the 3D voxels, allowing for shadows and advanced lighting while ensuring nothing is inadvertently blocked for view as can be the case in the existing Isometric mode.

Here is an example of what it looks like from a different camera angle.

New 3D Mode

I struggle to name it – it is simple a 3D mode, but not isometric. I often got complaints about the isometric mode feeling “odd” to control due to it’s angles.

This mode highlights the 3D models while ensuring there the camera is not blocked. I saw it as a happy medium.

Graphic Mode Errata

In order to introduce more modes, it took a major overhaul of the underlying engine. It was only ever built for one perspective. Each mode has distinct lighting and camera properties to ensure they all look wonderful! This means in the future it is easy to tweak existing modes, or add additional modes.

There was also a lot of effort put into improving the look and increasing the potential resolution of many sprites/voxels. They were 16x16x16 and many are now 32x32x32. This isn’t great for all voxels, but it does provide a new depth that was lacking from game characters.

Specific Behaviours

Specific Behaviours is a name I gave to any feature that strays from the “standard engine mechanics”. For example – if I want to talk to someone, the default behaviour is to lookup their dialogue script and follow it carefully. But there are a handful of NPCs that do not have dialogues built like that. Instead the original game code would have called a custom subroutine that followed specific and non standard logic. The Blackthorne guards are a great example of this.

Specific Behaviours are also anything that barely noticeable, but reflects a rule of the game world that you would maybe not consider at all. For another example – a minstrel is coded to look exactly like a bard. But if you sit them on a chair then they change to the minstrel sprite and begin to play music that the player can hear. These NPCs behave uniquely.

I wonder what you will wish for at the well?

See below for a more complete list.

Combat Map Triggers

If you have played Ultima V then you likely know some combat maps have special tiles that you must interact with in order to proceed. Without this completed I was unable to fully test a large number of dungeon combat maps. In this release they are fully implemented – although not fully tested. All preliminary tests work as expected though!

Dungeon’s are on the Menu!

I have become an amazing procrastinator for things I know to the be under-documented and complicated. This is what dungeons were for me. I had spent some time on and off in the past years learning about their mechanics but avoided making too much progress.

I did however finally dig in. I hacked an amazing number of save game files to be able to test and verify that I understood the data format. I am not sure it’s perfect, but I was able to introduce a new map type for it that adopts the current graphical view.

It uses “close enough” sprites to represent the tile types. For example a Trap is a swamp tile, a magic locked door is a hidden door and so on.

Errata

The full list can be found here: https://github.com/users/bradhannah/projects/6/views/21

But basically I took a huge amount of time to rework years of code that was not fully fleshed. I simplified the code base dramatically which means that I will be able to move even faster in the future.

Also – a new chat dialog that shows you what the Avatar has asked and places it towards the bottom so it doesn’t block whole screen.

I also created a cool new Debug window. Although the original game was more simplistic in it’s approach to the game engine – it’s simply not how a modern engine like Unity works. Take it or leave it – it’s the price you pay to use a modern engine like Unity.

I created a debug window that can be toggled on and off to help me spot where failures or issues occur. It has already saved my bacon more than a handful of times! Also… it’s very pretty.

What’s Next?

I haven’t exactly decided – but it will likely be continuing on specific behaviours such as bridge trolls, getting drunk, falling down waterfalls etc.

It will also be fleshing out the dungeons much more. I have not decided how I will represent them in game. The original 3D first person is a hard nut to crack – but it is likely where I will start. I will also be integrating the dungeon combat into the dungeons – presently they are separate.’

Mostly complete list of specific behaviours

  • Able to search for secret in searchable spots!? (such as… keys in a particular place)
  • Search for glass swords!
  • Smith the Horse only shows up after your first time at Iolo’s
  • Killing rats not a crime
  • Gremlins steal food (jerks!)
  • Tie a horse to a hitching post and it won’t leave the post
  • Walking through fireplaces hurts you, but you can if want
  • Guard on top of LBs castle is mean and will arrest you if you tick him off
  • Bards play lute when on seat
  • Horses and Carpets move faster than walking
  • People are scared of a murderer! They run away, while the guards will arrest you.
  • Lighthouse light rotates
  • Can Klimb in some combat maps
  • Custom dialogue feature allows for conversations that are not in default dialogue
  • Blackthorne guards are jerks – they expect you to wear the badge
  • Pushing stuff in combat can trigger tiles to change
  • Exit a combat map in single direction, if you try to leave in different directions it will prevent you
  • Search for hidden doors
  • Running into Cactus hurts
  • Get food from a table (but lose Karma)
  • Trade while in conversation with people
  • HMS Cape makes you vroom-vroom
  • You can free people in manacles, but they are antisocial afterwards
  • Freeing people pisses guards off
  • Daemon guards react as expected – they are both guards and not guards at the same time
  • You can wish for horses, but I won’t tell you how!
Featured

Milestone: Combat and Polish Complete

Well it’s been a hot minute since I have updated the blog and released an update video. Saying life has been busy would be an understatement but I have spent considerable time in pockets focusing on this particular milestone.

This was an update of bug fixes, polishing and (re)creation of a number of internal systems that weren’t optimal. For those in the gamedev space, there is a rule – make a bunch of small games to completion – don’t chose an RPG as your first project. I naturally ignored that advice and here we are over three years later 😉

When we last left off I had got some very early crude builds out for testing. They performed quite poorly and required major rework – but non the less it was something! I was blown away by the feedback of a few devoted fans who provided amazing insights and even helped develop a backlog of work items to better match the original. They also disproportionately ran Linux!?

August 2022 Update video for Ultima V Redux

Highlights

Music and Sound Effects

How do I show you music? Watch the video of course!

A situational music system and ambient noise system was put in. Using the famous Ultima V Midi pack, I converted it to MP3 and imported it. As location and circumstances change it is capable of fading music in and out.

The ambient noise generation is particularly cool! I want to add some ambience beyond the music so I implemented a few test cases. As you get closer or further from certain triggers the noises may be noisier or quieter.

  • As you approach a lighthouse, you will hear seagulls
  • When you are in the wild, you hear the call of the outdoors
  • Approaching a stream? Hear the gurgle of a stream
  • Out for a ride on the mighty ocean, surely you will hear the wind!

Other and more traditional sound effects were introduced as well such as footsteps, opening doors etc.

Combat

Combat was cleaned up dramatically. There were endless bugs in the dungeon generation and enemies didn’t generate in the overworld. Animations are largely cleaned up.

Overworld battles largely behave as expected now, with loot being dropped on occasion.

Chests, bloody pulp, item stacks and visible karma.
Updated sexier moongate, overworld projectiles and spawning monsters!

Overworld baddies can shoot at you with their fire or even a passing pirate ship with their cannon – but don’t worry you can shoot back with your own ships cannon!

Cool spell/potion/scroll effects – I think the Avatar may be in a bit of trouble this time around!

Spells (although largely un-implemented) can now be cast in combat or in the overworld.

User Interface Improvements

I almost feel bad putting these here because my Twitter followers have seen them as they have been built – but for the uninitiated I have been focused earlier in the milestone on overhauling the UI. I love the old UI – it was quick and easy – IF you had the manual close by to help you understand reagents required for spells for example.

There has been a focus on common component look and feel to ensure the player is immediately familiar as they traverse the dialogs.

Party Inventory includes filters, detailed
Spell Casting allows you to select the plater, indicates if you CAN cast it or if your level is too low, or don’t have any mixed.
Mixing reagents is more straightforward level indicators, highlighted reagents and after you mix your first spell correctly, the UI will remember – saving you time!
Quick and easy to mix you favourite spells!
Readying your party for battle has much of the guess work removed helping you understand attack and defence statss.

Saving and Loading

Love or hate the UI changes – something I imagine nearly all of us can agree on is that a single save file is the pits! I have added an unlimited (!?) save potential with details. It also finished the introduction of a separate save format. This allows me to extend it with additional data and saves me the hassle of understanding every single byte of the original. For the hackers out there – it’s JSON formatted, so easy to “tweak” 😉

Multiple save slots with lots of save details and party status!

The More Detailed List

The following highlights are included in this release (here for greater detail).

Sound

  • Added music system and 5 songs (midi->mp3) based on location
  • Added ambient sound effects system – for example, as you approach a lighthouse the seagulls get increasingly louder
  • Added standard sound effects such as walking on crunchy grass or click-clack on brick
  • The MIDI files are converted to MP3 and downloaded from http://exodus.voyd.net/downloads/

Improvements

  • Use/Inventory dialogs
  • Enemies can now drop chests (which you can search and open) and blood spatters as well. Included a new feature called “Item Stacks” which allows us to stack loot (or anything!) on top of each other.
  • Special items such as Crown, Sceptre, Amulet and Sandalwood box are now gettable in overworld, and disappear when you already have them in your inventory.
  • Monsters in the overworld now wander and chase you. If they catch you, they will initiate combat.
  • Projectile throwing overworld monsters such as sea serpents or pirate ships will fire at you if you get too close.
  • You can ‘f’ire the frigates cannons and kill overworld enemies.
  • Major effort in normalizing all buttons, sliders etc to use the common look and feel (using prefabs). Also added standard ‘X’ in top right of every dialog.
  • Small maps now have proper “outer edges” and even change depending on the map. For example Sin Vrall’s hut has desert tiles on the outside edges instead of grass.
  • Fixed major bugs that made the dungeon combat rooms… just plain wrong. There were some ‘off by one’ errors creating havic.
  • Multiple graphic and texture tweaks for a more common experience – such as lowering res on time of day semi-circles and new reagent graphics.
  • Cleaned up start up UI to make it easier to “get started” from scratch when booting the game. Options that “shouldn’t be clicked” are no longer clickable.
  • You can now extinguish a torch by clicking the torch icon in the bottom right.
  • Visible Karma tracking in bottom right (will eventually be optional).
  • New “escape” menu when hitting escape in the main game out of combat. This will allow you to save, load, quit and configure (kind of).
  • Unlimited save/load slots with easy access to save data on disk.
  • All potions are (should!?) be drinkable and have real effects.

New Systems

  • Created new “Tile” system that has each tile responsible for figuring out what it should be displaying and when – GREATLY simplified keeping track of what should be drawn and when
  • “Turn Result” queuing – this enables me to send an ordered list of events for processing. This allows for the classic feel of “one thing at a time” to be maintained. For example – it’s important that a projectile actually be seen hitting an enemy before the enemy dies!
  • Brand new animation system for tiles. Each tile now has an independent and semi random animation cycle. This creates a “liveness” feeling, but also erases a requirement on an obscure version of Voxel editing software I required to edit before.
  • Created a common UI framework to ensure all dialog boxes use same base code, ensuring continuity between them, but also saving me a ton of time developing and debugging.
  • Spell casting, potion drinking, scroll reading system during combat implemented. Only a few spells are implemented, but having the system in place will make the spell implementation much less difficult.
  • Numerous tweaks to make debugging faster including streamlines menus and saving previous values.
  • Converted from HDRP to URP rendering engines. There were massive performance issues related to using a very heavy engine (HDRP). Switching to Universal Render Pipeline resulted in huge improvements across to the board.

What’s Next

The game is clearly quite a ways from completion still. Much of my time has been spent creating, and re-creating or re-factoring internal systems. It has been important to do so because the issues and bugs that come from the old systems waste too much time, but now with the lessons learned and most of the systems in tip top condition I will be focusing on the following:

  • Implementation of endless “Specific Behaviours” (https://github.com/users/bradhannah/projects/6/views/17). There are events or mechanics that require special code for special circumstances. Big thanks to @tanabi for the amazing detail on the behaviours they recalled! Some examples:
    • Bard in Buccaneer’s Den plays a lute in the bar
    • When crossing a bridge, there is a chance that a troll will try to extort you!
    • If you do crappy stuff (steal, murder) in town, then the guards will try to arrest you
  • Complete implementation of combat “triggers” such as stepping on a tile or hitting a tile to open up secret entrances/exits.
  • Implement remaining music based on location
Featured

Pre Alpha Builds for Windows, Mac and Linux

Pre Alpha Screenshot

The latest milestone began late March 2021! I typically like to release official updates more often, but… you know… 2021… So here we are finally with some playable pre-alpha demos. For anyone who tried the past demos, this one will be much friendlier when it comes to opening up old save games. You must have a version of Ultima V for DOS on your system and original save games (even if they are the default).

You can get them from the my Github release page.

If (when) you hit some bugs, feel free to submit them to the bug tracker at: Ultima V Redux Issue Tracking. I will review all bugs.

Getting Started Notes

Just a few important notes to help you enjoy the build:

  1. You can get a handy debug menu with F2. It helps teleport, set provisions and time of day
  2. A combat creator debug menu can be found with F3. Dungeons are… not quite right, so no warranty yet lol
  3. “Free Move” is on by default for my own convenience, but can be turned off in the F2 menu
  4. For loading, exiting etc hit Escape in the game for a quick menu
  5. The only spell you can cast currently is In Lor

Best of luck and hit me up on Twitter @thissoftware if you have any questions or want to chat about it.

Operating System Notes

  1. Windows
    1. Should run well
    2. No tweaks needed
  2. MacOS
    1. Seems to run slow on my old MacBook, but would love to hear your experiences
    2. Only included x64 version, will do Apple Silicon shortly
    3. You need to chmod +x Contents/MacOS/* to make it executable (will fix later)
  3. Linux
    1. Untested, but probably need to chmod +x UltimaVRedux-Linux-Jan-9-2022.x86_64 before launching
    2. Please let me know if it even runs!

Featured

Knee Deep in Combat and No End In Sight!?

Life has been keeping me busy which has slowed some of my efforts, but I still try to devote as much of my spare time as I can to this project. My primary focus has been and continues to be on implementing the incredibly rich Ultima V combat system.

The process started out with a number of simple implementations including basic map loading, player character loading and enemy loading. It then got deeper and only made my respect for the original developers all the more grand as I realized how much had been packed into a few double density disks!

What was Implemented so far?

There are certain elements of this classic turn based combat model that have been implemented and I think MUST be present in the reworked system. I have implemented the following classic features so far:

  • Loading player characters, enemy and appropriate map based on overworld enemies
  • Keyboard based player character movement, enemy selection and player attacks
  • Selection of active player character if you wish to focus on a single player
  • Initiative based combat ensuring the most agile go first, and sometimes multiple times in a single round
  • Ability to attack enemies in overworld/underworld
  • Quick escape (ESC) when all enemies are dead
  • Highlighting active player or active enemy

Quality of Life Improvements

It is important that the game translates well to a more modern audience as well, so I have opted to add some improved quality of life settings as well that will still maintain the charm while speeding up the grind of some battles.

Highlighting of enemies that are in range

It is now immediately noted which enemies are in range once you enter your attack mode, making it easier to pick your next victim!

The Avatar is equipped a magic axe, which can reach anyone on the map, including his own party members!
The Avatar equipped with a melee only weapon can only attack enemies within one square, so only one wizard is highlighted.

The Initiative Bar

Who’s next? Should I cast my healing spell yet, or should I go in for the kill? The initiative bar is meant to help give the player a glimpse in to the 5 subsequent attackers to help with those strategies. There is likely going to be an option to disable this for the purists out there!

The initiative bar highlights the current attacker and the next 5 attackers as well!

Cycle Enemy/Quick Attack

Although it can be a topic that breeds many different opinions – it is my personal belief that the existing combat can take too long when you are grinding out your high levels. Think about it – you are level 7 party, all equipped with Magic Axes and are now facing yet another horde of slimes! Two new features have been added to speed up combat to make these encounters more bearable:

  1. <TAB> key will cycle through all available enemies one at a time. This will work in all targeting modes including when casting spells (once it’s implemented!)
  2. The ` (~, left of the 1 key) will automatically attack the previous enemy attacked by the player, or if none have been selected then it will automatically attack the closest enemy.

The combination of these two features can significantly speed up play without spoiling it for those who like to play the ole’ fashion way.

The Battle Report

Another quality of life improvement is the inclusion of a Battle Report. This will help you better understand the contribution of your team members in battle, as well as giving you a glimpse into how their experience was affected. This will show at the end of every battle regardless if you escaped.

Debug Menus for Quick Combat Testing

As in past work – a special debug menu was created to speed up testing.

The following Debug menu provides quick teleportation, time changes and previsions hacking on the fly.

Quick teleport access to anywhere in Britannia, time changes and provisions hacking on the fly!

The debug menu allows quick access to all combat maps and all player combinations.

Line Of Sight

I attempted, and believe I succeeded in duplicating the original flood fill technique when producing line of sight and hiding tiles the Avatar shouldn’t be able to see!

Blue Borders

As you may have noticed from the November release, the classic style blue borders now encapsulate all the UI elements, helping give them an old school feel and helping give each section it’s own purpose.

Other Additions

Although not all changes are as exciting as the combat (which is still in the works!), there have been some minor features implemented or completed since November as well:

  • Ships can travel fast with sails and get damaged when they hit land
  • eXit a frigate? How about a Skiff!
  • Take damage on a skiff in deep water, and prevent a frigate from entering shallow water
  • Able to use a magic carpet that is in your inventory
  • Added +/- to speed or slower keyboard input
  • Zoom in and out with mousewheel
  • Created all enemy voxel models with basic animations
  • Attacking people in stocks or bed will murder them!
  • Ctrl+K for Karma
  • Introduced outlining effect when characters are obstructed behind walls in combat
  • Carpets and horses now go in all four directions, unlike the original game which was only left to right
Some exciting for me techy changes:
  • Converted to the new Unity Input System, resulting in smoother and smarter input timing
  • Decoupled importing of classic save state from new save states
  • Considerable refactoring, removing all Find and GetComponent calls in place of strongly bound variables
Known Issues
  • Initiative calculations do not appear to be quiet correct yet
  • Dungeon maps seem to adhere to different rules when encountering baddies, they are not immediately clear

What’s Next?

The fact of the matter is, the combat maps and basic mechanics took quite a while. Moving from top down to an isometric view does and continues to have quite a few visibility challenges. The next update hopes to complete the combat aspect which will include:

  • Monster AI including movement, attack and special abilities (such as ghosts disappearing)
  • Monsters should spawn and seek you out in the overworlds
  • Player characters should be able to cast combat spells (IOW, I need to implement spells!)
  • Spell and attack animations
  • Hidden wall triggers
  • People should be scared of a murderer, and guards will want to arrest them!
  • When you die, you need to be resurrected and brought back home

I hope to get through the whole combat by the next update which should be around 3-4 months from now.

Featured

Shoppe Keepers and Vehicles Update! November 2020

The previous update which focused on engine optimization and the introduction of the Blacksmith shoppe keeper was back in June. Life has threw me some curveballs since but I have finally managed to complete all remaining shoppe keepers and introduced the common vehicles including Magic Carpets and Ships.

Shoppe Keepers

These shoppe keepers are comprised of:

  • Bar Keepers
  • Inn Keepers
  • Guild Masters
  • Healers
  • Apothecaries
  • Horse Sellers
  • Shipwrights
  • Blacksmiths (already implemented)

The shoppe keepers all use a common interface originally seen in the Blacksmith update. There is an emphasis on retaining the original charm from the smack talking shoppe keepers while improving and streamlining the shoppe experience. For example, it is VERY easy to miss the gossip option in Taverns if you are just quickly picking up rations and leaving. In the updated Bar Keeper interface, the gossip option is easily seen and will save many players hours of frustration by giving hints for a small fee.

I also opted to allow you to try to buy items and services if you don’t have the money. Most modern games would simply grey it out – but I just love the smarmy responses (or violent response if you try to stiff the Inn Keeper!).

Vehicles

The classes Ultima V vehicles were added as well. This was a hard requirement since you will visit the Shipwright and Horse Seller and expect to actually receive the thing you bought. The vehicles include:

  • Frigates
  • Skiffs
  • Magic Carpets
  • Horses

The Details

This update was very grueling! It seemed that everytime I had to introduce the next shoppe keeper a new challenge would present itself. For example, when implementing the Shipwright and Horse Seller I had to completely overhaul the underlying sprite handling system. I scoured the previous reverse engineering of the save state to understand how to determine if the party had boarded a vehicle. It wasn’t fully documented, but as always the previous researchers provided invaluable hints. The super cool news is that the same sprite systems that are used for riding magic carpets etc is also used to display “odd” sprites such as the bats in the tower in Skara Brae – something that had been on my list for a while.

It was also an opportunity to begin to describe the monsters as they would appear in the overworld.

It has lead to me some interesting bonus feature ideas such as a travelling merchants in the overworld (there are no NPCs in the overworld currently). Just ideas for now, but lots of cool opportunities in the future.

Continuing Challenges

I did what no one is supposed to do, I chose a very large project as my first Unity/Game project. As a result I have been “learning on the job” and creating some pretty crummy early interfaces and code. You will see UI improvements with the shoppe keeper update such as the “player selector”. There continues to be a lot of previous work such as the ‘U’se item UI which is a bit rough around the edges and doesn’t even support mouse input. It’s not really a problem, just notable.

Around The Corner

I have had a few people ask for up to date demos. In the next few days I will release Windows, MacOS and Linux pre-alpha builds for testing and experimenting.

What’s Next?

As mentioned in the video, I will:

  • Spit and polish the UI and graphics
  • Add line of sight (attempt #3)
  • Either “monster stuff” or dungeons

The spit and polish involves updating some old UI elements to be keyboard+mouse capable and just provide a more consistent overall experience. I also believe there is a long way to go on the graphical fidelity and tuning. I have a long list that I maintain of things I could do better that I hope to tackle.

I will AGAIN try to add line of sight – it just never makes it high on my list and I am seriously worried about screwing it up – but it’s long overdue.

Lastly, I am desperately keen to move onto some “very different” from the stuff I’ve been working on so I hope to begin to tackle either some combat elements or dungeons. I will just see what side of the bed I wake up on.

Featured

June 2020 Update – Engine Update and Blacksmiths

This update has been about 3 months in the works. You would think with Covid and self isolation that I would find myself with more free time, but it so often seems like I have less. Either way, there were two major features that I chipped away at over these three months and have made a big impact to the game.

June 2020 Update Video

Engine Update

Although I have written to graphical components in Unity and Unity is in fact a game engine, I had a tough problem to solve – the world is round. Unity is built primarily for a world that does not repeat. In Unity, when you hit the end of the defined worldspace then it just ends.

My first implementation of the worldspace involved keeping the Avatar at 0,0 in the world, while literally moving the visible portions of the world directly underneath the Avatar. This solved an important problem, but introduced a huge expense to the CPU and created unnecessary lag between input and screen response to that input. In short – it was lazy, and I paid for it in performance.

The new version of the engine is built on a different principle. The Avatar actually moves through the 3D space, while the world stays put. There are some optimizations such as trying to only draw the visible space so I don’ have to load the entire world in memory as I walk around a smaller portion of it. This resulted in some pretty crazy math-fu, but in the end it pretty much doubled the framerate and took a huge burden off the CPU. The input lag is gone and I am finally happy with the play experience.

Original Framerate Sample
New Engine Framerate Sample

A new Dev Vlog will be appearing shortly in which I will walk through the two models, the advantages, disadvantages and some of the optimizations that were implemented to squeeze every last frame out.

Shoppe Keepers and the Blacksmith

There were two main improvements I wanted to make to the blacksmith:

  1. Provide more equipment stats to help make buying decisions easier
  2. Incorporate the original (often funny) dialogue into a point and click interface

When I set out to implement the many shoppe keeper varieties, I thought it was going to be a snap. Track down the conversation data in the “talk” files, make some buttons and we would be done before you know it. Unfortunately the reality of the shoppe keeper data and code immediately reared its head.

In short – the shoppe keeper conversation data is spread across multiple files, if it’s findable at all. Next thing I know a whole new shoppe keeper dialogue system needs to be created, pulling all that disparate data from it’s many locations.

Although I only got the blacksmith implemented, I was able to create a complete shoppe keeper UI system which makes it much easier to use the same framework to add the additional shoppe keepers.

What’s Next?

Well, for the second time in a row I intend on implementing line of sight ensuring the player only sees what they are meant to see (turn off the x-ray vision!)

Secondly I am going to continue to implement the remaining shoppe keepers who include:

  • Barkeep
  • Horse seller
  • Shipwright
  • Healer
  • Innkeeper
  • Magic Seller
  • Guild Master

I am sure I will drop in one or two distractions as well – spending too much time on one feature can stifle motivation and creativity IMHO.

Featured

First Dev Vlog

Well, there isn’t much to say except that I have finally took the plunge and posted a Dev Vlog. This first vlog will introduce the tools I use to develop and offer a few antidotes while I’m at it. I talk about game engines, IDEs, art tools, editors and stuff.

In the future I will deep dive into particular subjects for those who are interested as well. In fact, I would love to hear about any particular subjects you may be interested in, in the future!

Featured

About Time! April 2020 Update

So What’s New?

I have already posted about NPC AI/Pathfinding, debug console and the Pre-Alpha Build, so I will stick to the newer items.

  • Full day/night cycles
  • Full moon cycles with onscreen widget
  • Moongates and Moonstones
    • Moongate travel by moon cycle
    • Cool “up/down” animation of moongate
    • Cool fade in/fade out when teleporting
    • Ambient glow of Moongates
    • Search and ‘G’et the moonstone
    • Bury the moonstone
  • ‘P’ush mechanic
    • Did you know chairs change direction when you push them? Now I do!
  • Complete Z-Stat descriptions
    • Highlighting of Reagents and Spell names for easier and quicker reference
    • Thank you to Ultima Codex who is attributed to many entries that were not in the original Book Of Lore
    • Look out for some great entries from the Book or Brad
  • Small enhancements include:
    • Fall down grates (even multiple grates like in Blackthorne’s castle)
    • Begun using light emitting materials in Unity to make things glow
      • Magic doors
      • Lava
      • Crystal balls

Some Details and Challenges

This was an interesting update because it seemed every time I wanted to implement some small component of the feature list then I would end up having to create some new system I had never considered.

Picking up a moonstone

So you want to ‘G’et a moonstone? Well first you ‘S’earch for it of course. But when you search in game for things that aren’t moonstones you could have stacks. The stacks do not translate well into the 3D game since they stack. So I had to create a queuing system that essentially puts them in a first in first out (FIFO) structure where the next item would appear as you ‘G’et the “exposed” item.

Next, typical inventory items are stored in a consistent way in the saved.gam file which makes it super easy to keep track – except moonstones are different. Moonstones are either “buried” or “not buried” and if they are not buried then I must assume they are in the Avatar’s inventory. This does not quite fit with the original games logic, and I still have to solve for it (but as I write this, I think I figured it out 🙂 )

Moonphases

Frankly, I have gotten away with being fairly ignorant of exactly how the moonphases work, progress and why the hell there are two moons! Needless to say, there is some very dirty (yet functional!) code that abstracts those complexities. I even wrote (borrowed) some calculus to move the moons and Sun in a circle. May God have mercy on my soul if I need to update this code again!

3D Tiles in a 2D World

This is not a new problem to me – the original game only showed a single tile at a time, so if an item such as a moonstone was exposed, then it simply hid the tile underneath. Also, things like signs did not technically have a tile underneath.

I had implemented a guessing algorithm in the past to try and take a best guess at the tile underneath but it was often wrong (no-one’s perfect), so to combat that I implemented an unfortunate, but requisite tile override system that allows me override any tile on any map. Note: This could be used in the future for customization or to makes quality of life tweaks to the game (I’m look at you @Cambragol!).

The Core Library versus the Unity Game Code

As many are aware, this is technically two projects – the core game code called Ultima5Redux (soon to be UltimaVRedux) and Ultima5Redux3D. Because I am using a paid/proprietary module in Ultima5Redux3D, I am unable to share it publicly on GitHub. To make sure the community get’s as much value as possible, I have continued to move game logic to the core library – if done correctly, the Ultima5Redux3D will only be reacting core game libraries logic decisions, allowing anyone in the future to build ontop of the core library if they opted to (MIT license).

Thanks

Just wanted to say thank you to all those who actively participate in the project such as the great feedback and ideas from @Cambragol, the publicity from Dino and WTF Dragon and all the other dragons who give me encouragement on Twitter and Reddit. It is always appreciated!

Also thank you to the Ultima Codex wiki contributors! When filling out the Z-Stats descriptions I used the wiki exclusively for quick descriptions from the Book of Lore, and when they weren’t available then I quoted (and attributed) portions of an article directly.

Featured

Let’s Walk on the Wild Side!

Coles Notes – there is a pre-alpha demo for you to try!

There is a pre-pre-alpha demo available for Windows and MacOS here: https://github.com/bradhannah/Ultima5Redux-Demos/blob/master/README.md! This version is not a game – it some core mechanics with endless bugs, but it’s something 🙂 I hope you like it. Please follow the instructions, if you don’t then you will only be disappointed.

So what’s new?

Since last update I have added a number of features:

  • Improved pathfinding
    • tile weighting allowing NPCs to favour dirt paths and brick roads over grassy shortcuts
    • smarter wandering and collision correction
    • comprehensive simulation of NPC travel over full day for every single town, keep and every single NPC
  • Improved directory/save game selection menu which was previously very buggy
  • Klimbing down grates and falling through floors (think Blackthorne’s Palace!)
  • Mirrors now reflect and can be broken by Avatar
  • Fixed a ton of long standing bugs
    • NPCs getting stuck/deadlocked
    • “Bleeding tiles” on outside tiles of townes
    • Conversation bugs causing crashing with gold or item transactions
  • Upgraded to latest High Defintion Render Pipeline for Unity
  • Created first pre-alpha release
  • Performance improvements and optimizations (was at 2fps in Blackthorne’s castle before I did!)
  • Added Unit Testing framework (NUnit), writing some initial tests
  • Initially migrated all tasks to Trello and then GitHub Projects
  • Updated MindMap

This work is now all being tracked here if you want to follow along https://github.com/users/bradhannah/projects/1.

Interestingly the biggest chunk of time was spent tuning the pathfinding, taking it from “good enough” to “not too shabby!”. I was able to write a number of simulations which both exposed a TON of deadlocks, but also let me address them, solve them and then prove they were solved.

What’s Next?

Well if my project list is any indication then I will intend on focusing on the following (as always – subject to change):

  • Gradual sunrise and sunsets
  • Creating a tile override system that will allow overrides for “poorly guessed” floor tiles
  • ‘P’ush things around the maps
  • ‘T’alk to shopkeepers
  • Moongates!!
  • Rewrite of voxel caching system to prevent “double caching” annoyance
  • Complete population of remaining item and inventory descriptions for Z-Stats
  • Fix some “special NPCs” that do not have proper sprites
  • Add “conversation log” feature for recording NPC conversations

Mindmap Update

Also here is an updated and already out of date mindmap for those who like pretty pictures.

Featured

Pathfinding – The All Consuming Chore

NPC AI and Pathfinding

As you may be aware since my late December update I have been focused on making the NPCs more mobile. I had been dreading the work because I feared (and was correct!) that it would be disruptive and force me to refactor my code in a big way.

At it’s most basic, every NPC has a schedule which basically has four main components:

  • What time should I move to a new position?
  • What X,Y coordinate should I be homed at?
  • Which Floor should I homed at?
  • When I get there, how should I act?

So we have interesting questions to answer like, if they aren’t on the right floor, then which ladder or staircase do they use? What do you do if two NPCs are battling for a single tile? Mix all that in with the memory and CPU constrained implementations developed by the original developers and you have a bit of a mess.

We also had the problem of reading in save game information that states where an NPC is presently and if they already had a path planned. If they did then we need to read it in and follow the original plan. One of my main goals was to have as close to 100% compatibility with the original save state as possible. To the point – ideally – where you could bounce between the original and Redux freely. That may be a pipe dream, but it is still my intention. Following this principal will also ease playtesting because I will be able to do like for like playtesting.

Code Improvements

To accommodate the additional logic and to make my life much easier I spent the better part of the month implementing a new concept called the Virtual Map (https://github.com/bradhannah/Ultima5Redux/blob/master/Ultima5Redux/Maps/VirtualMap.cs) It essentially pulls in all factors that could or would affect the map such as NPCs (dead or alive!?), open doors, keys in trees etc and give the program a single source of truth.

Secondly I fleshed out another concept called the World (https://github.com/bradhannah/Ultima5Redux/blob/master/Ultima5Redux/World.cs). As you may be aware – the project is broken into two parts; the core library Ultima5Redux and the 3D game component written for Unity called Ultima5Redux3D. The creation of the World object actually moves nearly all game logic into the core library, meaning that anyone in the future could “easily” plugin the core library and build on top of it with all the benefits of state management, world interactions, and even automated AI (crude) handling. It may seem a bit of a bore, but this was a massive shift for the project which ultimately is meant as an asset for the amazing Ultima Dragons community.

Another problem I had to solve was pathfinding. I have cringed at the thought of implementing my own pathfinding (bad college experience!). I knew everyone used the A* algorithm, so I went searching for a solution that was already baked and free OSS. I found https://github.com/davecusatis/A-Star-Sharp which is a wonderful and very C# native implementation. A small bug fix later, and the new Virtual Map function and I was up and running.

Lastly, voxels are 3D objects, and with that come with quite an expense. I managed to get around to something that has been on my list for the last 6 months. A simple voxel caching system was implemented which saved the unnecessary loading and destruction of voxels as the Avatar moved around the world and cities. It uses only basic constructs like Dictionaries and Queues to save an reuse tiles whenever possible. It more than double the framerate during my testing. As you can tell below, it had some hiccups!

Debug Console

I struggled with another issue – the debugger and debug console have become increasingly sluggish as I moved more and more into the core library. Secondly, it was very disruptive to continually break and inspect so I added a debug console which can be toggled as needed. As a bonus for any C# nerds, it is connected to the Debug/Trace handlers so all System.Diagnostic.Debug.WriteLine outputs automatically stream to it.

What’s Next?

The next month will be spent paying down some technical debt that I have accumulated as well as perhaps some core updates.

  • Tidy up and debug small bugs with pathfinding and scheduling
  • Improved lighting transitions from day to night to day
  • Save some state to disk such as player position and movement directions
  • Populate remaining item descriptions for ZStats
  • Continued play testing of the original game to refamiliarize myself with the finer details (F* this game is hard)

Maybe more – but given how slow it felt like I moved last month, I will hold it there.

Featured

Holiday Update!

I have posted a new video highlighting some features I have shown on Twitter (ready/use) and some I haven’t (ZStats).

The focus of the update is the following:

  • Intro screen with FIRE animation
  • Implemented “U”se interface
  • Implemented “R”eady
    equipment interface
  • Implemented “N”ew Order
  • Implemented ZStats
    • Character Stats
    • Item Descriptions

There a number of work items that are far less visible as well. A lot of time has been spent learning the ins and outs of the Unity UI. I actually implemented the few new UI features with varying techniques depending on time of day, phase of moon and general mood 🙂

Also, I implemented the Ready/Use system first which emulates the original experience fairly close, focusing on keyboard input and a general text based interface. The ZStats was far more graphical and extended existing functionality.

I will undoubtedly spend the month wondering how or if I should re-implement the Ready/Use interface to match the aesthetic of the ZStats interface.

What’s Coming

Next up is a focus on more fundamental mechanics that actually make the game feel more polished and “more like a game”.

  • Finish adding sprites and descriptions for
    remaining ZStat items
  • NPC pathfinding and schedules
  • Time of day/lighting change
  • Save game progressions to disk
  • time of day
  • equipment/inventory changes
  • (Maybe) some basic non-combat spells

Featured

Graphics – they’re hard

With the completion of the “R”eady and “N”ew Order functions, I have opted to mix it up and move on to something quite different. I am actively working towards getting an intro screen up and running. The primary goals will be:

  1. Show wicked blue/greeny Ultima logo
  2. Show Warriors of Destiny animated fire logo
  3. Provide load function – selecting from dynamic pick list of save directories

Other functions will follow eventually, but the biggest pain in the ass I currently suffer if manually changing my save game directory in code every time I want to test a new scenario (ie. new equipment load outs, different party members).

Progress thus far

I had in the past experimented and loosely integrated the Ultima 6 Decoder (http://nodling.nullneuron.net/ultima/code/ultima6/u6decode.zip). This uses an LZW algorithm to explode the *.16 files. The trick is then taking these exploded files and exporting them one more time – to a more commonly read format such as bitmap (.bmp).

When opening the create.16 file, I worked on spotting patterns and managed to spot what I incorrectly identified as fire.

To make sense of the specific format of the file, I looked back in time at the Ultima 4 ( http://wiki.ultimacodex.com/wiki/Ultima_IV_Internal_Formats#EGA_Files ) details. From there I created a basic program to read in and create a bitmap (https://github.com/bradhannah/Ultima5Redux/tree/master/Raw16ToBMP ). This is when i found out that my “flames” were actually the fortune teller.

Realizing I picked the wrong graphic I moved on to startsc.16.

So far so good. I have discovered a few things:

  1. each pixel is encoded in 4 bit chunks
  2. there are non-pixel bytes of varying sizes before each graphic which i haven’t been able to identify yet

This is what I’ve got so far – but my ultimate hope is to dynamically load the graphics at runtime from the original data files instead of exporting to BMP. I want to make sure that I am not peddling in copyrighted materials after-all 🙂

Featured

November 2019 Update Video

Novembers video includes some great updates. The project has really begun take shape and is actually starting to look like a game.

Note: All character data, inventory data and string data is gathered directly from actual Ultima save and data files

A few key changes/improvements in the November update

Visuals

  • Shifted to a classic isometric angle
  • Completed remaining sprite conversions to 3D model equivalents
  • Upgraded lighting engine

HUD

  • Implemented HUD with player characters, basic item quantities and current location (also added time into HUD!)
  • Implemented new Location tracking in HUD

NPC Chat

  • Reimplemented UI for NPC conversations with common look and feel

Signs

  • Implemented signs (no runes yet!)

Inventory System

  • Implemented basic inventory system

Basic Function

  • K-limb fences and mountains
  • O-pening doors
  • J-immy’ing doors
  • Space – pass time
  • G-et torches from wall
  • Porcullis drop at night

Next month brings on some new challenges I think. I will continue to work on equipping weapons and armour… you know honestly I’m not sure what else I will do – I just kind of work on the thing that most interests me that day or if I’m short on time, I just fix a bug and move on.

Featured

Signs Signs Everywhere are Signs

I haven’t found myself with much free time to work on my project in the last few weeks but I did manage to get some basic signs up and running.

It’s actually quite interesting the way that signs are stored. At least 2/3rds of them. There is a signs.dat file that contains the majority – however for some unknown reason I have unable to find a file with all the Eight Laws signs. As a result I have had to hard code them for now.

Also many signs use non english characters which I believe are indexes into a font file – but I haven’t got to the point where I can analyze them quite yet.

Lastly some signs are stuffed in the data.ovl file. I can only imagine why they needed to sink signs into any file other than signs.dat. I haven’t had to hardcode the sign text, but have had to hard code some file offsets which is a little gross, but I’ve done it before.

Thank goodness for the original rev-eng work here: http://wiki.ultimacodex.com/wiki/Ultima_V_Internal_Formats#SIGNS.DAT

Also I have begun to update some of the finer details in the wiki starting with Signs and NPCs.

Featured

Mind Mapping to Get Organized!

I often use Mind Maps at my day job to help organize my otherwise chaotic brain! I have begun to map out the entirety of what Ultima 5 boils down to in terms of function – then I overlay my personal plans for how I want to improve it. For example I have defined a number of custom UIs for functions such as buying/selling and a conversation log that you can actually refer to well after you had the conversation!

More than anything, it makes me realize how far I really have to go! But, it will serve as a de-facto project plan and feature list.

Featured

October Update

Take a look at the latest video!!

Work continues slowly but surely on the project. A focus on improved visuals has gone well (but is far from complete).

Updates include:

  • more 3D voxels replacing legacy sprites
  • ambient lighting
  • twilight lighting
  • new daytime lighting
  • basic NPC dialog

For the Unity nerds out there – I have switched from built-in renderer, to light weight render pipeline (LWRP) and finally to high definition render pipeline (HDRP). This has been a really neat experience and continues to strengthen the visual quality.

Next up I expect to:

  • Complete all “standard” NPC schedules and textures
  • Actually open a door!
  • Start creating a permanent UI

Featured

The cat’s out of the bag

Well I have been developing since the beginning of July and quietly uploading to GitHub. I decided to actually tell/show people what I have been up to.

You can read some interesting Q&A on Reddit here: https://www.reddit.com/r/Ultima/comments/d2z1iu/ultima5redux_a_very_very_early_preview_i_have/

Or you can just watch the development update video here:

There will be more to come but this seems to be a good start.

Design a site like this with WordPress.com
Get started