Does Nexus AI cheat?

Discussions about AI types, units, tactics & strategy.

Does Nexus AI cheat?

Postby aubergine » 17 Feb 2012, 23:17

...like a lot?

It seems to be capable of researching at roughly 1.5 the speed me and other AIs can. And at the same time it seems capable of creating far more units!
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
aubergine
Professional
Professional
 
Posts: 3459
Joined: 10 Oct 2010, 00:58

Re: Does Nexus AI cheat?

Postby Berg » 18 Feb 2012, 00:20

That's called cheating aubergine.

PS yes Im pretty sure it does
User avatar
Berg
Regular
Regular
 
Posts: 1945
Joined: 02 Sep 2007, 23:25
Location: Australia

Re: Does Nexus AI cheat?

Postby effigy » 18 Feb 2012, 04:54

Yeah, the Nexus AI cheats power and speed. The higher the difficulty the more.
This is why some features aren't implemented: http://forums.wz2100.net/viewtopic.php?f=30&t=7490&view=unread#p87241
User avatar
effigy
Regular
Regular
 
Posts: 1217
Joined: 22 Jan 2010, 03:21

Re: Does Nexus AI cheat?

Postby The Dominion of Duat » 18 Feb 2012, 08:25

I love the challenge of it though. Gives ya the good 'ol grit and spit in your teeth. :D
"Darkness is light turned inside out." ~Beezlebub
User avatar
The Dominion of Duat
Trained
Trained
 
Posts: 39
Joined: 16 Feb 2012, 04:54
Location: Duat

Re: Does Nexus AI cheat?

Postby Per » 18 Feb 2012, 10:48

It cheats at any difficulty above the minimum.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
 
Posts: 3742
Joined: 03 Aug 2006, 19:39

Re: Does Nexus AI cheat?

Postby NoQ » 18 Feb 2012, 15:18

I wonder how exactly it cheats, cause i didn't find the place in its script responsible for cheating last time i tried :oops:
User avatar
NoQ
Special
Special
 
Posts: 6136
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Does Nexus AI cheat?

Postby Cyp » 18 Feb 2012, 15:29

In nexus.slo:
Code: Select all
event difficultyModifier(difficultyModifierTr)
{
   if(not isHumanPlayer(me))
   {
      skDifficultyModifier(me);
   }
}


In src/scriptai.cpp:
Code: Select all
bool scrSkDifficultyModifier(void)
{
   int          player;
   RESEARCH_FACILITY   *psResFacility;
   STRUCTURE      *psStr;
   PLAYER_RESEARCH      *pPlayerRes;

   if (!stackPopParams(1,VAL_INT, &player ))
   {
      return false;
   }

   /* Skip cheats if difficulty modifier slider is set to minimum or this is a true multiplayer game.
    * (0 - player disabled, 20 - max value, UBYTE_MAX - autogame)
    */
   if (game.skDiff[player] <= 1 || game.skDiff[player] == UBYTE_MAX || NetPlay.bComms)
   {
      return true;
   }

   // power modifier, range: 0-1000
   giftPower(ANYPLAYER, player, game.skDiff[player] * 50, true);

   //research modifier
   for (psStr=apsStructLists[player];psStr;psStr=psStr->psNext)
   {
      if (psStr->pStructureType->type == REF_RESEARCH)
      {
         psResFacility =   (RESEARCH_FACILITY*)psStr->pFunctionality;

         // subtract 0 - 80% off the time to research.
         if (psResFacility->psSubject)
         {
            RESEARCH   *psResearch = (RESEARCH *)psResFacility->psSubject;

            pPlayerRes = &asPlayerResList[player][psResearch->ref - REF_RESEARCH_START];
            pPlayerRes->currentPoints += (psResearch->researchPoints * 4 * game.skDiff[player]) / 100;
            syncDebug("AI %d is cheating with research time.", player);
         }
      }

   }

   return true;
}


So, as far as I understand, it cheats at any difficulty level (including minimum), if it's in single-player skirmish. (Or multiplayer skirmish in 2.3.)

Even on minimum, it's guaranteed to finish any research in under 6 minutes (due to subtracting 20% from the research time, every minute), even if not having any power.
Cyp
Evitcani
Evitcani
 
Posts: 702
Joined: 17 Jan 2010, 23:35

Re: Does Nexus AI cheat?

Postby NoQ » 18 Feb 2012, 15:38

Thanks :oops:
Even on minimum, it's guaranteed to finish any research in under 6 minutes (due to subtracting 20% from the research time, every minute), even if not having any power.
I don't think so:
Code: Select all
   if (game.skDiff[player] <= 1 || game.skDiff[player] == UBYTE_MAX || NetPlay.bComms)
   {
      return true;
   }
Still, it does cheat by producing and building things it didn't research yet (eg., hardened sensor towers, or repair tank halftracks even without halftracks), but that doesn't really matter. (note: Semperfi is non-cheating in the sense of power and research, but it still cheats in the same way when it comes to sensor towers etc.)

Ok, so here is what really bothers me. Should AI cheat? Cause if it doesn't, it will pretty much never be a challenge in 1x1, at least not at our current level of development, which is a puty (an interesting battle on Startup against an AI is impossible). Nexus AI is no challenge even at Insane difficulty, but my brand-new super-duper AI could be quite nasty if only it cheated just a little.
User avatar
NoQ
Special
Special
 
