Author Topic: Agressive AI  (Read 1165 times)

Offline Thyrus

  • *
  • Posts: 6218
  • Rep: 19
  • Back to purple '17
    • http://www.youtube.com/Th
  • Awards BOTM Winner
    • View Profile
    • Awards
Agressive AI
« on: May 15, 2014, 11:23:40 AM »
Hey there

While playing with Whams Robot Wars pack I noticed the AI beeing very agressive against human controlled bots. The AI tends to attack me even though two other AI bots are way closer to it. they even gang up me. I never noticed that before in DSL 2.1 or such. Did Click or Wham change something in the DSL 3 coding? Cause it`s rather annoying since you can`t get in position for a good attack in a rumble or 3 way.

Offline Natster-104

  • Ultra Heavyweight
  • Posts: 1406
  • Rep: 6
    • http://www.youtube.com/ch
    • View Profile
    • Awards
  • Skype: natster-104
Re: Agressive AI
« Reply #1 on: May 15, 2014, 11:45:30 AM »
Hey there

While playing with Whams Robot Wars pack I noticed the AI beeing very agressive against human controlled bots. The AI tends to attack me even though two other AI bots are way closer to it. they even gang up me. I never noticed that before in DSL 2.1 or such. Did Click or Wham change something in the DSL 3 coding? Cause it`s rather annoying since you can`t get in position for a good attack in a rumble or 3 way.
I've had this problem as well, I think Wham might have done something with the AI coding

Offline Trovaner

  • *
  • Posts: 1222
  • Rep: 32
    • View Profile
    • Awards
Re: Agressive AI
« Reply #2 on: May 15, 2014, 02:00:49 PM »
Actually, its more likely that they didn't mess with anything. Stock does this as well.

If you would like to fix it, you can open up your AI/__init__.py file and replace the following line
Code: (Line 252) [Select]
            if not plus.isHuman(enemy): weighted_dist += 3 #currently favors human player
with
Code: (Line 252) [Select]
            #if not plus.isHuman(enemy): weighted_dist += 3 #currently favors human player

Offline Thyrus

  • *
  • Posts: 6218
  • Rep: 19
  • Back to purple '17
    • http://www.youtube.com/Th
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: Agressive AI
« Reply #3 on: May 15, 2014, 02:37:21 PM »
Actually, its more likely that they didn't mess with anything. Stock does this as well.

If you would like to fix it, you can open up your AI/__init__.py file and replace the following line
Code: (Line 252) [Select]
            if not plus.isHuman(enemy): weighted_dist += 3 #currently favors human player
with
Code: (Line 252) [Select]
            #if not plus.isHuman(enemy): weighted_dist += 3 #currently favors human player

never noticed it in stock either.
so by making the game ignoring that line the AI attacks the bot that is closest to it?
is "3" the radius that is responsible for the AI to check for human players?
« Last Edit: May 15, 2014, 03:51:20 PM by Trovaner »

Offline Trovaner

  • *
  • Posts: 1222
  • Rep: 32
    • View Profile
    • Awards
Re: Agressive AI
« Reply #4 on: May 15, 2014, 03:58:58 PM »
By commenting out that line, the AI doesn't add 3 units to the distance of all the other AI bots (making human-controlled bots seem closer and more favorable as targets).

Offline Thyrus

  • *
  • Posts: 6218
  • Rep: 19
  • Back to purple '17
    • http://www.youtube.com/Th
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: Agressive AI
« Reply #5 on: May 15, 2014, 04:33:00 PM »
I see
Well thank you :)