gametechmods

Robot Arena => General Support => Topic started by: Thyrus on May 15, 2014, 11:23:40 AM

Title: Agressive AI
Post by: Thyrus 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.
Title: Re: Agressive AI
Post by: Natster-104 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
Title: Re: Agressive AI
Post by: Trovaner 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
Title: Re: Agressive AI
Post by: Thyrus 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?
Title: Re: Agressive AI
Post by: Trovaner 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).
Title: Re: Agressive AI
Post by: Thyrus on May 15, 2014, 04:33:00 PM
I see
Well thank you :)