Company of Heroes: Eastern Front

Author Topic: 'Controlling' the AI  (Read 13858 times)

Offline jojorabbit

  • Developer
  • Commissar
  • *
  • Posts: 481
    • View Profile
Re: 'Controlling' the AI
« Reply #45 on: August 25, 2012, 12:06:29 PM »
Jojo do I just copy paste the whole modified jar.scar into ..\Eastern_Front\Data\scar or do I copy the entire text and paste at bottom of scarUtil.scar?

Hm, am not sure what entire text, i said edit jar.scar and all bolded is what needs to be added or commented.

Only thing you need to do with scarUtil is to add import of jar.scar after all other imports at begging of the file :).
If you get same error then i will make you new jar.scar and new scarUtil.scar and upload it here, when i will have more free time.

Offline viruz777

  • Ingenery
  • *
  • Posts: 46
    • View Profile
Re: 'Controlling' the AI
« Reply #46 on: August 25, 2012, 01:10:51 PM »
Ok jojo I see what you mean. Just copy edited jar.scar and paste into /scar folder, then add "import jar scar" line after garrisonbuilding.scar.

I did it already and got the same error. Did you see the screenshot of the error in console? Do you know what is causing that error or if it's something that I'm doing wrong?

Anyway yes I'd appreciate you send me the new jar.scar and new scarUtil.scar when you can :) unless it is something easily fixable on my end. Just let me know what to do next.

Offline jojorabbit

  • Developer
  • Commissar
  • *
  • Posts: 481
    • View Profile
Re: 'Controlling' the AI
« Reply #47 on: August 26, 2012, 12:01:30 PM »
Here are files. PE will always use reward units, and always Tank Destroyer Doctrine. Wehr will never use reward units and always Blitzkrieg Doctrine.

Hope it helps.

EDIT: Also you can see new PE Tank Destroyer Trees here :P
http://www.easternfront.org/forums/index.php?topic=8569.msg130646#msg130646
« Last Edit: August 26, 2012, 02:02:27 PM by jojorabbit »

Offline viruz777

  • Ingenery
  • *
  • Posts: 46
    • View Profile
Re: 'Controlling' the AI
« Reply #48 on: August 26, 2012, 02:09:01 PM »
Haha thanks jojo I'll try it later and hope it works.

Yes I saw that update on facebook and even commented there giving credit to you and thanking you for your help in helping me mod AI :D

Offline jojorabbit

  • Developer
  • Commissar
  • *
  • Posts: 481
    • View Profile
Re: 'Controlling' the AI
« Reply #49 on: August 26, 2012, 02:11:54 PM »
It works i have tested it ;).
No problem, if you need anything else you know where to find me.
I dont like fb, i never used it and i dont plan to use it.

Offline Otto Halfhand

  • Donor
  • Mr. Spam
  • *
  • Posts: 1166
    • View Profile
Re: 'Controlling' the AI
« Reply #50 on: August 26, 2012, 02:31:13 PM »
Hi guys,
JoJo: in the scarutil.scar file did you create the x,y,z orientation as described on lines 378 to~403? I ask because the convention creates a map on your tabletop x,z and y azis is the vertical , rising to the ceiling.  This is an application of "left hand rule", (x,z,y). Normally Cartesesian systems use a righthand rule. (x,y,z) orientation.

You should send a resume to the local tech school. You are a natural teacher.
孫 The
EF_v1.7.10
子 Art
Illegitimi non Carborundum -"Vinegar" Joe Stilwell
兵 of
Sun Tzu says: In warfare one compels and is not compelled by others
法 War

Offline jojorabbit

  • Developer
  • Commissar
  • *
  • Posts: 481
    • View Profile
Re: 'Controlling' the AI
« Reply #51 on: August 26, 2012, 02:37:04 PM »
Hi guys,
JoJo: in the scarutil.scar file did you create the x,y,z orientation as described on lines 378 to~403? I ask because the convention creates a map on your tabletop x,z and y azis is the vertical , rising to the ceiling.  This is an application of "left hand rule", (x,z,y). Normally Cartesesian systems use a righthand rule. (x,y,z) orientation.

Those lines were made before, probably those are from vCoh, i never add anything to scarutil.scar except imports, i always create new scar files when i need them as you can see a lot of scar files out there, easier ti maintain, every code chuck is where it suppose to be etc.

You should send a resume to the local tech school. You are a natural teacher.
LOL, Tnx a lot.


Offline Otto Halfhand

  • Donor
  • Mr. Spam
  • *
  • Posts: 1166
    • View Profile
Re: 'Controlling' the AI
« Reply #52 on: August 26, 2012, 02:43:13 PM »
Thanks, (x,z,y) orientation hmm. That clears up some things. Sounds like something from Gulliver's Travels. Oh well I'm lefthanded anyway.  ;D
孫 The
EF_v1.7.10
子 Art
Illegitimi non Carborundum -"Vinegar" Joe Stilwell
兵 of
Sun Tzu says: In warfare one compels and is not compelled by others
法 War

