Jump to content


Photo

AI infantry please don't attack buildings!


  • Please log in to reply
7 replies to this topic

#1 Grim

Grim

    Mad Axe

  • Project Team
  • 537 posts
  •  T3A Team Chamber Member
  • Division:T3A Moderator

Posted 08 December 2006 - 02:25 PM

Hi there,

I've seen some threads about how making infantry not to deal damage to wall hubs, or else, but i seek something else.
I noticed AI infantry does not attack wall segments, and i'd like some other structures to be spared, but i can't find how it's managed. I thought it was maybe something in the kindof of the structure, but anything i tried failed.

Has anybody an idea where to look?

Thank you
Posted Image

#2 Theo

Theo

    Hey look, im a VIP.

  • Members
  • 222 posts
  • Location:Sheffield, Uk,
  • Projects:Being lazy.

Posted 08 December 2006 - 03:12 PM

I think its in the armor of the structures.
In BFME2 (because not sure about ROTWK) at one point the infantry COULD attack walls. When i changed the armor values around and made them take no damage at all from infantry, the ai didnt even try to attack it. Most structures use the same Armorsets (i think) so you may find yourself making new armor sets so that every structure just cant be attacked :)
Maybe you should try that... if thats what you ment anyway.

Edited by Theo, 08 December 2006 - 03:14 PM.


#3 Grim

Grim

    Mad Axe

  • Project Team
  • 537 posts
  •  T3A Team Chamber Member
  • Division:T3A Moderator

Posted 08 December 2006 - 03:50 PM

Thanks for your reply Theo :)

However, i already tried this, without success :(

BUT, i think i found the answer in Cahik's AI tutorial, just a few seconds ago, a BIG thanks to him. In case someone ever needs the answer too, here is a quote from Cahik's tut:

1. Unit attack priorities

Ini.big -> data\ini\default\skirmishaidata.ini

First thing we can change here are attack priorities. This tells computer what will unit attack most likely. Code looks like this ( it is not complete list just part):

CombatChainDefinition CavalryCombatChain
Unit = CAVALRY
TargetTypes = STRUCTURE PIKEMAN CAVALRY ARCHER INFANTRY
TargetPriorityModifiers = 50.0 0.0 50.0 150.0 50.0
End

So basicly this tells computer that all units that are cavalry will attack most likely ARCHERS, then STRUCTURES, CAVALRY or INFRANTRY and if no other target is around the PIKEMAN.

TargetTypes = STRUCTURE PIKEMAN CAVALRY ARCHER INFANTRY

This part is hardcoded so make no changes to that.

TargetPriorityModifiers = 50.0 0.0 50.0 150.0 50.0

Here you can give numbers in the sameorder as type sof target in TargetTypes. The higher numer the higher is priority to attack this type of units. 0.0 means that AI will attack this target only when no other is around. And negative number means that it will not attack that type of targets at all.

But it is not all. We need to give computer information what type of unit is our new unit. So we put code like this in horde or unit code ( in unit code only when it is single unit and has no horde ).

ThreatBreakdown IsengardUrukCrossbowHorde_DetailedThreat
AIKindOf = CAVALRY
End

So this two lines say to computer what attack priorities will new unit have Unit = CAVALRY and AIKindOf = CAVALRY.


Posted Image

#4 Theo

Theo

    Hey look, im a VIP.

  • Members
  • 222 posts
  • Location:Sheffield, Uk,
  • Projects:Being lazy.

Posted 08 December 2006 - 05:00 PM

Thanks for your reply Theo :)

However, i already tried this, without success :(

Did you try removing the armor types altogether; so not having slash set to 0%, but either commenting it out or deleting it completly?
But anyway glad to hear you fixed it.

Edited by Theo, 08 December 2006 - 05:01 PM.


#5 cahik_

cahik_

    Sage engine ruler

  • Project Team
  • 1,896 posts
  • Location:Czech Republic
  • Projects:Rhovanion Alliance
  •  T3A Team Chamber Member and Crazy animator

Posted 08 December 2006 - 05:39 PM

i am glad to hear that this tutor help to some one :)

Posted Image

Posted Image
Posted Image


#6 Fingulfin

Fingulfin

    I Like Pi3. Do you?

  • Hosted
  • 1,752 posts
  • Location:California, USA
  • Projects:Staying Alive.
  •  This place looks familiar. I can't remember why.

Posted 08 December 2006 - 06:43 PM

Cahik, without your AI tutorial I wouldn't even know where the AI files are found at... I bet I would have figured it out eventually, but your tutorial has done wonders for me! I would like to give a big hats off to everyone here who has written a tutorial! I mean, while people might not post in the topic the creator posted it in, your work truly is appreciated by those trying to learn. Trust me, more people learn from your tutorials than you might have thought :)
Posted Image
--------------------------------------
"You look like a ghost of your former self..."

#7 Phil

Phil

    Force Majeure

  • Network Leaders
  • 7,976 posts
  • Location:Switzerland
  • Projects:Revora, C&C:Online
  •  Thought Police
  • Division:Revora
  • Job:Network Leader
  • Donated
  • Association

Posted 08 December 2006 - 08:34 PM

I kinda missed that part... unfortunately. I can only hope to redeem that fault when C&C3 is out :)

Edited by Dark Lord of the Sith, 08 December 2006 - 08:34 PM.

revorapresident.jpg
My Political Compass

Sieben Elefanten hatte Herr Dschin
Und da war dann noch der achte.
Sieben waren wild und der achte war zahm
Und der achte war's, der sie bewachte.


#8 Grim

Grim

    Mad Axe

  • Project Team
  • 537 posts
  •  T3A Team Chamber Member
  • Division:T3A Moderator

Posted 09 December 2006 - 02:35 PM

Damn stupid me, while crawling in the code, i realised i already tried that months ago, without success...Just because i tried 0 and not negative values :cry:

Now i can confirm, it works!

Thanks again Cahik. And a tutorial is always welcome and useful, yours most.
Posted Image




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users