DyDoBP: New AI on MultiAIpack

For code related discussions and questions
User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany
Contact:

DyDoBP: New AI on MultiAIpack

Post by DylanDog »

Hello
I am working on a new AI. Its name is DyDoBP. The final objective is for myself is to develop my own AI but to become "confident" with the scripting language I started by working on BP2.92 trying to improve it and fix few known bugs on it. This is the reason of the name DyDoBP...the core AI is always BP but with some improvements.

I have to thanks Nicker for allowing me to work on his AI and for the support given and for showing me where to find the necessary documentation which is needed when working on an AI for WZ2100.

And now some info about this new AI. I am still developing it, I have few milestones to be reached yet. Here below you can see the changelog with referece to BP2.92.

I have tested DyDoBP in skirmish games where also AIvolution is present, therefore in the attached package there is not only DyDoBP but AIvolution too, I hope this makes skirmish a bit more interesting:
Players 0-1-3 are AIvolution, players 2-4-5-6-7 are DyDoBP...therefore pay attention when playing a skirmish with 4 players, avoid to pick up position 2 as human player.

Please note that the "slider" is activated in DyDoBP (I know few people will not like it). This is not a cheat, if you want to play against the standard DyDoBP just leave the slider untouched...or you can change the following code at row 26 in the DyDoBP .vlo files:

Code: Select all

  EnableSliders	BOOL TRUE   //<-- edit this value
change in

Code: Select all

  EnableSliders	BOOL FALSE//<-- edit this value
...and now the changelog with reference to BP2.92

DyDoBP 1.01 - CHANGELOG

TESTED: ok on multy AIs (4players) when opponent is AIvolution and Rules are standard.
Human always on player 0;
MAP sk-Rush(T1 4players)
MAP sk-closeComba(T1 4players)
MAP sk-valley(T1 4players)

BUG FIXES (related to BP 2.92)
- MAJOR:
- Added check that "RepairFacility" is researched before building it
- MINOR:
- Changed wrong attack parameters which are used to identify the majority of the units (see script for more details)
- BP2.92 event buildRepairFirst builds RepairFacilities only if exactly 4 were present, this is a minor bug.
Now that event tries to build RepairFacilities if they are less then the MAX allowed

AI IMPROVEMENTS AND NEW FEATURES (related to BP 2.92)
1) Improve harvesting
- DyDoBP does not send 2 or more trucks to harvest an OliRes (like BP) but it sends only one
- DyDoBP sends the nearest idle Truck (to the oilRes) to harvest the selected oilRes (BP sends an idle random one)
- DyDoBP tries to harvest the nearest oilRes first (BP not)
- DyDoBP tries to harvest ALL OilRes (BP not), even the very far ones.
- Add a check for oilRes near Ally players and avoid to harvest such oilRes.
2) Improved Derrick Defenses
- DyDoBP defends the oilRes near to the enemy, (BP picks up a random one)
3) Improve base defences
-
4) Minor attack improving
- changed secondary settings for attacking troups, they are sent back for
r epair when they have LOW damage (BP has NEVER, it repairs only units near the base)
- Build a Repair Facility on the attack gathering point to support attacking troops.
5) Major attack improving {to be started}
-
6) Add interaction capability with human player (send help troops...)
-

the point 3-5 and 6 are on the "milestone" list...no work made on them yet.


this are the objectives for the next version of DyDoBP:

Milestones to DyDoBP 1.2:
1) Improve harvesting
-
2) Improved Derrick Defenses
-
3) Improve base defences
- DyDoBP should give priority to gateways points
4) Minor attack improving
- Add a small Attack group and leave tankGroup acting as BP2.92. The new small Attack group should have
many beheaviours: Attack enemy Derricks, Attack Enemy from another angle, defend own Derricks
5) Major attack improving
- Create multiple units groups (BP has only 2, Cyborgs and Tanks), ideally each group
should have 5-8 Tanks 5-8 Cyborgs 3-4 Repair Units 1-2 Commander
- Use of the sensors/commanders, keep repair units near the sensor/commanders
- If necessary (on big maps?) build structures (Factories and Repair Facilities) near enemy base
- Different tasks can be assigned to the Groups: defend the base, attack an oliRes, attack an enemy base,
attack the same player from different positions, this will be the real new INTELLIGENCE!
6) Add interaction capability with human player (send help troops...)


Enjoiy it...
Attachments
0_1_3AIv-2_4_5_6_7DyDoBP.wz
(578.19 KiB) Downloaded 447 times
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).
User avatar
Tenoh
Trained
Trained
Posts: 359
Joined: 18 Nov 2008, 15:06

Re: DyDoBP: New AI on MultiAIpack

Post by Tenoh »

well, thats very interesting! I already like the new features.
"No, you don't want to buy this Sh[beep]t from me. It shoots sideways, it was built by retard zombies in some f[beep]king outreach program." HL:G
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: DyDoBP: New AI on MultiAIpack

Post by Per »

It is really awesome that you are trying to fix the issues with BP.

Testing it here, it crashes instantly with the trunk version. The script function allianceExistsBetween is called with the second player parameter set to -1.

Also, from previous testing of BP, I noticed that on some maps it quickly will build itself into a corner with defensive buildings.

I am not sure if testing against AIvolution is much point anymore. It has not been maintained in a while, and that is starting to show, as it is optimized against the previous generation of rebalancing.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: DyDoBP: New AI on MultiAIpack

Post by Per »

Fixing the crash is not difficult. The function ReAllyBOTs needs to make sure it is not passing in a dummy -1 value for WhosMyLord, like this:

