SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 07-05-10, 04:33 PM   #1
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default [WIP] IRAI (Intelligent Random AI)

New version! v0.0.41

Intelligent Random AI (IRAI) for SH5 by TheDarkWraith
version 0.0.41

YOU HAVE TO BE PATCHED TO v1.2 OF THE GAME!!!

COPYRIGHT NOTICE:
The changes made to the .aix, .dat, .sim, .val, .zon, and .dsd files are the intellectual property of TheDarkWraith and may not be used, modified, or duplicated in whole, or in part, without the express written permission of TheDarkWraith. The changes made to these files may not be used in any commercial application of any form without the express written permission of TheDarkWraith.

This mod will bring new AI behavior to the aiplanes and ships in game. All airplanes have the ability to attack you now. If they have bombs and/or torpedoes then they will come and attack you if you are detected. Once they are out of bombs and/or torpedoes they will return to following their waypoints. Those airplanes that are armed with only a torpedo(es) will do a 'torpedo run' on you to fire their torpedo(es) (close to the water run). Ship's AI is 'smarter' now thanks to more states available and those states having sub-states bases on the crew's AI level (poor, novice, competent, veteran, or elite). The ship's AI has been greatly improved also. I went to great lengths to make anything that could be a random value random. This ensures that the AI's behavior doesn't look like it's scripted at all. Hunter-Killer groups are something to be weary of!!

To install this mod correctly do the following:
Navigate to where you unzipped the mod to and open it up. Select the 'MODS' folder and right click on it. Select copy. Navigate to your '\Ubisoft\Silent Hunter 5\' folder and open it up. Right click in an empty area and select paste. Enable 'IRAI_0_0_41_ByTheDarkWraith' via JSGME (this assumes you setup JSGME to use the 'MODS' folder as default). If you are using Wamphyri's Plane Mod you can also use this mod with it. Install this mod after his plane mod.

NOTE: is this mod perfect? NO WAY. It will continue to evolve as I learn more about the files and the game itself. Does the mod contain any bugs or errors? I hope not but to say it doesn't would be foolish. I will address errors/bugs as users find them and post them in my AIs thread.

NOTE: this mod can be customized by editing the \data\Scripts\AI\init.AIX. I went to great lengths to make it user customizable and for testing different setups/configurations (testing)

There is an add-on mod for no hydrophone on surface. If wanted it has to be installed after the main IRAI mod.

This mod is fully compatible with my UIs mod. You have to install my UIs mod first then install IRAI and then the add-on mod for no hydrophone on surface if you want that. Say yes to all JSGME warnings.

