Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Fri Mar 29, 2024 12:47 am
All times are UTC + 0
Modding the Skirmish AI TS?
Moderators: Global Moderators, Tiberian Sun Moderators
Post new topic   Reply to topic Page 1 of 1 [4 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
OrangeNero
Commander


Joined: 11 Jan 2012

PostPosted: Thu Oct 11, 2012 3:57 am    Post subject:  Modding the Skirmish AI TS? Reply with quote  Mark this post and the followings unread

Thanks in advance for reading. Its a real monster.

I am currently fiddling around with the AI and I have achieved diverse and weird results all over without really knowing how I influenced it.
Also some of the codes seem to either have no effect or nasty side effects.

The size of the taskforces have a great effect on the AI behavior, adding 20 titans to the attack forces slows the interval down since the AI has to produce them first, I don't know how price and amount does influence the AI in the attacks it chooses from if at all.
I read its completely random but I have my doubts. Is it really randomly choosing which attacks are carried out?
For example my GDI opponent attacks always first with Jumpjets and then overall uses nothing but jumpjets to attack, however theres only the original attack forces with jumpjets in the aifs.ini and the others have small additions. In an other case Nod would send wave after wave of bazooka guys. What I want to say is, it seems like there is a pattern.

Another influence is the buildings (I assume all of the following, don't know for sure please correct me if wrong). I noticed that the AI produces buildings according to the sidebar, if theres a building added before the warfactory it would first build this one before the factory. There is some sort of need, so it produces powerplants and refineries when in need then goes back to the original.

My mod added techcenters that make you advance in techlevels, which are really expensive (7000+$). By doing this I delayed production of the warfactory and also of the helipad, therefore at the beginning of the game you do NOT have the 2 orcabombers coming after your CY and the creation of vehicle teams is delayed (I think). Now I had to remove these techcenters because the AI build too much of them with the effect that in the first minutes of battle where your Anti Air is weak you got bombers coming for your base.

The problem is, while aircrafts and the whole vehicle production can be delayed I am not aware of any way to delay the production of strong units. I believe that if there was a certain pattern that the AI uses to create Taskforces then there could be some control after how much time the AI will send the cyborgcomando or other ubber units after you.

Another great mystery are the defenses and base size. This seems to be coupled with the AI's money it has at the start. I gave it some huge AICM sine it has to be really rich anyway and my AI should act like a "towerdefense game AI endlessly attacking you". Although I limited its size and amount it just expands endlessly as if all that code wouldn't exist. Also It builds hundreds of sam site upgraded composite towers (not the tower bug, they all have a weapon upgrade and aren't that massed like when I produced it to take a look) then I changed some of the red code and now it builds no sam sites at all.

It seems that the base defenses it builds are randomly, however my AI somehow is really hooked on one type and then after some changes entirely hooked at the other. So how could a well varied out mix be achieved? One solution seems to be adding duplicates of the lesser build defenses without the IsBaseDefense=yes, instead add IsBase=yes.

The question here is what is the effect of:
IsBaseDefense=yes
AIBuildThis=yes
SAM=yes
Unsellable=yes (some buildings are unsellable of mine while its =no)
Insignificant=yes
;interval between checking for and creating teams, by difficulty level
;from hardest to easiest

It is essential to know what codes work and what do they affect. I think it would be really nice to have a list of the following with the knowledge about DO THEY WORK? and DO THEY HAVE NASTY SIDE EFFECTS?
One nasty side effect is when Insignificant=yes it breaks Buildlimit=X and some other code seems to break unsellable=no.
Taken from unmodified rules.ini:

[Difficult]
Groundspeed=1.0
Airspeed=1.0
BuildTime=1.0
Armor=.8
ROF=1.2
Cost=1.0
RepairDelay=.05
BuildDelay=.1
BuildSlowdown=yes
DestroyWalls=no


; income and production
BuildSpeed=.8 ; general build speed (time (in minutes) to produce a 1000 credit cost item)
BuildupTime=.06 ; average minutes that building build-up animation runs
SeparateAircraft=yes ; Is first helicopter to be purchased separately from helipad?

; computer and movement controls
BaseBias=2 ; multiplier to threat target value when enemy is close to friendly base
BaseDefenseDelay=.25 ; minutes delay between sending response teams to deal with base threat
CloseEnough=2.25 ; If distance to destination less than this, then abort movement if otherwise blocked.
SuspendDelay=2 ; minutes that suspended teams will remain suspended
SuspendPriority=1 ; teams with less than this priority will suspend during base defense ops

TeamDelays=2250,2700,3600 ; interval between checking for and creating teams, by difficulty level
AIHateDelays=5400,4500,4050 ; delay in frames before the computer chooses an enemy, by difficulty level
AIAlternateProductionCreditCutoff=3000 ; when the AI house has less credits than this it will begin to spend money more conservatively

MultiplayerAICM=250,200,100 Amount of Cash bonus for AI multiplied by something

FillEarliestTeamProbability=100,80,60 ; (by difficulty level, from hardest to easiest)
MinimumAIDefensiveTeams=4,3,2 ; (by difficulty level, from hardest to easiest)
MaximumAIDefensiveTeams=6,5,4 ; " "
TotalAITeamCap=14,12,10 ; (by difficulty level, from hardest to easiest)
UseMinDefenseRule=yes
DissolveUnfilledTeamDelay=9000 ; how long to wait before dissolving an ai trigger team that has no members (multiplay only)

AI CONTROLS

[AI]
GDIWallDefense=6
GDIWallDefenseCoefficient=3
NodBaseDefenseCoefficient=1.2
GDIBaseDefenseCoefficient=1.5
MaximumBaseDefenseValue=60
ComputerBaseDefenseResponse=3 ; how much does the computer overrespond to attacks on its base?

AttackInterval=3 ; average delay between computer attacks ---CAN THIS BE BROKEN BY HUGE ATTACK TEAMS?---
AttackDelay=5 ; average delay time before computer begins first attack ---5=5min in normal speed?---
PatrolScan=.016 ; minute interval between scanning for enemys while patrolling. ---huh?---
CreditReserve=100 ; Structure repair will not begin if available cash falls below this amount.
PathDelay=.01 ; Delay (minutes) between retrying when path is blocked.
BlockagePathDelay=60 ; delay (frames) before unit paths around all blockage
AutocreateTime=5 ; average minutes between creating an 'autocreate' team ---AttackIntervall faster than this amount can break this?---
InfantryReserve=3000 ; always build infantry if cash reserve is greater than this
InfantryBaseMult=1 ; build infantry if building count times this number is less than current infantry quantity ---What is this I don't even?---
PowerSurplus=50 ; build power plants until power surplus is at least this amount

--- DOES ANY OF THIS WORK?---
BaseSizeAdd=3 ; computer base size can be no larger than the largest human opponent, plus this quantity ---Could not spot any difference with extreme or minor changes---
RefineryRatio=.16 ; ratio of base that should be composed of refineries ---Ratio and limit if any meaning affect each other how?---
RefineryLimit=4 ; never build more than this many refineries
BarracksRatio=.16 ; ratio of base that should be composed of barracks
BarracksLimit=2 ; never build more than this many barracks
WarRatio=.1 ; ratio of base that should be composed of war factories
WarLimit=2 ; never build more than this many war factories
DefenseRatio=.4 ; ratio of base that should be defensive structures
DefenseLimit=40 ; maximum number of defensive buildings to build
AARatio=.14 ; ratio of base that should be anti-aircraft defense
AALimit=10 ; maximum number of anti-aircraft buildings to build
TeslaRatio=.16 ; ratio of base that should be telsa coils
TeslaLimit=10 ; maximum number of tesla coils to build
HelipadRatio=.12 ; ratio of base that should be composed of helipads
HelipadLimit=5 ; maximum number of helipads to build
AirstripRatio=.12 ; ratio of base that should be composed of airstrips
AirstripLimit=5 ; maximum number of airstrips to build

-----

CompEasyBonus=no ; When more than one human in game, computer player goes to "easy" mode?
Paranoid=yes ; Will computer players ally with each other if the situation looks bleak? When one AI player dies all the remaining go after you
PowerEmergency=75% ; sell buildings to raise power level if it falls below this percentage
AIBaseSpacing=1 ; spacing between buildings when AI is building a base

---END---

Roundup of important questions and answers with no guarantee of what I think could be the case:

How does AttackIntervall and big attack forces behave?
A: it seems to have problems handling this. As if the attacks get stacked on each other breaking the AI to not attack as often as it should.

AttackIntervall, AutocreateTime, AIHateDelays, TeamDelays, Team size in aifs.ini, affect each other how?
A: They seem to corrupt each other. Small Teams with fast interval and very short Team Delays seems to work best.

AI defense building pattern?
A:Limit and Ratio seems to not work, power requirement and cost don't affect it either, at least not when really rich.


Are there nasty side effects affecting AttackDelay?
A: I set it to =1 and it still needs very long to attack, could be because AI wants to build a certain attack team and therefore waits till able to.

Sam sites are being build when?
A: Aircraft attacks seem to not make AI build Anti air, it also doesn't care about your amount of Aircraft. New AI-only buildings which are not a base defense but a copy of a SAM will be build by AI but only 1 so more copies needed.


AI builds new MCV after CY destruction because of?

And how can it be prevented as I somehow did prevent it from doing that without touching the MCV nor the MCV taskforce?


How can early attacks of really strong units be prevented?
A: In case of aircrafts and vehicles as a whole by expensive dummy buildings that appear in the buildlist before these factories. In case of single units I don't know.

AIBuildThis=yes can this be broken?
A: Yes, although I am not sure what is responsible for it the AI does build buildings that have AIBuildThis=yes.

Is there a AI pattern for attack teams it chooses to send out?
A: Said not to be but seems like there is, size and expensive units influence? The mission affects it a lot, and I count the cheap attack teams more often than the expensive ones (dozen attack forces in a row of 5 bazooka guys for example).

Name recognition if not written in capitals CYBORGL CyborgL?
A: It seems if an unit was made and its name has small letters the aifs.ini does not recognize it thus the whole team is never made by the AI.

Thats about it. If some would like to help or add comment about this please do. Also links to useful threads concerning all the AI stuff that is in the rules.ini are welcome.

Sorry for the long post, the topic is quite complex, and its more guessing than knowing from my part...

Back to top
View user's profile Send private message
TiberFCSL
Cyborg Artillery


Joined: 10 Nov 2006

PostPosted: Thu Oct 11, 2012 5:25 am    Post subject: Reply with quote  Mark this post and the followings unread

1. About the tech centers, I fixed that problem in my mod by making the AI build units only since you've got a certain building or a certain amount of a unit.
For example:
I build a radar ----> AI starts to build titans
I build 15 light infantry -----> AI starts to build buggies to counter them
Don't take away the tech centers, that won't feel like OTU

2. You can increase/decrease the amount of base defenses, in fact, I did it on my mod, by modifyng this line:
Code:
DefenseRatio=.4 ; ratio of base that should be defensive structures

I always thought that the amount was too big.

3. Some things that you want to know:
IsBaseDefense=
Can be set to 'true' or 'false' and specifies whether or not this BuildingType is classed as a base defense structure. This is used as BuildingTypes cannot be assigned a base defense mission by the AI engine, thus this identifies defensive structures enabling the AI logic to target them and consider them in its threat scan as well as labelling them to ensure that the AI builds them specifically for a defensive purpose.

AIBuildThis=
Specifies if the AI can build this unit/structure .

SAM=
Can be set to 'yes' or 'no' and determines that this BuildingType is a SAM (surface to air missile launcher) and thus its weapons can only fire at AircraftTypes.

Insignificant=
Can be set to 'yes' or 'no'. This defaults to 'no' for all objects as setting it to 'yes' means that the object is not counted for scoring and kills purposes when destroyed and therefore will not be included in the logic which accumulates scoring for objects improving with veterancy.

That's all I can do for now, plus attaching a INI guide.



RA2YR_INI_Bible_Pack.tar.gz
 Description:
A big guide to edit all INI files, made for Red Alert 2. Almost everything works the same as TS.

Download
 Filename:  RA2YR_INI_Bible_Pack.tar.gz
 Filesize:  452.37 KB
 Downloaded:  86 Time(s)


_________________
Inactive Projects >> Tiberian Sun: Tech Level War http://www.ppmsite.com/forum/index.php?f=843
Download the latest beta: http://www.moddb.com/mods/cc-tiberian-sun-tech-level-war

Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Thu Oct 11, 2012 6:39 am    Post subject: Reply with quote  Mark this post and the followings unread

OrangeNero wrote:

IsBaseDefense=yes
AIBuildThis=yes
SAM=yes
Unsellable=yes (some buildings are unsellable of mine while its =no)
Insignificant=yes


IsBaseDefense works well for Nod only. When used for GDI on something else than the component tower, it breaks the whole logic, because GDI thinks every building with this key is an upgrade for the component tower.

AIBuildThis makes the AI build this. It's especially used on buildings which have no special effect like silos or aren't triggered to be build by any other AI setting. The AI will most likely only build one exemplar of this building.

SAM as said makes the building able to attack aircrafttypes only. Pretty bad since there are flying infantry (jumpjets) as well which then aren't attacked (thus WW commented this out)

Unsellable=no doesn't works because you most probably forgot to give the building a buildup anim. Without it, they are not sellable.

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
^Rampastein
Rampastring


Joined: 11 Oct 2008
Location: Gensokyo

PostPosted: Thu Oct 11, 2012 2:31 pm    Post subject: Reply with quote  Mark this post and the followings unread

Quote:
How does AttackIntervall and big attack forces behave?
A: it seems to have problems handling this. As if the attacks get stacked on each other breaking the AI to not attack as often as it should.

AttackInterval is obsolete and a leftover from RA1. Use TeamDelays instead. Same with AutocreateTime and AttackDelay.
Quote:
For example my GDI opponent attacks always first with Jumpjets and then overall uses nothing but jumpjets to attack, however theres only the original attack forces with jumpjets in the aifs.ini and the others have small additions. In an other case Nod would send wave after wave of bazooka guys. What I want to say is, it seems like there is a pattern.

AI(FS).ini section AITriggerTypes lists the team creation triggers that the AI can use. Those can have specific conditions and chance numbers which affect in which situations the AI can build a specific team and how large of a chance the specific team has for getting built.

Generally, I'd say that you need to balance TeamDelays with the cost of the AI's teams. If you have very expensive TaskForces, you need use a high TeamDelays value, if you have very inexpensive TaskForces, you can use quite low TeamDelays values. Note that the base TS TeamDelays values are slightly higher than they could be (so the base TS AI builds units slower than it potentially could).

_________________
CnCNet Client | CnCNet TS patches | More Quality-of-Life Improvements for RA Remastered


Back to top
View user's profile Send private message ModDB Profile ID Facebook Profile URL
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [4 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.2089s ][ Queries: 13 (0.0080s) ][ Debug on ]