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 11-23-10, 02:28 AM   #571
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

Hi Magic,

I tested that EnvSim.act only with WinXP/32. It does not work in Win/64Bit. It shoud work with every sh3.exe. But be careful: Use a special SH3 installation for testing. And: the weather change periods are only 2 hours and less for demonstration purposes only. Not for serious play.

So if there are no more bugs in V15D, I'll release a "stable" Version this weekend after fixing the museum-bug which only appears when in museum.

In the next days I'll release a new EnvSim.act which will work with Win/64Bit.

h.sie
__________________
My Mediafire page: http://www.mediafire.com/hsie
h.sie is offline   Reply With Quote
Old 11-23-10, 02:54 AM   #572
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

@Stiebler: I have an vague idea (that must be tested): If the tendency of the algorithm to produce bad weather is a slow process that slowly converges to bad weather patterns, I could force a "reset" to normal conditions by randomly/casually set the conditions back to "good" (no storm, no fog).

But first

1) I have to find out why EnvSim.act doesn't work in 64Bit OS.
2) I have to find the variable resposible for fog.
__________________
My Mediafire page: http://www.mediafire.com/hsie
h.sie is offline   Reply With Quote
Old 11-23-10, 04:06 AM   #573
Magic1111
Silent Hunter
 
Join Date: Sep 2008
Location: Germany - Sailing on U-552 in North Atlantic
Posts: 4,429
Downloads: 783
Uploads: 0


Default

Quote:
Originally Posted by h.sie View Post
Hi Magic,

I tested that EnvSim.act only with WinXP/32. It does not work in Win/64Bit. It shoud work with every sh3.exe. But be careful: Use a special SH3 installation for testing. And: the weather change periods are only 2 hours and less for demonstration purposes only. Not for serious play.

So if there are no more bugs in V15D, I'll release a "stable" Version this weekend after fixing the museum-bug which only appears when in museum.

In the next days I'll release a new EnvSim.act which will work with Win/64Bit.

h.sie
Hi h.sie !

Many thanks for your Reply ! Now all is cleared !

And that are very good news, that you´ll release in the next days new "stable" Versions from V15D AND EnvSim.act !!!!

For me (and many other Users) is important, that EVERY MOD from you (and/or modded Files like EnvSim.act) work with Win7/64Bit too and we can play career with your MODs (not ONLY testing) !

Best regards,
Magic
__________________
Magic1111 is offline   Reply With Quote
Old 11-23-10, 04:29 AM   #574
Stiebler
Fuel Supplier
 
Stiebler's Avatar
 
Join Date: Oct 2005
Location: London, UK
Posts: 1,237
Downloads: 29
Uploads: 4


Default

@H.sie:
Many thanks for the detailed reply above. I'll look into this as soon as possible.

One quick thought: maybe most problems could be resolved by setting the 'emphasis-factor' (or its associated random number) for wind speed to zero. Then redistribute the wind speed parameter between 0 and 15 m/s. Or use CherryHarbey's solution (below).

@CherryHarbey:
Quote:
or alternatively take two random numbers between 0 and 16 and multiply together. Maximum value will still be 256 and answer from the range 0 to 256 but skewed towards the lower end.
That is a very imaginative solution - many thanks also. Particularly since, improbable though it may appear, calm seas are actually more common than very stormy seas in mid-Atlantic (according to U-boat war diaries).

My concern would be the source of the random numbers, and how random the numbers would be if plucked in quick succession, at assembler speed, in a few adjacent lines of code. (Most random number generators rely on a time seed for their random algorithm; a few take numbers from a hardware generator that is involved in code or output processing, so results are pseudo-random).

Stiebler.
Stiebler is offline   Reply With Quote
Old 11-23-10, 05:03 AM   #575
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

@Stiebler:

At EnvSim.act+0xDD61 you see the call for a routine which itself calls Random32(). There you see what happens. Of course this is pseudo-random but hopefully with a very long period since it's based on a 32bit-key. So it repeats the first time after 2^32 = 4G random numbers.

The problems I fear with simply damping down a factor are as follows:

1) The algorithm to calculate wind-speed is not simple and time-independent as I thought at first. It is not only

15*(RANDOM)+15 -> delimited to [0,449-15] and with -1<RANDOM<+1

This could be fixed by using this algorithm

7,5*(RANDOM)+7,5 with -1<RANDOM<+1

which does not even need to be delimited.

There seems to be a loop-back that considers older windspeeds for calculating the new ones. This closed loop also explains the tendency to converge to a certain value (15). An simple random algorithm without loop-back would never converge.

