![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
|
10-27-10, 04:17 PM
|
#1 |
|
Black Magic
![]() |
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. |
|
|
10-27-10, 04:41 PM
|
#2 |
|
Sea Lord
![]() Join Date: Mar 2010
Posts: 1,845
Downloads: 184
Uploads: 2
|
|
|
|
10-27-10, 04:58 PM
|
#3 |
|
Black Magic
![]() |
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. |
|
|
10-27-10, 05:19 PM
|
#4 | |
|
Commander
![]() Join Date: Jul 2010
Location: Spain
Posts: 452
Downloads: 87
Uploads: 0
|
Quote:
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 |
|
|
|
10-27-10, 05:37 PM
|
#5 |
|
Black Magic
![]() |
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....
|
|
|
10-27-10, 06:20 PM
|
#6 |
|
Black Magic
![]() |
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. |
|
|
10-27-10, 08:32 PM
|
#7 | |
|
中国水兵
![]() Join Date: Mar 2010
Location: 47°46′46″N, 37°14′51″E
Posts: 271
Downloads: 231
Uploads: 0
|
Quote:
And I was not injured. ![]() ![]() ![]() ![]() ![]()
|
|
|
|
10-27-10, 11:08 PM
|
#8 |
|
Black Magic
![]() |
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
|
|
|
10-27-10, 11:38 PM
|
#9 |
|
Black Magic
![]() |
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. |
|
|
10-28-10, 02:29 AM
|
#10 |
|
Loader
![]() Join Date: May 2007
Posts: 86
Downloads: 42
Uploads: 0
|
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.
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
