Company of Heroes: Eastern Front

Eastern Front Mod (Read-Only) => General Discussion => Topic started by: viruz777 on August 17, 2012, 02:32:45 PM

Title: 'Controlling' the AI
Post by: viruz777 on August 17, 2012, 02:32:45 PM
I really doubt this will work but is it actually possible to sort of 'control' what doctrines and what units the AI can roll out? For instance if I wanted them to roll out Jagdpanzers instead of hetzers, and if I wanted them to roll out Jagdtigers instead of Jagdpanthers, or if I wanted PE AI to choose Tank Destroyer doctrine, or if I wanted Wehr AI to choose Blitzkrieg doctrine.

Would this be at all possible? The reason is because I want to sort of experiment with some builds and counters and sort of enjoy doing it at my pace, without being harassed or kited by annoying nebels and mortar halftracks and also without having to restart the game everytime I don't get the desired AI doctrine to fight against.
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 18, 2012, 01:50:36 AM
Nothing? Just silent viewers coming and going?  :'(
Title: Re: 'Controlling' the AI
Post by: Pac-Fish on August 18, 2012, 02:24:14 AM
I honestly don't know the answer to this so I can't say. IDK if that makes u feel any better :P
Title: Re: 'Controlling' the AI
Post by: Cranialwizard on August 18, 2012, 02:30:40 AM
If you want controlled play, best way is VS another player. The AI can't be controlled to physically build the exact order you want it to. We have AI experts working on reprogramming the new AI but they probably won't be able to make build orders checked/unchecked by the player, probably selected at random.
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 18, 2012, 03:04:08 AM
I honestly don't know the answer to this so I can't say. IDK if that makes u feel any better :P

Well at least you popped by and said something about it so it does make me feel better to know that it's not fallen on deaf ears :)
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 18, 2012, 03:14:00 AM
If you want controlled play, best way is VS another player. The AI can't be controlled to physically build the exact order you want it to. We have AI experts working on reprogramming the new AI but they probably won't be able to make build orders checked/unchecked by the player, probably selected at random.

I'm just the sort of person who enjoys casual play with AI. Playing with another player just seems abit daunting to me so I hope you understand :) I'm not exactly looking for the AI to build the exact build order or anything because I notice that they dynamically change it every now and then. I was just wondering if there was a possibility to sort of disable AI from building artillery/long range units like mortar halftracks/nebels.

Alternatively, is it possible to sort of create preset AI doctrines where you can choose what doctrine they will play? Sort of like CNC3 where you could choose AI behaviour (eg. Steamroller had them rolling armor only whilst Guerilla had a mix but mostly hit + run + stealthy play). I would very much like to fight vs wehr Blitzkrieg and PE Tank Destroyer Doctrines and not always have to restart game and see if I get lucky and get what I want to fight against.

Also, is it possible for the customize army menu to affect the AI as well? For example if I check Jagdpanther tanks then AI can't build Hetzers, or if I uncheck Geschutzwagen then they stick to building Stug IV?
Title: Re: 'Controlling' the AI
Post by: Pac-Fish on August 18, 2012, 03:20:34 AM
IIRC AI has a 40% chance of picking reward units, regardless if you've checked them or not. Controlling whether the AI can do it? Take it up with the AI coders :P
Title: Re: 'Controlling' the AI
Post by: jojorabbit on August 18, 2012, 03:31:41 AM
Hi,

Quote
I was just wondering if there was a possibility to sort of disable AI from building artillery/long range units like mortar halftracks/nebels.
Yes there is. You need to comment few lines will write which ones when i will have more time(in day or two ;) ).

Quote
I would very much like to fight vs wehr Blitzkrieg and PE Tank Destroyer Doctrines and not always have to restart game and see if I get lucky and get what I want to fight against.
Yes it is possible. Same as above :).

Quote
IIRC AI has a 40% chance of picking reward units
It was before but now AI can take 1...n reward units means Wehr AI could take only Geshutzewagen or only schwimmwagen or both.

To make it simple.
AI goes through all reward units and takes 50% chances that AI will choose reward unit.
Before it was all reward units or none.

Hope it helps.
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 18, 2012, 04:12:38 AM
Wow an AI coder has emerged! Thanks for clearing this up and it's really good to know that these things are actually possible  :D

However, what do you mean when you say
Quote
Quote
I was just wondering if there was a possibility to sort of disable AI from building artillery/long range units like mortar halftracks/nebels.
Yes there is. You need to comment few lines will write which ones when i will have more time(in day or two ;) ).

Do you mean I need to say here which artillery/long range units I don't want AI to build and use against me or are you in the process of already adding this feature?

Quote
Quote
I would very much like to fight vs wehr Blitzkrieg and PE Tank Destroyer Doctrines and not always have to restart game and see if I get lucky and get what I want to fight against.
Yes it is possible. Same as above :).
So does this mean that you are in the middle of doing this feature and I'll be able to choose which AI doctrine to fight?


