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


Default

Quote:
Originally Posted by gap View Post
Since we are at it, have you checked the relation between engine RPMs and their maximum theoretical speed in game?

Do you need airbases to have sensors attached? Did I get you correctly? If so, can't you simply assign the needed sensors to them?
I located the function that takes ordered speed and calculates the sub's speed. It's some kind of formula that doesn't look familiar to me at all. The numbers being used look very strange

Yes it's a very simple measure to add sensors to them via their .sns file. The question is will the game recognize them? There are many strange things coded in SH5, this could be one of them. I tracked down why the type 500 units (subnets and minefields) aren't recognized by the game and it's because the game doesn't store a list of them (the devs coded it so the game reads the files in but does nothing with them). That is why the mission editor says platform x not found in platforms library
TheDarkWraith is offline   Reply With Quote
Old 07-07-13, 12:14 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
I located the function that takes ordered speed and calculates the sub's speed. It's some kind of formula that doesn't look familiar to me at all. The numbers being used look very strange
can you report it here?

Quote:
Originally Posted by TheDarkWraith View Post
Yes it's a very simple measure to add sensors to them via their .sns file. The question is will the game recognize them? There are many strange things coded in SH5, this could be one of them.
Let's hope not
gap is offline   Reply With Quote
Old 07-07-13, 12:36 PM   #3
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

I setup a single mission with an airbase, one victory cargo, and one VIIC sub (me). Hit a bookmark in the code where it iterates over all the units in the game. I was thrilled to see that the there were 3 units in the list (all 3 I had defined in the single mission) and upon investigating the second one (the airbase) I saw it was missing a pointer in one of it's memory addresses (it's a pointer to a type of Commanders controller). Without this pointer it will never use any sensors it has (any of them defined in the .sns file) and it will probably never fire any weapons given to it in it's .eqp file because this controller is missing (this controller is responsible for detecting contacts). I opened up it's .dat file and sure enough there is no commander controller specified in the .dat file. That explains why this pointer is missing

I let the game continue running till it hit the bookmark for checking for airstrikes. This is where I'm at currently and seeing if I can make the airbase spawn aircraft based on units in the area within a certain radius of the airbase having a contact. If the unit within the radius of the airbase has a contact then I'm going to try and make the airbase spawn a unit to investigate the contact.
TheDarkWraith is offline   Reply With Quote
Old 07-07-13, 01:10 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
...I opened up it's .dat file and sure enough there is no commander controller specified in the .dat file. That explains why this pointer is missing
Have you tried giving the airbase an unit_CostalDefense controller in its sim file?
gap is offline   Reply With Quote
Old 07-07-13, 02:04 PM   #5
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
Have you tried giving the airbase an unit_CostalDefense controller in its sim file?
No need to. That would just eat up memory (think how many airbases are defined in the game ) and there is a LOT of memory eaten up by each commanders controller (over 200 bytes each + bytes for the support stuff it creates)

I've come up with a clever solution! When the game checks for airstrikes it iterates over all the units and finds those units with airgroups defined. Every unit it finds that has an airgroup is added to a list. Then that list is iterated over and each item of that list is checked to every unit in the game:
- comparing sides
- comparing distances between them
If they meet the parameters then the game unit is added to the unit with airgroup's defined list of units to do airstrike against.

Then the unit with airgroup list of unit's to do airstrikes against is iterated over and airstrikes commence.

I'm inserting some code in here that will check to see if unit with airgroup is an airbase. If so then each game unit to commence airstrike on will be checked against all units in game to see if any of them have this unit as a contact. If so then each one will be checked to see if it radioed about it's contact (random number). If the game finds it did radio about it's contact then an airstrike will commence on the unit (plane(s) will be spawned from the airbase and given the waypoint of the unit). If not then the normal airstrike will be done (which spawns a unit in a random location around the contact and gives it random waypoints). Elegant, simple, and brilliant if I do say so myself
TheDarkWraith is offline   Reply With Quote
Old 07-07-13, 03:15 PM   #6
Sartoris
Captain
 
Join Date: May 2011
Posts: 489
Downloads: 106
Uploads: 0
Default

Can't wait to test this out!
Sartoris is offline   Reply With Quote
Old 07-07-13, 05:16 PM   #7
THE_MASK
Ace of the deep .
 
THE_MASK's Avatar
 
Join Date: Jan 2006
Posts: 9,153
Downloads: 901
Uploads: 73


Default

