Jump to content
blood1995

Wrath ED KW any way to make AI build our custom unit/buildings ?

Recommended Posts

Hellow, I know that actually we aren't able to edit the Skirmish AI on KW, but I've noticed that somehow on skirmish battle the AI used some of my custom units rarely so I wonder if it's possible to raise the chance of the AI to use them.

Share this post


Link to post

Without definitions to edit AI theres no chance of adding your units & structures to the AI..

Share this post


Link to post

As far as I know the AI can actually use almost everything we give it and as long as we add AI line in the unit's ability it should also be able to uses the abilities, but I too rarely saw it uses any of them

 

It used some of my custom units casually and don't train some at all, if I want it to train the Mastodon I need to put it with blue field, 40000 $, and as steamroller, while letting it build without disturbance, even after all that it not always use the Mastodon but seem to use units like the cyborg commando casually

Edited by Egozi44

Share this post


Link to post

The ai decides what units to build on more or less 3 criteria:

 

1. Map scripted teams. which is a worldbuilder based thing.

2. AI scripted teams, basically depending on the selected ai type (hard,normal,easy etc) and the selected personality (turtle, steamroller etc) there are predefined build queue's. Through these AI definitions you basicly tell the ai to build what units for what action and depending on how many funds it has and what difficulty it is then add those units to a virtual strike group and send them after a powerplant or harvester or something of those sorts. Because Kw doesn't have those definitions available like the TW SDK has it might be almost impossible to achieve this.

 

What you can do is the following:

3. Use the existing economic logic of the ai and tune your buildcost and times to make your unit more apealing to build then existing units or:

 

