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

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…

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.