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 07-01-13, 12:12 PM   #1
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

things will get really interesting once I finish the carriers spawning aircraft patch for the game.

Here's how the game works in regards to carriers and airbases (land):

A timer is checked to see if it's time to spawn airgroup units. If it's time:
game goes through every unit in the game and compares the distance from them to the carrier/airbase to a fixed value. If the distance is within the fixed value the game will spawn an airgroup unit. The airgroup unit is given random starting position and random waypoints.

My patch changes the code in the above so that if the unit is a carrier and the carrier has the unit as a contact then an airgroup unit is spawned. It's starting position is the carrier. It's given a waypoint of the contact's current position and another waypoint as the carrier's current position. This means the unit will head directly to the contact and once done return to the carrier position (when it spawned the aircraft). The unit is free to engage other contacts if it detects them (a la IRAI) before arriving at unit's position or when returning to the carrier.

I could make it really complex and update the airgroup unit's carrier's waypoint with the carrier's current position so that the unit will always return to the carrier's current position but decided it wasn't worth the time and code. Instead I set the altitude to a ridiculously high value so you'll never see it disappear from the game

I've been working on this patch for over 4 months and the end is near
TheDarkWraith is offline   Reply With Quote
Old 07-01-13, 12:25 PM   #2
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
things will get really interesting once I finish the carriers spawning aircraft patch for the game.
Cool

On a slightly unrelated note: is loadout type of aircraft affecting their AI routines? I need to know it for my tests on the new B-25 that I am still working on
gap is offline   Reply With Quote
Old 07-01-13, 12:36 PM   #3
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
Cool

On a slightly unrelated note: is loadout type of aircraft affecting their AI routines? I need to know it for my tests on the new B-25 that I am still working on
From what I've seen in the code (so far and what I have decoded) no. What determines a unit's AI routines is the type of unit (i.e. 102, 300, 200, etc.) and of course the AI code (IRAI). The AI code will determine whether it does bomb runs, torpedo run, etc.
TheDarkWraith is offline   Reply With Quote
Old 07-01-13, 12:54 PM   #4
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
From what I've seen in the code (so far and what I have decoded) no.
so, what is the use of this "type" entry in planes cfg file?


