I'm glad this is virtually impossible outside of testing.

Found a bug? Great! Post about it here!

I'm glad this is virtually impossible outside of testing.

Postby Ferret » Sun Sep 11, 2016 2:20 pm

So, when I'm testing for implementation correctness, rather than balance testing, I am a big cheater. I usually use the in-game debug tools to give myself a bunch of Green Essences that I chug like water as needed while I'm testing to see if whatever new ability I'm working on actually works the way it's supposed to. :D

I usually delete test characters fairly frequently, but for some reason I'd kept this one around awhile... so long that, in fact, his Vitality had gotten to where it was if he had spent a bit more than 6 points/level on it (listed bonus was +133%.)

Then, I noticed a funny thing happened... enemies no longer wanted to attack him.

I don't mean that they preferred other targets, but would take him if they could get him. I mean they Would Not Attack Him. Even if he was vulnerable to the attack type!

It turns out there was a rather horrifying bug in one of my AI evaluation functions. :D

One of the lines of code in there is basically this:

vulnerabilityValue = 200 - (targetEffectiveHealthPercentage)

targetEffectiveHealthPercentage is the target's health percentage, but modified by any bonuses they have to MaxHP, so that it properly reflects how vulnerable they actually are. Of course... if you have a bonus to MaxHP that is > 100... vulnerabilityValue... actually... becomes...negative. :(

Negative, to Demon AI, means "this is actually going to help your target, don't do it!" :( Which is not really an accurate assessment of the situation. :D

Anyway, it's fixed in the next build. :P
User avatar
Ferret
 
Posts: 1785
Joined: Tue Sep 16, 2014 3:18 pm

Re: I'm glad this is virtually impossible outside of testing

Postby mbj » Mon Sep 12, 2016 10:55 am

wow
Did demons even avoid performing AoEs and debuffs on/near the character? Did it affect friendly AI at all?
mbj
 
Posts: 116
Joined: Wed Apr 13, 2016 6:50 pm

Re: I'm glad this is virtually impossible outside of testing

Postby Ferret » Mon Sep 12, 2016 3:06 pm

Not everything checks "vulnerability" as a concept (ex: control effects, debuffs that reduce offensive capability, etc.), so some things would still apply.

But yeah, the AI will never* do anything that has even one negative evaluation outcome, so AEs including the player would be out too.

I didn't test friendly AI specifically while it was still buggy, but since friendly AI evaluates vulnerability too (such as when determining when to buff, when to heal, etc.), it would have also refused to do these things since, with the negative evaluation, it'd have assumed it was helping the enemy.

(* - A very small number of special cases among enemies, mostly uniques/heroes, have a "Ruthless" flag set that causes them to treat negative evaluations as just penalties to evaluation instead of a total no go. This flag is always ignored for player units, so even if you recruit a Ruthless AI, it will not behave that way in your party.)
User avatar
Ferret
 
Posts: 1785
Joined: Tue Sep 16, 2014 3:18 pm


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 12 guests

cron