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 05-13-13, 08:54 AM   #1906
Tonci87
Captain
 
Join Date: Jun 2012
Posts: 544
Downloads: 116
Uploads: 0


Default

Quote:
Originally Posted by TheDarkWraith View Post
What I'll add to the code is having it remember which unit the game used for the nearest visual contact distance. I'll also store the actual distance to the unit along with last random distance calculated. Then if player asks for nearest visual contact the code will check to see if the same unit is found, if so then it will check actual distance to see if it's changed some amount (I'll make that a variable in the patch file). If the distance changed >= variable amount then calculate new random distance. If distance changed < variable amount return last random distance calculated.

How's that? I don't want anything too complex. I just wanted something to get rid of the perfect range estimate every time you asked for nearest visual contact.
That sounds good
Tonci87 is offline   Reply With Quote
Old 05-13-13, 09:09 AM   #1907
BigWalleye
Sea Lord
 
Join Date: Jul 2012
Location: On the Eye-lond, mon!
Posts: 1,987
Downloads: 465
Uploads: 0


Default

That sounds like an elegant solution - simple but effective.
BigWalleye is offline   Reply With Quote
Old 05-13-13, 09:29 AM   #1908
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
What I'll add to the code is having it remember which unit the game used for the nearest visual contact distance. I'll also store the actual distance to the unit along with last random distance calculated. Then if player asks for nearest visual contact the code will check to see if the same unit is found, if so then it will check actual distance to see if it's changed some amount (I'll make that a variable in the patch file). If the distance changed >= variable amount then calculate new random distance. If distance changed < variable amount return last random distance calculated.

How's that? I don't want anything too complex. I just wanted something to get rid of the perfect range estimate every time you asked for nearest visual contact.
That's perfect!

P.S: can you do the same with the range to closest target estimated by the hydrophone operator?
gap is offline   Reply With Quote
Old 05-13-13, 11:17 AM   #1909
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
That's perfect!

P.S: can you do the same with the range to closest target estimated by the hydrophone operator?
Should be able to

I'm going to run out of variable space in my TDWData section soon I thought 0x2000 bytes would be plenty New command strings are taking up much of the space.
TheDarkWraith is offline   Reply With Quote
Old 05-13-13, 11:21 AM   #1910
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Should be able to


Quote:
Originally Posted by TheDarkWraith View Post
I'm going to run out of variable space in my TDWData section soon I thought 0x2000 bytes would be plenty New command strings are taking up much of the space.
Can you set a bigger variable space, or it would eat too much memory?
gap is offline   Reply With Quote
Old 05-13-13, 11:38 AM   #1911
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
Can you set a bigger variable space, or it would eat too much memory?
It's not a question of setting a bigger variable space but rather how many sections can one define in a exe (PE file)? I've added 3 additional sections to the SH5.exe: TDWData, TDWCode, and Updates. I'll need to add another section here soon just for strings but I'm not sure how many sections you are allowed to define in the PE format. I'll have to research that...If I can't add more sections then I'm forced to increase the size of my existing sections which means recalculating offsets for all the new functions I've added I don't have the luxury of the relocations section doing this for me because my code came after the source code was compiled. Kinda makes me want to learn how the relocations section works and how to add/manipulate it
TheDarkWraith is offline   Reply With Quote
Old 05-13-13, 03:05 PM   #1912
finchOU
Samurai Navy
 
Join Date: Jan 2004
Posts: 571
Downloads: 77
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
It's not a question of setting a bigger variable space but rather how many sections can one define in a exe (PE file)? I've added 3 additional sections to the SH5.exe: TDWData, TDWCode, and Updates. I'll need to add another section here soon just for strings but I'm not sure how many sections you are allowed to define in the PE format. I'll have to research that...If I can't add more sections then I'm forced to increase the size of my existing sections which means recalculating offsets for all the new functions I've added I don't have the luxury of the relocations section doing this for me because my code came after the source code was compiled. Kinda makes me want to learn how the relocations section works and how to add/manipulate it

