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 > Silent Hunter III
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 04-01-24, 02:29 PM   #1
Johnfb
Commodore
 
Join Date: Mar 2011
Location: Ireland
Posts: 639
Downloads: 293
Uploads: 64
Default Any Ideas

Anyone any idea why the opening script cuts off at the end and adds my save input instead ... ???

Thanks



Johnfb is offline   Reply With Quote
Old 04-02-24, 09:22 AM   #2
Kapt Z
Grey Wolf
 
Join Date: Aug 2007
Location: ...somewhere in the swamps of Jersey.
Posts: 908
Downloads: 153
Uploads: 0
Default

I have seen the same for years on my saves. Always figured it was some kind of glitch. Does not seem to affect successful reloading of saves for me so I ignore it.
__________________
...I fought in many guises, many names, but always me.
Patton
Kapt Z is offline   Reply With Quote
Old 04-02-24, 12:14 PM   #3
Johnfb
Commodore
 
Join Date: Mar 2011
Location: Ireland
Posts: 639
Downloads: 293
Uploads: 64
Default

Quote:
Originally Posted by Kapt Z View Post
I have seen the same for years on my saves. Always figured it was some kind of glitch. Does not seem to affect successful reloading of saves for me so I ignore it.
More of an annoyance...just thought it was something I did .
Thanks for responding
Johnfb is offline   Reply With Quote
Old 04-02-24, 01:27 PM   #4
propbeanie
CTD - it's not just a job
 
propbeanie's Avatar
 
Join Date: May 2016
Location: One hour from Music City USA!
Posts: 9,911
Downloads: 444
Uploads: 2


Default

Looks like too much text for the box to display in the given area...
__________________

"...and bollocks to the naysayers" - Jimbuna
propbeanie is offline   Reply With Quote
Old 04-02-24, 09:21 PM   #5
Captain Drastic
Mate
 
Join Date: Oct 2008
Posts: 60
Downloads: 623
Uploads: 0
Default Edited Script...

... I edited the Menu variable_en file in Commander so that there were fewer words of script. I guess it only can handle so much...
Captain Drastic is offline   Reply With Quote
Old 04-03-24, 12:55 AM   #6
Johnfb
Commodore
 
Join Date: Mar 2011
Location: Ireland
Posts: 639
Downloads: 293
Uploads: 64
Default Any ideas

Thanks all
Script is in the mod.... May well be too many letters as suggested when written by designer.

Although I have seen longer script in the load screen so not 100% sure it's length of script. But what do I know lol.

Any idea why my save data is added at end?

Cheers

Last edited by Johnfb; 04-03-24 at 02:14 AM.
Johnfb is offline   Reply With Quote
Old 04-03-24, 03:37 AM   #7
Hooston
Planesman
 
Join Date: Jun 2020
Posts: 199
Downloads: 15
Uploads: 0
Default wild guesses

See this on GWX but not on NYGM, which has shorter messages.
Never delved into SH3 code, but it looks like a buffer overflow.
At some point the game reads in the mission startup text from a file and sticks it in an area of memory. It saves the address of the start of this to use later. This "buffer" is not big enough for GWX, so either the program keeps writing over the next chunk of memory or it correctly stops reading when the buffer end is reached but the coder has forgotten to add a "null" character to signal the end of the string.
There's a slight chance it is caused by a consistent typo in the GWX campaign file, like missing quotation marks, in which case it would be an easy fix. I have no idea where these messages are loaded from, so I can't check them or compare with NYGM. Any ideas?
At some point the game saves the latest save game filename, which happens to be after the mission startup text in memory. This ends with a null character to show the end of the string.
When the game wants to display the startup text it says "output text starting at this address and ending in a null character" so you get the startup text and then whatever is after it until a zero byte is reached - which just happens to be the latest save game fileneme.
It's just luck that this does not cause a crash, but then if it caused a crash it would have been caught during testing. This is the sort of horrible hidden bug that leaps out and bites you on the bum years later.

Unless of course the Allied situation really was un220424...

Last edited by Hooston; 04-03-24 at 04:22 AM.
Hooston is offline   Reply With Quote
Old 04-03-24, 03:54 AM   #8
Johnfb
Commodore
 
Join Date: Mar 2011
Location: Ireland
Posts: 639
Downloads: 293
Uploads: 64
Icon14

Quote:
Originally Posted by Hooston View Post
See this on GWX but not on NYGM, which has shorter messages.
Never delved into SH3 code, but it looks like a buffer overflow.
At some point the game reads in the mission startup text from a file and sticks it in an area of memory. It saves the address of the start of this to use later. This "buffer" is not big enough for GWX, so either the program keeps writing over the next chunk of memory or it correctly stops reading when the buffer end is reached but the coder has forgotten to add a "null" character to signal the end of the string.
There's a slight chance it is caused by a consistent typo in the GWX campaign file, like missing quotation marks, in which case it would be an easy fix.

At some point the game saves the latest save game filename, which happens to be after the mission startup text in memory. This ends with a null character to show the end of the string.

When the game wants to display the startup text it says "output text starting at this address and ending in a null character" so you get the startup text and then whatever is after it until a zero byte is reached - which just happens to be the latest save game fileneme.
It's just luck that this does not cause a crash, but then if it caused a crash it would have been caught during testing. This is the sort of horrible hidden bug that leaps out and bites you on the bum years later.


Unless of course the Allied situation really was un220424...

Amazing post...really well explained thanks 😊 👍

Last line ...lol .. 😆
Johnfb is offline   Reply With Quote
Old 04-03-24, 11:18 AM   #9
Hooston
Planesman
 
Join Date: Jun 2020
Posts: 199
Downloads: 15
Uploads: 0
Default Not so amazing post


I've read some of the posts above and realised that the meddling with the mission briefing text is done by SH3 commander, so it's just as likely the problem lies there. I have looked at the "Menu variable_en.txt" file that comes with SH3 commander and I can't see anything obviously wrong with it.

Whilst the text is waaay longer than the vanilla game expects I assume that it all worked at some point and something has changed to break it. Is the bug linked to a particular edition of SH3 Commander? Or maybe a SH3 mod?
Hooston is offline   Reply With Quote
Old 04-03-24, 12:56 PM   #10
Johnfb
Commodore
 
Join Date: Mar 2011
Location: Ireland
Posts: 639
Downloads: 293
Uploads: 64
Default

Quote:
Originally Posted by Hooston View Post

I've read some of the posts above and realised that the meddling with the mission briefing text is done by SH3 commander, so it's just as likely the problem lies there. I have looked at the "Menu variable_en.txt" file that comes with SH3 commander and I can't see anything obviously wrong with it.

Whilst the text is waaay longer than the vanilla game expects I assume that it all worked at some point and something has changed to break it. Is the bug linked to a particular edition of SH3 Commander? Or maybe a SH3 mod?

No idea... wish I knew
Not the end of the world I know, but just annoying and annoying I don't know the resolution .
Thanks everyone.
Johnfb is offline   Reply With Quote
Old 04-03-24, 05:12 PM   #11
Hooston
Planesman
 
Join Date: Jun 2020
Posts: 199
Downloads: 15
Uploads: 0
Default Making some progress

My NYGM steel coffins installation seems to be OK, although I definitely remember the bug when running GWX 3.0.


Please tell me what you have for key 46 in the file [SH3 directory]\data\Menu\en_menu.txt


This should have been set up by SH3 Commander, so mine currently says:


46=Submarine Type: %s|Departure Point : %s, heading %.0f°|Grid (Patrol Area) %s|Starting Base: %s|Return To Base: %s||--- News for February 1941 --- First Units of Rommel's 'Afrika Korps' arrive in Tripoli --- 12th: 'Admiral Hipper' sinks 7 ships from unescorted convoy SLS64 --- 26th: In Italian Somaliland, British forces capture Mogadishu ---||--- Monthly losses: 0 U-boats for 254,118 tons of Allied shipping ---


If your version is mangled with the filename (or maybe another %s) at the end then the fault lies with SH3 commander. If it is OK then the problem is in SH3 itself... I think...
Hooston is offline   Reply With Quote
Old 04-04-24, 02:23 AM   #12
Johnfb
Commodore
 
Join Date: Mar 2011
Location: Ireland
Posts: 639
Downloads: 293
Uploads: 64
Default

Quote:
Originally Posted by Hooston View Post
My NYGM steel coffins installation seems to be OK, although I definitely remember the bug when running GWX 3.0.


Please tell me what you have for key 46 in the file [SH3 directory]\data\Menu\en_menu.txt


This should have been set up by SH3 Commander, so mine currently says:


46=Submarine Type: %s|Departure Point : %s, heading %.0f°|Grid (Patrol Area) %s|Starting Base: %s|Return To Base: %s||--- News for February 1941 --- First Units of Rommel's 'Afrika Korps' arrive in Tripoli --- 12th: 'Admiral Hipper' sinks 7 ships from unescorted convoy SLS64 --- 26th: In Italian Somaliland, British forces capture Mogadishu ---||--- Monthly losses: 0 U-boats for 254,118 tons of Allied shipping ---


If your version is mangled with the filename (or maybe another %s) at the end then the fault lies with SH3 commander. If it is OK then the problem is in SH3 itself... I think...

Hooston, mine reads as follows :


46=Submarine Type: %s|Departure Point : %s, heading %.0f°|Grid (Patrol Area) %s|Starting Base: %s|Return To Base: %s||--- News for May 1940 --- 10th: 'Operation Gelb' - Germany invades Holland, Belgium and Luxembourg. British Prime Minister Chamberlain resigns. Winston Churchill assumes leadership --- 15th: Dutch Army surrenders --- 24th: Allies capture Narvik and destroy port installations --- 26th: BEF and French Army fall back on Dunkirk --- 28th: Belgian Army surrenders ---||--- Monthly losses: 1 U-boat for 61,635 tons of Allied shipping ---

Thanks
Johnfb is offline   Reply With Quote
Reply


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 05:52 PM.


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.