Code: Select all

event ReAllyBOTs (buildBaseTr)
{
        if(WhosMyLord >= 0)
        {
                if((IamBOT == TRUE) and (allianceExistsBetween(player,WhosMyLord) == false))
                {
                        createAlliance(player,WhosMyLord);
                }
        }
}
User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany
Contact:

Re: DyDoBP: New AI on MultiAIpack

Post by DylanDog »

Per wrote:It is really awesome that you are trying to fix the issues with BP.
I am working on BP because before get to the e point I feel confident to develop my own AI it is much easier to to try to try to improve existing AIs.
Per wrote:The function ReAllyBOTs needs to make sure it is not passing in a dummy -1 value for WhosMyLord, like this.
Thanks for giving the solution, I will include this into the new version.

Per, I am not sure I understand the issues with AIvolution. I am not "testing" DyDoBP against AIvolution, I just think that a skirmish with different AIs is more interesting for a human player.
Per wrote:Also, from previous testing of BP, I noticed that on some maps it quickly will build itself into a corner with defensive buildings.
I will try to have a look at this, maybe you remember the MAPs?

FYI - I will be offline on the week-end.
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: DyDoBP: New AI on MultiAIpack

Post by Per »

DylanDog wrote:I will try to have a look at this, maybe you remember the MAPs?
Rush comes to mind.
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA
Contact:

Re: DyDoBP: New AI on MultiAIpack

Post by Zarel »

DylanDog wrote:Hello
I am working on a new AI. Its name is DyDoBP. The final objective is for myself is to develop my own AI but to become "confident" with the scripting language I started by working on BP2.92 trying to improve it and fix few known bugs on it. This is the reason of the name DyDoBP...the core AI is always BP but with some improvements.
THANK YOU THANK YOU THANK YOU THANK YOU.

This is pretty great. One thing I'm wondering about is its name, though. "DyDoBP" is kind of unreadable... Maybe something like "Dydo-BP" or "Dydog BP"?
Per wrote:Testing it here, it crashes instantly with the trunk version. The script function allianceExistsBetween is called with the second player parameter set to -1.
Or we could just have the parser always return false... How's that phrase go, "be liberal with what you parse"? One of the things I hate most about Java is its tendency to throw an exception when it would have been perfectly fine returning false/null and preventing me from having to set up a clunky try/catch block.

I think he's more improving the AI for 2.2 than making it any less ASSERTy in trunk. Any crash that we can prevent by changing the parser, we should prevent by changing the parser.
User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany
Contact:

Re: DyDoBP: New AI on MultiAIpack

Post by DylanDog »

Zarel wrote: One thing I'm wondering about is its name, though. "DyDoBP" is kind of unreadable... Maybe something like "Dydo-BP" or "Dydog BP"?
No problem at all to change the name...DyDo-BP is fine for me.
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).
User avatar
Tenoh
Trained
Trained
Posts: 359
Joined: 18 Nov 2008, 15:06

Re: DyDoBP: New AI on MultiAIpack

Post by Tenoh »

Id call it DD-BP for short ^_^.
"No, you don't want to buy this Sh[beep]t from me. It shoots sideways, it was built by retard zombies in some f[beep]king outreach program." HL:G
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA
Contact:

Re: DyDoBP: New AI on MultiAIpack

Post by Zarel »

DylanDog wrote:No problem at all to change the name...DyDo-BP is fine for me.
I was more referring to the second capital "D" which bugs me.

You know, you have plenty of room... "DylanDog BP" is about the same length as "BecomePrey", and people are going to abbreviate it DDBP no matter what. ;)

Alternatively, we could just give it a normal name... Like "Predator". "Predator" would be a pretty intimidating name for an AI. ;)
User avatar
new paradigm leader
Trained
Trained
Posts: 232
Joined: 23 Aug 2008, 11:21
Location: Who really knows? I don't.

Re: DyDoBP: New AI on MultiAIpack

Post by new paradigm leader »

i concur and when the alien bodies come in we can have predator vs aliens xD :P
Return to your designated zone or be destroyed. You are in contravention of the new paradigm.
User avatar
lav_coyote25
Professional
Professional
Posts: 3434
Joined: 08 Aug 2006, 23:18

Re: DyDoBP: New AI on MultiAIpack

Post by lav_coyote25 »

great name - yes to the pred vs alien.... :3
User avatar
Tenoh
Trained
Trained
Posts: 359
Joined: 18 Nov 2008, 15:06

Re: DyDoBP: New AI on MultiAIpack

Post by Tenoh »

Hmm... i dont get it,just like BP thisAI also deletes its HQ and rebuilds it somewhere else, wth!
"No, you don't want to buy this Sh[beep]t from me. It shoots sideways, it was built by retard zombies in some f[beep]king outreach program." HL:G
User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany
Contact:

Re: DyDoBP: New AI on MultiAIpack

Post by DylanDog »

Tenoh wrote:Hmm... i dont get it,just like BP thisAI also deletes its HQ and rebuilds it somewhere else, wth!
This "feature" will be removed from the next version of DyDo-BP, I do not like it neither.
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).
javierkaiser
Trained
Trained
Posts: 39
Joined: 23 Aug 2009, 08:05

Re: DyDoBP: New AI on MultiAIpack

Post by javierkaiser »

I just tried it last night, and I liked it :)
It even write something when it kills something or you destroy it's units/bases. First time I see something like that :D
And the challenge is moderate by now, I will test it more with some friends.
Good work.
Post Reply