In theory (i haven't used this myself extensively yet but:) you can trigger upgrades based of the AI difficulty like easy, normal, hard and brutal. You can create different commandsets for each difficulty and have those trigger by the ai:

 

You give the warfactory a EASY_commandset where it builds mostly light units because they are cheap and fast to build. Where as for HARD_commandset you could make that new unit cheaper or faster to build, thus it will prioritise building it. You could even remove for example the predator tank from that commandset so it won't be buildable so the ai focusses on building mammoth tanks etc etc.

 

i think for skirmish the aviable ai upgrades are:

Upgrade_EasyAIMultiPlayer

Upgrade_MediumAIMultiPlayer

Upgrade_HardAIMultiPlayer

 

I think you can add Upgrade_BrutalAIMultiPlayer and make a new upgrade for it and the ai will use it, but i am not sure.

 

Again i haven't gotten much experiance with this myself, i know Madin knows alot more about this then me.

 

but basicly you should be able to tune the production/commandset of the ai abit more then normal with this method.

Share this post


Link to post

The 1st solution seems to be the most simple, because I'm also working on mission maps for my mod so I guess that I'll only use that one.

Share this post


Link to post

As it's pretty easy to overlook: Raven you've got a pm.

Share this post


Link to post

weird didn't show the new message icon...hence why i didn't notice.

Share this post


Link to post

Even in a C&C3 mod with new units, the AI automatically creates those new units without mentioning the new units in the skirmish AI coding.

Share this post


Link to post

Yea, but with ai code you can tell the AI what to do with them, though for some units it not really worth it :9

Share this post


Link to post

No not really, the AI doesn't do anything automatic. What you see as it using new units automatic is actually a result of it processing its existing ai definitions. The new unit gets build used because it is told in a existing definition. Like the budget or the general attack. Like build VEHICLE, scan for economic target, attack that target with at least x number of units depending on the dificulty of the ai and the type of ai.

 

for example:

 

  <AIStrategicStateDefinition
        id="GDIOffensiveEconomyAttack"
        UnitUpgradeMultiplier="0.0">
    <Heuristic>
      <PathToTargetHeuristic PathExists="true"/>
      <SiegeThresholdHeuristic SiegeMode="false" Threshold="1.0"/>
      <FocusedThresholdHeuristic/>
    </Heuristic>
    <TargetHeuristic TargetHeuristic="SafestToGroundHarvesterHeuristic" TargetType="SpreadTarget"/>
    <Tactic Tactic="DefenseAvoidanceAttack" TargetType="SpreadTarget">
      <TeamTemplate MinUnits="6" MaxUnits="6" IncludeKindOf="CAN_ATTACK" ExcludeKindOf="AIRCRAFT" AlwaysRelease="false" AlwaysRecruit="false"/>
    </Tactic>
   </AIStrategicStateDefinition>

Just because that new tank you build has the CAN_ATTACK kindof there is a chance (mostly depended on its buildcost/time) that the ai will be build for that reason. This is what you are experiencing as automatic. In truth it is just an above average cheer luck scenario.

 

Now lets say you created a new artillery piece that you want the ai to use as artillery, and not for the most part spam as a frontline unit:

 

  <AIStrategicStateDefinition
        id="GDIOffensiveSiege"
        UnitUpgradeMultiplier="0.0">
    <Heuristic>
      <PathToTargetHeuristic PathExists="true"/>
      <LateGameHeuristic/>
      <SiegeThresholdHeuristic SiegeMode="true" Threshold="2.0"/>
    </Heuristic>
    <TargetHeuristic TargetHeuristic="ClosestStructureHeuristic" TargetType="SiegeTarget"/>
    <Tactic Tactic="SimpleSiege" TargetType="SiegeTarget">
      <TeamTemplate MinUnits="2" MaxUnits="2" IncludeKindOf="CAN_ATTACK" ExcludeKindOf="AIRCRAFT" AlwaysRelease="false" AlwaysRecruit="false">
        <CreateUnits UnitName="GDIJuggernaught"/>
        <CreateUnits UnitName="GDIJuggernaught"/>
      </TeamTemplate>
      <TeamTemplate MinUnits="6" MaxUnits="10" IncludeKindOf="CAN_ATTACK" ExcludeKindOf="AIRCRAFT" AlwaysRelease="false" AlwaysRecruit="false"/>
    </Tactic>
  </AIStrategicStateDefinition>
 

 

 

Here you see it actually gets told what named unit to build...e.a. the juggernaught and what to put on its top of to attack list.....structures. Where the previous was basically going after harvesters.

 

Although for combat units this might look neglectable, if you start making shield or repair units that you don't want the ai to rush forward but stay in base to defend or to follow its harvester the ai definitions are very needed. Just build and do what ever doesn't cut it then.

Share this post


Link to post
On 7/04/2016 at 1:40 PM, Ravendark said:

No not really, the AI doesn't do anything automatic. What you see as it using new units automatic is actually a result of it processing its existing ai definitions. The new unit gets build used because it is told in a existing definition. Like the budget or the general attack. Like build VEHICLE, scan for economic target, attack that target with at least x number of units depending on the dificulty of the ai and the type of ai.

 

for example:

 


  <AIStrategicStateDefinition
        id="GDIOffensiveEconomyAttack"
        UnitUpgradeMultiplier="0.0">
    <Heuristic>
      <PathToTargetHeuristic PathExists="true"/>
      <SiegeThresholdHeuristic SiegeMode="false" Threshold="1.0"/>
      <FocusedThresholdHeuristic/>
    </Heuristic>
    <TargetHeuristic TargetHeuristic="SafestToGroundHarvesterHeuristic" TargetType="SpreadTarget"/>
    <Tactic Tactic="DefenseAvoidanceAttack" TargetType="SpreadTarget">
      <TeamTemplate MinUnits="6" MaxUnits="6" IncludeKindOf="CAN_ATTACK" ExcludeKindOf="AIRCRAFT" AlwaysRelease="false" AlwaysRecruit="false"/>
    </Tactic>
   </AIStrategicStateDefinition>

Just because that new tank you build has the CAN_ATTACK kindof there is a chance (mostly depended on its buildcost/time) that the ai will be build for that reason. This is what you are experiencing as automatic. In truth it is just an above average cheer luck scenario.

 

Now lets say you created a new artillery piece that you want the ai to use as artillery, and not for the most part spam as a frontline unit:

 


  <AIStrategicStateDefinition
        id="GDIOffensiveSiege"
        UnitUpgradeMultiplier="0.0">
    <Heuristic>
      <PathToTargetHeuristic PathExists="true"/>
      <LateGameHeuristic/>
      <SiegeThresholdHeuristic SiegeMode="true" Threshold="2.0"/>
    </Heuristic>
    <TargetHeuristic TargetHeuristic="ClosestStructureHeuristic" TargetType="SiegeTarget"/>
    <Tactic Tactic="SimpleSiege" TargetType="SiegeTarget">
      <TeamTemplate MinUnits="2" MaxUnits="2" IncludeKindOf="CAN_ATTACK" ExcludeKindOf="AIRCRAFT" AlwaysRelease="false" AlwaysRecruit="false">
        <CreateUnits UnitName="GDIJuggernaught"/>
        <CreateUnits UnitName="GDIJuggernaught"/>
      </TeamTemplate>
      <TeamTemplate MinUnits="6" MaxUnits="10" IncludeKindOf="CAN_ATTACK" ExcludeKindOf="AIRCRAFT" AlwaysRelease="false" AlwaysRecruit="false"/>
    </Tactic>
  </AIStrategicStateDefinition>
 

 

 

Here you see it actually gets told what named unit to build...e.a. the juggernaught and what to put on its top of to attack list.....structures. Where the previous was basically going after harvesters.

 

Although for combat units this might look neglectable, if you start making shield or repair units that you don't want the ai to rush forward but stay in base to defend or to follow its harvester the ai definitions are very needed. Just build and do what ever doesn't cut it then.

thanks for replays i really want help to prevent Ai in hard mode spamming send tons of aircraft units what the line i must edit in Personalities AI files

 

regards,

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×