Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extending AI(md).ini - scripting
#1
Among other improvements in RP2, I want to enhance the AI(md).ini functionality - add extra Script Actions, increase the 6 UnitTypes limit in TaskForces, maybe even add an alternative, more readable, AITriggerTypes syntax...

This thread is for the discussion about improving ScriptTypes.

It would be fairly simple to add "Attack specific VehicleType/InfantryType/AircraftType" like the current "Attack BuildingType" logic, and such. However, all that is inconvenienced by the ScriptTypes syntax requiring two numeric arguments. I can either work with that, or come up with a new, more expressive, syntax, which would take time. Which way is better?

Of course, I alone can't possibly think of all the actions that would be worth doing/fixing, so suggest your own!

Also, the coder in me can't help but notice the lack of any conditionals in the scripting. It is not difficult to add a script action doing an if/then/else, if there is a use for it, even if that does sound like a repetition of the AITriggerType conditionals. I do think adding ifs for extraordinary conditions (say, "have we spied an allied battle lab already?" to avoid repetitively spying the same battle lab for no award) would help. Again, opinions are needed.
Reply
#2
I would imagine something expressive would be the best way to go to make it easier to script the AI. But, if you do it Westwood style with two numeric arguments, you won't go wrong either since that _is_ fairly simple once you've written several scripts.
I'm what Willis was talkin' about.
Reply
#3
I always wanted a cooperative AI script.

When in online multi play, players can used the beacon to alert their allies to send help. Is it feasble for a AI nation to compare an enemy attacking force with her own total units, if and when she comes up severly short to "call" a beacon over the surrounding area of the structure/units under attack..the beacon would just be cosmetic, but acts as a trigger & waypoint, prompting her allied AI nation to abandon any non-defensive script (that qualify under suspend priority) she is filling and choose a "cooperative" script to aid her allied AI nation.

A probability of using such feature as in easy/medium/hard.
A selection of Co-op teamtypes asked for and used by.
A option to send any and all available units.
After the threat is defeated, a return to base action would be needed in the Cooperative teamtype.

Or, am I again hoping for the moon.
Reply
#4
Dracaveli Wrote:I always wanted a cooperative AI script.

When in online multi play, players can used the beacon to alert their allies to send help. Is it feasble for a AI nation to compare an enemy attacking force with her own total units, if and when she comes up severly short to "call" a beacon over the surrounding area of the structure/units under attack..the beacon would just be cosmetic, but acts as a trigger & waypoint, prompting her allied AI nation to abandon any non-defensive script (that qualify under suspend priority) she is filling and choose a "cooperative" script to aid her allied AI nation.

A probability of using such feature as in easy/medium/hard.
A selection of Co-op teamtypes asked for and used by.
A option to send any and all available units.
After the threat is defeated, a return to base action would be needed in the Cooperative teamtype.

Or, am I again hoping for the moon.

with the engine probebly a moon but it has been done in other games such as rise of nations
[Image: rotate.jpg]
Reply
#5
I have some ideas, please comment my ideas DCoder.

In the script, where you add 1=0,1
There should be more choices after the ",":

Attack Vehicles,Infantries and basedefence. Right now there is something like this, but it is very buggy, I tested it for hours.

Also right now my AI are little bit retards.
I have set the script to 3=0,1(I have tried other, they are all the same)
They ignore my base defence, they ignore my tanks, they just rush in mmy base and tries to destroy my construction yard. So I can kill them without and resistance. It would be better if AI attack the first object it can see, instead of go in the middle of my base.
Reply
#6
Perhaps an "Escort" script action? I've read through the AImd.ini guide, and it says that having a secondary teamtype on a trigger with a script action calling for "Follow Friendlies" would achieve this effect, but so far, in all my testing, I have not noticed this to happen.

Also, what does it do with TFs that break the limit of 6 unit types?

Finally, could it be possible to re-enable some of the better parts of CNC AI? Like in TS, when you played against Hard AI, all the units in a taskforce would direct fire upon units that attacked it. In RA2, the AI just lets itself get mowed down. Or RA2's fast-deploy logic with GIs. (GIs would immediately deploy when paradropped or encounter an enemy)
Star Strike Next Beta :V.7x -- (current version=V.6x Build 2)
Star Strike TC Forums
Star Strike Website
Reply
#7
Okay, in turn...

Fen: If I use Westwood style, the main problem is actions like Move To Enemy Structure, they really need more than one argument - adding 101372 to actual indices to change the effect is no fun.