Re: sending a scout plane . IN sh4 Uboat missions you click on an air base icon and that brings up the waypoint pen . Click the nav map to place a waypoint on the navmap and a plane travels to that spot and patrolls an area i guess . Everytime you click on the air base it shows the scout plane waypoint and you can change the planes waypoint . I can see the planes icon on the map updated every so often as it heads to its destination . If i click on the planes icon it shows up the planes type , course , speed . If i click a patrol location that is too far away a message will say not enough fuel to reach the waypoint for the scout plane . Message display when new scout sent or scout changes course . Now i am not sure what the waypont is for . The scout plane goes in the general direction of the waypoint i created but goes randomly around it . In the mission editor there is a german plane called a shipborne searchplane . What does RevealEnemyConvoys in the special abilities in SH5 do ?

Last edited by THE_MASK; 07-07-13 at 05:51 PM.
THE_MASK is offline   Reply With Quote
Old 07-07-13, 05:25 PM   #8
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Sartoris View Post
Can't wait to test this out!
I already have been

All the code changes/additions were made and I began testing. I setup a single mission with a small airbase, a victory cargo, and a VIIC. I let the victory cargo detect me. When he did he radioed it in and sure enough the small airbase dispatched 3 fighters towards me


A little more tweaking to do and I'll be releasing new version of the Generic Patcher.
TheDarkWraith is offline   Reply With Quote
Old 07-08-13, 09:59 AM   #9
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
can you report it here?
For electric engines this is how the game calculates theoretical maximum speed for given bell:

XMM registers can be thought of floating point registers for this discussion
My sub was a VIIC. I asked for a forward bell (ahead slow - 1). I was submerged thus using electric engines. Engine ratios patch disabled.

XMM0 set to 0.0
load 1.0 into XMM2
load value into XMM1 dealing with current engine type in use (for electrics this is 3.913995)
multiply XMM1 by ordered bell (engine ratio asked for)
load XMM1 into XMM0
add XMM2 to XMM0
divide XMM0 by engine type in use value (for electrics this is 559500.0)
multiply XMM0 by engine type in use value (for electrics this is 7432.328)
multiply XMM0 by XMM1
multiply XMM0 by XMM1
raise XMM0 to the power of 0.3333333 (XMM0^0.333333)
multiply XMM0 by engine type in use value (for electrics this was 30.99133)

XMM0 contains theoretical maximum speed for ordered bell (for this it was 7.56) for that engine (done for each engine)

Actual speed attained ~ 1.5 knots

I'll post a reverse bell on electrics in next post

Last edited by TheDarkWraith; 07-08-13 at 10:19 AM.
TheDarkWraith is offline   Reply With Quote
Old 07-08-13, 10:17 AM   #10
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Reverse bell on electrics. Dead back slow - 1:

XMM0 set to 0.0
load 1.0 into XMM2
load value into XMM1 dealing with current engine type in use (for electrics this is 3.913995)
multiply XMM1 by ordered bell (engine ratio asked for)
load -1.0 into XMM3
load XMM1 into XMM0
change sign of XMM0
add XMM2 to XMM0
divide XMM0 by engine type in use value (for electrics this is 559500.0)
multiply XMM0 by engine type in use value (for electrics this is 7432.328)
multiply XMM0 by XMM1
multiply XMM0 by XMM1
raise XMM0 to the power of 0.3333333 (XMM0^0.333333)
multiply XMM0 by engine type in use value (for electrics this was 30.99133)
multiply XMM0 by -1.0
XMM0 contains theoretical maximum speed for ordered bell (for this it was 7.56) for that engine (done for each engine)

Actual speed attained ~ 1.5 knots
TheDarkWraith is offline   Reply With Quote
Old 07-08-13, 10:24 AM   #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
For electric engines this is how the game calculates theoretical maximum speed for given bell
Quote:
Originally Posted by TheDarkWraith View Post
Reverse bell on electrics. Dead back slow - 1:
Thank you TDW, I am converting your routines into formulas, and putting them on a graph
gap is offline   Reply With Quote
Old 07-08-13, 10:43 AM   #12
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
Thank you TDW, I am converting your routines into formulas, and putting them on a graph
I'll have diesel values here in a bit. Just found an error in the engine ratios patch that affects AI subs battery capacity. Loading new version currently.
TheDarkWraith is offline   Reply With Quote
Old 07-08-13, 10:46 AM   #13
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

v1.0.126.0 released. See post #1

Starting with v1.0.126.0 Revised the Engine ratios patch to fix bug of AI sub's battery capacity being incorrectly reported to the game
TheDarkWraith is offline   Reply With Quote
Old 07-08-13, 10:49 AM   #14
Sjizzle
Count Dracula
 
Sjizzle's Avatar
 
Join Date: Aug 2012
Location: 46°13′N, 24°47′E
Posts: 1,807
Downloads: 405
Uploads: 0


Default

Quote:
Originally Posted by TheDarkWraith View Post
v1.0.126.0 released.
Thanks TDW
Sjizzle 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 04:17 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.