Quote:
Originally Posted by h.sie
@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 ??