SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SH5 Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=249)
-   -   [WIP] IRAI (Intelligent Random AI) (https://www.subsim.com/radioroom/showthread.php?t=171973)

TheDarkWraith 08-15-10 08:27 AM

Quote:

Originally Posted by 303_Michcich (Post 1468422)
fantastic- thanks ! will test it asap. this refers to ship ai difficulty and NOT the escorts, right ?

Sorry, just downloaded 0.16 again, but difficulty settings seem not implemented yet ?

correct. They are in v0.0.17 which I'm just getting ready to finish up.

These difficult settings apply to ALL ships. Hmm, but now you make me think about it maybe I can differentiate between different classes of vessels :hmmm:

TheDarkWraith 08-15-10 08:32 AM

Quote:

Originally Posted by 303_Michcich (Post 1468394)
TDW, sorry to be a pest, but... :) I have tested the manual tutorial mission by emtguf contained in the thread quoted above - there is single ship in distance of 4,000 m going towards my sub - I dived to persicope depth, all stop, no scopes and....the ship starts zigazagin at about 3,000 m from my sub - why is that ? they can`t see me, can they ? they can`t hear me as it`s all stop !

P.S. weather conditions in this mission are perfect, mid-day, sunny, all clear...

the reason the ship starts zig zagging is because you were spotted within the first 5 seconds of loading up that mission. Look at the grey shaded area on the TAI map.....you're in his visual 'zone' and thus you were detected. If a ship detects you it's not allowed to start zig-zagging until the distance between itself and the contact is < 3000m and it will stop zig-zagging when distance is >= 3000m. If you want to use that single mission then you need to adjust it so that you start submerged or wait till v0.0.17 releases and change the visual difficulty.
That single mission exposed a bug in my ship AI. I noticed that the merchant ship was being told to come and investigate the sub...:nope:...if anything it should be running away. Have to fix this.

PL_Andrev 08-15-10 08:44 AM

Quote:

Originally Posted by Antar (Post 1468359)
Stock bug spotted (tested no mods/IRAI):
On some escort ships hydro is not working (I attacked this convoy at full submerged speed (historic mission/Pedestal)
1.
Escorts on convoy with no hydro, other task force escorts have it:
http://img227.imageshack.us/img227/6960/hydro1.png

Hmmm.. strange...
Tested with IRAI.16 - I dive to 150 to protect from active sonar, but they hunted me... It looks like passive sonar is not show correctly...
:hmmm:

After start new Pedestal mission with IRAI.16...
1. Supply convoy with escort ships without passive sonar (used full speed at periscope depth very close to DD and they do not listen me).
2. After surfacing they are alarmed and start to hunt me,
3. They work as with worked passive sonar (but not shown on the map)
________________
Mods used to tests:
- Removed intro
- Environmnt 3.0
- AilSmoke 1.7
- GWX Compass Rose Grid
- IRAI 0.16
- Sober's hydrophone fix

303_Michcich 08-15-10 09:15 AM

Quote:

Originally Posted by TheDarkWraith (Post 1468427)
correct. They are in v0.0.17 which I'm just getting ready to finish up.

These difficult settings apply to ALL ships. Hmm, but now you make me think about it maybe I can differentiate between different classes of vessels :hmmm:


Great, thanks TDW ! that would be good idea - I think ships themselves should be relatively easy prey (no sensor, hydrophone ability - just some sort of visual, but one that allows to get close to them at night) plus cracking escorts to avenge - that would make the `das boot` experience...:)

303_Michcich 08-15-10 09:16 AM

Quote:

Originally Posted by TheDarkWraith (Post 1468432)
the reason the ship starts zig zagging is because you were spotted within the first 5 seconds of loading up that mission. Look at the grey shaded area on the TAI map.....you're in his visual 'zone' and thus you were detected. If a ship detects you it's not allowed to start zig-zagging until the distance between itself and the contact is < 3000m and it will stop zig-zagging when distance is >= 3000m. If you want to use that single mission then you need to adjust it so that you start submerged or wait till v0.0.17 releases and change the visual difficulty.
That single mission exposed a bug in my ship AI. I noticed that the merchant ship was being told to come and investigate the sub...:nope:...if anything it should be running away. Have to fix this.

thanks again

TheDarkWraith 08-15-10 10:06 AM

well I bet your tonnage goes WAY down with v0.0.17. Due to the bug I discovered a few posts above I investigated my code. I found the problem and corrected it AND I added some new tactics to the merchants.

Let's look what used to happen (prior to v0.0.17):

merchant is steaming along, constant speed, following waypoints. You are ~2000m out from it and the merchant detects you. Merchant starts zig-zag pattern and goes to ahead flank speed. He continues this zig-zag pattern at ahead flank until he's in the safe zone distance. Boring :zzz:

now v0.0.17:

merchant is steaming along, constant speed, following waypoints. You are ~2000m out from it and the merchant detects you. If in zone 1 distance then it starts zig-zag pattern and changes speed to some random value. It waits some random period of time and then changes speed again. Process keeps repeating until it reaches zone 2 distance. If in zone 2 distance it chooses a new heading based on it's current heading + some random value AND chooses a new random speed. It waits some random period of time and then repeats the course and speed change. It keeps repeating this process until it reaches zones 3 distance. Once it gets to zone 3 distance (it's safe distance from you) it reverts back to following waypoints. Now that's exciting :D

tonschk 08-15-10 10:19 AM

:DL Thank you TheDarkWraith :salute: , waiting for v0.0.17 :up:

SteelViking 08-15-10 10:20 AM

For a single merchant, that sounds great! But, what about when they are in a convoy, will all of the merchants choose a random heading? That would cause the convoy to break up.

TheDarkWraith 08-15-10 10:24 AM

Quote:

Originally Posted by SteelViking (Post 1468487)
For a single merchant, that sounds great! But, what about when they are in a convoy, will all of the merchants choose a random heading? That would cause the convoy to break up.

no worries...convoys will still act the way they did. This applies to only single merchant (or to be more correct a merchant that is it's own Commander)

SteelViking 08-15-10 10:39 AM

Quote:

Originally Posted by TheDarkWraith (Post 1468490)
no worries...convoys will still act the way they did. This applies to only single merchant (or to be more correct a merchant that is it's own Commander)

Ah, ok cool.:yeah:

TheDarkWraith 08-15-10 10:51 AM

Quote:

Originally Posted by SteelViking (Post 1468499)
Ah, ok cool.:yeah:

Yeah I thought about that too but found a way to make them behave like a convoy still when they are part of one :D

Merchants now have their own difficulty settings also:

###################### Difficulty parameters ####################
# Note: difficulty is in range 0.0 - 1.0 with 0.0 being no difficulty (sensor doesn't exist)
# for non-merchants
VISUAL_DIFFICULTY = 1.0;
HYDROPHONE_DIFFICULTY = 1.0;
RADAR_DIFFICULTY = 1.0;
SONAR_DIFFICULTY = 1.0;
# for merchants
VISUAL_DIFFICULTY_MERCHANT = 1.0;
HYDROPHONE_DIFFICULTY_MERCHANT = 1.0;
RADAR_DIFFICULTY_MERCHANT = 1.0;
SONAR_DIFFICULTY_MERCHANT = 1.0;


I gave you the ability to change the difficulty of the new merchant behavior in v0.0.17. These values can be found in \data\Scripts\AI\init.aix. The new parameters added to control the single merchant's behavior in v0.0.17 are:
the below says that the merchant will start the familiar zig zag pattern when it detects you and you are <= 3000m (NOTE: this value is used in convoys also!)
MERCHANT_ZIGZAG_CONTACT_DISTANCE = 3000.0;
the below says that the merchant will go back to following it's waypoints when it's distance from you is >= 6000m
MERCHANT_CONTACT_DETECTED_WAYPOINTS_DISTANCE = 6000.0
the below is the base value of time for couse and speed changes. This value is also part of a Random function as the -min and max value of it. Value of Random function is added to base for final time (in minutes)
MERCHANT_CONTACT_DETECTED_COURSE_SPEED_CHANGE_TIME = 2.0
the below is the -min and max values of a Random function for determing the offset from current course for new course
MERCHANT_CONTACT_DETECTED_COURSE_CHANGE = 12.0
the below is the min value of a Random function for the speed change
MERCHANT_CONTACT_DETECTED_SPEED_CHANGE_MIN = 0.25
the below is the max value of the Random function above for the speed change
MERCHANT_CONTACT_DETECTED_SPEED_CHANGE_MAX = 1.0

need a few volunteers to test v0.0.17 before I release it as the changes are drastic from v0.0.16. PM me.

TheDarkWraith 08-15-10 11:48 AM

ok volunteers not needed. Works absolutely beautiful :rock: Convoy will scatter as each merchant ship is taking their own evasive maneuvers and speed changes. As each merchant ship enters into the safe zone it regroups in the convoy where it originally was (position in convoy) :D Time to package up v0.0.17 for release

TheDarkWraith 08-15-10 12:13 PM

v0.0.17 released. See post #1 for details :|\\

Kromus 08-15-10 01:35 PM

Just to be sure, if I want to change difficulty should I change any of these values between 0-1.0?

VISUAL_DIFFICULTY = 1.0;
HYDROPHONE_DIFFICULTY = 1.0;
RADAR_DIFFICULTY = 1.0;
SONAR_DIFFICULTY = 1.0;
# for merchants
VISUAL_DIFFICULTY_MERCHANT = 1.0;
HYDROPHONE_DIFFICULTY_MERCHANT = 1.0;
RADAR_DIFFICULTY_MERCHANT = 1.0;
SONAR_DIFFICULTY_MERCHANT = 1.0;

Nothing else needs to be changed there? No other values in init.aix?

TheDarkWraith 08-15-10 01:41 PM

Quote:

Originally Posted by Kromus (Post 1468613)
Just to be sure, if I want to change difficulty should I change any of these values between 0-1.0?

VISUAL_DIFFICULTY = 1.0;
HYDROPHONE_DIFFICULTY = 1.0;
RADAR_DIFFICULTY = 1.0;
SONAR_DIFFICULTY = 1.0;
# for merchants
VISUAL_DIFFICULTY_MERCHANT = 1.0;
HYDROPHONE_DIFFICULTY_MERCHANT = 1.0;
RADAR_DIFFICULTY_MERCHANT = 1.0;
SONAR_DIFFICULTY_MERCHANT = 1.0;

Nothing else needs to be changed there? No other values in init.aix?

that's all you have to change for difficulty. You decide how difficult you want each sensor of the ship's to be. Did I make it too easy :06: :DL


All times are GMT -5. The time now is 08:01 PM.

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