Quote
To make it simple.
AI goes through all reward units and takes 50% chances that AI will choose reward unit.
Before it was all reward units or none.
Whenever I got to fight PE Tank Destroyer Doctrine, 1/10 times they build jagdpanzer against me. The rest is ALWAYS hetzer :( that's why I wish I could sort of choose what units AI can build, whether I want to fight Jagdpanther/Jagdtiger or Hetzer/Jagdpanzer.
Title: Re: 'Controlling' the AI
Post by: GodlikeDennis on August 18, 2012, 05:29:41 AM
A wild jojorabbit has appeared!

jojorabbit uses explanation.

It's not very effective...

jojorabbit flees.

I guess he means to tell you he will write here what lines pertain to your question and tell you how to mod it yourself to get the situation you're after. You'll be able to tell the AI exactly what you want it to build.
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 18, 2012, 12:07:57 PM
Hahahaha thanks very much it really clears things up for me. Looking forward to be able to play it customised to my taste. One thing though, am I really allowed to modify the game files that you guys have worked hard for? And what if a new update rolls and the EF launcher can't update it properly because the modded files messed it up?
Title: Re: 'Controlling' the AI
Post by: jojorabbit on August 18, 2012, 12:45:26 PM
Quote
Do you mean I need to say here which artillery/long range units I don't want AI to build and use against me or are you in the process of already adding this feature?
I mean you can turn off some units for AI (just for your testing or whatever you r doing), am not adding that feature am trying to turn on all units for AI like vampires, halftracks etc etc...

You can comment, discuss some stuff about AI here: http://www.easternfront.org/forums/index.php?topic=7958.0
Or gamemodes here: http://www.easternfront.org/forums/index.php?topic=8058.0

Quote
So does this mean that you are in the middle of doing this feature and I'll be able to choose which AI doctrine to fight?
No, am will explain you what files you need to edit to remove other doctrines so AI will always choose Tank Destroyer or Blitz.

Quote
Whenever I got to fight PE Tank Destroyer Doctrine, 1/10 times they build jagdpanzer against me. The rest is ALWAYS hetzer that's why I wish I could sort of choose what units AI can build, whether I want to fight Jagdpanther/Jagdtiger or Hetzer/Jagdpanzer.
I wont explain this it is fixed in internal version as i told post ago, sometimes AI will choose 1...n units. You cant tell AI what units too build in late game, well you could make some sort of your AI mod  ;D.

Quote
One thing though, am I really allowed to modify the game files that you guys have worked hard for? And what if a new update rolls and the EF launcher can't update it properly because the modded files messed it up?
If new update rolls out and you mess something up, you can always re-install  :P.
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 18, 2012, 05:40:29 PM
Quote
Quote
So does this mean that you are in the middle of doing this feature and I'll be able to choose which AI doctrine to fight?
No, am will explain you what files you need to edit to remove other doctrines so AI will always choose Tank Destroyer or Blitz.
Ok I look forward to you teaching me what to do when you're free :). Will you PM or post here?

Quote
Quote
Whenever I got to fight PE Tank Destroyer Doctrine, 1/10 times they build jagdpanzer against me. The rest is ALWAYS hetzer that's why I wish I could sort of choose what units AI can build, whether I want to fight Jagdpanther/Jagdtiger or Hetzer/Jagdpanzer.
I wont explain this it is fixed in internal version as i told post ago, sometimes AI will choose 1...n units. You cant tell AI what units too build in late game, well you could make some sort of your AI mod  ;D.
So it is not possible to edit AI to build Jagdpanzer only and not Hetzer? Like how you said can stop AI from building artillery/mortars? Nah I wouldn't want to spend so much time making my own mod. I just want to custom these few things only that I've mentioned already that's all ;)

Quote
Quote
One thing though, am I really allowed to modify the game files that you guys have worked hard for? And what if a new update rolls and the EF launcher can't update it properly because the modded files messed it up?
If new update rolls out and you mess something up, you can always re-install  :P.
Re-install then re-edit the AI lines and it will still work?
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 21, 2012, 11:15:37 PM
Any news on when I'll be able to learn what I need to do jojorabbit?
Title: Re: 'Controlling' the AI
Post by: Pac-Fish on August 21, 2012, 11:24:44 PM
You'll find EF doesn't work as fast as most ppl like :P. Give him time
Title: Re: 'Controlling' the AI
Post by: jojorabbit on August 22, 2012, 12:44:29 AM
Hey,
sorry for late reply am pretty busy with a lot of stuff.

Here is what you need to do for doctrines.

file : command_tree_prefs_lib.ai


You will see a lot of tables they r kinda sorted for all factions, so you just need to comment what you don't need.
-- sign means commented line or you can look it as ignored code :P.
Example PE starts at line 180 for only Tank Destroyer PE it needs to look like this:

Code: [Select]
-------------------------------------------------------
-- AXIS PE

-- LUFTWAFFE SUPPORT
-- pe_luftwaffe_random = {
-- main = CT_PZ.LUFTWAFFE,
choices = {} -- choices as nil means random
-- },

-- pe_luftwaffe_left_first = {
-- main = CT_PZ.LUFTWAFFE,
-- choices = {CT_PZ.LUFTWAFFE_00, CT_PZ.LUFTWAFFE_01, CT_PZ.LUFTWAFFE_02, CT_PZ.LUFTWAFFE_10, CT_PZ.LUFTWAFFE_11, CT_PZ.LUFTWAFFE_12,}
-- },

-- pe_luftwaffe_right_first = {
-- main = CT_PZ.LUFTWAFFE,
-- choices = {CT_PZ.LUFTWAFFE_10, CT_PZ.LUFTWAFFE_11, CT_PZ.LUFTWAFFE_12,CT_PZ.LUFTWAFFE_00, CT_PZ.LUFTWAFFE_01, CT_PZ.LUFTWAFFE_02,}
-- },

-- pe_scorched_random = {
-- main = CT_PZ.SCORCHED_EARTH,
choices = {} -- choices as nil means random
-- },

-- pe_scorched_left_first = {
-- main = CT_PZ.SCORCHED_EARTH,
-- choices = {CT_PZ.SCORCHED_EARTH_00, CT_PZ.SCORCHED_EARTH_01, CT_PZ.SCORCHED_EARTH_02, CT_PZ.SCORCHED_EARTH_10, CT_PZ.SCORCHED_EARTH_11, CT_PZ.SCORCHED_EARTH_12,}
-- },

-- pe_scorched_right_first = {
-- main = CT_PZ.SCORCHED_EARTH,
-- choices = {CT_PZ.SCORCHED_EARTH_10, CT_PZ.SCORCHED_EARTH_11, CT_PZ.SCORCHED_EARTH_12, CT_PZ.SCORCHED_EARTH_00, CT_PZ.SCORCHED_EARTH_01, CT_PZ.SCORCHED_EARTH_02,}
-- },

pe_tankdestroyer_random = {
main = CT_PZ.TANK_DESTROYER,
--choices = {} -- choices as nil means random
},

pe_tankdestroyer_left_first = {
main = CT_PZ.TANK_DESTROYER,
choices = {CT_PZ.TANK_DESTROYER_00, CT_PZ.TANK_DESTROYER_01, CT_PZ.TANK_DESTROYER_02, CT_PZ.TANK_DESTROYER_10, CT_PZ.TANK_DESTROYER_11, CT_PZ.TANK_DESTROYER_12,}
},

pe_tankdestroyer_right_first = {
main = CT_PZ.TANK_DESTROYER,
choices = {CT_PZ.TANK_DESTROYER_10, CT_PZ.TANK_DESTROYER_11, CT_PZ.TANK_DESTROYER_12, CT_PZ.TANK_DESTROYER_00, CT_PZ.TANK_DESTROYER_01, CT_PZ.TANK_DESTROYER_02,}
},

For WH Blitz only is the same stuff just comment other two doctrines, i have not tested yet but it should work ;).
Re-install and re-editing lines should always work :).

Reward units are fixed internally and i guess i can post that fix cuz it is just a one file that fixes it will see with others. But that fix will be out with new patch i guess :P.

Hope it helps.

