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..

Related Posts:

This time you’ve got me to help you…

A few months back I received an email from Marmalade Studios. Marmalade is the system I used to give me cross platform support. I pay for a licence yearly which is still covered by the ongoing sales on the long tale of the game. Anyway, the email informed me that Marmalade were pulling out of the Tools business to focus on their own development. They laid out a timetable and final release plan for the current tools but ultimately from March 2017 they will no longer be supporting their toolset. There was an offer to purchase rights to the source code, but as a small indie, that’s not really an option.

This doesn’t affect the current releases, but what it does mean is that any chances of me producing updates in the future have almost certainly been removed. And with every new OS release, the chance of the game not working are increased.

I know I have not been prolific with updates since the release of Doomdark’s Revenge settled. There was so many things I wanted to do, but just haven’t gotten around to. The reality is two fold, as amazing as the sales of the games have been, they are obviously not enough to support me full time, and secondly, the games were written quite frantically in the end and I never regained that sense of purpose after their release; this is not just for these games but for everything that I have been doing creatively.

I’ve been trying recently to tie up another release. The main reason for this is to produce a build with the latest version of Marmalade and get it out there to properly support the latest devices. In theory a new release should keep its visibility in the App Stores for a few more years. As part of this I’ve been slowing adding a couple of features: Discovery Mode, Difficulty Modes, Rationalise the code base between DDR and LOM. etc..

So with all this in mind I have been toying with the following: Uploading the source code to GitHub and making it open-source with the objective of transferring it to another cross platform solution, Cocos2d-x for example. Or, allowing people to port the engine to any other coding languages they like, so it could be used however they like.

The current codebase is written in c++, and thus moving to Cocos2d-x makes sense, but I quite like the idea of porting to c# or swift.

Moving to open source could also allow for the tool chain to be fully developed which would allow for more work to be put into ongoing development of the games.

Anyway, I shall think on this more, but if anyone is interested in getting involved, then drop me a note…

 

 

Related Posts:

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…

Related Posts:

Amazon Underground

amazon-underground-app1A month or two back, Amazon approached me about putting The Lords of Midnight and Doomdark’s Revenge on their new service. It had just a project name then, and I had to sign a whole host of documents before I was even told watch the service was, and then another whole host of documents when I agreed.

Before deciding that I would, I thought long and hard. Essentially, I never wanted the Midnight games to be advert driven, and I couldn’t see a compelling way to have “in app purchases” that would generate the kind of sales required to support the game, without an amount of work that would be loss leading.

By having the Midnight games as a full purchase game, it has probably stopped it from being installed as many times as it might have been when free, indeed I have seen the spikes when the game has been reduced in price for promotion. But even those extra sales have not amounted to much in the way of cash as the price reduction has obviously hurt.

That said, the games have sold around 30k units which I couldn’t be happier at. That just hasn’t resulted in a great deal of money, in the scheme of things. Rough fag packet calculation, if you take the average price at £2.50, taking into account price reductions, different platforms, and multi-currency, you get a turnover of £75k less Commission 30%, and VAT at 20%, it’s just £37.5k – and divided between Jure and Mike’s family, pretty much a three-way split, I’m looking at £12.5k over 2.5 years. Without doing an accurate calculation, I can say that number feels about right, and it’s still a long way from covering my time costs if I apply a day rate to it.

Android sales of the games are well under a 3rd of Apple, but they appear to have a 10:1 piracy ratio when taking into account rough internal data calculations.

So, as we hit the tail end of sales, I wondered if the Amazon pay-for-play where they pick up the tab, might be an interesting approach for some additional Android sales. The gamble was, will people who won’t buy it on Android, possibly pick it up and play it for a while, enough to generate a small trickle of income, that might be greater than the normal Android sales. This could all possibly be maximised by being an official launch app for the service.

Android still accounts for about £50 a month in sales, this last week has seen and additional £3k units downloaded through Amazon Underground, accounting for less than a £1 worth of pay-for-play. Amazon pay a fraction of a penny per minute played. So not a great start, but I’ll have to see how it goes.

I know the t&c’s for the Amazon offering are a little harsh, and the privacy settings quite extraordinary, but still understandable considering what they need to achieve, however I figure that the target audience who don’t want to pay for the games in the first place, probably don’t care. And those who do, have either already bought the game, or still have the option to through Google Play, or Amazon Store proper.

I just need to keep an eye on whether the Amazon Underground sales hurt the Android sales, better them, or just become another small income stream.

Related Posts:

The Eye of the Moon

I have finally typed up the notes for The Eye of the Moon and combined it with a little story history.

I’ve just found some extra notes and bits that I forgot to scan. I have now added these in.

The new bits are:-
1. The hand drawn map of Valahar at the end.
2. Some information about name changes on the Eye map.
3. Names of additional wise characters.
4. Known Routes
5. Single Use Magic
6. Holding Domains
7. Independents
8. Restricting the Numbers

Related Posts:

To Luxor, everything now grew clear

Clumping together...I’ve spent some more time looking at the AI for Doomdark’s Revenge, trying to work out why it doesn’t quite appear to be playing like the original. One thing I noticed is that I have completely misunderstood the recruiting logic when it comes to Loyalty and Treachery. I made changes in the last version, but I am going to need to revert them.

