Many battles fought again by tongue

Strange day today. Not just because it would have been Mike’s birthday, but because for some reason I found myself fixing a bug in Doomdark’s Revenge. Back in January I had a bug reported to me by Simon Foston, I managed to get some save games from him and just needed to find some time to look at it. Now, it’s taken a little while for me to find that time, but for some reason I looked at it today. It wasn’t a conscious decision, I was just looking through some emails that needed dealing with and noticed Simon’s bug report.
A quick look through the code and with a tip off from Simon’s report, it became apparent that the ghosts of dead lords were continuing to take part in battles. I checked the original code and it looked as if the bug was there too, however, I then found that the isDead check was happening later in the process. Strangely what it means is that battles at a dead lords location are processed as part of a dead characters turn, and not as part of other characters in the location. In my case, I’d missed the later isDead check and therefore the dead lord actually took part in the battle.

 

So, it seemed strange to be working on a bug in Doomdark’s Revenge that included the dearly departed, today of all days. I’m sure Mike had a wry smile..

In the forest, the trees grew tall and shady and bright flowers carpeted the floor

Screenshot 2016-01-06 23.01.13I finally got round to spending some time converting some Citadel data. On of the issues that I had was that I have the map data in LBM image format. It’s obviously not a great format for the terrain data, but this was given to me by the original programmer and I’m not sure how they were processed for the final game. The other issue is the difference in game styles. This data is for a 3d free roaming map and some of the maps are different sizes. The region map are 128×128, however I can’t believe that the citadel could be played out as a 2d landscaping game, without seriously playing with the time taken to move. Therefore, I decided to make the Citadel map 256×256, this is in keeping with the map that Mike drew up for Eye of the Moon, and therefore as the Bloodmarch was originally going to be the setting for EotM it seems fitting to go with the same size.

Last year I did some work on transferring The Lords of Midnight and Doomdark’s Revenge maps into Tiled. I figured that if I could create a tool chain from that, I could possibly edit the maps for future campaign updates to the games. I did all the work on converting to Tiled and coming up with data formats, but never did any work on the toolchain to get the data back into the game. This is something I still need to do.

With that in mind, I produced a draft Tiled version of the Citadel map which you can download to take a look at. It has layers for Realms and Regions, and then individual layers for each terrain type. The Citadel map was very sparsely populated compared to LoM and DDR, and although the current terrain types account for 19 different terrain, which is actually three more than both LoM and DDR, these terrain really are base landscape terrain. Land, Water, Trees, Mountains, Swamps, etc…. it is lacking anything remotely of interest. There are no Liths, Villages, Hits, etc…

If a game is going to come of the Citadel, this is something that is going to need to be rectified.

LoM and DDR pretty much share the following landscape terrain types: Mountain, Forest, Downs, Lake, Frozen Wastes, Plains, and Hills.

LoM adds: Citadel, Henge, Tower, Village, Keep, Snow Hall, Ruin, Lith, and Cavern, while DDR adds: Gate, Temple, Pit, Palace, Fortress, Hall, Hut, Tower, City, Fountain, and Stones.

The Citadel has landscape types of: Mountains, Craggy Mountains, Forest, Hills, Plains, Land, Valley, Lakeland, Swamp, River, Sea, Bay, Lake, Foothills, Isle, and Downs, and adds: Castle.

As you can see, there isn’t a great deal of variety in those none landscape terrains. Citadel, City, and Castle pretty much replace each other, as do keep and fortress. I seem to recall that Maranor is the Dark Citadel, but I am not aware of any cities.

So, apart from Snow Hall, I see no reason why the additional LoM and DDR terrain types could not be used within a Citadel scenario.

The question then becomes, should there be any new terrains?

My first process is to make sure the Tiled map all holds together. I needs a little tidying up which will need to be a visual process. I’m not sure if there were problems with the original, but I noticed things like trees in the sea. I never got that far in the game, so I don’t know if there were indeed trees in shallow water on the coast line, but a few things like that should probably be ironed out.

At this stage I would like to get some Terrain graphics so that I could drop the map into the engine, and start walking around. There are some issues here, as The Citadel introduces water in a way that LoM and DDR didn’t, so there will need to be engine changes to handle that.

Once a clean version of the map is available, the next stage would be to hand populate the map with the other terrain types. I don’t see this being a quick exercise because I think a lot of thought will need to go into this process.

Only at that stage, will I be anywhere near thinking about an ACTUAL game. There is a lot of underlying work do consider with how the game should work, how the AI in the original works etc. Without help this will also be a lengthy process.

So basically, don’t hold your breath, but slowly slowly catchy monkey…

We must find friends as well as enemies…

A new bug came to light in Doomdark’s Revenge. I had a report of a crash bug that occurs after 138 days, that’s one hundred, one score, and eighteen days since the Moonprince rode forth into the Icemark.

The problem appeared to be that an AI character’s liege was getting set to himself. This causes a problem in the AI logic for a character choosing to follow their liege. The AI goes something like this…

I want to follow my liege, but my liege is dead, so I need to follow my liege’s liege and this character will become my new liege. The code ripples up the liege tree until it finds someone to follow, or bails and decides to hunt down Luxor instead. When the bug occurs it follows the tree and finds a liege who is dead but they are also their own liege, and thus we get stuck in an infinite loop.

Once I found this as the source of the crash, I needed to work out WHY it occurs.

There are only two places where the liege can change, the aforementioned follow liege routine, and being recruited.

I stuck some debug info on both cases and set the game to run on automatic to see if the issue triggered, and it did.

Here is the scenario…

Anvarorn starts with Fangrorn being his liege. Fangrorn’s liege is Shareth. Fangrorn gets recruited by Anvortheon the Barbarian, and thus his loyalty changes to the barbarians, and his new liege becomes Anvortheon. Anvarorn decides to follow his Liege, who is still Fangrorn. When he gets to the same location as him he notices that they are not the same loyalty and thus tries to recruit him. He succeeds. Thus Fangrorn’s liege becomes Anvarorn. So we now have a circular liege issue. This becomes a problem if Fangrorn dies, because in this instance Anvarorn decides to follow his liege, finds that his liege is dead so takes his liege’s liege as his new liege and therefore becomes his own liege!

I went back and checked the original code, and this issue can happen. The only place you would notice it would be on one of the description screens where it would say, Anvarorn’s liege is Anvarorn – or words to that affect. At worst the character would end up following themselves and end up not moving. This is something that has been mentioned as possibly happening in the current version.

When I implemented the liege tree walk, I did just that, I implemented it as a walk up the tree, and because of the circular issue, a dead lord who is their own liege will create a circular loop if they are someone else’s liege. The original code doesn’t do that, it only takes the next liege up the stack and therefore slowly makes its way up the liege tree over a number of nights. Thus no infinite loop.

This would possibly occur with characters following their foe. If their foe is dead it walks the liege tree of the foe to find the next foe.

Fix to follow soon…