View Full Version : AITweak an AI tweaker for CloD missions
von Pilsner
04-27-2012, 09:47 PM
AITweak for CloD
================
Version: 0.4
By: von Pilsner
This utility will modify the AI within a CLoD mission file (*.mis) based on these (http://www.bobgamehub.blogspot.com/2012/03/ai-settings-in-cliffs-of-dover.html) suggestions. It tries its best to determine the type of plane (fighter, fighter bomber, bomber/transport) and the skill level (rookie, average, veteran, ace) and modify the skill values accordingly.
When you run it from the batch file it automatically makes a backup of the mission file(s) before making any changes (puts them in a subdirectory named 'mission_backup' [as of v0.3]) so any changes can be easily un-done. If a backup file already exists AITweak will not process that mission.
Usage: AITweak [mission.mis]
This program does not include an installer, I simply unzip it to the desktop and copy the missions I want to mod into that folder and run 'AIProcess.bat'. To uninstall simply delete the folder.
Even though this program makes it's own backups I recommend making a backup of any important or purchased missions before running 'AITweak' or 'AIProcess'.
ADVANCED STUFF (not needed to use the program)
There is an included 'aiconf.ini' file that contains the AI info, you can hand edit the values and AITweak will use your values instead of mine. ;) This file will be auto-generated if it does not exist.
================
How it works:
First it matches a pattern to determine what type of aircraft it is dealing with then it looks for certain strings (ex.: ' 1 1 1 1 1 1 1 1' is an ace) and if it finds the string it replaces the skill based on airplane type. Skills that do not match the following patterns will not be modified:
' 0 0 0 0 0 0 0 0'
' 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3'
' 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7'
' 1 1 1 1 1 1 1 1'
Any AI that has been hand-set to anything other than the above by the mission builder will NOT be modified, this way missions that already have custom AI will retain that custom AI!
The default planeset is the CloD planes and unknown planes will be set with fighter AI.
This has been tested on WinXP and Win7x64.
================
v0.4 -added (beta) IL2DCG mode (-i), when enabled will read mission as though it is generated from IL2DCG and enhance the individual plane AI within the flights. This mode will not make any backups! TEST AT YOUR OWN RISK! This mode is really meant to be used with 'DCEMon.exe' to autoedit IL2DCG campaigns.
-added unsafe mode (-u), when enabled the program will not make backups.
-added debug mode (-d), this will generate lots of useless output...
-included DCEMonitor for use with IL2DCG and AITweak to auto edit your campaign while you play.
v0.3 -Moved the backup files to a subdirectory.
v0.2 -Added 'aiconf.ini' file that AI can be hand edited to allow more customization (for Madfish).
-Fixed cariage returns so missions can be read by a human (thanks pupo162).
v0.1 -Initial release.
================
Get it here: AITweakv0.4b.zip (http://bs.beckament.net/files_pub/FlightSim/IL2CloD/AITweak_v0.4b.zip)
Previous Version: AITweak_v0.3.zip (http://bs.beckament.net/files_pub/FlightSim/IL2CloD/AITweak_v0.3.zip)
If you would like to test the AI improvements before trying this utility, here are the Quick Missions with modded AI (as of v0.6 I am using AITweak to modify the AI instead of doing it by hand): http://forum.1cpublishing.eu/showthread.php?t=31193
von Pilsner
04-28-2012, 01:59 AM
As of version 0.4 'AI Tweak' now includes 'DCE Monitor', an automatic utility for enhancing your IL2DCE offline campaign AI. :D
If you are not using IL2DCE you can simply ignore it.
DCE Monitor (for CloD and IL2DCE-0.2.1.306)
http://bs.beckament.net/files_pub/FlightSim/IL2CloD/dcemon.png
Automatically enhance your IL2DCE campaign AI while you play! (no need to alt-tab or re-run the program)
This program monitors the IL2DCE mission directory and when a new mission is generated it calls AITweak (in a special DCG mode) and expands and modifies the mission AI before you fly it.
It is automatic, nothing to config. Just run DCEMonitor.exe then start CloD and begin or continue an IL2DCG campaign. (it won't modify anything until IL2DCE makes a new mission).
=================================
When you run it, simply make sure the 'Monitoring' directory is correct for your system. If it is not correct start it (from a command line or batch file) like this (but replace c:\temp with the directory you want to monitor): DCEMon "c:\temp"
=================================
IL2DCE: http://code.google.com/p/il2dce/
IL2DCE release thread: http://forum.1cpublishing.eu/showthread.php?t=25076
AITweak: http://forum.1cpublishing.eu/showthread.php?t=31573
=================================
Go from this:
Flight0 1 2 3
Flight1 4 5 6
Class Aircraft.Ju-88A-1
Formation VIC3
CallSign 33
Fuel 100
Weapons 1 1 1 0 0 4
SetOnPark 0
Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
Briefing BoB_LW_KG51_III.33
to this
[BoB_LW_KG51_III.33]
Flight0 1 2 3
Flight1 4 5 6
Class Aircraft.Ju-88A-1
Formation VIC3
CallSign 33
Fuel 100
Weapons 1 1 1 0 0 4
SetOnPark 0
Skill0 0.32 0.21 0.87 0.35 0.74 0.95 0.95 0.72
Skill1 0.93 0.21 0.96 0.45 0.74 1 1 0.75
Skill2 0.73 0.21 0.92 0.40 0.74 0.95 0.95 0.75
Skill10 0.73 0.21 0.92 0.40 0.74 0.95 0.95 0.75
Skill11 0.32 0.21 0.87 0.35 0.74 0.95 0.95 0.72
Skill12 0.30 0.21 0.78 0.30 0.74 0.85 0.90 0.70
Briefing BoB_LW_KG51_III.33
[B]Automatically!
=================================
This beta has been tested on Win7x64 and WinXP using IL2DCE-0.2.1.306.
NOTE: Since it is only modifiying one mission in one directory quickly, DCEMon does NOT make a backup of the mission 1st! (so use at your own risk)
Madfish
04-28-2012, 09:21 AM
Great tool! Following suggestions:
I'd love if the backups would go straight into a subfolder without messing with the extension (as some people may still use the option to not show file extensions).
As for the command line tool I'm okay with it. You might want to get input from others though if they are okay with the amount of help available to use it correctly.
Generally I'd love to see a launcher that let's you adjust the values before applying them. I've been looking for a thread I remembered where the values were explained and then realized it was probably yours. :D
http://forum.1cpublishing.eu/showthread.php?t=31193&highlight=advanced+flying
But I remember a different one with a screenshot from a mission builder itself with some sliders.
I'd love to have more control over the values so I can experiment with them easisly.
Madfish
04-28-2012, 02:49 PM
One more suggestion: would it be possible to set individual planes to higher levels?
For example:
Make low settings set the planes to: 1. low 2. low 3. low 4. med 5 med. 6. high
medium setting so that planes are: 1. low 2. med 3. med 4. med 5 med. 6. high
High setting could then be like this: 1. low 2. med 3. high 4. high 5 high 6. high
This could turn out to feel more "realistic" as certain individual planes would stand out and could require actions taken against them. E.g. a quick kill rookie amongst aces or an ace amongst rookies.
Not sure if that makes sense :D
von Pilsner
04-28-2012, 08:57 PM
I'd love if the backups would go straight into a subfolder without messing with the extension (as some people may still use the option to not show file extensions).
That is a great idea - I will make the appropriate change!
As for the command line tool I'm okay with it. You might want to get input from others though if they are okay with the amount of help available to use it correctly.
I was wondering about that myself, I am not good at GUI design and implimentation....
Generally I'd love to see a launcher that let's you adjust the values before applying them.
For full control of each setting you must open the mission up in the full mission builder and adjust the individual sliders there...
Open the mission in the mission builder and do this: http://bobgamehub.blogspot.com/2012/03/ai-settings-in-cliffs-of-dover.html :D
EDIT: As of version 0.2 you can open aiconf.ini and adjust the individual AI values there and the program will use your values and not mine... ;)
One more suggestion: would it be possible to set individual planes to higher levels?
I think I understand, it depends on the original mission, if the pilots in the flight have different skill levels they will be converted automatically.
Class Aircraft.SpitfireMkIIa
...
Skill0 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7
Skill1 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
Skill2 0 0 0 0 0 0 0 0
Skill3 1 1 1 1 1 1 1 1
Skill4 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7
Skill5 0.7 0.5 0.5 1 1 0.8 0.5 0.5
Skill6 0 0 0 0 0 0 0 0
the skills will be adjusted to:
Skill0 0.73 0.21 0.92 0.85 0.74 1 0.95 0.63
Skill1 0.32 0.21 0.87 0.75 0.74 0.95 0.90 0.53
Skill2 0.30 0.21 0.78 0.70 0.64 0.85 0.85 0.43
Skill3 0.93 0.21 0.96 0.95 0.84 1 1 0.63
Skill4 0.73 0.21 0.92 0.85 0.74 1 0.95 0.63
Skill5 0.7 0.5 0.5 1 1 0.8 0.5 0.5 (Notice that this one does NOT get converted)
Skill6 0.30 0.21 0.78 0.70 0.64 0.85 0.85 0.43
So if the mission designer wanted 1 ace in the flight and 2 rookies you will still end up with 1 ace and 2 rookies. :D
Thanks for the suggestions, Madfish! I work all weekend, but early this week I will make some changes.
von Pilsner
04-30-2012, 05:16 AM
I was notified via PM that the formatting of the mission file may be losing the carriage returns after editing, I use notepad++ and it must be hiding that from me.... :D
I updated it to version 0.2: I added 'aiconf.ini' file so that AI can be hand edited to allow more customization and fixed the carriage return issue.
HessleReich
05-01-2012, 10:03 AM
This a really nice tool, thanks for the hard work.
Tried this on the JG26 campaign, and omg the fighters attacked AND didnt defy gravity.
the_soupdragon
05-05-2012, 05:34 PM
Sound cool. But how do I know what directory to point the deamon at? and how do I know if the program is working? Do i get any feedback in the deamon window?
Sorry if these questions are a bit silly but I need to know :)
Cheers
SD
von Pilsner
05-05-2012, 09:04 PM
Sound cool. But how do I know what directory to point the deamon at? and how do I know if the program is working? Do i get any feedback in the deamon window?
Sorry if these questions are a bit silly but I need to know :)
Cheers
SD
Remember, DCEMon is just for use with IL2DCE (dynamic campaign), otherwise try AITweak.:D
On Win 7 look for: C:\Users\<your user name>\Documents\1C SoftClub\il-2 sturmovik cliffs of dover\mission\IL2DCE
For XP I believe it is: C:\Users\<your user name>\My Documents\1C SoftClub\il-2 sturmovik cliffs of dover\mission\IL2DCE
The monitor shows the directory it is monitoring in green
http://bs.beckament.net/files_pub/FlightSim/IL2CloD/dcemon.png
and when it is working you will see a bit of text scroll by:
http://bs.beckament.net/files_pub/FlightSim/IL2CloD/dcemon-working.png
To test DCEMon, start the monitor and drop a file into the target directory and you should see some scrolling text. :D
To test AITweak copy some missions to the AITweak directory and run 'AIProcess.bat'.
the_soupdragon
05-06-2012, 08:45 AM
Thanks for the reply but I am still a bit confused (it doesn't take much :) )
So I have to copy the il2DCE missions into the DCEmon target folder? ........................OK I just did that and got some feedback in the DCEmon window, but, what do I do now? Do I have to copy the files back into the original DCE folder?
Sorry to sound a bit dense but I am just a little confused.
SD
von Pilsner
05-06-2012, 10:35 AM
Thanks for the reply but I am still a bit confused (it doesn't take much :) )
So I have to copy the il2DCE missions into the DCEmon target folder? ........................OK I just did that and got some feedback in the DCEmon window, but, what do I do now? Do I have to copy the files back into the original DCE folder?
Sorry to sound a bit dense but I am just a little confused.
SD
If you are using DCEMon and IL2DCE, you don't have to move the mission files... DCEMon should monitor your campaign directory. When IL2DCE generates a new campaign mission DCEMon will automatically modify it. Since you will be in-game at the time you wo'nt know unless you tab out (once) to see if you get the output.
To check you can open a mission in notepad if the skill lines are 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 then it has not been modified.
If you are not using IL2DCE then you do need to copy mission files to the AITweak directory, run AIProcess and then copy them back.
If you have any more problems (or suggestions), just let me know :D
pupo162
05-06-2012, 12:21 PM
thank yo ufor correcting the issue.
great costumer feedback, :grin:
ATAG_Septic
05-14-2012, 02:18 PM
I really appreciate your sharing AITweak with us Von Pilsner, a very generous contribution.
Thanks,
Septic.
bolox
05-14-2012, 03:14 PM
I know many of you are experimenting and fine-tuning these values and I would appreciate more feedback (preferably in this thread: http://forum.1cpublishing.eu/showthread.php?t=31573) on what values to tweak in what circumstances (bomber, fighter, etc...). Perhaps we (the CloD community) can find some good AI values and get Luthier and Co. to incorporate these into the full mission builder... This would require a slight modification to the FMB as it would need to define the values differently based on plane type. I know this is not difficult to do in C++ so I imagine they could do it to their code base in hours (not days - but we need to wait and see what the AI improvements bring as they may already have solved many AI issues in the next few months and if not we want to supply them the best settings we can come up with).
An other problem is that the mission builder will (by default) set the whole flight to 1 skill level so they all behave similarly... When building a mission I suggest setting the planes to individual skill settings rather than make the whole flight one skill level this leads to some variation in AI and if you use the default skill attribute settings (rookie, average, etc...) you can still use AITweak on your mission to tweak the values for you.
Ok, here's my findings on AI levels. These are very empiric, and they seem to show some interaction between levels (and also some other parameters such as fuel level) which makes 'ideal' settings a bit of a problem.
Let's start with my understanding of each skill level:-
Basic flying- pretty self explanatory
Advanced flying- I think it is a mistake to think of this as purely stopping the rolling behaviour, it seems to affect other things aswell, such as ability to control ac at high speeds. Turning this down to 'realistic' levels for rolling does seem to increase 'lawndarting' by AI. Rolling also seems to be associated with the unrealistic deployment of flaps
Gunnery- again self explanatory
Awareness/visibility- these 2 seem slightly interlinked but at the moment i'm working on the basis of visibility = offensive vision and awareness is defensive/situational awareness
Tactics- this seems to alter the amount of 'vertical' in attacking manouevers
Bravery- This seems to control the 'aggression'/ stupidity but seems to combine with Tactics, and also discipline on breaking away from an enemy attack and reengaging. On breaking away from an attack there almost appears to be a clock running before deciding to get back in the fight
Discipline- this to me seems to be very related to fuel level and when AI decides to 'cut and run' . It appears something like a store of 'courage' which is depleted by fuel levels and also the number of times an enemy gets into an attacking position (for fighters) so it has quite a big effect. Damage also obviously has a big impact here.
Also, there is the 'once they've decided to bug out' AI is then stuck in dumb mode 'feature'
The above applies to fighters/fighter bombers.
Bombers can be 'interesting'
gunnery affects both aimed guns and bomb dropping accuracy .
As for the rest the differences in behaviour seem less than for fighters,
So that's my observations, I hope others will add theirs.
From this i'd say it's hard to give ideal settings as several of them are very dependent on what the mission is. Discipline's relation with fuel level being the most prominent.
I'm also very much into variations in individual skills- the more the better:-P
von Pilsner
05-14-2012, 08:28 PM
Nice info bolox! Very helpful.
vBulletin® v3.8.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.