The approach algorithm

  • compare the the attributes of the lords and looking for matches gain +1 for each match.
  • If the character being approached is not loyal then +1
  • If the character being approached is treacherous then * 2
  • if the recruiting character is the liege of the character being approached then +3
  • If the recruiting character carries a crown of persuasion then +2
  • If the score is greater than 3 then the approach will succeed.

The basic concept that I have misunderstood is: Loyal characters are less likely to be recruited away form their current liege and un-loyal characters are more likely, therefore the algorithm gets a +1 for none loyal characters. And that treacherous characters are more likely to leave and thus the *2

The next thing I have missed is the lords following the objectives of their lieges.

It works like this.

If the lord has a liege and that liege is following their liege or their foe, then we must follow our liege. Otherwise pick a new objective.

There is a 32% chance that we will pick a new objective. Although that should be 25% because we could pick the objective we already have. That leaves a 68%/75% chance that we continue doing what they were already doing.

The problem for me is the first check. If we use Shareth as an example. She has a 12.5% chance that she will choose to follow either her foe or leader. As she has no leader she reverts to Luxor, which is her foe. So she has a 12.5% chance that she will follow Luxor. All the lords that follow her now have a 100% chance of following Shareth, and this ripples all the way down the stack of lords. Which at the start of the game means that 47 Icelords will disregard what they are doing and follow her.

The mistake I had made is that I had made the following lords take the objectives of their liege when their liege was following their liege or foe. What this means is that when the liege is following their foe the lord follows their own foe. So using Shareth again as the example, when she is following her liege ( Luxor by default ) then all her minions will head to her location, but when she is following her foe ( Luxor ), then all her minions are heading to their foe and not to her location. So as an example, Imgaril the Icelord would be heading to Imgorthand the Fey, who, is likely the the other direction of Shareth.

Hopefully this fix should make the game more like the original, but it bothers me that it is a flawed AI. I ran the game for the first ten days, up until the first battle took place, I ran it on the emulator too to compare notes. Here is what Shareth did over those days.

  1. Head Home
  2. Head Home
  3. Head Home
  4. Follow Luxor
  5. Head Home
  6. Follow Luxor
  7. Follow Luxor
  8. Follow Luxor
  9. Search for object
  10. Head home

Now Talormane does this

  1. Head Home
  2. Head Home
  3. Search for object
  4. Search for object
  5. Follow Lorelorn
  6. Follow Lorelorn
  7. Follow Lorelorn
  8. Follow Lorelorn
  9. Follow Lorelorn
  10. Follow Asorthane

The reason for the delayed follow on day 4 is because Talormane is following Lorelorn who is following Shareth, but Lorelorn is lower in the processing order than Talormane, and thus Talormane doesn’t know that Lorelorn is going to follow Shareth in that turn.

The final thing that I changed was that there is a 6.25% chance that the change of objective will be DO NOTHING. This is especially important for being in a battle with someone who is not the lords foe, because it means that without this the lord will always leave the battlefield. The mistake I had made was that I persisted the do nothing as an objective, i.e.. The lords objective becomes do nothing. But it shouldn’t, it should stay the same as the previous objective, and this turn that objective is ignored.

Going back to Shareth. If she chose to DO NOTHING then her objective would no longer be follow liege or foe, which means that her followers would be able to perform whichever objective they chose. However, if her previous objective had have been follow liege or foe, then her followers should still be heading towards her when she chooses to do nothing. This would have the affect of allowing them to catch up on her.

Related Posts:

Midnight @ Blackberry

BB World_Get It_BLK Box I have removed The Lords of Midnight and Doomdark’s Revenge from Blackberry App World. It’s been a tough decision to finally make, but the games are just not viable on that platform. There are a couple of major issues that I have:
Firstly, the games are not really selling, so the low numbers mean that I am not triggering Blackberry’s minimum payment thresholds. I estimate that I have sold somewhere between 100 and 200 units of The Lords of Midnight, but Blackberry use three different payment vendors depending on how the game is purchased. These are Bango, Digital River, and Blackberry themselves.
Bango, and Blackberry have minimum payment thresholds, and I have received no payment for games sold through them.
Digital River have paid me, but they pay in USD into the business paypal account. This is really poor and a nightmare to administer from an accounting point of view. In particular it makes calculating my VAT very difficult.
The fact that my sales are estimates is because you are unable to get accurate reports from the Blackberry Vendor Portal. You have to rely on statements to calculate your sales. But some of the Vendor statements ( Digital River ) appear to lack any reference to the game sold. So I can’t separate the sales for the two games.

Should there be enough interest, I will consider placing the Blackberry .bar files for future updates on this website, so that the keen players can side load the updates themselves.

Related Posts:

Update for Doomdark’s Revenge released

ddr_icon_iosI have just pushed a new version of Doomdark’s Revenge out for ALL platforms. This brings all platforms in line with each other. The previous update was only released for Android and iOS. I apologiss for the delay in getting the last two versions out, but my heart and mind has just not been in it for the last couple of months.