Posts: 6136
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Does Nexus AI cheat?

Postby aubergine » 18 Feb 2012, 16:06

Maybe something like this:

Image Easy: no cheating at all

Image Medium: Deity cheating (ie. can see all enemy units/structures) only

Image Hard: Deity + small amount of power cheating

Image Insane: Cheat like a trainer munching scriptkiddie

But I also think alliances / number of players needs to factor in to the equation. Currently playerData doesn't tell us who is human, if it's MP/SK, or which AIs are being used. (you can find alliances/teams easily enough though).

For example, if nullbot were to power cheat then it should power cheat less per AI if there are several allied nullbot AIs.
Last edited by aubergine on 18 Feb 2012, 16:20, edited 1 time in total.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
aubergine
Professional
Professional
 
Posts: 3459
Joined: 10 Oct 2010, 00:58

Re: Does Nexus AI cheat?

Postby NoQ » 18 Feb 2012, 16:13

+deity cheating
I think currently deity-cheating is hardcoded. There is no AI that doesn't deity-cheat, just some AIs don't use that. You can see it by switching players with Ctrl+O in cheat mode.
User avatar
NoQ
Special
Special
 
Posts: 6136
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Does Nexus AI cheat?

Postby aubergine » 18 Feb 2012, 16:22

I plan on having EggPlant avoid deity cheating wherever possible (so will always filter enum lists to me+ally visibility).

However, even then there will still be bits of deity cheat happening: if I see a unit, and then it retreats to the fog, I'll still know about it. And if ranged attack on my units, I get told about the attacker and so know where the attacker is.

BTW: Edited my post above.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
aubergine
Professional
Professional
 
Posts: 3459
Joined: 10 Oct 2010, 00:58

Re: Does Nexus AI cheat?

Postby Cyp » 18 Feb 2012, 17:56

NoQ wrote:Thanks :oops:
Even on minimum, it's guaranteed to finish any research in under 6 minutes (due to subtracting 20% from the research time, every minute), even if not having any power.
I don't think so:
Code: Select all
   if (game.skDiff[player] <= 1 || game.skDiff[player] == UBYTE_MAX || NetPlay.bComms)
   {
      return true;
   }
Still, it does cheat by producing and building things it didn't research yet (eg., hardened sensor towers, or repair tank halftracks even without halftracks), but that doesn't really matter. (note: Semperfi is non-cheating in the sense of power and research, but it still cheats in the same way when it comes to sensor towers etc.)

Oh, ok. In 2.3, it was probably possible for game.skDiff[player] to be equal to 1. In 3.1, I think it's restricted to the values 5, 10, 15, 20. In multiplayer skirmish, it can't cheat with research speed/power, since it was breaking synch, and I didn't really approve of the AI cheating enough to consider possibly contemplating thinking of trying to start implementing a workaround.
Ok, so here is what really bothers me. Should AI cheat? Cause if it doesn't, it will pretty much never be a challenge in 1x1, at least not at our current level of development, which is a puty (an interesting battle on Startup against an AI is impossible). Nexus AI is no challenge even at Insane difficulty, but my brand-new super-duper AI could be quite nasty if only it cheated just a little.

In my opinion, the AI should never cheat; should have exactly equal opportunities as a human player, including having a reaction time limit equal to how fast it's physically possible for a non-augmented human player to click, and should have input equivalent to what a human player sees on the screen; but should beat the human player by making superior decisions.
Cyp
Evitcani
Evitcani
 
Posts: 702
Joined: 17 Jan 2010, 23:35

Re: Does Nexus AI cheat?

Postby aubergine » 18 Feb 2012, 19:28

In my opinion, the AI should never cheat; should have exactly equal opportunities as a human player, including having a reaction time limit equal to how fast it's physically possible for a non-augmented human player to click, and should have input equivalent to what a human player sees on the screen; but should beat the human player by making superior decisions.


I think for now AIs are going to have to cheat a little (based on difficulty setting) because it's not going to be possible to put a human's adaptable brian in to an AI at the moment.

AIs are still pretty much blind to what's going on in the game. For example, they can't work out how long it will take to reach a target. Because distBetweenTwoPoints() calculates distance in straight line regardless of terrain obstacles, what might look like a nearby target to the AI could actually require a droid to travel half way around the map to get to it.

It's because of things like this, which are known about but non-trivial to fix, that the AI isn't going to be making superior decisions any time soon.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
aubergine
Professional
Professional
 
Posts: 3459
Joined: 10 Oct 2010, 00:58

Re: Does Nexus AI cheat?

Postby NoQ » 18 Feb 2012, 19:30

Pathfinder-aware distBetweenTwoPoints could be really helpful, yeah (:
That's not the worst thing though (:
User avatar
NoQ
Special
Special
 
Posts: 6136
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Does Nexus AI cheat?

Postby aubergine » 18 Feb 2012, 19:43

Ability to properly micromanage droids would be most important thing IMHO? So, specifically an event telling me a droid has fired its weapon, so I can retreat it a little. And a way of knowing the reload time of that droid, so I could set a timer to tell it to return to the fight once it's reloaded.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
aubergine
Professional
Professional
 
Posts: 3459
Joined: 10 Oct 2010, 00:58

Next

Return to Skirmish / Multiplay