So if we change one factor we could change the whole loop-back behavior (and shred the whole algorithm).

2) As Hitman said, 15m/s is not the hightest windspeed and other people are there wanting higher waves. If we damp down that factor, windspeeds will be lower in average. I would not like that.


But let me first find out how to program for 64-Bit systems. DLL's and ACTs are loaded in a different way in 64 Bit OS, and obviously I made a mistake. If I don't find the cause of my error, there is no need to talk about algorithm.

And then it's important to find out how to manipulate clouds / fog.

And after that all we can test different algorithms to fix the weather.

Greetings,
h.sie
__________________
My Mediafire page: http://www.mediafire.com/hsie
h.sie is offline   Reply With Quote
Old 11-23-10, 07:56 AM   #576
Stiebler
Fuel Supplier
 
Stiebler's Avatar
 
Join Date: Oct 2005
Location: London, UK
Posts: 1,237
Downloads: 29
Uploads: 4


Default

@H.sie,

This information acknowledged with thanks.

You made a good point with:
Quote:
15*(RANDOM)+15 -> delimited to [0,449-15] and with -1<RANDOM<+1

This could be fixed by using this algorithm

7,5*(RANDOM)+7,5 with -1<RANDOM<+1
Don't forget that higher waves can be fixed elsewhere (I think in scene.dat) without needing higher wind speeds. Magic111 or Makman94 or OneLifeCrisis know better than me.

Keep up the good work! So far I have been unable to link the .act (or other dll) files to sh3.exe in my own disassembler. It is not a task I have ever needed previously.
[Edit: I have just discovered that Ollydbg2 does not function with 64-bit Windows.]

Stiebler.

Last edited by Stiebler; 11-23-10 at 08:17 AM.
Stiebler is offline   Reply With Quote
Old 11-23-10, 09:16 AM   #577
Hitman
Pacific Aces Dev Team
 
Hitman's Avatar
 
Join Date: Sep 2002
Location: Spain
Posts: 6,099
Downloads: 109
Uploads: 2


Default

To clarify some things, so that h.sie has it easier :

- Wave size and style can be set in the scene.dat file

- You can set a wave size and style for each m/s wind speed, from zero to whatever you want, so you would see waves change as wind speed increases/decreases with each 1 m/s change

- In the game there are currently only 4 sizes of waves, for 0 wind speed, small (4-8 m/s), medium (9-14 m/s) and hard wind speed (15 m/s). Most environmental mods have changed waves size, but in general keep that number of possible waves.

- 15 m/s waves in the game are actually storm waves and would appear in real life only with much stronger winds. But somehow the game has the maximum at 15 m/s, and hence that's the speed where you get the biggest waves.

So, in general, we can provide "playable" waves even with 15 m/s winds in the game simply by reducing the size of them, as f.e. Manos has already done with his environmental mod.

So where's the problem?

The problem is double:

A) Wind speed tends to stick high, as you already know

B) The game's logarythm seems to have strong winds associated with fog and rain, and that together makes the game almost unplayable. There is a parameter in scene dat for "Randomwind" that relates windspeed and rain. Wether it adds a certain wind speed when rain appears, or makes rain appear when wind goes over the set speed, it's difficult to say. It could also be altogether broken.

But it's a fact that overall softer wind speeds will mean more sunny days and less fog & rain.

