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

Reply
 
Thread Tools Display Modes
Old 10-27-10, 04:17 PM   #1
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Josef von Posorschitz View Post
That sounds interesting!
I've taken the idea above to a (possible) whole new level I'm coding it now and if it works it will be a quantum leap for IRAI

I'm coding in watch rotations and fatigue for the ship AI.

Here's the idea:

A watch rotation shift will be defined in \data\Scripts\AI\init.aix that lets you define the ship's watch rotation (in minutes). At some random time between 0.25 and 0.75 of that defined watch rotation fatigue will set in. Fatigue will reduce each AI sensor's sensor effectiveness some random amount. i.e.:

ShipWatchRotation = 4; # in hours
ShipFatigueMin = 0.25; # min time of ShipWatchRotation when fatigue starts
ShipFatigueMax = 0.75; # max time of ShipWatchRotation when fatigue starts
ShipFatigueSensorReductionMin = 0.0; # min sensor reduction amount for fatigue
ShipFatigueSensorReductionMax = 0.1; # max sensor reduction amount for fatigue

the formula for calculating when fatigue sets in is:

fatiguetime = ShipWatchRotation * Random(ShipFatigueMin, ShipFatigueMax)

the formula for calculating fatigue sensor reduction is:

(sensor base value * sensor difficulty level) - Random(ShipFatigueSensorReductionMin, ShipFatigueSensorReductionMax)

then the next 'watch rotation' starts at:

ShipWatchRotation - fatiguetime


If this works (cross your fingers!) then this will add a whole new dynamic to the ship AI.

The thing to realize is EACH ship will act differently as they each get a copy of this file in game

Last edited by TheDarkWraith; 10-27-10 at 04:41 PM.
TheDarkWraith is offline   Reply With Quote
Old 10-27-10, 04:41 PM   #2
Zedi
Sea Lord
 
Join Date: Mar 2010
Posts: 1,845
Downloads: 184
Uploads: 2
Default

Quote:
Originally Posted by TheDarkWraith View Post
...
If this works (cross your fingers!) then this will add a whole new dynamic to the ship AI.
...
I do on booth hand. This can finally level up the quality of SH5 and make it way better than any of the previous versions. Yey!
Zedi is offline   Reply With Quote
Old 10-27-10, 04:58 PM   #3
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

It works

but the change in the sensors is very abrupt (expected) when fatigue set in. So now I'm going to try and make fatigue be a gradual thing. Fatigue will cause the sensor effectiveness to start decreasing from start of watch to end of watch. When new watch crew comes on sensor effeciveness goes back to base value * difficulty level and starts decreasing with time again. This may not be possible to do...Coding and testing change now....

Last edited by TheDarkWraith; 10-27-10 at 05:10 PM.
TheDarkWraith is offline   Reply With Quote
Old 10-27-10, 05:19 PM   #4
[501]Otto
Commander
 
Join Date: Jul 2010
Location: Spain
Posts: 452
Downloads: 87
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
It works

but the change in the sensors is very abrupt (expected) when fatigue set in. So now I'm going to make fatigue be a gradual thing. Fatigue will cause the sensor effectiveness to start decreasing from start of watch to end of watch. When new watch crew comes on sensor effeciveness goes back to base value * difficulty level and starts decreasing with time again. Coding and testing change now....
Great news Will make it much more real.
BTW, don´t know if this has something to do with this mod, but is it possible to limit the number of depth charges that each destructor has to a fixed number? I mean, sometimes those DD´s hunt you for hours and they seem to have millions of depth charges, they never end... Maybe it is just me feeling the combat stress , but I just feel amazed of the quantity of ammunition that those dammed escorts can throw to you
[501]Otto is offline   Reply With Quote
Old 10-27-10, 05:37 PM   #5
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

well, as I thought, there's no way to implement a gradual sensor effectiveness decrease

So I'll implement a stepped decrease over 4 time periods (4 tiers of fatigue). The time periods will be random based on ShipWatchRotation / 4. Each time period (tier) will decrease the sensor effectiveness some random amount. This also makes the watch rotation a random period of time which is good (now when the current watch finishes the 4th tier of fatigue they're too tired to continue their watch duties so a new watch team will step in) Coding and testing now....
TheDarkWraith is offline   Reply With Quote
Old 10-27-10, 06:20 PM   #6
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

4 tiers of fatigue works like a charm along with watch crew rotations

Now this is awesome....simply awesome. The dynamics of it are just amazing.

