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)
-   -   Realism- and gameplay-related hardcode fixes for SH3.EXE (https://www.subsim.com/radioroom/showthread.php?t=174225)

LGN1 11-26-10 03:14 PM

Hi,

it's great to see this thread gathering momentum :up:

Just a comment about higher waves: I don't think they look nice/realistic in-game. They are just too short. It's not really possible to 'ride' them (just compare them to some storm pictures from Buchheim). I guess the engine is not capable to model large waves properly. Maybe that's the reason why they limited the wind speed :06:

Now some weather questions :oops::

- Is it known what happens if a new weather pattern is created before the old pattern has been reached? Can this cause problems?

- A possible weather change every 10-12h sounds really short to me :hmmm: Is this realistic? When shadowing a convoy for some time (up to days) I don't want to see the whole weather pattern of SH3 so that I can choose the best weather to attack.

Anyway, I am sure we will see a good algorithm in the end! Keep up the great work, h.sie.

Cheers, LGN1

h.sie 11-26-10 03:36 PM

I'm glad that I can finally use some boring statistics knowledge I learnt and never needed up to now.

Lets say because of the bug the weater algorithm sticks at high windspeeds. My fix will only be active if windspeed is 14 or 15. Then, with a certain chance C the windspeed will be reduced to a lower value (1m/s ... 8m/s) .

In order to adjust the chance C, I must have an idea of what is the resulting probability P that the bad weather period is interrupted after n = 1, 2, 3, 4,..... weather periods.

Solution: P = C * (1-C)^(n-1)

That means:

If I chose for the chance C = 10%
---------------------------------
P that bad weather is interrupted after the 1. weather period: 10%
P that bad weather is interrupted after the 2. weather period: 9,0%
P that bad weather is interrupted after the 3. weather period: 8,1%
P that bad weather is interrupted after the 4. weather period: 7,3%
P that bad weather is interrupted after the 5. weather period: 6,6%
P that bad weather is interrupted after the 6. weather period: 5,9%
P that bad weather is interrupted after the 7. weather period: 5,3%
P that bad weather is interrupted after the 8. weather period: 4,8%
P that bad weather is interrupted after the 9. weather period: 4,3%
P that bad weather is interrupted after the 10. weather period: 3,9%
P that bad weather is interrupted after the 11. weather period: 3,5%
P that bad weather is interrupted after the 12. weather period: 3.1%
P that bad weather is NOT interrupted after 12 weather periods: 28%

If I chose for the chance C = 20%
---------------------------------
P that bad weather is interrupted after the 1. weather period: 20%
P that bad weather is interrupted after the 2. weather period: 16%
P that bad weather is interrupted after the 3. weather period: 12,8%
P that bad weather is interrupted after the 4. weather period: 10,2%
P that bad weather is interrupted after the 5. weather period: 8,2%
P that bad weather is interrupted after the 6. weather period: 6,5%
P that bad weather is interrupted after the 7. weather period: 5,2%
P that bad weather is interrupted after the 8. weather period: 4,2%
P that bad weather is interrupted after the 9. weather period: 3,3%
P that bad weather is interrupted after the 10. weather period: 2,6%
P that bad weather is interrupted after the 11. weather period: 2,1%
P that bad weather is interrupted after the 12. weather period: 1,7%
P that bad weather is NOT interrupted after 12 weather periods: 7,2%

So C = 20% seems to be the optimal value for me.

By the way: this is not for bragging with formulas. I'm too old for that. But much more I think it's good for all interested people to know what we can expect from the fix (which is almost done!)

h.sie

h.sie 11-26-10 06:54 PM

@Stiebler: Funny, I found out that in the arctic sea I could not force windspeed lower than 7,5, even if I set ESI+3D4 to 0.

In other regions, St. Naziere, setting ESI+3D4 to 0 lets the wind go down to 0. So there is more code related to windspeed, maybe a location-dependent lower limit?

Lets hope that reducing wind to 7,5 is sufficient to remove fog.

h.sie

Yoriyn 11-27-10 06:15 AM

I'm very sceptic about all this messing in weather algorithms. Even the described Stiebler constant bad weather bug don't convince me. Maybe I only one who wahe a different weather experiences. I agree the storms can be big pain in the a**, but when they finish weather can back to "normal". Only problem what I see is a waiting for a weather change. Problem with fog is bad, cos minimum constant fog period is to first weather change interval (as we agree 40h), so that give as almost two days with fog. I think reducing intervals time should reduce all problems with weather. Reducing waiting time for change we also reducing time of duration of specific weather.

Actual "fixing" wind in north atlantic can have a bad effect on wind in south atlantic or mediterranean sea or increasing bad weather periods or decrasing muchly on arctic sea.

h.sie 11-27-10 06:31 AM

In fact: The delimiter at EnvSim.act+DDA5 does not always use the same limits. In the arctic, windspeed limits are not [0,49....15] but [7.5....15].
The limits itself can be found at ESI+3DC and ESI+3E0.

@Yoryin: I'll make a special version for you without any code messing except for time period reduced by 3. but for Stiebler et al. this is not sufficient. where is the problem?

h.sie 11-27-10 07:09 AM

In some tests in the northsea:

1. I fixed windspeed to 1m/s and watched fog over the time. then
2. I fixed wind to 15m/s and watched fog.

My first impression: Reducing windspeed does not affect fog and rain, at least there is no obvious strong correlation, which we need to control fog by windspeed. So I fear our idea does not work as intended. So I'll try to control fog directly.

Maybe in the game fog often occurs when wind is 15. but that does not automatically mean that windspeed controls fog.

Yoriyn 11-27-10 07:35 AM

Sorry I was sure there will be only one version. I thought you joking with all this extra versions. Sorry again, no more problems with me :D I'm closing my mouth forever :smug:

h.sie 11-27-10 08:02 AM

I'm not joking

h.sie 11-27-10 09:04 AM

@Yoriyn: So what factor would you like? 3.0?

Since I wasn't able to reproduce the long-time sticking on no-visibility, I think the idea to simply reduce time interval is not that bad. i like there more often changes, even if they are not 100% realistic. and even if the bug occurs, its length is reduced by 3.

Nevertheless I'll not give up to make a better fix. But for this I need to REPRODUCE the bug. Under which circumstances does it occur? location? season? year? month? any suggestions?

h.sie

Yoriyn 11-27-10 09:19 AM

Yes factor 3 for me please :)

