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)
-   -   [TEC] SH5.exe patches to fix bugs and add functionality (https://www.subsim.com/radioroom/showthread.php?t=181433)

Tonci87 05-13-13 08:54 AM

Quote:

Originally Posted by TheDarkWraith (Post 2055970)
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

BigWalleye 05-13-13 09:09 AM

That sounds like an elegant solution - simple but effective.

gap 05-13-13 09:29 AM

Quote:

Originally Posted by TheDarkWraith (Post 2055970)
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! :up:

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

TheDarkWraith 05-13-13 11:17 AM

Quote:

Originally Posted by gap (Post 2055982)
That's perfect! :up:

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

Should be able to :up:

I'm going to run out of variable space in my TDWData section soon :huh: I thought 0x2000 bytes would be plenty :shifty: New command strings are taking up much of the space.

gap 05-13-13 11:21 AM

Quote:

Originally Posted by TheDarkWraith (Post 2056023)
Should be able to :up:

:yeah:

Quote:

Originally Posted by TheDarkWraith (Post 2056023)
I'm going to run out of variable space in my TDWData section soon :huh: I thought 0x2000 bytes would be plenty :shifty: New command strings are taking up much of the space.

Can you set a bigger variable space, or it would eat too much memory? :hmm2:

TheDarkWraith 05-13-13 11:38 AM

Quote:

Originally Posted by gap (Post 2056025)
Can you set a bigger variable space, or it would eat too much memory? :hmm2:

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 :dead: 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 :hmmm:

finchOU 05-13-13 03:05 PM

Quote:

Originally Posted by TheDarkWraith (Post 2056040)
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 :dead: 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 :hmmm:


you might as well be speaking Klingon :rotfl2: .....all this shows is how utterly clueless I am when it comes to computers. Are the files IN the computer?:06::haha:

TheDarkWraith 05-13-13 03:23 PM

Quote:

Originally Posted by finchOU (Post 2056175)
you might as well be speaking Klingon :rotfl2: .....all this shows is how utterly clueless I am when it comes to computers. Are the files IN the computer?:06::haha:

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 :03:

finchOU 05-13-13 04:24 PM

Quote:

Originally Posted by TheDarkWraith (Post 2056186)
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 :03:

I'm learning slowly.....then faster when stuff breaks/ is not working as advertised.

SkyBaron 05-13-13 04:45 PM

Quote:

Originally Posted by TheDarkWraith (Post 2055649)
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. :nope:

Thanks for all your work fixing the game! :salute:

finchOU 05-13-13 05:10 PM

Quote:

Originally Posted by SkyBaron (Post 2056215)
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. :nope:

Thanks for all your work fixing the game! :salute:


The only problem of that I would think would be a higher probability of collisions. :hmmm: 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. :up: 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.

TheDarkWraith 05-13-13 11:27 PM

Quote:

Originally Posted by gap (Post 2055953)
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 :D

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.

TheDarkWraith 05-13-13 11:37 PM

Quote:

Originally Posted by SkyBaron (Post 2056215)
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. :nope:

Thanks for all your work fixing the game! :salute:

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 :up:

Gillian81 05-14-13 05:19 AM

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


volodya61 05-14-13 05:20 AM

Quote:

Originally Posted by TheDarkWraith (Post 2056342)
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 :salute:

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? :06:

Please :)


All times are GMT -5. The time now is 06:11 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.