To sum up, if you simply manage to have the average wind speed decrease in the algorythm, we will have the biggest part of the weather problem solved, both because we will get rid of "permanent storm" situations, and because in general fog and rain (Which make the game unplayable many times) will appear less often. It is not as important to have "realistic" wind speeds (i.e. wind speeds of more than the game's current limit of 15 m/s) as to have a more logical distribution of wind speed along the days in a patrol.
__________________
One day I will return to sea ...
Hitman is offline   Reply With Quote
Old 11-23-10, 09:30 AM   #578
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

@Hitman. Now I understand why you always talk about manipulating windspeed instead of fog.

That means I don't even need to manipulate fog, it's sufficient to manipulate windspeed, because it affects fog. I'll give that a try, because I have already successfully manipulated windspeed in the debugger (not yet by patch code).

Ok, now I have to find out how to program 64bit-compatible .act files. Let's hope I find a solution.

Then we can discuss about how exactly modify windspeed (algorithm).

Question: What if I find out how to directly modify fog/clouds? Would that be better than indirectly modify them by reduced windspeed???

h.sie
__________________
My Mediafire page: http://www.mediafire.com/hsie

Last edited by h.sie; 11-23-10 at 09:47 AM.
h.sie is offline   Reply With Quote
Old 11-23-10, 10:05 AM   #579
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

@Stiebler: I am able to run OlliDbg2 on Win7/64Bit. It automatically loads all dll's and .act's at program start and you just have to set the breakpoints as I described above.

h.sie
__________________
My Mediafire page: http://www.mediafire.com/hsie
h.sie is offline   Reply With Quote
Old 11-23-10, 12:23 PM   #580
Stiebler
Fuel Supplier
 
Stiebler's Avatar
 
Join Date: Oct 2005
Location: London, UK
Posts: 1,237
Downloads: 29
Uploads: 4


Default

@H.sie:

1. I agree completely with Hitman that wind speed is the critical issue, even before you identified a bug in the wind-speed algorithm.

2. Therefore it would be safer not to alter fog and rain settings until the natural wind fix is tried first.

3. Many thanks for the information about Ollidbg2 with Windows-7/64-bit. I took my pessimistic view from the download page for this disassembler, so I haven't actually tried it.

4. I believe I understand now how to see envsim.act file in my own disassembler (IDA PRO plus), so I can try that too (both tomorrow).

Wish me luck. I think I'm going to need it!

Stiebler.
Stiebler is offline   Reply With Quote
Old 11-23-10, 02:37 PM   #581
Hitman
Pacific Aces Dev Team
 
Hitman's Avatar
 
Join Date: Sep 2002
Location: Spain
Posts: 6,099
Downloads: 109
Uploads: 2


Default

Quote:
Question: What if I find out how to directly modify fog/clouds? Would that be better than indirectly modify them by reduced windspeed???
I agree with Stiebler. Wind is the critical issue, and following the spirit of what your work is about, let's do fewer and effective changes instead of complicating things too much. First we must try with a simple fix to windspeed and test, as well as get feedback from the thousands of people who will be able to use it (ACT file will work also for the starforce versions).

If later we see the need and oportunity to tweak something else, then we can talk about it. But in general, the less you change, the easier it will be to keep everything under control.

[EDIT]

Probably the best thing will be a combination of more frequent weather changes and a tendency for lower wind speeds in the algorythm. That should allow the complicated pattern created by the Devs for seasons/zone weather changes to work much better.
__________________
One day I will return to sea ...
Hitman is offline   Reply With Quote
Old 11-23-10, 05:22 PM   #582
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

In the meantine I made a new version of EnvSim.act which ran on XP/32 and Win7/64 without problem. Can be used with unpatched sh3.exe.

Only fix so far: Weather change period reduced by a factor of 20.

I suggest to go to the bridge or external cam and set TC=128x. (Normally max. TC on bridge is 32x, but this value can be changed using SH3Cmdr: "When in 3D views").

Then you can see the fast weather changes.

This is for demonstration purposes only.

Use on your own risk.

Can be downloaded from my mediafire page, Folder "Testing".

Tomorrow I'll start to implement a very simple algorithm in which I try to disturb the windspeed tendency to converge to 15m/s

h.sie
__________________
My Mediafire page: http://www.mediafire.com/hsie

Last edited by h.sie; 11-23-10 at 05:34 PM.
h.sie is offline   Reply With Quote
Old 11-23-10, 08:26 PM   #583
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

What software do you use for your work at this point?
  Reply With Quote
Old 11-24-10, 01:49 AM   #584
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

@privateer: A little bit with OlliDbg and mainly with a tool that has been developed in my company - not freely available.

@Stiebler: I think the author of OlliDbg meant that OlliDbg won't run in 64-BIt mode, but it (obviously) can debug 32-bit applications. I had no problems so far.
__________________
My Mediafire page: http://www.mediafire.com/hsie
h.sie is offline   Reply With Quote
Old 11-24-10, 01:59 AM   #585
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

My idea for a first very simple algorithm is as follows:

Windspeeds between 0 and 14 are not touched, because they are (hopefully) distributed homogenuously.

But if New_Windspeed==15, then, by a certain chance of, let's say, A=50% this is not changed. But with the remaining chance of (1-A)=50% a new windspeed between B=5 and C=14 is randomly generated. That should at least disturb most of the long periods of bad weather, although, there remains (statistically) a little chance for very long periods, what I think is not unrealistic.

If that works in principle, one can fine-adjust A, B, C.

What I don't know is: how low must the windspeed been chosen in order to guarrantee that bad weather ends or at least will be reduced?



h.sie
__________________
My Mediafire page: http://www.mediafire.com/hsie

Last edited by h.sie; 11-24-10 at 03:05 AM.
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 12:33 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.