Offline viruz777

  • Ingenery
  • *
  • Posts: 46
    • View Profile
Re: 'Controlling' the AI
« Reply #53 on: August 26, 2012, 06:36:30 PM »
Hi jojo

I've already tested it and it's true that AI PE only uses reward units but Wehr AI is still using Terror doctrine and PE AI is still using Luftwaffe doctrine :(

EDIT 1 : Tested it 2nd time. First I saw Wehr build stormtroopers and was happy then I was praying PE will follow tank destroyer.. After waiting for about 20 mins then I saw Jagdpanzer :DDDD I hope it works now jojo thanks! I wonder why it didn't work first time around but only after 2nd game?

EDIT 2 : FFFFFFFFF I forgot that AI will auto upgrade Jagdpanzer to Panther gun and have increased range now I can't fight it head 2 head. Is it possible to prevent AI from upgrading Panther gun? Just asking xD

EDIT 3 : Tested it 3rd time to make sure it REALLY works. Wehr and PE use Blitz and Tank Destroyer as intended but the weird thing now is Wehr AI build Geschutzwagen instead of Stug IV  ??? This is really random.
« Last Edit: August 26, 2012, 08:11:34 PM by viruz777 »

Offline Otto Halfhand

  • Donor
  • Mr. Spam
  • *
  • Posts: 1166
    • View Profile
Re: 'Controlling' the AI
« Reply #54 on: August 26, 2012, 08:29:32 PM »
Hey viruzz, becareful what you wish for. Go to \rules_addon_purchase. create or edit line:


if    (upgrade_pbg    ==    BP_GetUpgradeBlueprint("upgrade\axis_pe\items\panzer_elite_jagdpanzer_l70_gun.rgd")) then
         return demand_neverbuild
end


孫 The
EF_v1.7.10
子 Art
Illegitimi non Carborundum -"Vinegar" Joe Stilwell
兵 of
Sun Tzu says: In warfare one compels and is not compelled by others
法 War

Offline viruz777

  • Ingenery
  • *
  • Posts: 46
    • View Profile
Re: 'Controlling' the AI
« Reply #55 on: August 26, 2012, 08:41:44 PM »
haha i'll try this thanks ottoooooo  :-* :-* :-*

don't worry it will make my life easier  ;D

Offline jojorabbit

  • Developer
  • Commissar
  • *
  • Posts: 481
    • View Profile
Re: 'Controlling' the AI
« Reply #56 on: August 26, 2012, 09:16:46 PM »
Hi jojo

I've already tested it and it's true that AI PE only uses reward units but Wehr AI is still using Terror doctrine and PE AI is still using Luftwaffe doctrine :(

EDIT 1 : Tested it 2nd time. First I saw Wehr build stormtroopers and was happy then I was praying PE will follow tank destroyer.. After waiting for about 20 mins then I saw Jagdpanzer :DDDD I hope it works now jojo thanks! I wonder why it didn't work first time around but only after 2nd game?
IDK, never happened to me

EDIT 2 : FFFFFFFFF I forgot that AI will auto upgrade Jagdpanzer to Panther gun and have increased range now I can't fight it head 2 head. Is it possible to prevent AI from upgrading Panther gun? Just asking xD
It is possible, Otto answered it :P

EDIT 3 : Tested it 3rd time to make sure it REALLY works. Wehr and PE use Blitz and Tank Destroyer as intended but the weird thing now is Wehr AI build Geschutzwagen instead of Stug IV  ??? This is really random.
It is not random you have old code, there was some fix that added all or nothing, but in internal it is removed, i will send you file that will remove that.

Offline viruz777

  • Ingenery
  • *
  • Posts: 46
    • View Profile
Re: 'Controlling' the AI
« Reply #57 on: August 28, 2012, 12:32:32 PM »
Sorry for late reply jojo was busy the whole day yesterday.

Anyway, I thought you sent me already edited jar.scar where Wehr AI will not build any reward units? You're sending me new replacement file?

Offline jojorabbit

  • Developer
  • Commissar
  • *
  • Posts: 481
    • View Profile
Re: 'Controlling' the AI
« Reply #58 on: August 28, 2012, 02:36:54 PM »
Yes jar.scar is ok, but old code that i have removed is still in last version that you have.

To remove that old code go to default.ai file and remove lines from 546 to 575. Then jar.scar will work without any problems ;).

Offline viruz777

  • Ingenery
  • *
  • Posts: 46
    • View Profile
Re: 'Controlling' the AI
« Reply #59 on: September 01, 2012, 01:19:44 AM »
Hi Jojo I finally had time to test it but midgame it suddenly said fatal AI error - execution paused again.

I checked console and I think it's from the error that says "SCAR - Could not execute rule: AI_Think2". I'm not sure what is causing that but I tried this a few times and when I got fatal AI error and check console there is always this message  :-[