Changelog:
v0.0.1 - first official beta release
v0.0.2 - added new states to crew states AI. Crew now has the following states: in port, in port alert, in port damage control, in port alert damage control, cruise, alert, damage control, alert damage control, abandon, and surrender (only for neutrals). Each state (except for abandon and surrender) has a sub-state based on the crew's AI level - poor, novice, competent, veteran, and elite
v0.0.3 - redid the ship's AI. Convoys are deadly now, it is advisable to run and hide when detected by escorts (or single warships for that matter)!
- adjusted values in the sim.cfg and sensors.cfg files
v0.0.4 - tweaked values in sim.cfg file (noise value was raised from 0.26 to 0.33 - so noise has a bigger effect on the escorts ability to 'hear' you)
- fixed bug of escort AI not assigned to ship commander's tactic unresponsive to convoy attacks
- tweaked bombs and DC values to be more effective (deadlier)
- escorts in convoy or lone warships will now attack any target they discover that's an enemy (including airplanes)
- fixed bug of ship commander's current tactic not able to continue. I was not cancelling the tactic if it wasn't able to continue - now it's cancelled when it needs to be cancelled
- current ship commander's tactic is also cancelled when AI no longer detects you and they have 'lost' you
v0.0.5 - adjusted AI visual sensitivity value in sim.cfg
- adjusted AI Radar sensitivity value in sim.cfg
v0.0.6 - fixed bug of CTDs on some ships
- added some new tactics and roles to the ships
v0.0.7 - fixed bug of crew state staying in alert once the ship detects it's first contact
- changed the implementation of some roles
v0.0.8 - added tactics for Hunter-Killer groups
- convoys that have a contact detected less than CONVOY_CONTACT_TAKE_ACTION_DISTANCE will respond to the threat otherwise will ignore it
- added tactics for unknown contacts
- total rewrite of the AI files. I wasn't satisfied with the way the ship's AI was behaving - it appeared scripted. So in the rewrite I made use of the Random function that's available - result is AI doesn't appear scripted anymore! The ship's AI is more random in it's behavior now - borderline unpredictable even
- ship's are only allowed to DC for MAX_CONTACT_LOST_DC_TIME after losing a contact
- changed 'Lost contact time' from 23 to 20 in \data\Cfg\Sim.cfg
v0.0.9 - in Bombs.sim all the entries depth precision were cut in half from 5 to 2.5 (they are more precise now)
- in DC_barrels.sim the DCs depth precision were cut in half from 5 to 2.5 (they are more precise now)
- adjusted values in sim.cfg
- adjusted DC parameters for DCs used in KGun, YGun, DC racks, and air depth charge
v0.0.10 - adjusted airstrike parameters to decrease the number of airstrikes happening (trying to get a balanced value here)
v0.0.11 - fixed timing bugs in Operation Plaster, Operation Plaster Two, Operation HK Plaster, and Operation Plaster Director
- fixed bug of current tactic continually being reset by roles
- partial rewrite of ship tactics .aix file
- adjusted sim.cfg [Sonar] Speed factor to 23 from 28
- added a random delay to the ship's ability to respond to torpedo sighted based on crew ability
v0.0.12 - adjusted AI's visual values in sim.cfg
- made the AI ship speed dependent upon damage incurred
v0.0.13 - adjusted Hydrophone and Sonar values in sim.cfg (made enemy AI better at hydrophone and sonar but also made thermal layer more effective)
- adjusted sub's AI crew visual and hydrophone in sensors.cfg to make them better at those sensors
v0.0.14 - adjusted sub's AI crew visual, hydrophone, radar warning, and DF in sensors.cfg (trying to find good balance)
- adjusted hydrophone and sonar values in sim.cfg (made thermal layer little less effective and waves a little less effective)
- adjusted impulse, range, minEF, maxEF, minradius, and maxradius for all DCs and bombs (made them more effective - sub will rock more if DC explodes near and much more damage if DC explodes close to sub)
- fixed error of incorrect file location of guns_radars_01.zon (was causing all sorts of problems including not letting the event camera work correctly)
- made DC runs more precise (enemy's DC run will be located much closer to your sub if not directly over it)
- fixed bug of ship's instant speed decrease with damage. Ships can now only change speed up to max of 10% of current throttle setting with damage
v0.0.15 - re-wrote the sub AI. It still needs more work done to it but as it now it's WAY better than stock. I guarantee you'll be amazed by it. Currently the sub AI cannot fire cannons and I'm trying to figure out why (they can and will fire torpedoes!)
- included the add-on mod 'Wolpack_mission' by Magnum. It's a single mission that puts you in a wolfpack. It's a great mission to show off the new sub AI.
- adjusted sim.cfg values for sonar and hydrophone to make AI a little easier to evade
v0.0.15.1 - fixed bug of when AI sub destroyed they sat motionless on surface. Now they will sink into the abyss if their damage >= 1.0
v0.0.16 - adjusted sonar cones of ship AI to be 120 degree arc
- adjusted elevations of all sonars to give them a little bit more down elevation
- adjusted ship AI hydrophone to full 360 degree sweep. From 90-135 the sensitivity is 0.85, from 135-157 the sensitivity is 0.7, from 157-169 the sensitivity is 0.55, from 169-191 the sensitivity is 0.3 (to account for propeller noise and engine noise), from 191-203 the sensitivity is 0.55, from 203-225 the sensitivity is 0.7, and from 225 to 270 the sensitivity is 0.85, and from 270-90 the sensitivity is defined by the sim.cfg file (currently 1.0)
- adjust sub crew AI's sweep time from 30 to 5 and sweep arc from 16 to 20 to give faster updates on hydrophone contacts
- adjusted sub crew AI's RPM detection level from 0.25 to 0.075 (crew will be able to detect slow moving contacts now)
- adjusted planes max visual range from 20,000m to 50,000m
- adjusted all depth charges to be slightly less lethal. Their depth precision is now 3.5.
- adjusted the ability of ships to damage themselves from depth charges by changing the minimum depth they are allowed to release DCs
- adjusted AI hydrophone and sonar to be just a little less precise
- adjusted error angle for AI cannons from 4 to 5 degrees
- adjusted Detection time for hydrophone and sonar from 1 second to 3 seconds
v0.0.17 - added the ability to set difficulty level by adjusting values in \data\Scripts\AI\init.aix. There are difficulty level settings for merchants and non-merchants
- fixed bug of merchants being ordered to investigate enemy contacts when they are part of a convoy or a single unit
- added some new tactics to merchants. These new tactics will cause the merchants to use speed and course changes when they have detected you. Say bye bye to high mission tonnage numbers! It will be very difficult to torpedo a merchant that has detected you.
v0.0.18 - changed behavior of the HK group's commander. It now follows the pack when they head off to investigate or attack a contact.
v0.0.19 - fixed bug of hydrophone needle sweeping too fast
- wrote more tactics for ship AI, partial rewrite of ship AI also, redid sub AI
- gave convoys with merchants the ability to slow down and change direction when they have a contact sighted
- HK groups have been improved in their tactics
v0.0.20 - changed behavior of merchant convoy. Now the convoy leader will look to see where the contact is in relation to it's current heading and turn away from it some random value (this fixes the bug of the merchant convoy sometimes turning towards the contact)
- HK groups now assign a convoy leader
- changed HK group tactics
- removed director from non-HK groups
- added director to HK groups
- fixed bug of carriers and battleships swarming over the contact. They now continue following waypoints
- fixed bug of leader not being correctly chosen on some tactics if they had escorts and battleships available. Now the game will look to see which one is the commander and assign it as the leader
- fixed bug of single merchants being able to turn into the contact. Now they will turn away from the contact some random amount added to their current heading
- gave airplanes in early war years at least one bomb if they had the capability to carry a bomb. Those that had the capability to carry a torpedo have a torpedo now also in the early war years
v0.0.21 - fixed many logic error bugs found in last version and version before
- fixed bug of ability to fire cannons tied to ability to DC
- gave merchants who are leaders of convoys tactics
- fixed bug of HK convoy leaders unable to 'lead' convoy
- added ship tactics for air contacts
- added add-on mod for no hydrophone on surface
v0.0.22 - more bug fixing in ship's tactics
- fixed bug of escorts coming to all stop when they are assigned the role of guard convoy and they have a contact spotted
- fixed bug of merchant leading convoy with contact detected and loses contact it immediately starts following waypoints. Now it waits some period of time before switching back to following waypoints (in that period of time it will continue to evade by changing speed and course)
- gave the leader of a convoy that is not a merchant a specified time that it is allowed to use evade tactics (course and speed changes) when it has 'lost' it's contact
- found a solution to the 'kill the convoy leader bug' present in the game
- updated single ship tactics
- adjusted depth that ships are allowed to use DC racks from -12.0 to -10.5
v0.0.23 - adjusted the maximum number of escorts allowed to be assigned to Guard Convoy to 1
- added a new role to the tactics - Protect Convoy. Protect Convoy is different from Guard convoy in that the escort is allowed to break convoy formation and pursue a contact if it is less than an assigned distance. If greater than this assigned distance then the escort will rejoin the convoy ranks and follow the convoy leader
- adjusted visual, radar, hydrophone, and sonar detection times to 1.5
- adjusted radar, hydrophone, and sonar min signal strength to 0.125
- adjusted hydrophone and sonar thermal layer singal atten to 1.4
- adjusted hydrophone noise factor to 0.30
v0.0.24 - fixed bug of non-air unknown contacts not being able to be DC'd
- fixed bug of ship's having instant speed decrease when switching to abandon ship state
- allowed escorts to use full throttle longer while chasing down contact
- adjusted max time allowed to DC after contact lost to 3.0 minutes
v0.0.25 - fixed bug of commander not setting tactic for non-air unknown contacts if contact is 'lost'
- minimum contact depth to be able to fire DC racks adjusted to -8.5m
- minimum escort speed to fire DC racks adjusted to 3.0 knots
- escort's hedge hogs and DC Throwers can be used on a sub contact at any depth now
- HK Director distance from contact adjusted to 750m
- DC run speed adjusted to 0.8 of max escort speed
- rewrote tactics for single units
v0.0.26 - removed distance restriction for determining action/no-action of tactics (HK groups and non-HK groups)
- The commander's damage is checked and if it exceeds a preset value the current tactic is exited (this allows all units to act as independent units)
- HK groups now get a maximum of 2 escorts assigned the role of guard convoy
- non-HK groups now get a maximum of 4 escorts assigned the role of guard convoy
- In Operation HK Plaster the convoy leader now follows/circles the contact at a defined distance instead of running away
- revised surfaced contact spotted tactics
- revised non-air unknown contact spotted tactics
- fixed bug of convoys sometimes coming to all stop after losing a contact
- tweaked the sim.cfg file settings for hydrophone, sonar, visual, and radar
- fixed bugs found during reviewing all the tactics (typos)
v0.0.27 - adjusted \data\cfg\Sensors.cfg
- adjusted \data\Library\sensorvisualsub.sim
- revised the UBoot_Sensors.sim file
v0.0.28 - added watch crews and fatigue to the ship AI
v0.0.29 - rewrote ship unknown tactics
- changed ship tactics for subs. The ship AI used to differentiate between a sub contact as surfaced (investigate) or submerged (plaster aka DC). They now just treat a sub contact as a sub contact (plaster aka DC)
v0.0.30 - fixed problems found with warship's fatigue model
- added better randomness to the ship's sensors
- made noise a larger factor in ship AI. Adjusted some other entries in sim.cfg to make it a little easier to evade escorts/warships
- appears I have finally fixed the 'kill the leader bug' once and for all! Even if the leader kill himself by running into another ship or something someone else takes over!!
v0.0.31 - changed visual sensor for player from 0.5 to 0.3
v0.0.32 - never released
v0.0.33 - rewrote sub AI (subs are not so 'fragile' anymore and they are very good at finding and destroying contacts) - still haven't been able to get them to fire guns
- rewrote ship AI (ship AI no longer has pinpoint accuracy of submerged contacts)
- difficulty settings are now in range 0.0-1.0 vice 0-100
v0.0.34 - reduced memory requirements by removing entries from init.aix file (a copy of this file is given to every unit in game!)
- reduced memory requirements and cpu usage by optimizing code
- have the starshells working for the ship AI. The current implementation by the devs is flawed. There will be limited starshell activity in this version. I'll fix the implementation in next version
- ship AI will now shoot at submerged contacts (this is NOT using Rongel's method either!)
- fixed some bugs found in some of the operations (mainly dealing with operation plaster)
- speed restrictions based on crew ability removed. Now just a calculated speed restriction based on damage to the ship is used (no more outrunning the escort - only if it's badly damaged will you be able to do this)
- some roles and ops removed due to changes from v33
- fixed incorrect sim.cfg file contained in mod (wrong one in v33)
- docked ships will be more 'alive' when they are in alert status
- docked ships now have hydro capability
- changed hedgehogs fall speed from 7.3 to 4.5
- changed hedgehogs weapon range from 172 to 500
- changed hedgehogs weapon diameter from 61 to 45
v0.0.35 - made changes to sim.cfg to make it a little easier for AI to detect you
- enemy is allowed to search for contact longer
- operation plaster now has ability to ram contact if close enough to the surface
- HK leader now has ability to ram contact if close enough to the surface
- corrected bug where if leader was unable to follow waypoints it could possibly come to all stop (and the rest of the ships in group come to all stop also)
- more optimizations done
- changed how AI subs can fire guns at submerged contacts. If they spot you visually or they spot you on sonar (not hydro!) and you are <= 20m depth and within 8000m they will open fire
- rewrote sub AI so they don't get slaughtered by ship gunfire (they minimize exposure to it)
- corrected bug where if single unit was unable to follow waypoints it could come to all stop
- changed hedgehogs fall speed to 6.5
- changed hedgehogs launcher to max range of 200, diameter to 70
- fixed bug of when torpedo detected a unit could come to all stop vice trying to avoid torpedo
- Airplanes now hang around if they have cannons available and will not resume waypoints until your sub has submerged or it runs out of ammo. Also if a plane has no bombs and no torpedoes but it has cannons then it will come and investigate you (in previous versions it would just keep following waypoints)
- Airplanes (excluding torpedo bombers) now change altitudes as they are coming to investigate you, drop bombs on you, or shell you to death. This is something I've been trying to do for many months!
- When an airplane initially spots a contact it will drop down close to the water surface for it's initial run. If it's a torpedo bomber then it will stay close to the water until it delivers it's torpedo. If it's a bomber or a plane that has no bombs or torpedoes then it will pop up and make it's 'bomb run' at 3000m from the contact. This makes for a very nasty surprise because you have little to no warning that an airplane is tracking you!
v0.0.36 - fixed bugs found in code that could stop units from searching for a contact (found these bugs while testing in scapa flow)
- HK director now has ability to ram contact if it's surfaced
- fixed bug of leader sometimes not cancelling tactic and roles setup for ships in group
v0.0.37 - removed ability of HK leader to ram contact if near surface
- game is unreliable in reporting depth of contact. It varies from ship to ship, class to class, thus I have changed the depth the mod considers a contact submerged to -4m
- changed enemy visual fog factor from 0.9 to 0.875 as per Sober's recommendation
v0.0.38 - never released
v0.0.39 - added new tactics to airplanes. Airplanes now can change heading and altitude while attacking. Airplanes will also call off the fight if they incur too much damage. If damage is too great to an airplane they will kamikaze.
v0.0.40 - removed the ability of ships to fire starshells due to severe game bug that causes them not to fire guns that have fired starshells
v0.0.41 - removed kamikaze tactics for airplanes added by v0.0.39 and revised some of the airplane tactics. Added support for Generic Patcher's Air-To-Air combat patch so aircraft can target and engage other aircraft. Changed how subs handle unknown contacts. Changed damage amount to subs before they are forced to follow waypoints.

TheDarkWraith


v0.0.41 available here: https://www.mediafire.com/?0sg49j5mlwi49gi

NOTE: because of the new features of fatigue and crew watch rotations for the ship AI it is recommended to leave all the difficulty levels at 1.0
NOTE2: DO NOT USE RONGEL'S SHOOT AT PERISCOPE MOD WITH THIS MOD! ENEMIES WILL SHOOT AT SUBMERGED CONTACTS WITH THIS MOD!


If you are using my Ship's Inertia mod then you'll want to update IRAI with this: http://www.mediafire.com/?r6mxk65jaxmb9fu
This will allow the maximum speed of the unit to be dictated by damage incurred. Enabling this without my Ship's interia mod installed will cause the ship's to instantly slow down when they are damaged.


NOTE: to see the new sub AI in action (in a wolfpack nonetheless) start the included single mission 'Wolfpacks!'. When the mission starts go to ahead flank (you are already heading in the direction as the wolfpack). When the wolf pack detects the 'contact' they will turn to the SW. Follow them. Once you are within ~9000m of the 'contact' go to allstop. Go to external cam and go to the lead sub and follow it. Sit back and enjoy the show


video of airplane making torpedo run on sub:
http://www.filefront.com/17645967/AI...o-Bombers.avi/

Last edited by TheDarkWraith; 02-16-14 at 03:37 PM.
TheDarkWraith is offline   Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 06:25 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.