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 > SHIII Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 10-21-09, 11:18 AM   #1
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default A potential reason for problems and CTD

While trying to get familiar with cameras.dat, I found a potential CTD reason if cameras.dat is edited with newer S3Ditor Versions (thanks, skywasjer for this great tool!) and if the player uses the Sabotage and Malfuntion - Option of Sh3-Commander (thanks, J.Jones for another great tool):

The Sabotage and Malfuntion-Option uses a file called RandomizedEvents.cfg which contains Hex-Pointers to the data positions in binary files like Cameras.dat. In a case of a sabotage, a binary value which is referred by such a Hex-pointer is changed in order to simulate sabotage. For example, the zoom of the periscopes is restricted to 1x.

When editing cameras.dat with a newer version of S3D, the AuthorInfo chunk is 71 bytes longer as is has been when editing with older versions of S3D. This means: All Hex-pointers point to wrong data positions, so that undesired data is changed. This can lead to a CTD (which in fact is perfect sabotage).

So if you change cameras.dat values with a newer version of S3D, the pointers in RandomizedEvents.cfg have to be adapted to prevent from unwanted side-effects like CTD in conjunction with sabotage & malfunction. Otherwise your cameras.dat is not compatible with Sabotage and Malfuntion.


excuse my bad english!
h.sie
__________________
My Mediafire page: http://www.mediafire.com/hsie
h.sie is offline   Reply With Quote
Old 10-21-09, 03:08 PM   #2
Philipp_Thomsen
Old Gang
 
Philipp_Thomsen's Avatar
 
Join Date: Nov 2007
Location: Drunk at the whorehouse
Posts: 2,278
Downloads: 146
Uploads: 0


Default

Quote:
Originally Posted by h.sie View Post
This can lead to a CTD (which in fact is perfect sabotage).
__________________
To each his own
Philipp_Thomsen is offline   Reply With Quote
Old 10-21-09, 07:04 PM   #3
ViperU48
Torpedoman
 
Join Date: Jun 2003
Location: Vancouver, BC, Canada
Posts: 118
Downloads: 58
Uploads: 0
Default

Bingo! I've been trying to wrap my head around this CTD problem I've been having for days.

I've editted my cameras.dat recently and havn't been able to start a career at all, and have been trying to narrow the problem down for some time.

Just a question: what is considered to be a "newer" version of SH3editor? (mine is beta 0.8.2, is that too new?)
__________________
...Wir alle leben auf einem gelben Unterseeboot...
ViperU48 is offline   Reply With Quote
Old 10-21-09, 07:15 PM   #4
Commander Gizmo
Watch Officer
 
Join Date: Jan 2007
Posts: 339
Downloads: 76
Uploads: 4
Default

If only we had a program that didn't rely on hex locations for this sort of thing... Thanks for the heads up. Maybe you could release a fixed random events file for Commander to resolve this issue for those that experience it? I'm away from my desktop for the week or I'd do it.
Commander Gizmo is offline   Reply With Quote
Old 10-21-09, 08:35 PM   #5
ViperU48
Torpedoman
 
Join Date: Jun 2003
Location: Vancouver, BC, Canada
Posts: 118
Downloads: 58
Uploads: 0
Default

Yes, so; would editing out all the sections in the randomevents.cfg file that edits the cameras.dat fix this problem?

Would this cause any more problems?
__________________
...Wir alle leben auf einem gelben Unterseeboot...
ViperU48 is offline   Reply With Quote
Old 10-21-09, 10:43 PM   #6
Commander Gizmo
Watch Officer
 
Join Date: Jan 2007
Posts: 339
Downloads: 76
Uploads: 4
Default

I think that would just remove the sabotage of any camera views. I was thinking more along the lines of adjusting the hex coordinates.
Commander Gizmo is offline   Reply With Quote
Old 10-22-09, 02:04 AM   #7
JScones
Navy Seal
 
Join Date: Apr 2005
Posts: 5,501
Downloads: 19
Uploads: 0
Default

Quote:
Originally Posted by h.sie View Post
While trying to get familiar with cameras.dat, I found a potential CTD reason if cameras.dat is edited with newer S3Ditor Versions (thanks, skywasjer for this great tool!) and if the player uses the Sabotage and Malfuntion - Option of Sh3-Commander (thanks, J.Jones for another great tool):
Good catch.

Yes, editing the following game files (beyond just changing existing values) may result in CTDs when the malfunctions/sabotage option is selected, due to changed hex offsets:

AI_Sensors.dat
GUNS_SUB.sim
Cameras.dat
Sensors.sim
Sensors.dat
NSS_Uboat7b.sim
NSS_Uboat7c.sim
NSS_Uboat9b.sim
NSS_Uboat9c.sim
NSS_Uboat9d2.sim
NSS_Uboat21.sim

If editing these files and unsure of the impact, test both with and without the malfunctions/sabotage option selected.

If the offsets have changed, then simply update them in ..\SH3 Commander\Cfg\Randomised events.cfg.

Mind you, in over four years only modified Cameras.dat and Sensors.dat have ever created problems.

Quote:
Originally Posted by Commander Gizmo View Post
If only we had a program that didn't rely on hex locations for this sort of thing...
Not that simple for reasons I've expressed many times elsewhere. But I remember you spouting about writing such a program over a year ago - can you pls provide a link to it?

Last edited by JScones; 10-22-09 at 03:07 AM.
JScones is offline   Reply With Quote
Old 10-22-09, 03:05 AM   #8
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

i use a hex editor to copy the first two chunks of an older and Sabotage-compatible cameras.dat (e.g. from GWX-Open Hatch) into my new tweaked cameras.dat. this eliminates the byte-offset and ensures compatibility.
__________________
My Mediafire page: http://www.mediafire.com/hsie
h.sie is offline   Reply With Quote
Old 10-29-09, 08:40 AM   #9
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,549
Downloads: 26
Uploads: 3
Default

Hmm? I did not change anything to the header-code in the last releases, so it should behave the same as before. Although it writes out the assembly title string (but I don't recall this has changed). What difference did you specifically find? (I have no idea, don't have anything installed to check)
skwasjer is offline   Reply With Quote
Old 10-31-09, 11:41 AM   #10
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

Hi skywasjer,

In cameras.dat from GWX-OpenHatch, for example, the first _Dummy_Cam_UZO section starts at Hex-Position 0xB8. This file is compatible to Sabotage & Malfunction, or, more precisely, it is compatible to the RandomizedEvents.cfg which comes with the SH3-Commander Files for GWX3.0.

After editing this file with S3D, the first _Dummy_Cam_UZO section now starts at Hex-Position 0xFF. All following data is shifted about 0xFF - 0xB8 = 0x47 Bytes. This file no more is compatible to Sabotage & Malfunction. Moreover, it's a potential CTD cause if used together with Sabotage & Malfunction.

But it could be made compatible by adapting RandomizedEvents.cfg accordingly.

It seems that the original cameras.dat from GWX-OpenHatch unfortunately has not been edited with S3D.......

Greetings,
H.sie
__________________
My Mediafire page: http://www.mediafire.com/hsie
h.sie 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 02:07 AM.


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