Ai blocking/attacking, wasting damagers

All about getting the AI less baka...
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: unhappy ai

Post by Zethfox »

:( yeah we need more defined combat rules for ai....
wololo
Site Admin
Posts: 3728
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: unhappy ai

Post by wololo »

Things that are natural to a human are not to a computer. The best way to understand why the ai acts like that is to look at the code. For example it casts a lightning bolt on a 4 4 because that creature has been identified as a threat, and thinks damaging it for 3 point is a move in the good direction to lower the threat. Lightning bolt only to kill is too predictable and would prevent those random times when the ai feels human and casts 2 lightning bolt on Your 4 4
muaddib
Posts: 38
Joined: Fri Jun 25, 2010 9:28 am
Location: Russia

Re: unhappy ai

Post by muaddib »

Please note these comments in next versions.
I am ready to help in testing.
wololo
Site Admin
Posts: 3728
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: unhappy ai

Post by wololo »

We'll do our best, but realistically, we need more devs :)
rawsugar
Posts: 228
Joined: Wed Aug 11, 2010 11:05 am

Re: unhappy ai

Post by rawsugar »

actually im pretty sure i'd be fine w letting go of a 1 in a 1000 chance of a stroke of genius of 2 lightning bolts on same creature for having it cast only to kill.
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: unhappy ai

Post by Zethfox »

i would have to agree with raw on this one...as natural as it might be to cast a nonkill lightining bolt...it also just seems like dumb programing...which is what people keep complaining about over and over....
wololo
Site Admin
Posts: 3728
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: unhappy ai

Post by wololo »

The logic is not that simple, I simplified because I type on a phone. Look at the code, it all depends on the difference between life and damage. It's just a matter of tweaking the values

Edit:
http://code.google.com/p/wagic/source/b ... er.cpp#243

Code: Select all

        else if (aad->getDamage() >= target->toughness)
        {
            efficiency = 100;
        }
        else if (target->toughness)
        {
            efficiency = (50 * aad->getDamage()) / target->toughness;
        }
        else
        {
            efficiency = 0;
        }
        break;
The idea would be to reduce the 50 into something smaller, maybe 10, or even less.
muaddib
Posts: 38
Joined: Fri Jun 25, 2010 9:28 am
Location: Russia

Re: unhappy ai

Post by muaddib »

on what affect efficiency parameter?
It is interesting, I'm programmer too.
wololo
Site Admin
Posts: 3728
Joined: Wed Oct 15, 2008 12:42 am
Location: Japan

Re: unhappy ai

Post by wololo »

the result is a percentage of chance to cast the ability/card
muaddib
Posts: 38
Joined: Fri Jun 25, 2010 9:28 am
Location: Russia

Re: unhappy ai

Post by muaddib »

I would be write:

Code: Select all

        if (aad->getDamage() >= target->toughness)
        {
            efficiency = target->toughness/aad->getDamage()*100-41; //not 100%, and no less 40%
            if (efficiency<0)
               efficiency = 0; 
        }
        else
        {
            efficiency = 0;
        }
and something that:

Code: Select all

      if (target==opponent && target->life<=aad->getDamage())
      {
           efficiency = 100;
      }
If I can't kill nothing I keep spell in hand.
Locked