Dracaveli: There are obstacles, but I think that will be doable eventually.

Guest: both of those are easy to fix.

Eva: Not all the stuff from the guide is true. Follow Friendlies seems to actually instruct the whole team to escort whatever same-owner unit is closest to the team at execution time. "Escort" would make sense when I can come up with a way to tell it what exactly to escort... TFs with more than 6 unit types is fixable, but it will take time.
As for the "re-enabling", there's a flag on the TeamType, iirc Suicide=yes, which makes it ignore damage and try and execute its task regardless. TeamType flags lack bloody documentation so badly -_-

I also see a way to fix the Scout command, but that will take a lot of time.

In addition, I think it would be interesting to add a way to dynamically attach/remove Tags to objects, even though that is not necessarily best done within this scope.

If a consensus was reached on a new way to give AI hints about good base entrances, choke points, etc., I could add an action to randomly pick one of those instead of always rolling in the front door.. even though those things are highly map-specific and really should be done at that level.

As a quick start, I'm thinking of adding these:
a) 70-72,## makes the team attack specified Inf/Air/VehicleType (replace ## with the index of wanted Type, and add 65k/131k like with Structures)
b) 73-75,## makes the team follow/escort the specified I/A/VehicleType, same pattern
c) 0,99 makes the team seek out any disabled units (offline Robot Tanks and such)
d) 99,## works the same as 0,## , but supports the same 65k/131k logic)
Reply
#8
Well to add the whole if/then/or stuff, would it be possible to make an intelligent "engineer bridge" type script?

I've seen it done in several AI mods, but they seem to fall under the problem of "engineers try to repair bridges that don't need it", would it be possible for the AI triggers to know when a bridge is destroyed, and THEN use the trigger weighting to decide weather they build a "bridge repair" team?

It may also need a "destroyed bridge" flag in the "move to" field, or it's own separate entry, like a "fix destroyed bridge" entry, as opposed to the current "attack bridge repair hut with engineers" script we've got to make ATM.
[Image: MRMIdAS2k.jpg]
MRMIdAS: No longer allowed to criticise Westwood on PPM
Reply
#9
Or we could scrap the AI altogether and just use an adaptive and almost (but not) sentient AI
Reply
#10
Yeah. What could possibly happen?
Forum Rules

(01.06.2011, 05:43:25)kenosis Wrote: Oh damn don't be disgraced again!

(25.06.2011, 20:42:59)Nighthawk Wrote: The proverbial bearded omni-bug may be dead, but the containment campaign is still being waged in the desert.
Reply
#11
how about a way to include more than 1 country from the countries list on a trigger?
for example, i have a unit available to france and germany, but net the rest of allies, the current method means you have to have a trigger for france, and another 1 for germany. this gets a little tedious when you have 6 countries on a side, and want the trigger on all but 1.

and also, more than 1 condition on the trigger, for example, depot and war factory, but not have const yard to build MCV.
Reply
#12
OOH!

just thought.

Would it be possible to get a particular game mode to use a particular AI file?

For instance, in Unholy Alliance, the computer just builds to it's own country specs, even though it can build more, so have an entry like UseAI=UnholyAI.ini, The game then uses UnholyAI.ini instead of the bog-standard AI. So the unholy AI would then have mixteams from different sides, just like anyone else would build.
[Image: MRMIdAS2k.jpg]
MRMIdAS: No longer allowed to criticise Westwood on PPM
Reply
#13
It would be easier from my POV to just make the game read ai sections from the mpmode rules override file, but yeah, that is doable too.
Reply
#14
don't forget that the AI is kinda hardcoded to be a certain side, although i'm sure it is doable, this kind of change would require more than simply changing the AI file.

but i agree, other AI files for different modes. or overides, AFAIK, you can't have AI overides in the game mode file, you have to add it to the map, which forces you to have costom maps for this mode.
Reply
#15
Bobingabout Wrote:don't forget that the AI is kinda hardcoded to be a certain side, although i'm sure it is doable, this kind of change would require more than simply changing the AI file.

Not really, as you could just make everything build everything withing the mpunholymd.ini.

So instead of a prerequisite being say, GAWEAP,GAPILE. It'd be BARRACKS,FACTORY.

THEN have the mix AI file setup to take advantage of that.
[Image: MRMIdAS2k.jpg]
MRMIdAS: No longer allowed to criticise Westwood on PPM
Reply




Users browsing this thread: 1 Guest(s)