Skirmish AI

Wargus is a Warcraft 2 mod that allows you to play Warcraft 2 with the Stratagus engine.
Post Reply
ArtOfWar
Posts: 2
Joined: Mon Aug 27, 2012 4:30 pm

Skirmish AI

Post by ArtOfWar »

We normally play Wargus in Skirmish mode (multiplayer-humans vs computers on our LAN). In order to keep things interesting, we make our own maps with WAR2EDIT and compile them with PUDCONVERT. We'll typically set up our maps with 4 computer opponents and assign AI as follows: 2 Land attack, 1 sea attack, 1 air attack. A while ago we noticed that (although our "air attack" AI opponents did a great job attacking via air) our computer opponents assigned the "sea attack" role stopped building/attacking via sea and became passive... most recently with 2.2.7 (we skipped 2.2.6 altogether) we noticed that neither air nor sea attack AI opponents do much at all (other than attack by land, and not too aggressively at that).

This leads me to many questions:
1) Are we doing something wrong, or has the AI gotten worse over time?
2) Are our custom PUD files to blame? should we be using something other than WAR2EDIT?
3) Are their better scripts/ai/* files to be had?

Thanks in advance for any help regarding these issues.

ps. We have a LUA programmer in the family, can the AI be adjusted simply by editing the associated sea_attack.lua files and re-starting the game?
User avatar
jarod42
Posts: 101
Joined: Fri Jan 20, 2012 7:43 pm

Re: Skirmish AI

Post by jarod42 »

There is currently some bugs in AIForce when sending mixed units (land/sea or land/air).
(by fixing some bugs, we introduced others :-/ )
It may occur that only one part of AIForce attack, (the other part can't reach the goal of the other group)...
Since the attack never fail/success, problem occurs.
a work around may be to split force to avoid mixed units.
ArtOfWar
Posts: 2
Joined: Mon Aug 27, 2012 4:30 pm

Re: Skirmish AI

Post by ArtOfWar »

Perhaps either I don't understand the reply, or jarod42 doesn't understand my problem...I'll try to re-itterate in different words:

We have made our own map using WAR2EDIT.
In our example map, we have designated 8 players, with the following "Player Properties":
Player 1: Controller: Human
Player 2: Controller: Human
Player 3: Controller: Human
Player 4: Controller: Human
Player 5: Controller: Computer, AI: Land Attack
Player 6: Controller: Computer, AI: Air Attack
Player 7: Controller: Computer, AI: Sea Attack
Player 8: Controller: Computer, AI: Land Attack

During gameplay, it [used to be] that P5 and P8 would attack via Land as specified, and P6 would attack via Air (as specified), but P7 (sea attack) would not really do much...
With 2.2.7 we noticed that computer opponents 5-8 attack only by land - and aggression is reduced for those designated air or sea.

In your response you mention "sending mixed units" and "splitting force to avoid mixed units"... I'm unsure how "mixing units" comes into play in your response as there is (at least that I have found in WAR2EDIT thus far) no way to to specify "land/sea" attack for a computer/ai opponent.

We have extensive programming experience in our family, a sincere love of this game, and would love to help debug/build upon/rewrite the AI. We just need someone to introduce us to the intricacies of how the Wargus AI operates, and I'm sure we'll be able to take it from there...

Thanks, looking forward to being a contributing part of this community...
User avatar
jarod42
Posts: 101
Joined: Fri Jan 20, 2012 7:43 pm

Re: Skirmish AI

Post by jarod42 »

for example,
in 'Sea Attack' AI, they send gunboat AND ground unit like archer or footmen. (so mixed unit types)
Target of the force depend of the unit selected to find opponent.
if we select an archer or a footman, a ground destination will be chosen and (if needed) a transporter will be added to the force to reach island.
but unfortunately, a boat can be chosen, and so, a water destination is chosen and that blocks the AI (because of the ground units).
the proposed work around is to have one force with boats, and one with ground units, but they will behave independently, and boats will select a target sea
and don't 'protect' the transporter (but actually, it is buggy anyway).

As I said, we fixed some bug in the engine about AI (use transporter was broken, continue attack when target die, come back to home when no more enemy...)

The script implementation of AI is in wargus-data/scripts/ai.lua and wargus-data/scripts/ai directory
and in the engine in stratagus/src/ai directory.

Patch welcome :)
User avatar
DinkyDyeAussie
Posts: 260
Joined: Fri Feb 10, 2012 10:39 am
Location: Australia

Re: Skirmish AI

Post by DinkyDyeAussie »

ArtofWar everyone is welcome to tweak this game and the AI does need work like Jarod said.

I do a little LUA programming, mainly interface fixes, that unfortunatly, i have to redo due to patching my copy of the game with the latest scripts wiht out backing them up...I really gotta start writing down what files I gotta modify...

Other than that, I compile and test the latest trunk releases that Pali and Jarod post on lauchpad and also put them here for other poeple to test out and report back here about things that bug out in the game...I haven't played it for a long time lately myself either...must set aside time someday...
Post Reply