I'm making 4 levels of fatigue reduction:
- cruise
- alert
- damaged
- damaged alert

In cruise fatigue will set in very slow rate. In alert fatigue will set in medium rate. In damaged fatigue will set in fast rate. In damaged alert fatigue will set in very fast rate. This way if you damage a ship it will fatigue faster and thus after time it will be easier for you to either sneak up on it or get away from it (until the next watch crew comes on).

NOTE: everytime the ship AI changes state (alert, cruise, damaged, etc.) a new watch crew will take watch (thus no fatigue at start)

Also to note is that each sensor fatigues on it's own. All the ship's sensors don't fatigue the same amount each tier interval - they fatigue their own random amount. Couple that with each ship fatigues totally different from each other ship and it's truely dynamic

Last edited by TheDarkWraith; 10-27-10 at 07:12 PM.
TheDarkWraith is offline   Reply With Quote
Old 10-27-10, 08:32 PM   #7
SashaKA001
中国水兵
 
Join Date: Mar 2010
Location: 47°46′46″N, 37°14′51″E
Posts: 271
Downloads: 231
Uploads: 0
Default

Quote:
Originally Posted by [501]Otto View Post
Great news Will make it much more real.
BTW, don´t know if this has something to do with this mod, but is it possible to limit the number of depth charges that each destructor has to a fixed number? I mean, sometimes those DD´s hunt you for hours and they seem to have millions of depth charges, they never end... Maybe it is just me feeling the combat stress , but I just feel amazed of the quantity of ammunition that those dammed escorts can throw to you
No, they have a limit. Within 4 hours they fell and I was bombarded by depth charges, my depth of 127 meters from the start was 8 or 10 destroyers, then 5, then there were 3, and then they were gone, so they have a limit of depth charges.
And I was not injured.



SashaKA001 is offline   Reply With Quote
Old 10-27-10, 11:08 PM   #8
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

v0.0.28 is working good. Will probably need some tweaking of the new values added for the watch crews and fatigue. We'll see how you all like it when I release it (here shortly).

Now I need to explain some things about the new additions for the ship AI:

there is a base watch crew time (in minutes) for each ship:
ShipWatchRotation = 180;

every ship starts with crew with no fatigue. It then determines the time before the first fatigue level by:

intervalTimeCP = (ShipWatchRotation + Ship:Random( -( ShipWatchRotation * 0.25 ), ShipWatchRotation * 0.25 ) ) / 4.0;

this says take the 180 and add a random value somewhere between -25% and +25% of 180 to it and then divide the result by 4. This gives the time before the 1st fatigue level

every ship then determines it's own fatigue levels (4 of them). Each fatigue level determines it's time by:
intervalTimeCP = (ShipWatchRotation + Ship:Random( -( ShipWatchRotation * 0.25 ), ShipWatchRotation * 0.25 ) ) / 4.0;

this says take the 180 and add a random value somewhere between -25% and +25% of 180 to it and then divide the result by 4. This gives the fatigue level time. This repeats 3 more times

after the 4th fatigue level the watch crew is relieved by a 'fresh' watch crew with no fatigue.

Now as each fatigue level is attained, each sensor of the ship will degrade in performance some random amount (simulating fatigue). Each sensor degrades it's own random amount.

All of this makes for a truly random ship AI. You can be stalking a ship thinking you're at safe distance only to find that it changes watch crew and now you're detected! The vice versa is also true: you might be hunted by an escort and over time as fatigue sets in it may 'lose' contact with you allowing you to escape.

Everytime the ship changes state (cruise, alert, damaged, etc.) the watch crew is relieved by a fresh crew with no fatigue.

I'll have v0.0.28 available for download here very shortly
TheDarkWraith is offline   Reply With Quote
Old 10-27-10, 11:38 PM   #9
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

v0.0.28 released. See post #1 for details

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

Last edited by TheDarkWraith; 10-28-10 at 12:04 AM.
TheDarkWraith is offline   Reply With Quote
Old 10-28-10, 02:29 AM   #10
flymar
Loader
 
Join Date: May 2007
Posts: 86
Downloads: 42
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
Everytime the ship changes state (cruise, alert, damaged, etc.) the watch crew is relieved by a fresh crew with no fatigue.
What is the rate of the status change? I'm curious if the ship cen get cruise-->alert-->damage-->alert-->cruise path like in 5 minutes. I don't know if resetting fatigues in such situation is right.
flymar is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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 09:10 AM.


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