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-18-11, 01:58 PM   #31
makman94
Hellas
 
Join Date: Jul 2008
Posts: 2,325
Downloads: 182
Uploads: 7


Default

Quote:
Originally Posted by Rubini View Post
I tried it some days ago but no luck. The results continued inconsistents, just small better than before. I never get that good result as if we had a real fix on the visual sensor.


hello Rubini ,

i made some more extensive tests and the results are DEFINETELY much much better with AmbientLightColor and ReflectLightColor setted to 0-0-0 (just for the testing purposes) .

i created a new mission with the target 'showing' us all of its hull (AoB=90) for being as easily as possible spoted . i have send you this mission (and something more) to test at your yahoo mail ,make a check there !

here is the results of my tests as for the detect ranges:

i run the same mission 10 times
on pure NYGM installation (no mods enabled and no tweaks at NUGM's files):

1. 8400 m
2. 13900 m
3. 10200 m
4. 13300 m
5. 14100 m
6. 12200 m
7. 13600 m
8. 13000 m
9. 11900 m
10. 10400 m

then i run the same mission again 10 times but with AmbientLightColor and ReflectLightColor setted to 0-0-0 and here are the results at detect ranges:

1. TARGET NOT SPOTED AT ALL !
2. 7900 m
3. 5600 m
4. TARGET NOT SPOTED AT ALL !
5. 2600 m
6. TARGET NOT SPOTED AT ALL !
7. TARGET NOT SPOTED AT ALL !
8. TARGET NOT SPOTED AT ALL !
9. 200 m
10. TARGET NOT SPOTED AT ALL !

so , as you can see , the AmbientLightColor and ReflectLightColor are definetely giving better results !

BUT i think that it is absolutely NESECCERY to start by locating what is causing this randomness to detect results and ELIMINATE this randomness during the development - tests (see the second pack results...there is one 7900 m !!!). that way ,we will be able then to have secure results as for the 'effectivness' of AmbientLightColor, ReflectLightColor and light factor's at cfgs files

check your pm at yahoo mail , i am very curius to see your results

Quote:
Originally Posted by Rubini View Post
BTW, IMO, too dark nights in game will make the game (in ours houses) unplayable in normal conditions - i mean, during daytime, night with lights on, etc. So, I am not sure that using a so dark nights in game as unique solution (if it works) for vampire nights is a good solution. Will perhaps fix something but will narrow the game environment options to the players.
thats one other story that needs a lot of discussion Rubini ! point is this: are we after 'realism' ?...becuase if the answer is yes then you must not be able to see your nose during deep night (no moon nights). now, if you don't like the 'hardcore' dark envs then you (the player) will be able to see the ship at large distances....
__________________
Knowledge is the only thing that nobody can ever take from you...



Mediafire page:http://www.mediafire.com/folder/da50.../Makman94_Mods
makman94 is offline   Reply With Quote
Old 11-18-11, 02:10 PM   #32
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

@makman: I've found the code dealing with crew sensors. Different from my first statements, crew sensors do not use the same code as ememy sensors - they use completely different code! Not understood until now how it works.

If still desired, I'll try to add an ability to manually scale up/down the detection probability during gameplay. And I could also try to bypass the influence of random-numbers on detection in order to make influences more visible.

Don't know what is possible. Not very optimistic.
__________________
My Mediafire page: http://www.mediafire.com/hsie
h.sie is offline   Reply With Quote
Old 11-18-11, 02:21 PM   #33
makman94
Hellas
 
Join Date: Jul 2008
Posts: 2,325
Downloads: 182
Uploads: 7


Default

Quote:
Originally Posted by h.sie View Post
@makman: I've found the code dealing with crew sensors. Different from my first statements, crew sensors do not use the same code as ememy sensors - they use completely different code! Not understood until now how it works.

If still desired, I'll try to add an ability to manually scale up/down the detection probability during gameplay. And I could also try to bypass the influence of random-numbers on detection in order to make influences more visible.

Don't know what is possible. Not very optimistic.
yes H.Sie , i understand that it must be a 'hard' one but i just wish you the best of luck on this . i can't help ,although i really would like to could,on executables so i only wish the best of luck to you and Reaper (i really trust this guy,he is very dedicated and very serious on his work !!) .

about the probability of detection : i don't think that is needed a tool for 'scaling' this up or down . i really would like a tool that TOTALLY ELIMINATE the randomness (if possible of course). yes , this tool would help a lot during the development of mod and ,at the end, if the mod is complete we can enable back again this randomness(altered by us as it would be located) at values
__________________
Knowledge is the only thing that nobody can ever take from you...



Mediafire page:http://www.mediafire.com/folder/da50.../Makman94_Mods
makman94 is offline   Reply With Quote
Old 11-18-11, 02:41 PM   #34
reaper7
sim2reality
 
Join Date: Jun 2007
Location: AM 82
Posts: 2,280
Downloads: 258
Uploads: 30
Default

Quote:
Originally Posted by h.sie View Post
@makman: I've found the code dealing with crew sensors. Different from my first statements, crew sensors do not use the same code as ememy sensors - they use completely different code! Not understood until now how it works.

If still desired, I'll try to add an ability to manually scale up/down the detection probability during gameplay. And I could also try to bypass the influence of random-numbers on detection in order to make influences more visible.

Don't know what is possible. Not very optimistic.
That's great news. Hope you have luck getting this working via Hardcode.
I could possibly do an external script that will alter the distance detected influenced by the time of day if its not possible to hardcode it.
I would need to find the line of code that stores the variables for detection range. Haven't tried it yet - will wait to see how you get on (Hardcoded would be a better solution)

Again great work H.sie
reaper7 is offline   Reply With Quote
Old 11-18-11, 04:03 PM   #35
LGN1
Ace of the Deep
 
Join Date: Mar 2006
Posts: 1,138
Downloads: 147
Uploads: 12
Default

Hi,

I don't know whether it's of interest, but here is an old post from OLC about visual sensors, light factors,...

http://www.subsim.com/radioroom/show...postcount=1091

Cheers, LGN1

LGN1 is offline   Reply With Quote
Old 11-18-11, 05:14 PM   #36
makman94
Hellas
 
Join Date: Jul 2008
Posts: 2,325
Downloads: 182
Uploads: 7


Default

Quote:
Originally Posted by LGN1 View Post
Hi,

I don't know whether it's of interest, but here is an old post from OLC about visual sensors, light factors,...

http://www.subsim.com/radioroom/show...postcount=1091

Cheers, LGN1

I have FANTASTIC news guys !!!

@LGN1,this post of OLC was a real treasure ! the post of OLC 'showed' me that i hadn't setted to 0-0-0 the third (and seems more critical of all) environment 'light' !

so , i setted also the sunlightcolor to 0-0-0 and the results of 10 runs of my previous message's mission are :

1. TARGET NOT SPOTED AT ALL !
2. TARGET NOT SPOTED AT ALL !
3. TARGET NOT SPOTED AT ALL !
4. TARGET NOT SPOTED AT ALL !
5. TARGET NOT SPOTED AT ALL !
6. TARGET NOT SPOTED AT ALL !
7. TARGET NOT SPOTED AT ALL !
8. TARGET NOT SPOTED AT ALL !
9. TARGET NOT SPOTED AT ALL !
10. TARGET NOT SPOTED AT ALL !

OLC gave also another great tip ! that the reflectlightcolor is NOT effecting the visuals ,so i setted sunlightcolor and ambientlightcolor to 0-0-0 BUT i maxed a lot (not till higher max) the reflectlightcolor !
the results of 10 runs of same mission are :

1. TARGET NOT SPOTED AT ALL !
2. TARGET NOT SPOTED AT ALL !
3. TARGET NOT SPOTED AT ALL !
4. TARGET NOT SPOTED AT ALL !
5. TARGET NOT SPOTED AT ALL !
6. TARGET NOT SPOTED AT ALL !
7. TARGET NOT SPOTED AT ALL !
8. TARGET NOT SPOTED AT ALL !
9. TARGET NOT SPOTED AT ALL !
10. TARGET NOT SPOTED AT ALL !
(see the pics of these settings....my crew hasn't spot the target ! neither ,of course my own boat is spotted---don't pay attention at colors ...are just for testing purposes)


what does all these means ???
that he have a SOLUTION for the vampire effect ! a very CAREFULL selection of colors (intensity and RGB) at sunlightcolor and ambientlightcolor during night will give us the desired detect ranges for own crew ! and then we can SAFELY enlight the ships-sub as much we want via the ReflectLightColor and make them to come in harmony with the environment !!.of course ,this is something that must be done to each ones envcolors.dat

@H.Sie, i think that this is a perfect solution to vampire effect ! need ,of course , to create the envcolors.dat to see it 'working' in game but i am very optimistic that it will 'work' for sure !!
in this case,if you manage to create this tool that will eliminate the random probabilities at detect ranges we will be able to set these colors giving us the desired detect ranges !
i really believe that we are very close to fix it without the need of the 'hardcode' way!

=======
__________________
Knowledge is the only thing that nobody can ever take from you...



Mediafire page:http://www.mediafire.com/folder/da50.../Makman94_Mods

Last edited by makman94; 11-20-11 at 12:22 PM.
makman94 is offline   Reply With Quote
Old 11-18-11, 05:51 PM   #37
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

@Makman: I would not be that optimistic.

In 2008, I followed the development of OLC environment. OLC spent months to fine-adjust the light intensities of his environment in order to have realistic enemy sensor behaviour at daylight and at night (surface attacks possible). The light intensities are the heart of his work.

If you now adjust these light intensities to match your requirements for crew sensors, the enemy sensor adjustment could get worse.

I fear it won't be possible to adjust the env color / intensity to have both: well-adjusted enemy AND crew sensors at daylight and at night.

But hopefully I'm wrong. Good luck !
__________________
My Mediafire page: http://www.mediafire.com/hsie
h.sie is offline   Reply With Quote
Old 11-18-11, 06:31 PM   #38
reaper7
sim2reality
 
Join Date: Jun 2007
Location: AM 82
Posts: 2,280
Downloads: 258
Uploads: 30
Default

Hi H.sie do you know the location of the variable that is used for the 'Enemy Spotted' call i.e. the Range to nearest contact that has the random variance adjusted.

I've been able to find the Actual Distance to nearest contact 'From the Sh3sim.act' but its giving a random memory location each time so I can't read/write to it using my method.
Sh3sim.act+16E26 - Code :mov [edi+000000A0],edx
reaper7 is offline   Reply With Quote
Old 11-18-11, 07:15 PM   #39
Rubini
Ocean Warrior
 
Join Date: May 2005
Location: São Paulo Brazil
Posts: 2,728
Downloads: 132
Uploads: 0
Default

Quote:
Originally Posted by makman94 View Post
....

thats one other story that needs a lot of discussion Rubini ! point is this: are we after 'realism' ?...becuase if the answer is yes then you must not be able to see your nose during deep night (no moon nights). now, if you don't like the 'hardcore' dark envs then you (the player) will be able to see the ship at large distances....
I can´t agree with you here Mak. I never saw any game with night so dark that you can´t see anything. I want realism, but I also want some fun, some playability. Deep dark nights is out if my interest because this is at first a game and I want to play it. As we know the broken sh3´s visual sensor at night give you so much irrealistic detections, this just need a fix, not need to be a very realistic one. You also know that with a reasonable ( just this) dark nights in sh3 you will not be able to see ships so far and i guees that this is enough for our intentions. It´s then just need to adjust what you can see with the new sensors (hardfix) detections night distance and we will have a really new game behaviour at night!

My vote, my ask, continues to be to a hard fix on player crew night visual sensor.
I´m ready to help h.sie in any test.

I don´t have NYGM installed on my system to make the tests that you asked me. But if it works, it will work at the stock game too. I will have a look and let you know my results
__________________
One gamer's must-have mod is another gamer's waste of time.
-Sailor Steve
Rubini is offline   Reply With Quote
Old 11-19-11, 08:31 AM   #40
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

@reaper:

I use a single mission with one ship at 16km distance, coming slowly into my direction.

If you set a breakpoint at sh3.exe + 0x118F03, you can see a (float)variable on the stack at [esp+10]. This could be something like a detection probability. As long as its value is very small, the ship is not detected. If now distance gets smaller, this value rises, and suddenly jumps up to high values (currently don't know why). In this moment, the ship is detected, reported and shown on the nav-map. If I force this value to 0 by a little hack, the ship is never detected, even if its very near at daylight.
__________________
My Mediafire page: http://www.mediafire.com/hsie

Last edited by h.sie; 11-19-11 at 08:51 AM.
h.sie is offline   Reply With Quote
Old 11-19-11, 09:30 AM   #41
reaper7
sim2reality
 
Join Date: Jun 2007
Location: AM 82
Posts: 2,280
Downloads: 258
Uploads: 30
Default

Quote:
Originally Posted by h.sie View Post
@reaper:

I use a single mission with one ship at 16km distance, coming slowly into my direction.

If you set a breakpoint at sh3.exe + 0x118F03, you can see a (float)variable on the stack at [esp+10]. This could be something like a detection probability. As long as its value is very small, the ship is not detected. If now distance gets smaller, this value rises, and suddenly jumps up to high values (currently don't know why). In this moment, the ship is detected, reported and shown on the nav-map. If I force this value to 0 by a little hack, the ship is never detected, even if its very near at daylight.
Thanks H.sie this sound like just the variable I've been searching for. Like wise I've been using a singlemission by Makman for sensor testing.
And the Range location I posted above appears to activate exactly at the contacts max detection range (The circle shown when you click on the contact on the Nav-map at Easy Realism settings).

So I would Imagine the variable you found is 0 upto this point and then rises in a logarithmic fashion the closer you get to the contact (Same way the Stadimeter works for range finding) . That would explain why the value appears to jump to high values all of a sudden.

So using both of these Instructions my thinking of a solution would be to NOP the Instruction that write to the (sh3.exe + 0x118F03) so no value is sent to the memory location.
Then using the Instruction for distance to nearest contact (Sh3sim.act+16E26) we can send a large value to the sh3.exe + 0x118F03 location whenever we want.
So in essence we could send the value for different ranges for different stages of the day.

So if its dark send the large value (To activate the contact spotted routine) when the range to contact is between 1200m and 800m.
Like wise if its bright out then send the Large Value when target is between 20Km to 16Km out etc.


EDIT: Just looked at the code you posted (sh3.exe + 0x118F03) and this is the same value as the (Sh3sim.act+16E26)
So the variable on the stack at [esp+14] = Range to Contact while on the [esp+10] = Detection probability

Edit2: While the range to contact is read in at (sh3.exe + 0x118F03) from (Sh3sim.act+16E26) its not constant variable keeps reading in from other areas too. so jumps all around when breakpoint not set. So (Sh3sim.act+16E26) is a better solution for range as it value is constant updated for range only.
Not sure how to use Ollydebug to find [esp+10] to see the variable you refer to ??

Last edited by reaper7; 11-19-11 at 10:46 AM.
reaper7 is offline   Reply With Quote
Old 11-19-11, 09:44 AM   #42
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

@reaper: Yup, try that out. That could already be a solution. In the meantime I try to understand how the variable is calculated.
__________________
My Mediafire page: http://www.mediafire.com/hsie
h.sie is offline   Reply With Quote
Old 11-19-11, 10:04 AM   #43
Hitman
Pacific Aces Dev Team
 
Hitman's Avatar
 
Join Date: Sep 2002
Location: Spain
Posts: 6,099
Downloads: 109
Uploads: 2


Default

Quote:
Originally Posted by makman94
....

thats one other story that needs a lot of discussion Rubini ! point is this: are we after 'realism' ?...becuase if the answer is yes then you must not be able to see your nose during deep night (no moon nights). now, if you don't like the 'hardcore' dark envs then you (the player) will be able to see the ship at large distances....
Well, yes and no. Yes it is true that sailing on a dark night you might not see the bow of your own ship, but the reason is that you see it pitched against dead black water. However, if you watch an object that is taller than you and is against the sky, that is a different thing and the ambience light might at least show you its silhouette -even if only by contrast.

I can't explain that, I have experienced it when sailing at night but it is difficult to describe. Simply consider two things of huge influence:

1) The ambient light level in the air

2) What you pitch the object against, i.e. the background.

The effect is quite weird because from a high merchant's bridge you would actually be able to spot an uboat at some distance because it is silhouetted against the sky, but as soon as it comes close, you are higher than him and will see it against the black water -where you don't stand a chance of spotting it even if very close!

I guess this is impossible to translate into the game
__________________
One day I will return to sea ...
Hitman is offline   Reply With Quote
Old 11-19-11, 10:50 AM   #44
reaper7
sim2reality
 
Join Date: Jun 2007
Location: AM 82
Posts: 2,280
Downloads: 258
Uploads: 30
Default

Quote:
Originally Posted by h.sie View Post
@reaper: Yup, try that out. That could already be a solution. In the meantime I try to understand how the variable is calculated.
Added a second edit to the post above.
reaper7 is offline   Reply With Quote
Old 11-19-11, 11:24 AM   #45
h.sie
Admiral
 
Join Date: Jul 2008
Posts: 2,192
Downloads: 131
Uploads: 0


Default

@reaper: the variable I talk about of course jumps frequently, because it is located on the stack, that means it is a procedure-local variable with restricted lifetime and will be overwritten frequently as soon as the procedure ends. But this isn't really a problem and can easily be solved. I still prefer patching sh3.exe, because the whole code for crew sensors is located there: range, precise range and so on - the whole crew sensor algorithm! will take some time to understand it. But that's the fun part of it. Additionally, patching the Sh3Sim.act file is more difficult since one needs to write position-independent code and take care for relocation fixups (DLL !).

But I don't want to influence you and your ideas - since I am never 100% sure whether I see things correctly. Thus, let us try two different approaches. This is better than none.

I want to do as few changes to the sensor algorithm as possible. My first attempt is simply to multiply the detection probability variable with a certain value (1.0 (= no change) for day - and maybe 0,1 (= more blind) for night).
__________________
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 04:49 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.