Quote:
Originally Posted by TheDarkWraith View Post
What determines a unit's AI routines is the type of unit (i.e. 102, 300, 200, etc.) and of course the AI code (IRAI). The AI code will determine whether it does bomb runs, torpedo run, etc.
I have a problem with the B-25 bomber: in single mission she only fires a few shots of her front guns before dropping her bombs, (or during her first attack run, I don't remember exactly right now). Then, no matter how much rounds are left, she won't fire them again (even though guns keep tracking the target) and she keeps circling around my U-boat forever.

I have tried increasing gun's training/elevation range, and improving plane's handling, but with no apparent result. UnitType is set to 301.
gap is offline   Reply With Quote
Old 07-01-13, 01:26 PM   #5
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
so, what is the use of this "type" entry in planes cfg file?




I have a problem with the B-25 bomber: in single mission she only fires a few shots of her front guns before dropping her bombs, (or during her first attack run, I don't remember exactly right now). Then, no matter how much rounds are left, she won't fire them again (even though guns keep tracking the target) and she keeps circling around my U-boat forever.

I have tried increasing gun's training/elevation range, and improving plane's handling, but with no apparent result. UnitType is set to 301.
You'd have to send me the unit and the test mission you are using so I can see what's going on using the debugger.
TheDarkWraith is offline   Reply With Quote
Old 07-01-13, 02:14 PM   #6
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
You'd have to send me the unit and the test mission you are using so I can see what's going on using the debugger.
Here:

http://www.mediafire.com/?b9qhrzwdsz8cj5w

only one of the frontal guns and the dorsal turret got a gun controller, but at the moment I am more concerned about the frontal gun (just ignore the turret). Launch any of the single missions included.

I have also noticed that the bomber got problems dropping its torpedo. No matter how low I set the minimum height, in many cases the plane starts circling, loosing altitude and falling down in the water before she can fire her fish. In other cases, the B-25 manages to achieve a good firing position, but the torpedo moves backward () as it inherited a reversed momentum from the plane, and when it finally touches the water, it falls down to the seabed and explodes.
gap is offline   Reply With Quote
Old 07-01-13, 02:19 PM   #7
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
I have also noticed that the bomber got problems dropping its torpedo. No matter how low I set the minimum height, in many cases the plane starts circling, loosing altitude and falling down in the water before she can fire her fish. In other cases, the B-25 manages to achieve a good firing position, but the torpedo moves backward () as it inherited a reversed momentum from the plane, and when it finally touches the water, it falls down to the seabed and explodes.
Try setting the maximum speed of the unit to a larger value in it's .cfg file.

The torpedo problem is a sign of hitting a collision sphere or box on the unit. Lower the torpedo's hardpoint (do a drastic lowering) and see if it doesn't cure the problem. There is a minimum distance (arming distance - 300m) the torpedo must travel before it's able to detonate. If the torpedo 'hits' something before this 300m then it acts like a dud (which is what you are seeing).
TheDarkWraith is offline   Reply With Quote
Old 07-18-13, 03:41 PM   #8
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
You'd have to send me the unit and the test mission you are using so I can see what's going on using the debugger.
Hi TDW, any news on the B-25?
gap is offline   Reply With Quote
Old 07-18-13, 03:49 PM   #9
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
Hi TDW, any news on the B-25?
not yet. Been coding/testing new plug-in framework/architecture for SH5 via Generic Patcher.
TheDarkWraith is offline   Reply With Quote
Old 07-01-13, 02:34 PM   #10
vanjast
Sea Lord
 
Join Date: Jun 2006
Location: Somewhere else now
Posts: 1,797
Downloads: 1214
Uploads: 4
Default

Quote:
Originally Posted by gap View Post
I have a problem with the B-25 bomber: in single mission she only fires a few shots of her front guns before dropping her bombs, (or during her first attack run, I don't remember exactly right now). Then, no matter how much rounds are left, she won't fire them again (even though guns keep tracking the target) and she keeps circling around my U-boat forever.
Maybe it's modeled 'correctly' where the plane circles out of gun range while calling a destroyer in (that's if this tactic is really modeled).
If you dive, maybe it might attack again - try this.

IIRC.. it was rare for a bomber to attack a U-boat more than once, unless they were sure they had done some good damage - an aircraft is very vulnerable.. especially in the middle of the ocean. All attacks, if possible, were based on tracking and surprise - after the first attack is was generally suicidal to attack again.
vanjast is offline   Reply With Quote
Old 07-01-13, 03:48 PM   #11
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Try setting the maximum speed of the unit to a larger value in it's .cfg file.

The torpedo problem is a sign of hitting a collision sphere or box on the unit. Lower the torpedo's hardpoint (do a drastic lowering) and see if it doesn't cure the problem. There is a minimum distance (arming distance - 300m) the torpedo must travel before it's able to detonate. If the torpedo 'hits' something before this 300m then it acts like a dud (which is what you are seeing).
Okay, I will do as you are suggesting I will let you know

On your end, please keep me informed on anything wrong you may find about the gun issue.

Quote:
Originally Posted by vanjast View Post
Maybe it's modeled 'correctly' where the plane circles out of gun range while calling a destroyer in (that's if this tactic is really modeled).
If you dive, maybe it might attack again - try this.
No, as per IRAI settings, planes keep diving on their target until the last gun round. Or forever, if for some reason they can't fire their weapons.

Quote:
Originally Posted by vanjast View Post
IIRC.. it was rare for a bomber to attack a U-boat more than once, unless they were sure they had done some good damage - an aircraft is very vulnerable.. especially in the middle of the ocean. All attacks, if possible, were based on tracking and surprise - after the first attack is was generally suicidal to attack again.
I agree. A while back I suggested TDW to make planes to end their attack once they drop their bombs. Unfortunately, there are many limitations to what can be done with aircraft AI.
gap is offline   Reply With Quote
Old 07-01-13, 06:27 PM   #12
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
I agree. A while back I suggested TDW to make planes to end their attack once they drop their bombs. Unfortunately, there are many limitations to what can be done with aircraft AI.
That is how IRAI used to be. People complained so I changed it. Here's the problem: say said plane attacks another unit and drops it bombs. That unit submerges and hides. Plane continues on waypoints. Plane encounters another enemy unit. If IRAI is setup so that planes don't attack anymore if they have no bombs or torpedoes then said plane continues on with it's waypoints. Here in is where people complained airplanes never attack. What is the plane has no bombs or torpedoes from the start? Then it never attacks anything.
TheDarkWraith 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 10:42 PM.


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.