Noob question - AI chaining/alternatives

Please post here for questions and discussion about scenario design, art and sound modding and the game editor for WITP Admiral's Edition.

Moderators: wdolson, MOD_War-in-the-Pacific-Admirals-Edition

Post Reply
Szilard
Posts: 386
Joined: Wed Jan 03, 2001 10:00 am

Noob question - AI chaining/alternatives

Post by Szilard »

I think I understand in general how chaining AI actions works. But I don't see anything in the brief editor manual or the editor itself about setting up alternative actions - eg do this thing with a 50% probability, otherwise do this other thing.

I'm missing something obvious?
Andy Mac
Posts: 12578
Joined: Wed May 12, 2004 8:08 pm
Location: Alexandria, Scotland

RE: Noob question - AI chaining/alternatives

Post by Andy Mac »

Nope you cannot do it there is no % chance of x happening
 
Instead what you can have is up to 99 alternative scripts for the entire war and the AI picks one at random at game launch
herwin
Posts: 6047
Joined: Thu May 27, 2004 9:20 pm
Location: Sunderland, UK
Contact:

RE: Noob question - AI chaining/alternatives

Post by herwin »

ORIGINAL: Andy Mac

Nope you cannot do it there is no % chance of x happening

Instead what you can have is up to 99 alternative scripts for the entire war and the AI picks one at random at game launch

I've been studying this in the context of how the brain works (and making some progress). Plans seem to be trees, with nodes and alternative paths, extending in time from the initial actions to the eventual rewards. The remaining parts of the current plans are kept in memory so that changes in the rewards can be propagated back to the current set of alternative actions. This is done whenever a node is reached or a reward estimate is updated, and can result in switching of plans. The current value of an alternative action reflects the current estimate of the future value of all rewards it can potentially lead to, weighted by 1/variance for each estimate, so that the more certain the estimate, the higher the weighting.

One of my current grant proposals will implement this in a robot.
Harry Erwin
"For a number to make sense in the game, someone has to calibrate it and program code. There are too many significant numbers that behave non-linearly to expect that. It's just a game. Enjoy it." herwin@btinternet.com
Andy Mac
Posts: 12578
Joined: Wed May 12, 2004 8:08 pm
Location: Alexandria, Scotland

RE: Noob question - AI chaining/alternatives

Post by Andy Mac »

I am obviously a moron because that went way over my head Herwin...
 
 
** SPOILER **
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
OK what we have is a predefined selection of scripts most of which follow a sensible approach for both sides in game - I did 13 because thats all I could cope with in terms of patching and maintaining and each one has 1500+ scripts so I dont think thats unreasonble.
 
There are 13 scripts in the AI and it randomly selects 1 of the 13 on game launch to play against you some are VERY aggressive, some are VERY Aggressive but its a BLUFF, some are patient and methodical, some appear patient and methodical but are in fact crazy only I will will know which one you are playing after I run a save.
 
Within those scripts the vast bulk is very similar although they are now steadily diverging as I bespoke more and more of the scripts on each script. (Up until 6 weeks ago we only had one script so the additional scripts were not intended until patch 2 at earliest but Don and James managed to squeeze them in so I did a quick re write of the scripts - this feature of the AI makes it a LOT more replayable.
 
For patch 1 most of the effort matching the forum has went into the Japanese Ai as no one is giving feedback on allied AI so far but in time they will also become more bespoke.
 
There is room in the rotation for an additional 87 scripts if anyone wants to design one to put into the rotation. If you want to increase the chance of getting a wild and wacky script then I can tell you how to do that.
 
13 is about as many as I can cope with personally but if someone else wants to try a script let me know and I can give out the top tips on what does and doesnt work.
 
I may after patch 2 is out of the way have a go at some really creative scripts although actually the nastiest from an allied players perspective are the Bluff scripts - you knwo make a move make it look like you are going deep but in fact you are forting up to attrit the allies - they can be nasty if you dont pick up on them - basically you probably won't know which AI script you are playing until its to late.
 
Andy
herwin
Posts: 6047
Joined: Thu May 27, 2004 9:20 pm
Location: Sunderland, UK
Contact:

RE: Noob question - AI chaining/alternatives

Post by herwin »

Actually, I don't think it did go over your head! You're taking the approach of a chess opening library, and what we're seeing in the brain is something of that nature, but taking advantage of the natural parallelism of the situation to switch quickly between openings when feasible and appropriate.
Harry Erwin
"For a number to make sense in the game, someone has to calibrate it and program code. There are too many significant numbers that behave non-linearly to expect that. It's just a game. Enjoy it." herwin@btinternet.com
herwin
Posts: 6047
Joined: Thu May 27, 2004 9:20 pm
Location: Sunderland, UK
Contact:

RE: Noob question - AI chaining/alternatives

Post by herwin »

When both sides can bluff, you get chaotic game dynamics!
Harry Erwin
"For a number to make sense in the game, someone has to calibrate it and program code. There are too many significant numbers that behave non-linearly to expect that. It's just a game. Enjoy it." herwin@btinternet.com
Andy Mac
Posts: 12578
Joined: Wed May 12, 2004 8:08 pm
Location: Alexandria, Scotland

RE: Noob question - AI chaining/alternatives

Post by Andy Mac »

I wpould love to get up to 99 scripts to choose from but its hard enough keeping 13 straight !!
User avatar
Zebedee
Posts: 535
Joined: Tue Aug 30, 2005 11:52 am

RE: Noob question - AI chaining/alternatives

Post by Zebedee »

Please keep documenting this info Andy Mac :) I'm certainly going to be playing with the AI scripting after a play through with each side (currently Japan vs Allied AI).

Really interesting to get this kind of overview of the work you've put in.
Image
Post Reply

Return to “Scenario Design and Modding”