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: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
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
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.
TheDarkWraith is offline   Reply With Quote
Old 05-13-13, 08:54 AM   #2
Tonci87
Samurai Navy
 
Join Date: Jun 2012
Posts: 590
Downloads: 119
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   #3
BigWalleye
Sea Lord
 
Join Date: Jul 2012
Location: On the Eye-lond, mon!
Posts: 1,973
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   #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
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   #5
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
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   #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
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   #7
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
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   #8
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   #9
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
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
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 03:19 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.