When I can expect relase?

h.sie 11-28-10 06:57 AM

@ALL (who are interested) : Good news:

1) I finally managed to get write access to EnvSim.act. That means, I can work with a counter and store some stuff, which could be important when measuring the length of a bad-weather period. Patched sh3.exe is not required.

2) Also, I found a way to force windspeed AND fog to good conditions. The trick is not to change windspeed variable itself directly, that didn't change fog. Instead, I found out that the random numbers generated influence not the absolute weather but the weather tendency. If the random number is +1, weather gets worse. storm, fog are the result in 2 of 3 cases (@Stiebler: the other missing case of these 3 cases is caused by a scrambler related to the counter at 0xDD02BC). When the random number is -1, weather gets better in most cases (not always, maybe also because of a scrambler, but not absolutely sure in this point).

So I can now realise a fix that:

1) Measures the length of the bad weather period, which could be identified

a) either only by the amount of fog, or,
b) by the amount of fog AND windspeed.

2) If the bad weather period is longer than a certain value (could be a constant or a randomly chosen value), I bypass the random generator and load some -1 instead (or allow only negative random values), and wait, until weather gets better. I am slightly optimistic now, that we can fix the weather bug (which I have never seen, bru-har-har!)


@Yoriyin I think, your patch will be done in the next 0-2 days.

h.sie

h.sie 11-28-10 07:25 AM

Release: Bad Weather Fix - Yoryin special Edition

From the readme:

Weather Fix - Yoriyn Edition
----------------------------

Background
----------

Due to a serious bug, the sh3 weather sometimes sticks at high windspeeds with 15m/s and fog, rain and no visibility.

What does this mod do
---------------------
It simply reduces the weather changing period by a factor of 3, so that bad weather periods are shorter now. I don't know if now all problems are solved.

- Tested with WinXP/32Bit and Win7/64Bit.

- Should work with every version of sh3.exe

h.sie

Download: See my mediafire page, folder "Bad weather fix"

Magic1111 11-28-10 07:27 AM

Quote:

Originally Posted by h.sie (Post 1543001)
@ALL (who are interested) : Good news:

1) I finally managed to get write access to EnvSim.act. That means, I can work with a counter and store some stuff, which could be important when measuring the length of a bad-weather period. Patched sh3.exe is not required.

2) Also, I found a way to force windspeed AND fog to good conditions. The trick is not to change windspeed variable itself directly, that didn't change fog. Instead, I found out that the random numbers generated influence not the absolute weather but the weather tendency. If the random number is +1, weather gets worse. storm, fog are the result in 2 of 3 cases (@Stiebler: the other missing case of these 3 cases is caused by a scrambler related to the counter at 0xDD02BC). When the random number is -1, weather gets better in most cases (not always, also because of a scrambler).

So I can now realise a fix that:

1) Measures the length of the bad weather period, which could be identified

a) either only by the amount of fog, or,
b) by the amount of fog AND windspeed.

2) If the bad weather period is longer than a certain value (could be a constant or a randomly chosen value), I bypass the random generator and load some -1 instead, and wait, until weather gets better. I am slightly optimistic now, that we can fix the weather bug (which I have never seen, bru-har-har!)


@Yoriyin I think, your patch will be done in the next 0-2 days.

h.sie

Hi h.sie !

Wonderful news ! :yeah:

When do you plan to release your mod / the files ?

Best regards,
Magic:salute:

Yoriyn 11-28-10 07:43 AM

Thank you, I starting tests now.

After first tests I can say weather changing intervals in my SH3 is 10h:40min. So it is perfect :D exacly what I expect. Now I'm starting longer tests to check weather behavior.

Great job :yeah::yeah:

h.sie 11-28-10 12:43 PM

@Yoriyn: In the arctic sea weather changes more often, hopefully not too often now.

@Magic1111: I don't know. days? weeks?

@LGN1: One has to differ between the, say "current_weather" and, say, "current_end_weather". the second is what's calculated every weather period (20-40h), the first then slowly fits to the second during the time. but only the second is considered for the calculation of a new weather, that means it doesn't matter if the first has already fitted to the second or not. We have to discuss about the weather period. I asked earlier, but only got 1 answer: factor 3. I don't know what e.g. Hitman and Stiebler are thinking about that.

@ALL: The released Fix "Yoriyn edition" is not my final fix, it's just a quick fix for those who want shorter weather periods without any changes to the weather algorithm.

There will follow my fix I described above and perhaps, if necessary, a Stiebler's edition containing Stieber's approach to fix the weather bug.

h.sie


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