EDIT:
This was typed in hurry so i know it is kinda not so easy to understand.
The file you need to edit is located in : COH_HOME\Eastern_Front\Data\ai\personality folder, edit it with npp or some other editor.
Title: Re: 'Controlling' the AI
Post by: Otto Halfhand on August 22, 2012, 01:11:12 AM
Hi guys, just got back from a week on the road.

@viruz777: Welcome to the club. You are quite a HasenJaeger. Please post your wishlist for EF_mod AI behaviour on the Compstompers corner THread. It will be taken under advisement. - PM me.

I too wish to see a mode of player for compstompers which allows the selection of particular AI Personalities pre-game. THis is do-able. It is not at this time politically viable in the EF_mod. I hope to change this but as Sharks suggested: We are not fast. I will add to that we are not slow, we are half fast.  :P I have hopes that perhaps by the time the first or second Ostheer patch is offered we might be able to get this feature. If you can;  Lobby JoJo. He is after all the only Dev here.

Regarding your request to fight only Jagdpanzers in TD mode this is do-able as well. Jojo has a program to select a particular reward unit and THe CT tree used in a game can be selected at start with rudumentary knowledge of lua coding. Download a copy of "notepad ++" text editor and we can get you started. I can show you how to increase the occurance of Jagdpanzers in ai play but that is not so rudimenatary. Don't let the balancers intimidate you. They are good guys but they don't understand why anyone like you and I prefer compstomping.
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 22, 2012, 02:03:46 AM
Hey,
sorry for late reply am pretty busy with a lot of stuff.

Here is what you need to do for doctrines.

file : command_tree_prefs_lib.ai


You will see a lot of tables they r kinda sorted for all factions, so you just need to comment what you don't need.
-- sign means commented line or you can look it as ignored code :P.
Example PE starts at line 180 for only Tank Destroyer PE it needs to look like this:

Code: [Select]
-------------------------------------------------------
-- AXIS PE

-- LUFTWAFFE SUPPORT
-- pe_luftwaffe_random = {
-- main = CT_PZ.LUFTWAFFE,
-- choices = {} -- choices as nil means random
-- },

-- pe_luftwaffe_left_first = {
-- main = CT_PZ.LUFTWAFFE,
-- choices = {CT_PZ.LUFTWAFFE_00, CT_PZ.LUFTWAFFE_01, CT_PZ.LUFTWAFFE_02, CT_PZ.LUFTWAFFE_10, CT_PZ.LUFTWAFFE_11, CT_PZ.LUFTWAFFE_12,}
-- },

-- pe_luftwaffe_right_first = {
-- main = CT_PZ.LUFTWAFFE,
-- choices = {CT_PZ.LUFTWAFFE_10, CT_PZ.LUFTWAFFE_11, CT_PZ.LUFTWAFFE_12,CT_PZ.LUFTWAFFE_00, CT_PZ.LUFTWAFFE_01, CT_PZ.LUFTWAFFE_02,}
-- },

-- pe_scorched_random = {
-- main = CT_PZ.SCORCHED_EARTH,
-- choices = {} -- choices as nil means random
-- },

-- pe_scorched_left_first = {
-- main = CT_PZ.SCORCHED_EARTH,
-- choices = {CT_PZ.SCORCHED_EARTH_00, CT_PZ.SCORCHED_EARTH_01, CT_PZ.SCORCHED_EARTH_02, CT_PZ.SCORCHED_EARTH_10, CT_PZ.SCORCHED_EARTH_11, CT_PZ.SCORCHED_EARTH_12,}
-- },

-- pe_scorched_right_first = {
-- main = CT_PZ.SCORCHED_EARTH,
-- choices = {CT_PZ.SCORCHED_EARTH_10, CT_PZ.SCORCHED_EARTH_11, CT_PZ.SCORCHED_EARTH_12, CT_PZ.SCORCHED_EARTH_00, CT_PZ.SCORCHED_EARTH_01, CT_PZ.SCORCHED_EARTH_02,}
-- },

pe_tankdestroyer_random = {
main = CT_PZ.TANK_DESTROYER,
--choices = {} -- choices as nil means random
},

pe_tankdestroyer_left_first = {
main = CT_PZ.TANK_DESTROYER,
choices = {CT_PZ.TANK_DESTROYER_00, CT_PZ.TANK_DESTROYER_01, CT_PZ.TANK_DESTROYER_02, CT_PZ.TANK_DESTROYER_10, CT_PZ.TANK_DESTROYER_11, CT_PZ.TANK_DESTROYER_12,}
},

pe_tankdestroyer_right_first = {
main = CT_PZ.TANK_DESTROYER,
choices = {CT_PZ.TANK_DESTROYER_10, CT_PZ.TANK_DESTROYER_11, CT_PZ.TANK_DESTROYER_12, CT_PZ.TANK_DESTROYER_00, CT_PZ.TANK_DESTROYER_01, CT_PZ.TANK_DESTROYER_02,}
},

For WH Blitz only is the same stuff just comment other two doctrines, i have not tested yet but it should work ;).
Re-install and re-editing lines should always work :).

Reward units are fixed internally and i guess i can post that fix cuz it is just a one file that fixes it will see with others. But that fix will be out with new patch i guess :P.

Hope it helps.

Hi Jojo not a problem at all. I'm sorry if I sounded impatient because I actually wasn't. I only took your word seriously that you said you'll maybe help me in a day or two when you're free  :-X Didn't mean to rush you or anything so again I apologise. I'm actually a very patient person when it comes to EF_mod releases. There's just so much to experiment and explore! (vs AI of course  :P)

To be honest I am very new to modding and have little to no experience. The last time I modded COH to my taste was back during vanilla release and I think it was Corsix's mod studio. Do I need to download that and edit the lines like you suggested? I'm still trying to understand your instructions since I'm very confused and the lines can't help but make me feel abit intimidated since I'm abit at a loss on where exactly to start..

Thanks for taking the time to help me out with this though, I really appreciate it!
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 22, 2012, 02:16:32 AM
Hi guys, just got back from a week on the road.

@viruz777: Welcome to the club. You are quite a HasenJaeger. Please post your wishlist for EF_mod AI behaviour on the Compstompers corner THread. It will be taken under advisement. - PM me.

I too wish to see a mode of player for compstompers which allows the selection of particular AI Personalities pre-game. THis is do-able. It is not at this time politically viable in the EF_mod. I hope to change this but as Sharks suggested: We are not fast. I will add to that we are not slow, we are half fast.  :P I have hopes that perhaps by the time the first or second Ostheer patch is offered we might be able to get this feature. If you can;  Lobby JoJo. He is after all the only Dev here.