you might as well be speaking Klingon .....all this shows is how utterly clueless I am when it comes to computers. Are the files IN the computer?
__________________
Intel i7-2700K-3.50GHz, 16 GB RAM, 2 xGTX 560,2GB,SLI,2 TB HD
The Wolves of Steel 1.06
The Wolves of Steel 1.06 Update 05c
finchOU is offline   Reply With Quote
Old 05-13-13, 03:23 PM   #1913
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by finchOU View Post
you might as well be speaking Klingon .....all this shows is how utterly clueless I am when it comes to computers. Are the files IN the computer?
You should learn about computers. You can't get away from the fact that there's a computer (embedded CPU) in almost anything you use in society today. The more knowledge you have about them the better prepared you are for anything dealing with them
TheDarkWraith is offline   Reply With Quote
Old 05-13-13, 04:24 PM   #1914
finchOU
Samurai Navy
 
Join Date: Jan 2004
Posts: 571
Downloads: 77
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
You should learn about computers. You can't get away from the fact that there's a computer (embedded CPU) in almost anything you use in society today. The more knowledge you have about them the better prepared you are for anything dealing with them
I'm learning slowly.....then faster when stuff breaks/ is not working as advertised.
__________________
Intel i7-2700K-3.50GHz, 16 GB RAM, 2 xGTX 560,2GB,SLI,2 TB HD
The Wolves of Steel 1.06
The Wolves of Steel 1.06 Update 05c
finchOU is offline   Reply With Quote
Old 05-13-13, 04:45 PM   #1915
SkyBaron
Lieutenant
 
Join Date: Mar 2010
Location: South Atlantic
Posts: 262
Downloads: 673
Uploads: 2
Default

Quote:
Originally Posted by TheDarkWraith View Post
v1.0.92.0 released. See post #1

Starting with v1.0.92.0 Added a new patch to the SH5.exe that randomizes the nearest visual contact's distance returned. This new patch will take your sub's crew veterency level into account.
Awesome! That always annoyed me. Can I make a suggestion since you're working with the "visual contact" part of the code? Would it be too complicated to turn off visual contacts until you leave port (ie. until the DOCK icon disappears)? It would avoid all the "ship spotted" messages from watching crew with X-Ray vision seeing through walls.

Thanks for all your work fixing the game!
__________________


SkyBaron is offline   Reply With Quote
Old 05-13-13, 05:10 PM   #1916
finchOU
Samurai Navy
 
Join Date: Jan 2004
Posts: 571
Downloads: 77
Uploads: 0
Default

Quote:
Originally Posted by SkyBaron View Post
Awesome! That always annoyed me. Can I make a suggestion since you're working with the "visual contact" part of the code? Would it be too complicated to turn off visual contacts until you leave port (ie. until the DOCK icon disappears)? It would avoid all the "ship spotted" messages from watching crew with X-Ray vision seeing through walls.

Thanks for all your work fixing the game!

