IPB

Welcome Guest ( Log In | Register )


 
Reply to this topicStart new topic
> (***) AI Triggers for Single Player
Yoshi
post Apr 6 2007, 09:02 PM
Post #1


Hum-vee
Group Icon

Group: Members
Posts: 161
Joined: 28-October 06
From: Fremont, CA
Member No.: 180
Alliance: GDI
Favorite game: Tiberian Sun



Credits:
-Aro and his topic of AI triggers for making me think on this.
-scorpionim6@msn.com, not sure what his forum name here is.
-OrcaCommander for refering me to scorp.

Okay here's the thing that sets the difference between Aro's AI Trigger tutorial and mine.
Aro's is for multiplayer, and I have tested this myself on a single player test map. I tested this for about 3 days now, and I finally achieved the result I wanted.

First thing's first. Set up teamtypes, scripts, and taskforces. You will need to construct a total of 1 taskforce, 2 scripts, and 2 teamtypes. I will go into this in detail.
The most important part, other than creating the AI triggers itself, is activating them. Be sure that your triggers allow Production and AI triggers to begin. Otherwise, your AI is a sitting duck.

First, let's know what we want the AI to build shall we? Let's do something small, like light infantry.


Now we set up two scripts. One is for them to just stand around and look pretty while the other one is what they're REALLY going to do.


Now it's time for the teamtypes. One is something that rings a bell: Pools, while the other is the actual attack. While researching Westwood maps and the AI.ini file, I saw what was called pools. Doing further research, I've noticed that they used the same taskforce as the actual attack action they're supposed to do. Priority and options selected between the pool and attack are different from what I've seen. Pool teamtypes have a priority of 6, while attack teamtypes have a priority of 7. The Max are generally the same, unless you want some units in reserve for another AI script or just to defend the base. Pool teamtypes MUST have the option "AreTeamMembersRecruitable" checked, while IsBaseDefense is actually optional, but recommended.

AreTeamMembersRecruitable is crucial due to the fact that these units NEED to be recruitable in order for the other AI trigger to fire and send these units on their mission.
IsBaseDefense is optional, but recommended because, while these units are in reserve, if the base or harvester is to be attacked, then these units will respond to the attack. CORRECTION: IsBaseDefense is crucial as well. It NEEDS to be checked.

In our attack team, we need to have recruiter checked so that the AI can recruit any available units (preferably our pool units) to launch a strike force. The rest are optional. Waypoint NEEDS to be blank in order for the AI to look throughout the whole map instead of in one particular area to recruit units. If there aren't any available. The AI will create "pool" units to use. Here's a screenshot to sum it all up for you.
NOTE: For the attack scripts, be sure to have "Success" be the second action.


And now, for the last part. The AI triggers itself. I will copy and paste what Aro wrote in his post on the descriptions on AI triggers. As well as commentary on some additions.
QUOTE (Aro)
Enabled: Do not forget to check this if the AI trigger shall be used

Type: This specifies the general event type for the AI Trigger. You can choose between several different types, The selected one specifies that the house that accesses the AI trigger must have a certain amount of certain objects. The exact amount, and the object type, is specified later on.

Name: Just a descriptive name of the AI Trigger

House: Usually this should be all, except you want only a certain house to access the AI trigger

Teamtypes: They specify the teams that shall be created as result of the AI trigger

Multi-Side: Specify if this trigger is for Everybody, Soviets, Allies or Yuri
This is for Multiplayer only. You can set this to <none>

Base defense: If this is checked, this AI trigger may be used even if the house doesn´t have a hated enemy yet

Available in Skirmish: Check this, and the AI trigger may be used in multiplayer games
We will not be using this option for Singleplayer maps.

Easy, Medium, Hard: In which difficulty modes is this AI trigger available?

Weight: Starting weight of the AI trigger. As higher, as more likely it is that the house decides to build the teamtype

MinWeight: The minimum weight that this AI trigger must have

MaxWeight: The maximum weight that this AI trigger can have


For pools, be sure that the weights are relatively close together. For example: Min. Weight: 30.000000, Weight: 40.000000, Max Weight: 40.000000.
For attackers, it doesn't really matter. It's based on you.

Note: AI trigger types for Pools are generally set to -1 None, but if a certain building requirement is needed you can change it to 1 House Owns (CONDITION) N of type X. They also tend to repeat the same teamtype pool so more units are in reserve.

Here's screen shots:


Basically, my AI will pool units when the AI triggers begin, and once 2 GDI Power plants are built, the AI (depending on whether or not it feels like it) will launch an attack on the base.

And now comes the moment of truth, testing.

AI builds the pool team.


Conditions are met.


AI launches strike force.


And there you go, the AI successfully fired both triggers!

Known issues: The AI tends to sit there after pooling units. I'm not sure if it's due to the fact that I have only 2 AI triggers or not, but it'll eventually send its forces at you. Sometimes you need to give him a little "kick" to start him up.

-Yoshi

This post has been edited by Yoshi: Apr 6 2007, 09:59 PM


--------------------
Go to the top of the page
 
: | +Quote Post
Crash
post Apr 6 2007, 10:01 PM
Post #2


Ghost Stalker
Group Icon

Group: Members
Posts: 1,282
Joined: 27-October 06
From: Norway
Member No.: 173
Alliance: Nod
Favorite game: Tiberian Sun



Nice Singleplayer AI trigger version, Yoshi biggrin.gif


--------------------
Perfection can never be achieved; it's merely approachable.
Go to the top of the page
 
: | +Quote Post
Warlord
post May 6 2007, 08:28 PM
Post #3


Artillery
Group Icon

Group: Members
Posts: 988
Joined: 21-October 06
From: Barnsley, UK
Member No.: 61
Alliance: GDI
Favorite game: Tiberian Sun



all the pics are roads..


--------------------

Signature By Aro^

"So long as there are men, there will be wars." - Albert Einstein.

Flying Saucer..
Go to the top of the page
 
: | +Quote Post
Crash
post May 7 2007, 12:21 PM
Post #4


Ghost Stalker
Group Icon

Group: Members
Posts: 1,282
Joined: 27-October 06
From: Norway
Member No.: 173
Alliance: Nod
Favorite game: Tiberian Sun



Yoshi has no domain at the moment, so all the pictures are that road until he fixes a new one.


--------------------
Perfection can never be achieved; it's merely approachable.
Go to the top of the page
 
: | +Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 28th March 2024 - 11:29 PM


XGhozt.com