Regarding your request to fight only Jagdpanzers in TD mode this is do-able as well. Jojo has a program to select a particular reward unit and THe CT tree used in a game can be selected at start with rudumentary knowledge of lua coding. Download a copy of "notepad ++" text editor and we can get you started. I can show you how to increase the occurance of Jagdpanzers in ai play but that is not so rudimenatary. Don't let the balancers intimidate you. They are good guys but they don't understand why anyone like you and I prefer compstomping.

Thanks for the welcome :) what is a HasenJaeger? Thanks for bringing my attention to that thread, I never knew it was around and it's great to finally meet someone else who enjoys compstomping! I find PvP is too fast paced that I am unable to enjoy and appreciate the game at my own pace + the graphics and gameplay aspect of it.

Yes AI personalities should be a very helpful option which I feel will benefit newcomers to CoH and EF_mod alike. I first noticed how useful it is in the C&C3 and Generals franchise. I know that EF_mod isn't as fast as how most people would want but I am not like most people and I can understand :) I am not demanding that they work quicker and roll out stuff faster just so they can start working on this AI improvement thing. I was about to say to Sharks that I didn't mean to hustle jojo since I actually took his word that he'd be free to help me in a couple of days but I cleared that up. Anyway, are you by any chance one of the devs? I'm surprised you are quite confident and positive to say that this is do-able. I would very much wish to lobby with jojo but it's abit hard sometimes since I wouldn't want to take too much of his time away from doing the real work and rolling out 'what needs to be rolled out' quick hahaha... but also mainly since english isn't his first language, it's abit hard to understand what he's trying to say exactly - no offense to you jojo!

I've downloaded a copy of notepad++ as instructed so feel free to instruct me here :D I'm not exactly intimidated by the devs here but in fact I appreciate the vast knowledge they have with coding - as shown by the fantastic details on the EF_mod models.  It's just that when I'm asking for something like this and they try to help it can be abit hard to understand because it seems quite advanced and the coding itself intimidates me. Will PM you the details on the compstomp wishlist,
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 22, 2012, 02:34:06 AM
Hi Jojo after really reading properly I think I understand what you're trying to say and I see the difference in the code.

Basically just add "--" to all those doctrine lines that you don't want and the AI will ignore it right? I can see tank destroyer didn't have "--" in their lines.

Seems simple enough just adding -- there :D Problem now is using the right tools to edit it hmm..

Anyway, what about if I wanted AI to not build artillery like nebelwerfer, calliope etc?

Thanks again for your help!
Title: Re: 'Controlling' the AI
Post by: jojorabbit on August 22, 2012, 12:17:49 PM
Hi Jojo after really reading properly I think I understand what you're trying to say and I see the difference in the code.

Basically just add "--" to all those doctrine lines that you don't want and the AI will ignore it right? I can see tank destroyer didn't have "--" in their lines.

Seems simple enough just adding -- there :D Problem now is using the right tools to edit it hmm..

Anyway, what about if I wanted AI to not build artillery like nebelwerfer, calliope etc?

Thanks again for your help!

Yes "--" means one line comment.

Some instructions :

Just open command_tree_prefs_lib.ai in notepad++ aka  npp, on toolbar select Language-> L -> Lua and you will get Lua syntax coloring.
Also you can use other editors like metapad, scite etc, i recommend npp.

When you turn on syntax coloring you will get something like on this image:
(http://img708.imageshack.us/img708/999/screenshot473x.jpg)

When you comment line/s they will be colored green ;). Without syntax coloring everything will be gray so it is hard to notice it :P.

Tip: For faster commenting just select lines you want to comment and press CTRL+Q and all of then will be auto commented.

File you need to open is located in : COH_HOME\Eastern_Front\Data\ai\personality folder

P.S.

Quote
I was about to say to Sharks that I didn't mean to hustle jojo since I actually took his word that he'd be free to help me in a couple of days but I cleared that up.

 I would very much wish to lobby with jojo but it's abit hard sometimes since I wouldn't want to take too much of his time away from doing the real work and rolling out 'what needs to be rolled out' quick hahaha... but also mainly since english isn't his first language, it's abit hard to understand what he's trying to say exactly - no offense to you jojo!

Don't worry am not so easy to offend. I did not know that my english is that bad :D, my problem is cuz i think everyone knows everything so sometimes i skip some of stuff that should be explained.

Quote
Anyway, what about if I wanted AI to not build artillery like nebelwerfer, calliope etc?
When you get this working then we will go to other step ;).

Feel free to ask anything you need.
Title: Re: 'Controlling' the AI
Post by: Otto Halfhand on August 22, 2012, 03:06:03 PM
Hey viruzz777 HasenJaeger is Pennsylvania Dutch for Rabbit Hunter. We haven't gotten jojorabbit out of his hole since fishing season started. Looks like he's got you started on the right paw.  ;) good luck.
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 22, 2012, 07:59:44 PM
Hi Jojo

Yes the instructions you provided are clearer to understand now. Thanks for the additional instructions it made it much much easier :D Also, your english is not bad. It's just at first when you replied to this thread it was harder to understand until GodlikeDennis helped clear things up for me.

I have edited the code and tried playing a game but the game pauses after finish loading and says "FATAL AI ERROR - EXECUTION PAUSED". What did I do wrong and what should I do now? All I did was add the -- to every line as shown in your example except US Armor, UK Royal Engineers, Axis Blitz, PE Tank Destroyer and Soviet Breakthrough. I started a game with US vs PE and Axis and that error message popped up.

Edit : Tried continuing my SP campaign while waiting for response and found that the editing also affected it. After loading it would stay in black screen and not continue to play cutscene. Tried replacing the edited file with the original and everything went back to normal. I'm surprised that editing this AI personality would also affect SP experience since I thought it would only affect skirmish.
Title: Re: 'Controlling' the AI
Post by: jojorabbit on August 22, 2012, 09:35:36 PM
Hm, am not sure what you did wrong i did not tested this yet but i will test it and will attach whole file that works.
Also it is great that you made backup of original file.
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 23, 2012, 12:09:00 AM
Hey Jojo yes please try to test it and see how it works. I copied everything EXACTLY like the example you gave me and I still got that fatal AI error again. When I looked carefully I realised this line:

-------------------------------------------------------
   -- AXIS PE

   -- LUFTWAFFE SUPPORT
   -- pe_luftwaffe_random = {
      -- main = CT_PZ.LUFTWAFFE,
      choices = {} -- choices as nil means random

The highlighted red line I added the "--" as well but I noticed in your example it didn't have it. So I thought it was my mistake and I removed the -- but it still gave me error.

Funny thing though, I used original file and ONLY edited Wehr Blitz and PE Tank Destroyer instead of all the other countries, WITH adding -- in that "choices = {} -- choices as nil means random" line. The game launched fine and no error but the code didn't affect AI and they still build terror doctrine and luftwaffe...
Title: Re: 'Controlling' the AI
Post by: jojorabbit on August 23, 2012, 12:28:22 AM
choices = {} -- choices as nil means random
That red line needs to be commented. Probably my mistake with CTRL + Q.

Quote
. The game launched fine and no error but the code didn't affect AI and they still build terror doctrine and luftwaffe...

Did you commented just _random or all three _left, _right?
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 23, 2012, 12:40:55 AM
Oh ok that means I did it correctly first time around but they still used terror and luftwaffe  ???

I commented on all three _random, _left and _right just like your example showed.

Here is download link of my edited file for you to see for yourself if I did it correctly : https://rapidshare.com/files/3211722122/command_tree_prefs_lib.ai (https://rapidshare.com/files/3211722122/command_tree_prefs_lib.ai)
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 23, 2012, 02:29:03 AM
Tried another game and I think this time I got lucky since wehr AI selected blitzkrieg but it kept spamming geschutzwagen  :-\

PE AI still chose luftwaffe again so I don't think both AI choices was a result from the editing that I did. Also kept spamming Marder III at me -_- Can't wait to get past this stage and learn how to prevent AI from building those!
Title: Re: 'Controlling' the AI
Post by: Otto Halfhand on August 23, 2012, 02:50:30 AM
Hey jojo give viruzz jar.scar.  I don't think its a sectret.
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 23, 2012, 01:27:26 PM
What's a jar.scar?  ???
Title: Re: 'Controlling' the AI
Post by: jojorabbit on August 23, 2012, 01:55:39 PM
What's a jar.scar?  ???

This :D, It is code that fixes reward units for AI so AI chooses 0....n reward units. Before it was all or none :P.

Here is code i will attach file later.
Just import it in scarUtil.scar and put in folder with scarUtil, ref: ..\Eastern_Front\Data\scar, script will be automatically activated when you import it. You can see output in console.

Code: [Select]
----------------------------------------------------------------
-- THIS SCRIPT WAS WRITTEN BY: jojorabbit
----------------------------------------------------------------
-- Fix for AI using reward units aka jojorabbit`s AI reward unit fix aka jar
----------------------------------------------------------------
-- @author: jojorabbit
-- @version: v 1.0 b270412
-- @filename: jar.scar
-- This file fixes AI usage of reward units, in vCoH ai uses all or none reward units
-- If you are gonna use this with other mod give me credits
----------------------------------------------------------------


----------------------------------------------------------------
-- REFERENCE
----------------------------------------------------------------
-- ALLIED UPGRADES
-- upgrade\upgrade_allied_105.lua
-- upgrade\upgrade_allied_hellcat.lua
-- upgrade\upgrade_allied_jumbo.lua
-- upgrade\upgrade_allied_staghound.lua

--  AXIS UPGRADES
-- upgrade\upgrade_axis_geschutzwagen.lua
-- upgrade\upgrade_axis_schwimmwagen.lua
-- upgrade\upgrade_axis_tiger_ace.rgd
-- upgrade\upgrade_axis_officer.rgd

-- COMMONWEALTH UPGRADES
-- upgrade\upgrade_british_comet.lua
-- upgrade\upgrade_british_kangaroo.lua
-- upgrade\upgrade_british_staghound.lua
-- upgrade\upgrade_british_sas.lua -- THIS IS/(WILL BE) HANDLED IN aiutil.scar

-- PANZER ELITE UPGRADES
-- upgrade\upgrade_panzer_elite_hotchkiss.lua
-- upgrade\upgrade_panzer_elite_jagdpanzer.lua
-- upgrade\upgrade_panzer_elite_jagdtiger.lua
-- upgrade\upgrade_panzer_elite_schwimmwagen.lua
-- upgrade\upgrade_panzer_elite_nashorn.rgd

-- SOVIET UPGRADES
-- upgrade\upgrade_soviets_is3
-- upgrade\upgrade_soviets_kv1
-- upgrade\upgrade_soviets_su_122.rgd

-- OSTHEER UPGRADES
-- NONE TILL IT IS FINISHED

----------------------------------------------------------------
-- INIT
----------------------------------------------------------------
function OnInit()
print("JAR Init")
AddRewardUnitsToAIPlayers()
end

Scar_AddInit(OnInit)

----------------------------------------------------------------
-- CONSTANTS
----------------------------------------------------------------
isDebug = true -- turn on/off logging

-- ALLIES
R_ALLIES_SHERMAN_105 = BP_GetUpgradeBlueprint("upgrade/upgrade_allied_105.lua")
R_ALLIES_HELLCAT = BP_GetUpgradeBlueprint("upgrade/upgrade_allied_hellcat.lua")
R_ALLIES_SHERMAN_JUMBO = BP_GetUpgradeBlueprint("upgrade/upgrade_allied_jumbo.lua")
R_ALLIES_STAGHOUND = BP_GetUpgradeBlueprint("upgrade/upgrade_allied_staghound.lua")

ALLIES_REWARD_UNITS = {
R_ALLIES_SHERMAN_105,
R_ALLIES_HELLCAT,
R_ALLIES_SHERMAN_JUMBO,
R_ALLIES_STAGHOUND,
}

-- AXIS
R_AXIS_GESCHUTZEWAGEN = BP_GetUpgradeBlueprint("upgrade/upgrade_axis_geschutzwagen.lua")
R_AXIS_SCHWIMMWAGEN = BP_GetUpgradeBlueprint("upgrade/upgrade_axis_schwimmwagen.lua")
R_AXIS_TIGER_ACE = BP_GetUpgradeBlueprint("upgrade/upgrade_axis_tiger_ace.lua")
R_AXIS_LW_OFFICIER = BP_GetUpgradeBlueprint("upgrade/upgrade_axis_officer.lua")

-- table
AXIS_REWARD_UNITS = {
R_AXIS_GESCHUTZEWAGEN,
R_AXIS_SCHWIMMWAGEN,
R_AXIS_TIGER_ACE,
R_AXIS_LW_OFFICIER,
}
-- COMMONWEALTH
R_CW_COMET = BP_GetUpgradeBlueprint("upgrade/upgrade_british_comet.lua")
R_CW_KANGAROO = BP_GetUpgradeBlueprint("upgrade/upgrade_british_kangaroo.lua")
R_CW_STAGHOUND = BP_GetUpgradeBlueprint("upgrade/upgrade_british_staghound.lua")

CW_REWARD_UNITS = {
R_CW_COMET,
R_CW_KANGAROO,
R_CW_STAGHOUND,
}
-- PE
R_PE_HOTCHKISS = BP_GetUpgradeBlueprint("upgrade/upgrade_panzer_elite_hotchkiss.lua")
R_PE_JAGDPANZER = BP_GetUpgradeBlueprint("upgrade/upgrade_panzer_elite_jagdpanzer.lua")
R_PE_JAGDTIGER = BP_GetUpgradeBlueprint("upgrade/upgrade_panzer_elite_jagdtiger.lua")
R_PE_SCHWIMMWAGEN = BP_GetUpgradeBlueprint("upgrade/upgrade_panzer_elite_schwimmwagen.lua")
R_PE_NASHORN = BP_GetUpgradeBlueprint("upgrade/upgrade_panzer_elite_nashorn.lua")

PE_REWARD_UNITS = {
R_PE_HOTCHKISS,
R_PE_JAGDPANZER,
R_PE_JAGDTIGER,
R_PE_SCHWIMMWAGEN,
R_PE_NASHORN,
}
-- SOV
R_SOV_IS3 = BP_GetUpgradeBlueprint("upgrade/upgrade_soviets_is3.lua")
R_SOV_KV1 = BP_GetUpgradeBlueprint("upgrade/upgrade_soviets_kv1.lua")
R_SOV_SU122 = BP_GetUpgradeBlueprint("upgrade/upgrade_soviets_su_122.lua")

SOVIET_REWARD_UNITS = {
R_SOV_IS3,
R_SOV_KV1,
R_SOV_SU122,
}
-- OST


----------------------------------------------------------------
-- METHODS
----------------------------------------------------------------
function AddRewardUnitsToAIPlayers()
for i = 1, World_GetPlayerCount() do
local player = World_GetPlayerAt(i)
-- only for AI players
if(AI_IsEnabled(player)) then
local race = Player_GetRaceName(player)

LogOutput("AI race= "..race)

-- ALLIES
if(race == TRACE_ALLIES) then
rewardTable = ALLIES_REWARD_UNITS
-- AXIS
elseif(race == TRACE_AXIS) then
rewardTable = AXIS_REWARD_UNITS
-- CW
elseif(race == TRACE_ALLIES_COMMONWEALTH) then
rewardTable = CW_REWARD_UNITS
-- PE
elseif(race == TRACE_AXIS_PANZER_ELITE) then
rewardTable = PE_REWARD_UNITS
-- SOV
elseif(race == TRACE_ALLIES_SOVIETS) then
rewardTable = SOVIET_REWARD_UNITS
-- OST
end

if(rewardTable ~= nil) then
LogOutput("rewardtable size "..#rewardTable)
ApplyRewardUnits(player, rewardTable)
end
end
end
end


function ApplyRewardUnits(player, rewardTable)
--~ local rndTable = Table_GetRandomItem()
local randomTest = World_GetRand(1, 100)
LogOutput("Test: rnd= "..randomTest)

for n = 1, table.getn(rewardTable) do
local rnd = World_GetRand(1, 100)
LogOutput("Test: "..n.." rnd= "..rnd)
if((rnd % 2) == 0) then
LogOutput("Activating - "..BP_GetName(rewardTable[n]))
Command_PlayerUpgrade(player, rewardTable[n], true, false)
end
end
end

function LogOutput(message)
if(isDebug) then
print(message)
end
end

Note: part of ScarUtil.scar code:

Code: [Select]
...
import("NIS.scar")
import("Debugger.scar")
import("GarrisonBuilding.scar")
import("jar.scar")
...
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 23, 2012, 02:08:22 PM
Excellent! so if I download attached file and put it in folder - what will happen? Abit confused on how this works since I don't really understand your explanation sorry xD This will affect if AI will choose to build Jagdpanzer and not Hetzer?

Also what about my earlier issue with command_tree_pref? Did you manage to see my attached file and see if I did anything wrong? Please help me on that. :-*
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 23, 2012, 04:34:08 PM
Still testing that issue jojo?  ;)
Title: Re: 'Controlling' the AI
Post by: Otto Halfhand on August 23, 2012, 06:15:23 PM
viruzz upload the file for your command_tree issue here. I don't have time to futz with a rapidshare account right now. I can give you a looksee while jojo is fishing/working

Title: Re: 'Controlling' the AI
Post by: viruz777 on August 23, 2012, 06:52:29 PM
Oops I didn't know this forum had the option to upload attachments that's why i did it through rapidshare. Now I've found it and here you go!
Title: Re: 'Controlling' the AI
Post by: jojorabbit on August 23, 2012, 11:37:34 PM
Excellent! so if I download attached file and put it in folder - what will happen? Abit confused on how this works since I don't really understand your explanation sorry xD This will affect if AI will choose to build Jagdpanzer and not Hetzer?

Also what about my earlier issue with command_tree_pref? Did you manage to see my attached file and see if I did anything wrong? Please help me on that. :-*

0...n it is simple math explanation or [0,n] :D, to make it simple, before this file AI used all reward units or none. With this file AI will use sometimes 0, sometimes only 1 reward unit, like only geshutzewagen, sometimes only 2 like offiecer and schwimmwagen, etc... for PE it means AI could choose jagdpanzers and jagtiger or only jagdpanzers, or only nashorn.
So sometimes AI will attack you with jagdpanzers and jagdpanther, sometimes hetzer and jagdtiger etc etc....

Conclusion it makes AI more human alike cuz some ppl choose only some units :P.
Hope it helps.

I will help you dont worry i just dont have so much time to test and see everything in one day.
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 24, 2012, 03:47:36 PM
Ahhh I see what you mean now that explains it better thanks jojo ^^ So will this file improve the chance that AI will build Jagdpanzer instead of Hetzer? Or is it still 50/50 chance? There's really no way at all to make AI 100% build Jagdpanzer instead of Hetzer by editing this file?

Again I really appreciate the time you're taking and the help you're giving me in teaching a noob like me jojo. I don't mean to sound impatient but I'm sorry if I gave you that impression. It's just that when I get started on a new piece of work that I have no experience on, I am eager to learn and move forward. So since I am stuck with this error/AI still building other doctrines I get frustrated that something went wrong and I want to know how to fix it otherwise I feel unsettled like work is unfinished. Hope you understand how I feel ^^
Title: Re: 'Controlling' the AI
Post by: jojorabbit on August 24, 2012, 03:58:09 PM
Ahhh I see what you mean now that explains it better thanks jojo ^^ So will this file improve the chance that AI will build Jagdpanzer instead of Hetzer? Or is it still 50/50 chance? There's really no way at all to make AI 100% build Jagdpanzer instead of Hetzer by editing this file?

Again I really appreciate the time you're taking and the help you're giving me in teaching a noob like me jojo. I don't mean to sound impatient but I'm sorry if I gave you that impression. It's just that when I get started on a new piece of work that I have no experience on, I am eager to learn and move forward. So since I am stuck with this error/AI still building other doctrines I get frustrated that something went wrong and I want to know how to fix it otherwise I feel unsettled like work is unfinished. Hope you understand how I feel ^^

To make 100% just comment 2 lines in for loop:

it needs to look like this:
Quote
for n = 1, table.getn(rewardTable) do
      local rnd = World_GetRand(1, 100)
      LogOutput("Test: "..n.." rnd= "..rnd)
      --if((rnd % 2) == 0) then -> this is commented -> %2 basically means 50%-50% chances
         LogOutput("Activating - "..BP_GetName(rewardTable[n]))
         Command_PlayerUpgrade(player, rewardTable[n], true, false)
      --end -> this is commented
   end

With those 2 lines commented AI will always use reward units.
Hope it helps.

I know the feeling making and programming AI is painful i know. Will try to resolve doctrines asap.
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 24, 2012, 04:56:04 PM
Hmm if that's the case then I think I will still have to keep restarting in order to get to fight the units I want. If I make AI choose 100% reward units then it's great that PE will definitely choose jagdtiger and jagdpanzer to fight me but I usually fight 1v2 Expert AI with 1 Wehr and 1 PE. The wehr AI will not build stug IV but Geschutzwagen instead which will be another long range headache -_-

So to explain it simply, having AI choose 100% reward units won't be good and having AI 100% not choose reward units is also not good so I will have to stick with 50/50 chance in order to get the units I want. What I thought would be possible is just to single out AI to use jagdpanzer only not hetzer and the rest of the reward units can stay normal but I guess this is not possible since earlier in the thread you said it is not possible to force AI to build what you want, even though it's a single reward unit like Jagdpanzer instead of Hetzer, since it is all or nothing am I correct? ^^

Anyway let me know when you've resolved it then we can move on to next step in preventing AI from building long range units + artillery. If you want to know the reason I am doing all this to give you a better understanding is because I love tank vs tank battles especially heavy tanks like Tiger, Pershing, IS-2 etc which is why I feel long range units spoil the fun if you know what I mean. Thanks jojo!
Title: Re: 'Controlling' the AI
Post by: jojorabbit on August 24, 2012, 10:32:08 PM
Quote
So to explain it simply, having AI choose 100% reward units won't be good and having AI 100% not choose reward units is also not good so I will have to stick with 50/50 chance in order to get the units I want. What I thought would be possible is just to single out AI to use jagdpanzer only not hetzer and the rest of the reward units can stay normal but I guess this is not possible since earlier in the thread you said it is not possible to force AI to build what you want, even though it's a single reward unit like Jagdpanzer instead of Hetzer, since it is all or nothing am I correct? ^^

That is purpose of the file that AI is more human alike sometimes 1reward, sometimes 2 etc etc, so it is not all or nothing.
But it is possible to force PE to use jagdpanzer reward and WH not to use geschutzwagen reward :P. You just need to modify file a little bit :P.

By commenting one line you can easy turn off WH reward units :P.

Quote
if(race == TRACE_ALLIES) then
   rewardTable = ALLIES_REWARD_UNITS
   -- AXIS
elseif(race == TRACE_AXIS) then
   -- rewardTable = AXIS_REWARD_UNITS -> this needs to be commented.
        -- CW
elseif(race == TRACE_ALLIES_COMMONWEALTH) then
   rewardTable = CW_REWARD_UNITS
   -- PE

Here is part of code that should force PE to use Tank_Destroyer, And Wehr to use Blitz, i did not had much time to test it, so if it does not work inform me so i can speed up testing:
Quote
-- AXIS
         elseif(race == TRACE_AXIS) then
            --rewardTable = AXIS_REWARD_UNITS -- commented cuz STUG IV
            UI_ForceCommanderTreeChoice(player, COMMANDER_TREE.AXIS.BLITZKRIEG) -- this is added
         -- CW
         elseif(race == TRACE_ALLIES_COMMONWEALTH) then
            rewardTable = CW_REWARD_UNITS
         -- PE
         elseif(race == TRACE_AXIS_PANZER_ELITE) then
            rewardTable = PE_REWARD_UNITS
            UI_ForceCommanderTreeChoice(player, COMMANDER_TREE.ELITE.TANK_DESTROYER) -- force tank d.

Hope it helps.
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 24, 2012, 11:51:20 PM
Haha you should have said so sooner that I can actually still modify it. From the way you make it sound in 1st page of the thread I thought it was not possible:

Quote
It was before but now AI can take 1...n reward units means Wehr AI could take only Geshutzewagen or only schwimmwagen or both.

To make it simple.
AI goes through all reward units and takes 50% chances that AI will choose reward unit.
Before it was all reward units or none.

and

Quote
I wont explain this it is fixed in internal version as i told post ago, sometimes AI will choose 1...n units. You cant tell AI what units too build in late game, well you could make some sort of your AI mod

Based on what you said I thought it's just 3 options = 100%, 0% reward units or your modded code of 50%. I can't really test it now since I still can't set command_tree_pref.ai to choose that doctrine to see if I use the jar.scar with the commented line works. But it's really great to know that all this is possible when I first thought I could never really get the kind of AI I want. Thanks again jojo! :)
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 24, 2012, 11:55:25 PM

Quote
-- AXIS
         elseif(race == TRACE_AXIS) then
            --rewardTable = AXIS_REWARD_UNITS -- commented cuz STUG IV
            UI_ForceCommanderTreeChoice(player, COMMANDER_TREE.AXIS.BLITZKRIEG) -- this is added
         -- CW
         elseif(race == TRACE_ALLIES_COMMONWEALTH) then
            rewardTable = CW_REWARD_UNITS
         -- PE
         elseif(race == TRACE_AXIS_PANZER_ELITE) then
            rewardTable = PE_REWARD_UNITS
            UI_ForceCommanderTreeChoice(player, COMMANDER_TREE.ELITE.TANK_DESTROYER) -- force tank d.

Oh I see you added new line of code! Is this in the jar.scar file that you sent me or in command_tree_pref.ai? The code looks different from the first file you told me to work on. So what will I do with the modified command_tree_pref.ai file?
Title: Re: 'Controlling' the AI
Post by: jojorabbit on August 25, 2012, 12:19:04 AM
Quote
Oh I see you added new line of code! Is this in the jar.scar file that you sent me or in command_tree_pref.ai? The code looks different from the first file you told me to work on. So what will I do with the modified command_tree_pref.ai file?

Yes all code i told you to modifiy is jar.scar.
Remove that modified command_tree_pref.ai and use old one :P.
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 25, 2012, 01:46:26 AM
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?
Title: Re: 'Controlling' the AI
Post by: viruz777 on August 25, 2012, 02:27:24 AM
Hi jojo I copy pasted the edited jar.scar into /scar folder as you instructed. I also copied the entire text and pasted at the bottom of scarutil.scar and also added import "jar.scar" inside there. (if that is what you mean by import it in scarUtil.scar)

It still gave Fatal Scar Error - Execution paused.

here is screenshot :

(http://img542.imageshack.us/img542/3493/fatalscar.png)



I think it has something to do with the added lines of the command tree? Please help what should I do now?

Title: Re: 'Controlling' the AI
Post by: jojorabbit 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.
Title: Re: 'Controlling' the AI
Post by: viruz777 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.
Title: Re: 'Controlling' the AI
Post by: jojorabbit 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
Title: Re: 'Controlling' the AI
Post by: viruz777 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
Title: Re: 'Controlling' the AI
Post by: jojorabbit 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.
Title: Re: 'Controlling' the AI
Post by: Otto Halfhand 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.
Title: Re: 'Controlling' the AI
Post by: jojorabbit 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.

Title: Re: 'Controlling' the AI
Post by: Otto Halfhand 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
Title: Re: 'Controlling' the AI
Post by: viruz777 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.
Title: Re: 'Controlling' the AI
Post by: Otto Halfhand 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


Title: Re: 'Controlling' the AI
Post by: viruz777 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
Title: Re: 'Controlling' the AI
Post by: jojorabbit 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.
Title: Re: 'Controlling' the AI
Post by: viruz777 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?
Title: Re: 'Controlling' the AI
Post by: jojorabbit 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 ;).
Title: Re: 'Controlling' the AI
Post by: viruz777 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  :-[
Title: Re: 'Controlling' the AI
Post by: Otto Halfhand on September 02, 2012, 08:38:02 AM
Two lines call range of 1-12 out of range. This may have to do with an error in the ai unit purchase routine. IIRC in 1.6 it is set at range 1-5 with a variance of 25 %. If the range was changed to 1-8 or 1-9 a 25% variance would put it out of range as stated.
Title: Re: 'Controlling' the AI
Post by: viruz777 on September 04, 2012, 04:08:06 AM
Errr I'm sorry Otto but I don't understand what this means xD Is that out of range causing the fatal AI error? I didn't edit any lines except what you and jojo have instructed me to.
Title: Re: 'Controlling' the AI
Post by: viruz777 on October 02, 2012, 02:35:14 PM
Been so quiet here  :(
Title: Re: 'Controlling' the AI
Post by: Otto Halfhand on October 02, 2012, 03:53:13 PM
How has your quest for Panzer battles coding been working?

Title: Re: 'Controlling' the AI
Post by: viruz777 on October 02, 2012, 07:19:54 PM
jojo has been soooooooo quiet for sooooooo long so I'm hoping he'll one day return and pull my hand out of the deep dark well :') I can't progress forward without his help.
Title: Re: 'Controlling' the AI
Post by: Otto Halfhand on October 02, 2012, 08:32:11 PM
What is thenature of your problem?

Title: Re: 'Controlling' the AI
Post by: Jeff 'Robotnik' W. on October 03, 2012, 01:18:43 AM
well jojo does still come onto the forum, and he will respond if you PM him, he just has been keeping quiet thats all :)
Title: Re: 'Controlling' the AI
Post by: Otto Halfhand on October 03, 2012, 03:37:09 AM
Jojo is fishing til about the middle of October. :)

Heh Robotnik When I make the most innocuous of changes to code (one at a time ), and copy them into EF AI folder I get a Fatal ai error. What are the proper command line parmeters to use?

 
Title: Re: 'Controlling' the AI
Post by: Jeff 'Robotnik' W. on October 03, 2012, 04:22:21 PM
command line parameters  ??? you mean for starting COH?

heres what i use

 -dev -mod EF_Devbox -nomovies
Title: Re: 'Controlling' the AI
Post by: viruz777 on October 08, 2012, 12:14:07 AM
What is thenature of your problem?

Well Otto as you can see the progression of my discussion with jojo on page 4, he gave me some files to overwrite, and also with regards to reward units. I followed his instructions but I'm still getting Fatal AI error. Asked for jojo's help but he didn't respond so I've been waiting since.

Title: Re: 'Controlling' the AI
Post by: viruz777 on October 08, 2012, 12:17:06 AM
well jojo does still come onto the forum, and he will respond if you PM him, he just has been keeping quiet thats all :)

Why is he keeping quiet in this thread? He will only respond to PMs from now on? I didn't know this. I thought if I made this thread then other people could help give me some useful input if they were aware of any information. Didn't know jojo would be the single person to be my salvation and I would rely on his help all this while.

So will he come back here or should I just PM him what I posted on page 4 but he didn't respond to? I'm also worried that he might be busy coding new stuff for the EF Community and the last thing he needs is an extra headache from 1 person wanting to customise his own AI experience and spamming his inbox.
Title: Re: 'Controlling' the AI
Post by: jojorabbit on October 08, 2012, 10:04:58 AM
Hey,
sorry for keeping quiet. It is true that i have a lot of projects and stuff to code, also i have new job so i come few times a day on forum to see if there is something interesting. I did not had much time to resolve you problem but i will try today to go through all our conversation and i will test files that i sent to you. Also i saw some AI errors in internal version that need to be resolved.

Quote
Why is he keeping quiet in this thread? He will only respond to PMs from now on? I didn't know this.
I will respond dont worry am just so busy, also i tried to setup notifications on this topic but there is just no button to setup it.

To speed up my walking through posts in this topic. Could you just tell me is code working or working and error every time in middle game? Did you finish any games without errors?