Hopefully this will fix the remaining issues with the gameplay, and will also be the last of the 1.3 changes. The intention is that any update to follow will include some new features.

The Windows and Mac version should be showing up on your main menu now. Android/Amazon version should be ready now, or very soon. Mac App Store and iOS version will take a week in Apple Clearance, and Blackberry version usually takes a couple of days.

The changes are..

v1.3.6
1. Fix recruitment check. Loyalty of character being approached now correctly gives +1 and when the lord is treacherous the chance of recruitment is halved – This fix should mean that treacherous lords are no harder to recruit for AI lords, which should stop lords swapping allegiance so much. They should therefore be able to focus on the task at hand.

v1.3.5
1. Morkin’s AI attribute is reset once recruited. Stops him moving and allows him to move in tunnels. Previously Morkin’s AI attribute remained set after Tarithel recruited him. This mean that he didn’t work in tunnels very well, and had a habit of wandering off at night.
2. Tarithel can no longer be recruited away. Tarithel was incorrectly being recruited by AI lords.
3. Spell of Carudrium now works correctly. Previously this was bringing ALL characters to the location of the caster, and not just the the lords loyal to the Moonprince.

If the AI characters are still not behaving like the original, I am going to have to spend a lot more time analysing why. I can’t see any reason why the logic should not play out the same as the original ( other than the difference in random numbers ). This will involved a lot of debugging. But hopefully this version should just nudge everything in the right direction.

 

Related Posts:

I follow no road, I simply ride.

I’ve had a torrid few days with the updates. Only myself to blame really. I managed to release, not one, but two updates with debug code left in. Rookie mistakes! I must be more strict with the regression testing and debug development. But it’s difficult when you are working alone and trying to react as quick as possible to issues raised. This has not been made any easier by working in a Hotel where the internet access doesn’t really get going until after Midnight. Pushing out an update involves building ten different versions, and uploading ~300mb – tethering on my phone has taken a battering and my Data Plan has been boosted once already.

For the record, and just in case you have updated during that time, the two issues are; Approach will always succeed, no matter who you are or who you approach, and after attacking a stronghold, the next morning your lords will seem to have scattered. If you see this happen, you need the latest update.

iOS and OSX App Store will not have these issues as the releases had not made their way through the original update process. If you have updated Windows or Mac through the game menu, you might want to check again.

Anyway I am hoping that the latest update 1.3.4 will settle and I can take a break.

Related Posts:

Tell me what ails thee

ddr_c64Version 1.3 has now been pushed out on all formats. You will start to see it coming live over the next 7 days. As usual, Android will be first ( probably already is live ), with iOS and OSX being last. If you have a Windows or OSX version directly from this site, or through GoG, you should see an UPDATE menu option appear on the main menu. GoG.com will also go live with the update in their time.

There are a embarrassingly large number of bug fixes in this version. Thanks to a number of very eagle eyed players, in particular Mark Wright, I have been able to fix up many specific differences between the initial release version and the original 1985 release. I also spent a large amount of time pouring over the original code, looking for anything that might alter the way the game played in a way that I might not have foreseen.

doomdrk1On the whole, I think we have most of them, but there is always a chance that there are a few differences still. In particular, the remake is based on the original ZX Spectrum version, and there are definite differences between the Spectrum and the C64 version. So, if you were a C64 player, then the game will not being playing quite as you remember it.

The last few weeks has really made me understand the intricacies of the original game to a level that I never fully appreciated before. It’s quite amazing the small amount of time that the original game was developed and tested in, that said, it’s because of that that you understand why the original had more problems than Lords of Midnight ever did.

There are a number of bugs or oddities that I have chosen not to fix, these are because they are in the original. To players coming to the game anew, or even returning to the game without the same outlook of 30 years ago, some of the AI logic might not make a great deal of sense. I intend to address these issues in a later version by adding different playing modes.

The intention is to have the following playing modes, Original Spectrum, Intended Spectrum, Original C64, Updated.

Intended Spectrum will fix a couple of obvious bugs inherent in the original release, the main one being movement. There are some movement values that would change the way certain races move across particular terrain, for example giants and mountains, but these were never applied in the original due to a bug that referenced the wrong table.

The Original C64 will apply a couple of AI differences to the Spectrum version, namely the aforementioned movement issue. In C64 the functionality was added, but the terrains are different than the Spectrum Intended version. The other change would be that recruited lords start at dawn in the C64 version I believe. Please feel free to call out any other known differences ( apart from the sun 🙂 )

Updated will allow me to make a number of slight AI changes.

Firstly I will change the behaviour of fighting critters. I think it’s wrong that a lord with an army can be killed by a critter, especially on not much more than a flip of a coin. Currently a Lord’s army takes damage from the critter, which should remain, but a lord should not engage the critter until the army is wiped out.

Secondly, I will add some changes to make it less likely that a lord that you attack just continues on with their objectives and completely avoids a battle. I think that if they start the night in a location with an enemy army, there should be a large chance that they remain there and engage in battle. If they are near a location with an enemy army, there should also be a smaller chance that they will attack.

Related Posts: