SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SHIII Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=195)
-   -   [TEC] Modding SH3 (https://www.subsim.com/radioroom/showthread.php?t=225726)

Tycho 07-26-17 05:55 AM

I'm not doing anything about SH3 these days.
Yet, from time to time, in my thoughts something interesting emerges.
In my recent dealing with sh3.exe, during the spring, I saw something.

Now I think, that it will be possible, for example, to take some of kriegsmarine grid and to move and rearrange its lines, in order to create new grid.

Looking over SH3 kriegsmarine grid representation, I see the grids that are absolutely not needed, like: PA, PB and PC, and maybe GK.
So, why not to move, rearrange and rename these, and create for example: CL and CP (Black sea and East Med) .
Or maybe: AA, AB, AC and AT, for north operations.

When I will do that, I don't know. I have other priorities to do in SH3 for this winter.
First I will test the possibilities, and if it is possible, through the next year will make something about that.

gap 07-26-17 09:02 AM

Interesting topic :up:

In the past I have been messing with SH5's terrain types, I even had some clues by one of the devs, and I must say that things haven't changed much from SHIII to SH5.

Thank you for sharing your knowledge Tycho & Co. :salute:

Tycho 12-24-17 07:38 AM

Not much time for SH3 lately, but here I made something to enhance my game.
I sail hardcore way. Without my boat on map, I use dead reckoning and coastal navigation. Deep in the sea, except dead reckoning, two or three time per day I make fixes by ctrl+left click, if the sky objects are visible.
First, look over this thread by Sjizzle:Long / lat.

So, if debug is activated in EnvSim controller, we will have this thing on screen.
It will be on every external camera directly over the scene, under the Gui. The whole looks:


I decide to make use of this.
Well, I need only Long/Lat information, now let's dig, from where this come. Probably from the EnvSim.act file, and yes I found it there.
First, I don't need this red compass thing, it show the camera orientation with respect to the world directions. Found some bool and switch it off.
Next are these color index/ratio informations, also not needed. Just changed its color to transparent, now this part is invisible.
Now, where to put Long/Lat? First, I thought about upper right corner of the screen.
Ops, setback. There is only one byte for vertical coordinate, I can't move it more than FF.
For horizontal coordinate it is the whole word, so no problem there.

And here a idea come in my mind. I moved the Long/Lat information in the lower left part of the screen and cut a hole in my interface.
Then I took the Stiebler's Weather meter graphic element, moved and changed it, to cover the Long/Lat. Made "none fog" and "light fog" with some transparency, medium and havy fog without transparency.
So in bad weather Long/Lat is covered and not visible. Screens:


Yes, there have weather conditions, that spoil the impression, like: light fog and overcast clouds.
But, I have enough self control, to not use it in these cases.
If it is possible for Stiebler to make the weather meter to count also the clouds state, not only fog state....?
Screen:


Now, what to do with this? Calculate and plot on map. Let's do it.

What we have here, Long: -8,19221 and Lat: 43,42171
Obviously, we are at 8° and a something West of the Greenwich, 43° and a something North of the Equator.
In SH3 world, 1° is 120 km. So we take the number after decimal, like whole and multiply it by 1.2
We get the distance in meters. Plot it on map after appropriate degree.
We can use a calculator, or by hand on paper, but I like to do it directly in game, so I use sliderule, and it come to this.
We multiply 19 and 1/4 by 1.2 and the result is 23km and 50m, and plot this on map:

Then, multiply 42 and a little by 1.2 and the result is 50km and 500m, and plot this on map:

Now, the tricky part, take the horizontal (Long) line, grab the zero side and move it straight up and make it vertical.
The same with vertical (Lat) line, grab the zero side and make it horizontal. The two line must cross, and where they cross is our position.
Screens:

If we do it with calculator, the results are:
19220x1.2=23064
42171x1.2=50605

If we check the exact position, it is on mark 1.
Screen:

So, with calculator it will be absolutely correct.
But, when you sail without boat on map, you get used to that your exact position is not so important and needed.
In fact, the real U-boat almost all of the time are not on exact position, but on assumed position.
Even for a few hours after fix they have accumulated several miles of incorrectness.
You can see this in most of U-boat KTB's. And probably, their Celestial fixes were also not so accurate, a few hundred meters are not a problem, there.

Merry Christmas and Happy New Year to you all.

Tycho 11-13-18 08:12 AM

Screenshots
 
Some time ago I realised, that to make the screenshots to go in separated folder will be very easy.
You know, the screenshots are written in the main directory, between the other files.
I have two variants for that.
Will put this here, until update my TychoSh3Patch.

So, I open sh3.exe with HexEditor and use search for text - ".bmp", and found this string: "SH3Img@%u-%u-%u_%u.%u.%u_%u.bmp"

It is in rdata section, and must be used somewhere in the code section, by it address.
I look the address of the first byte, and I go in beginning of the file and use search for hex value: ecda5100
And found it here:

I see that it is pushed there, but let's look the disassembled code for more explicit view.
I take the address for the previous byte "68" and go there in the disassembled code:

So, I see that the string is pushed, then something else is pushed, and then have call for function that will use this pushes.
Further research shows that this function is: MSVCR71.DLL!sprintf
Looking further, how this function is used in other places in the code, I see that there is no problem the string to be pointed with location.
The conclusion is that, I can very easy make the game to write the screenshots in separate folder, with change of only one byte.

I go back to the string and change this byte (address: 0011DAF2) from 40 to 5C, from @ to \

For use with TychoSh3Patch:
 
Code:

@@@ The screenshots will go to the SH3Img folder
#
0011DAF2: 40 5c
#
#


I go in the main game directory and I create a new folder named exactly SH3Img.
Now, the screenshot will be written to the "SH3Img" folder, but the screenshot will not have this prefix: SH3Img@date_hour.minutes...bmp,
but will start directly with the date, for example: 17-10-2018_18.35.42_681.bmp

But, for me is more satisfactory the folder to be named "Screenshots", so I make something else.
I see that to the end of the rdata section have some free space. So, I write there:
Screenshots\SH3Img@%u-%u-%u_%u.%u.%u_%u.bmp

Then, I take the address of the first byte: 0013A100, I go to where the string is pushed (00001A4E) and change the bytes there, from: ECDA5100 to 00A15300.

For use with TychoSh3Patch:
 
Code:

@@@ The screenshots will go to the Screenshots folder
#
00001A4E: ec 00
00001A4F: da a1
00001A50: 51 53
00001A51: 00 00
@
0013A100: 00 53
0013A101: 00 63
0013A102: 00 72
0013A103: 00 65
0013A104: 00 65
0013A105: 00 6e
0013A106: 00 73
0013A107: 00 68
0013A108: 00 6f
0013A109: 00 74
0013A10A: 00 73
0013A10B: 00 5c
0013A10C: 00 53
0013A10D: 00 48
0013A10E: 00 33
0013A10F: 00 49
0013A110: 00 6d
0013A111: 00 67
0013A112: 00 40
0013A113: 00 25
0013A114: 00 75
0013A115: 00 2d
0013A116: 00 25
0013A117: 00 75
0013A118: 00 2d
0013A119: 00 25
0013A11A: 00 75
0013A11B: 00 5f
0013A11C: 00 25
0013A11D: 00 75
0013A11E: 00 2e
0013A11F: 00 25
0013A120: 00 75
0013A121: 00 2e
0013A122: 00 25
0013A123: 00 75
0013A124: 00 5f
0013A125: 00 25
0013A126: 00 75
0013A127: 00 2e
0013A128: 00 62
0013A129: 00 6d
0013A12A: 00 70
#
#


I go in the main game directory and I create a new folder named exactly Screenshots.
Now, the screenshot will be written to the "Screenshots" folder.

makman94 11-15-18 03:51 PM

Another comfort addition ,now all pics at their folder

Thank you for sharing :Kaleun_Salute:

JeromeHeretic 12-28-18 11:38 AM

Quote:

Originally Posted by Tycho (Post 2532833)
Not much time for SH3 lately, but here I made something to enhance my game.
I sail hardcore way. Without my boat on map, I use dead reckoning and coastal navigation. Deep in the sea, except dead reckoning, two or three time per day I make fixes by ctrl+left click, if the sky objects are visible.
First, look over this thread by Sjizzle:Long / lat.


Tycho, do you have an idea how to set board clock to GMT? In this debug screen with coordinates GMT is presented.

Ingame problem with celestial navigation is, that when you start mission, board clock is set to time in nautical timezone where you actualy start (so for example if you are in Kiel, your board clock are set to zone GMT +1.

Second problem - when you load previously saved game, the board clock is reset to time of the actual nautical timezone where your uboat is.
I can live with this, but if there is any possibility how to fix board clock to GMT, it will be very nice.


And second question - do you have any idea how star sky is represented in SH3?

Why I'm asking? I seen the 3D model of hemisphere, it is real "halfball", but what i don't know from where are the stars taken to project it on this spere. And im asking for it, because i created sun almanak for SH3 world, but i can't create star almanak for celestial navigation. This information about exact position of stars is somewhere in SH3 world hidden, but i don't know where. If i will be able to get this info, i can create star almanak corresponding to SH3 world.

In north hemisphere i'm using Polaris when im under 50 deg. When im in higher latitude i use Perkhad when is exactly under Polaris.

In SH3 universe is Perkhad exactly 20 deg (+- so little bit, that you are not able measure it anyway) from Polaris. Measuring of angle bigger as 50 degrees is problem because of camera distorsion, which can't be completely removed. I'm able only precisely know how distorsion looks like, so can create precision degree scale for sextant. For transatlantic traveling it is precisely enough, but longitude is bigger problem and is not acurate enough.

Just imagine, that 1 minute of time is error of 1/4 deg, so it means, that error is 15 NM, that means 30 km in SH3 world. With unacurancy of measuring and unacurancy of 10 deg scale of sun almanak, there is no problem to have error +- 200 km in longitude. Again - for transatlantic travel it can be enough, but in other way it is absolutly unusable. Just imagine, that you need to set course for attacking some convoy and you know your position with precision +- 200 km.... Absolutly unusable.
(for coastal navigation im working on mod with about 2000 lighthouses and lightboats)

3 stars measuring solution can be reason for this. If i can dig out the star data from game somehow...

Echolot 02-15-19 05:30 AM

Hello Tycho.


Thank you for your patches, I enjoy the full screen maps very much for example.


Do you guess we can get a full screen museum like in SHV in the future?


:Kaleun_Salute:

Anvar1061 02-15-19 02:41 PM

Quote:

Originally Posted by makman94 (Post 2577435)
Another comfort addition ,now all pics at their folder

Thank you for sharing :Kaleun_Salute:

Yeah, but how does it work? And where can I download?

Tycho 02-21-19 08:09 AM

Quote:

Originally Posted by JeromeHeretic (Post 2583564)
Tycho, do you have an idea how to set board clock to GMT? In this debug screen with coordinates GMT is presented.

I was read about this time problem, but it is not my concern. I will not go to measure angles myself.
Ideal variant for me is to ask Nav Officer for boat position, and he to report it with long/lat coordinate, if conditions permit.

Something interesting:
This "Time Accel: 1 times", that you see on this debug info is not the time compression, that we use to accelerate the game.
If you use time compression X something, this will stay to "Time Accel: 1 times".
And once, more than year ago, I activated this incidentally.
I tested something, don't remember what, but was not related to this time stuff.
Was some editings in the code and in the save files. And after I load the save, this time acceleration come to "something times".
What happened, is that the world was stay on normal speed of existent, but the sky/stars started to move/rotate quickly.
This did not affect the sun, the sun was stayed on position and moved on normal speed.
So, probably, the movement of the stars and the sun are handled by different functions.
Now I can't remember at all, what I did then, to activate this.

About stars drawing! I can imagine, how the stars are made by some Draw Primitives function in the code, with additional functions for position, rotation..., but where is this, I don't know.

Quote:

Originally Posted by Echolot (Post 2591777)
Hello Tycho.
Do you guess we can get a full screen museum like in SHV in the future

Are the museum is not the full screen. I don't even remember how exactly the museum looks, I don't use it.
If it is the menu, that hinders you, and if it is in menu_1024_768.ini file, some gui modder can change it. If there have hardcoded menu elements, then it is in sh3.exe and someone have to find and change these. Sorry but, I'm not that one.

Quote:

Originally Posted by Anvar1061 (Post 2591886)
Yeah, but how does it work? And where can I download?

Sorry, but I can't do these things more easy for you! You need to learn a very basic and easy stuff.
I did the hard work and found a bunch of useful byte location in sh3.exe, change these byte values and you will have some result, like to have different colors for drawing lines on the map tools, for example. Why you can't take advantage of this? I don't understand.
Specifically for screenshots thing, it is single byte change, do it manually with hex editor or put it in TychoSh3Patch.
How to put it there?
With Copy/Paste, as simple as that.
Well, probably I'm not capable to make good explanations. But, it is like it is!
Considering, that I'm out of Silent Hunter, there will not be more easy option from my side.

makman94 02-21-19 07:36 PM

Quote:

Originally Posted by Anvar1061 (Post 2591886)
Yeah, but how does it work? And where can I download?

hello Anvar,

you can download it from here:
http://www.subsim.com/radioroom/showthread.php?t=231140

look at the "how to install" section and you will find the download link

The instructions how to make it are here: http://www.subsim.com/radioroom/show...&postcount=105

i used the fast way of the two that Tycho shared.
So , copy-paste in the TychoSh3Patch.map the code:
@@@ The screenshots will go to the SH3Img folder
#
0011DAF2: 40 5c
#
#


and then create a new folder in the main game directory with the exact name SH3Img

Your screenshots ,simply as this, are located now into the "SH3Img" folder

makman94 02-21-19 08:18 PM

Quote:

Originally Posted by Echolot (Post 2591777)
Hello Tycho.


Thank you for your patches, I enjoy the full screen maps very much for example.


Do you guess we can get a full screen museum like in SHV in the future?


:Kaleun_Salute:

hello Echolot,

There is a problem at the museum page and this is not the fulling of the screen itself. This can be easily done via the menu_ini ,the museum.tga and the museum camera parameters of the cameras.dat.
The problem is that ,if you full the museum screen, all the ui items (ships's data..etc) are "covered" by the 3d view and this is not fixable through the menu_ini

Anvar1061 02-22-19 12:02 AM

Quote:

Originally Posted by makman94 (Post 2592969)
hello Anvar,

you can download it from here:
http://www.subsim.com/radioroom/showthread.php?t=231140

look at the "how to install" section and you will find the download link

The instructions how to make it are here: http://www.subsim.com/radioroom/show...&postcount=105

i used the fast way of the two that Tycho shared.
So , copy-paste in the TychoSh3Patch.map the code:
@@@ The screenshots will go to the SH3Img folder
#
0011DAF2: 40 5c
#
#


and then create a new folder in the main game directory with the exact name SH3Img

Your screenshots ,simply as this, are located now into the "SH3Img" folder

http://www.subsim.com/radioroom/imag...n_Salute-1.gif
Thank you very much, makman94! I wish you good luck and wait for you a new interface mod (HAHD).http://www.subsim.com/radioroom/imag...n_Cheers-1.gif

Echolot 02-22-19 03:32 AM

Thank you very much Tycho and makman94.


:Kaleun_Salute:

makman94 02-22-19 12:19 PM

Quote:

Originally Posted by Anvar1061 (Post 2592994)
http://www.subsim.com/radioroom/imag...n_Salute-1.gif
Thank you very much, makman94! I wish you good luck and wait for you a new interface mod (HAHD).http://www.subsim.com/radioroom/imag...n_Cheers-1.gif

thank you too Anvar but,
I just rewrote you the specific part of Tycho's post that you need for making it work the fast way so ,if you want to try the other way too, you must read Tycho's post carefully and follow his steps

Quote:

Originally Posted by Echolot (Post 2593013)
Thank you very much Tycho and makman94.


:Kaleun_Salute:

:Kaleun_Salute:

Anvar1061 02-22-19 01:09 PM

Quote:

Originally Posted by makman94 (Post 2593072)
thank you too Anvar but,
I just rewrote you the specific part of Tycho's post that you need for making it work the fast way so ,if you want to try the other way too, you must read Tycho's post carefully and follow his steps.
:Kaleun_Salute:

http://www.subsim.com/radioroom/imag..._Applaud-1.gifhttp://www.subsim.com/radioroom/imag..._Applaud-1.gifhttp://www.subsim.com/radioroom/imag..._Applaud-1.gif
I do not know how to use HexEditor and there is no need now. You quite clearly explained and now my screenshots in the separate folder.
http://www.subsim.com/radioroom/imag...n_Cheers-1.gifhttp://www.subsim.com/radioroom/imag...n_Cheers-1.gifhttp://www.subsim.com/radioroom/imag...n_Cheers-1.gif


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