The only problem of that I would think would be a higher probability of collisions. I don't mind the harbor sequence as much....I actually take my time to enjoy the scenery while it lasts. Ships spotted does in/near port doesn't annoy me as it keeps my SA a bit higher in that critical phase of seamanship. Now seeing through walls? that has been a problem as long as I can remember (or DD's trying to sail through walls. Or Lights shining through walls/buildings.
__________________
Intel i7-2700K-3.50GHz, 16 GB RAM, 2 xGTX 560,2GB,SLI,2 TB HD
The Wolves of Steel 1.06
The Wolves of Steel 1.06 Update 05c
finchOU is offline   Reply With Quote
Old 05-13-13, 11:27 PM   #1917
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
You are probably right about the complexity of coding it. But I wouldn't call it "a small gain in realism" as it would make the reporting officer to behave as a sentient being, instead of a stupid random numbers generator
v1.0.94.0 released. See post #1

Starting with v1.0.94.0 Revised the randomize nearest visual contact patch again. Now the patch remembers the last unit it used for the command. If the unit is the same unit as last time and difference between distance to contact now and before < 500m (a variable in the patch file) then it returns last randomized distance else returns new randomized distance. If the unit is different than last unit then it returns a new random distance.

Now I'll look to see if I can do the same thing to the sonarman's command that's similar to this.

Last edited by TheDarkWraith; 05-13-13 at 11:42 PM.
TheDarkWraith is offline   Reply With Quote
Old 05-13-13, 11:37 PM   #1918
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by SkyBaron View Post
Awesome! That always annoyed me. Can I make a suggestion since you're working with the "visual contact" part of the code? Would it be too complicated to turn off visual contacts until you leave port (ie. until the DOCK icon disappears)? It would avoid all the "ship spotted" messages from watching crew with X-Ray vision seeing through walls.

Thanks for all your work fixing the game!
It probably would be possible but I'm still figuring out all the menu item stuff in the code. I can find menu items, find their parents, grab some data from them (command associated with them, offsets, etc.) but I don't have them completely mapped out yet. Once I do then I have to figure out how the warning icons are made
TheDarkWraith is offline   Reply With Quote
Old 05-14-13, 05:19 AM   #1919
Gillian81
Watch
 
Join Date: Sep 2010
Posts: 20
Downloads: 12
Uploads: 0
Default

Question regarding patching.
Is it advisable to first disable al my mods, before patching, and then after patching enable all my mods again? Or doesn't it really matter?

Also do I still have to edit the menu.txt manually with the follwing:

Code:
Required menu.txt entries for versions >= v1.0.74.0:

Edit this line in your menu.txt file:
MaxStrings=11100

Add these to the end of your menu.txt file:

; Independent engine controls patch
10025=Shafts
10026=Click to enable/disable speed commands for the port shaft
10027=Click to enable/disable speed commands for the starboard shaft
; Contact report wolfpack patch
11000=Dispatching available submarines to your patrol area|Remain undetected and in a favorable position|Send status reports| |Bdu
11001=All available submarines have been dispatched to your patrol area
11002=Submarines in your area have received instructions to join your attack|Stay in front of contact/convoy, remain undetected, and send regular status reports| | |B.d.u
11003=Remain undetected and continue following contact/convoy|Available submarines are heading to your patrol area
11004=Attain favorable position and shadow contact/convoy until reinforcements arrive
; possible messages from Bdu when can not dispatch subs
11010=No boats are within your patrol area|Act as lone boat| |Bdu
11011=No support within range|Be more aggressive| |Bdu
11012=Contact report received|Act on own data| |BdU
11013=Be more aggressive!| |Bdu
11014=Attack contact| |Bdu
; Reports from dispatched subs
11020=Contact keeper continue to send bearing signals|Group act on own data|Take every opportunity to attack
11021=Convoy in sight|Signal bearing sent|Moving to attack port side
11022=I believe to have made contact with the convoy|Sending bearing signals|Act according to own data|Attacking at full speed
11023=Requesting bearing signal from contact keeper
11024=Beacon signals lie in the line of approach according to dead reckoning.|Attacking far side of convoy
Gillian81 is offline   Reply With Quote
Old 05-14-13, 05:20 AM   #1920
volodya61
Ocean Warrior
 
volodya61's Avatar
 
Join Date: Feb 2012
Location: Rostov-on-Don, local time GMT+4
Posts: 3,300
Downloads: 374
Uploads: 0


Default

Quote:
Originally Posted by TheDarkWraith View Post
v1.0.94.0 released. See post #1
...
Now I'll look to see if I can do the same thing to the sonarman's command that's similar to this.
Thank you, sir

Sorry, I don't want to annoy you but.. what about Gap's question - can we hope to get rid of the perfect automatic ship recognition every time we asked our WO even at the night or with the heavy fog?

Please
__________________
.
Where does human stupidity end?

.


El sueño de la razón produce monstruos © - and for some people awakening will be cruel
volodya61 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 11:15 AM.


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