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 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 03-24-14, 04:51 PM   #3031
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
yep, I know it, and I have copied your formulas in my proposed algorythm.
The few extra calculations I have added (in bold in my previous post), ensure that the value that minimum signal strength gets multiplied by, is alway within the range 1-3. Without them, detection during "twilight-almost-night" can be weaker than during night time (i.e. multiplier bigger than 3), which wrong imo.
Your formula doesn't work. Try it with current light value of 0.5 and 0.283.
Mine has an error also that I just found out when current light = 0.5

Thus I came up with a new algorithm:
- if game reports back it's daytime:
-- compare game's nighttime value (0.283) to start of nighttime value (0.5) - I do this comparison because it's possible someone may screw up and assign the start of nighttime value <= 0.283 since it's a variable in the patch file
-- if greater than or equal then jump to end of function
-- if less than then subtract game's nighttime value (0.283) from start of nighttime (0.5) - result is 0.217
-- take current light value (say it's 0.385) and subtract game's nighttime value (0.283) - result is 0.102
-- divide 0.102 by 0.217 - result is 0.47
-- subtract 0.47 from 1.0 - result is 0.53
-- multiply 0.53 by game's nighttime multiplier for player's crew (3.0) - result is 1.59
-- if result above > 1.0 then subtract 1.0 from result above - result is 0.59
-- load derived minimum signal strength into XMM0 and XMM1 (let's say it's 0.1)
-- multiply XMM1 by 0.59 - XMM1 = 0.059
-- add XMM1 to XMM0 - XMM0 = 0.159 - this is the new minimum derived signal strength
TheDarkWraith is offline   Reply With Quote
Old 03-24-14, 05:26 PM   #3032
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Your formula doesn't work. Try it with current light value of 0.5 and 0.283.
This is exactly what I did, and the extreme values 0.5 and 0.283 gave me the expected results (i.e. 1 and 3)

You can check yourself: I have entered my formulas in an on-line document (google spreadsheet). Just replace the 'current light value (clv)' figure with whatever you want within the range 0.283-0.5, and read the result in the last row
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 03-24-14, 05:46 PM   #3033
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
This is exactly what I did, and the extreme values 0.5 and 0.283 gave me the expected results (i.e. 1 and 3)

You can check yourself: I have entered my formulas in an on-line document (google spreadsheet). Just replace the 'current light value (clv)' figure with whatever you want within the range 0.283-0.5, and read the result in the last row
That's wrong. 0.5 should give 0 - no multiplier (thus the current minimum signal strength should be used)
0.283 should give 3 - max multiplier - thus 3.0 should be multiplied by the minimum signal strength
TheDarkWraith is offline   Reply With Quote
Old 03-24-14, 06:04 PM   #3034
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
That's wrong. 0.5 should give 0 - no multiplier (thus the current minimum signal strength should be used)
I don't get you here.

My formulas return 1 for a 0.5 light value. That seems correct to me, as current minimum signal strength x 1 is obvioulsy equal to current minimum signal strength (i.e. that exact value is used). If the multiplier was 0 (or close to 0), it would nullify the effect of other sensor strength modifiers (current minimum signal strength x 0 = 0).

Quote:
Originally Posted by TheDarkWraith View Post
0.283 should give 3 - max multiplier
It does
Have you checked the spreadsheet with my formulas?
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 03-24-14, 07:49 PM   #3035
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Thus I came up with a new algorithm:
- if game reports back it's daytime:
-- compare game's nighttime value (0.283) to start of nighttime value (0.5) - I do this comparison because it's possible someone may screw up and assign the start of nighttime value <= 0.283 since it's a variable in the patch file
-- if greater than or equal then jump to end of function
-- if less than then subtract game's nighttime value (0.283) from start of nighttime (0.5) - result is 0.217
-- take current light value (say it's 0.385) and subtract game's nighttime value (0.283) - result is 0.102
-- divide 0.102 by 0.217 - result is 0.47
-- subtract 0.47 from 1.0 - result is 0.53
-- multiply 0.53 by game's nighttime multiplier for player's crew (3.0) - result is 1.59
-- if result above > 1.0 then subtract 1.0 from result above - result is 0.59
-- load derived minimum signal strength into XMM0 and XMM1 (let's say it's 0.1)
-- multiply XMM1 by 0.59 - XMM1 = 0.059
-- add XMM1 to XMM0 - XMM0 = 0.159 - this is the new minimum derived signal strength
I have put your new algorithm on graph (using your same constants), and it is not linear. It got a sharp bump at a light value of ca. 0.430



If you want, you can check yourself: I have entered your formulas in the second sheet of my on-line spreadsheet.

Now compare the graph above with the one of your algorithm with my adjustements (same constants as above used):

__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 03-24-14, 07:50 PM   #3036
Viktor_Prien
Navy Dude
 
Join Date: Jan 2010
Location: Italy
Posts: 178
Downloads: 313
Uploads: 0
Default

thank gentlemen for all your hard work for the community!
Viktor_Prien is offline   Reply With Quote
Old 03-24-14, 07:51 PM   #3037
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

You have to see the code to understand. It works perfectly and is linear throughout the whole range.

Here are the variables for the searchlights and the player's crew and other units visual sensor signal strength varied by available sunlight (they are located in the SHSim patch file):

[SECTION 1]
...
;
; +0x0 = nighttime value for searchlights active - 0.4
Code3=0x40,CDCCCC3E
;
; +0x0 = the start of nighttime value for other units - 0.5
; +0x4 is the nighttime multiplier addition for other units - 1.0
Code4=0x48,0000003F0000803F
;
; +0x0 = the start of nighttime value for player's unit - 0.6
; +0x4 = the nighttime multiplier addition for player's unit - 2.5
Code5=0x50,9A99193F00002040

If you adjust any of the variables then you need to run the Generic Patcher app again and ensure to open the SHSim patch file so it can be updated with your changes.

v1.0.158.0 released. See post #1

Starting with v1.0.158.0 added 3 new patches to the SHSim.act file: searchlights active at dusk when they have a contact, Player's unit visual sensor affected by available light, and Units visual sensor affected by available light (does not affect player's unit)
TheDarkWraith is offline   Reply With Quote
Old 03-24-14, 08:09 PM   #3038
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
You have to see the code to understand. It works perfectly and is linear throughout the whole range.
You beat me on that: I have no idea how to look into your patch file

Nonetheless, if your code uses the same function you have described at post #3035 , it just can't give a linear output: that's not a matter of code, it is pure mathematics
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 03-24-14, 08:28 PM   #3039
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
You beat me on that: I have no idea how to look into your patch file

Nonetheless, if your code uses the same function you have described at post #3035 , it just can't give a linear output: that's not a matter of code, it is pure mathematics
Here's the code for the other units (the code for player's unit is basically the same):
Code:
TEST AL,AL                                                           ; (Check_Adjust_Nightime_Minimum_Signal_Strength_For_Other_Units_Visual_Sensor) tests whether is daytime (0)
JNE SHSim_act.088A319E                                               ; if already nighttime then jump to end
PUSH EAX                                                             ; saves EAX to stack
PUSH ECX                                                             ; saves ECX to stack
PUSH ESI                                                             ; saves ESI to stack
PUSH 48                                                              ; saves offset needed in TDWData to stack (start of nighttime value for other units)
CALL SHSim_act.Load_TDWData_Address_Into_EAX                         ; calls Load_TDWData_Address_Into_EAX
FLD DWORD PTR DS:[EAX]                                               ; loads start of nighttime value for other units onto top of floating point stack
MOV ECX,DWORD PTR DS:[EBX+48]                                        ; loads pointer to table of offsets into ECX
MOV ECX,DWORD PTR DS:[ECX+4]                                         ; loads an offset into ECX
FLD DWORD PTR DS:[EBX+ECX+28]                                        ; loads current available light onto top of floating point stack
FCOMIP ST,ST(1)                                                      ; compares current available light to start of nighttime value for player's unit
JNB SHORT SHSim_act.088A3194                                         ; if current available light is greater than or equal to start of nighttime value for
PUSH 0                                                               ; saves 0 to stack (need start of rdata section)
CALL SHSim_act.Load_rdata_Address_Into_EAX                           ; calls Load_rdata_Address_Into_EAX
MOV ESI,EAX                                                          ; saves start of rdata section to ESI
ADD EAX,0FB1C                                                        ; adds offset needed to EAX (sunlight value - used to determine if nighttime)
FLD DWORD PTR DS:[EAX]                                               ; loads sunlight value - used to determine if nighttime onto top of floating point stack
FSUBP ST(1),ST                                                       ; subtracts ST0 (sunlight value - used to determine if nighttime) from ST1 (start of nighttime value) and stores result in ST1 and pops top of floating point stack (gets range)
FLDZ                                                                 ; loads 0.0 onto top of floating point stack
FCOMIP ST,ST(1)                                                      ; compares ST0 (0.0) to ST1 (range) and pops top of floating point stack
JNB SHORT SHSim_act.088A3194                                         ; if negative value for range then jump
FLD DWORD PTR DS:[EBX+ECX+28]                                        ; loads current available light onto top of floating point stack
FSUB DWORD PTR DS:[EAX]                                              ; subtracts sunlight value - used to determine if nighttime from ST0 (current available sunlight)
FDIVRP ST(1),ST                                                      ; divides ST0 (result) by ST1 (range) and stores result in ST1 and pops top of floating point stack
FLD1                                                                 ; loads 1.0 onto top of floating point stack
FSUBRP ST(1),ST                                                      ; subtracts ST1 (result) from ST0 (1.0) and stores result in ST1 and pops top of floating point stack
ADD ESI,0FAB4                                                        ; add offset needed to ESI (Constant 3.0)
FLD DWORD PTR DS:[ESI]                                               ; loads constant 3.0 onto top of floating point stack (nighttime multiplier)
PUSH 4C                                                              ; saves offset needed in TDWData to stack (nightime multiplier addition for other units)
CALL SHSim_act.Load_TDWData_Address_Into_EAX                         ; calls Load_TDWData_Address_Into_EAX
FADD DWORD PTR DS:[EAX]                                              ; adds nighttime multiplier addition for other units to nighttime multiplier
FMULP ST(1),ST                                                       ; mutiplies % of range by nighttime multiplier for other units and stores result in ST1 and pops top of floating point stack
FLD1                                                                 ; loads 1.0 onto top of floating point stack
FSUBP ST(1),ST                                                       ; subtracts ST0 (1.0) from ST1 (result) and stores result in ST1 and pops top of floating point stack
FLDZ                                                                 ; loads 0.0 onto top of floating point stack
FCOMIP ST,ST(1)                                                      ; compares ST0 (0.0) to ST1 (result) and pops top of floating point stack
JBE SHORT SHSim_act.088A3177                                         ; if before or equal then jump
FLD1                                                                 ; loads 1.0 onto top of floating point stack
FADDP ST(1),ST                                                       ; adds ST0 (1.0) to ST1 (result) and stores result in ST1 and pops top of floating point stack
088A3177:
FLD DWORD PTR SS:[ESP+20]                                            ; loads minimum signal strength onto top of floating point stack
FXCH ST(1)                                                           ; swaps ST0 (minimum signal strength) and ST1 (result)
FLD ST(1)                                                            ; loads minimum signal strength onto top of floating point stack
FMULP ST(1),ST                                                       ; multiplies ST1 (result) by ST0 (minimum signal strength) and stores result in ST1 and pops top of floating point stack
FADDP ST(1),ST                                                       ; adds ST0 (result) to ST1 (minimum signal strength) and stores result in ST1 and pops top of floating point stack
PUSH ECX                                                             ; creates temp variable
FST DWORD PTR SS:[ESP]                                               ; saves new minimum signal strength to stack
MOVSS XMM0,DWORD PTR SS:[ESP]                                        ; loads new minimum signal strength into XMM0
ADD ESP,4                                                            ; deletes temp variable
ADD DWORD PTR SS:[ESP+0C],10                                         ; sets new return value
088A3194:
FSTP ST                                                              ; pops top of floating point stack
POP ESI                                                              ; restores ESI
POP ECX                                                              ; restores ECX
POP EAX                                                              ; restores EAX
XORPS XMM2,XMM2                                                      ; zeroes out XMM2
TEST AL,AL                                                           ; tests whether is daytime (0)
088A319E:
RETN                                                                 ; returns to caller
TheDarkWraith is offline   Reply With Quote
Old 03-24-14, 08:49 PM   #3040
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Here's the code for the other units (the code for player's unit is basically the same):

...
In short: what is the difference between the concise formulas you had posted before, which I can get almost at first glance, and the leghty (for a profane like me) assembly code that you are pointing me to?

If you wanted to confuse me, you have succeeded
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 03-24-14, 08:52 PM   #3041
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
In short: what is the difference between the concise formulas you had posted before which I can get almost at first glance, and the leghty (for a profane like me) code that you are pointing me to?

If you wanted to confuse me, you have succeeded
Before I was using pseudo-code. It's a way to express how the code will probably look like. You wanted to see that it was linear and I gave you a glimpse at the actual code. Follow the notes I have on the code and you'll make sense of it
TheDarkWraith is offline   Reply With Quote
Old 03-24-14, 09:13 PM   #3042
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
Before I was using pseudo-code. It's a way to express how the code will probably look like. You wanted to see that it was linear and I gave you a glimpse at the actual code. Follow the notes I have on the code and you'll make sense of it
Will do it (deciphering your notes will take me a while though), but I repeat: if your assembly code follows your pseudo-code, its output can't be linear. I think I have demonstrated it in the most straightforward way I am capable of, with the graphs I have posted a few posts back.

If on the contrary your code contains some substantial corrections which were absent from the pseudo-code (and, indeed, if you like me are enjoying our friendly debate), maybe you could put your changes in a way that I can understand/find them more quickly than having to dig for them into your code.

On a more hilarious note: I have the feeling that we were discussing in a language that we both understand, and suddenly you started answering me in ancient aramaic
__________________
_____________________
|May the Force be with you!|
...\/

Last edited by gap; 03-24-14 at 10:27 PM.
gap is offline   Reply With Quote
Old 03-24-14, 11:49 PM   #3043
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Looked into when game decides to add new units to the game (when they are actually rendered) and finally figured out the hows and whys.

First of all everything centers around the player's unit. The game tests every possible unit's distance from the player's unit to see if it >= 40,000m (sometimes 35,000m) and if so then unit is considered a 2D unit and is evolved by the MissionEngine.DLL. If the unit's distance to the player's unit is < 40,000m (sometimes 35,000m) then unit is considered a 3D unit and is rendered and is considered an active unit.

Now I'm playing around with getting units to be 3D units and thus rendered and an active unit when it's distance from player's unit is > 40,000m (sometimes 35,000m)
TheDarkWraith is offline   Reply With Quote
Old 03-25-14, 01:52 AM   #3044
THE_MASK
Ace of the deep .
 
THE_MASK's Avatar
 
Join Date: Jan 2006
Posts: 9,226
Downloads: 901
Uploads: 73


Default

Using the latest patch in career mode . I will see how it goes
THE_MASK is offline   Reply With Quote
Old 03-25-14, 10:38 AM   #3045
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

@ TDW

I have finally finished comparing the code of your new patch with the corresponding algorithm that my graph at post #3039 is based on. That was a good mental excercise by the way, and an excellent introduction to assembly for an illiterate like me; thank you for pushing me into it.

For better understanding I have grouped your code from post #3043. Each group is followed by the corresponding pseudo-code (if any; copied/pasted from post #3035).

Color legend:
Text marked in sea-green bold: parts of code which have a direct correspondence into your pseudo-code
Text marked in lime-green: parts of code which are implicit into your pseudo-code (mostly variable/offsets declaration/loading/saving/unloading)
Text marked in yellow bold: parts of code which have not a direct or implicit correspondence into your pseudo-code
Text marked in italic bold below: pseudo-code which the code above is based on.

My comparison:
================================================== ========

TEST AL,AL ; (Check_Adjust_Nightime_Minimum_Signal_Strength_For _Other_Units_Visual_Sensor) tests whether is daytime (0)
JNE SHSim_act.088A319E ; if already nighttime then jump to end

- if game reports back it's daytime:


PUSH EAX ; saves EAX to stack
PUSH ECX ; saves ECX to stack
PUSH ESI ; saves ESI to stack
PUSH 48 ; saves offset needed in TDWData to stack (start of nighttime value for other units)
CALL SHSim_act.Load_TDWData_Address_Into_EAX ; calls Load_TDWData_Address_Into_EAX
FLD DWORD PTR DS:[EAX] ; loads start of nighttime value for other units onto top of floating point stack
MOV ECX,DWORD PTR DS:[EBX+48] ; loads pointer to table of offsets into ECX
MOV ECX,DWORD PTR DS:[ECX+4] ; loads an offset into ECX
FLD DWORD PTR DS:[EBX+ECX+28] ; loads current available light onto top of floating point stack


FCOMIP ST,ST(1) ; compares current available light to start of nighttime value for player's unit
JNB SHORT SHSim_act.088A3194 ; if current available light is greater than or equal to start of nighttime value for


PUSH 0 ; saves 0 to stack (need start of rdata section)
CALL SHSim_act.Load_rdata_Address_Into_EAX ; calls Load_rdata_Address_Into_EAX
MOV ESI,EAX ; saves start of rdata section to ESI
ADD EAX,0FB1C ; adds offset needed to EAX (sunlight value - used to determine if nighttime)
FLD DWORD PTR DS:[EAX] ; loads sunlight value - used to determine if nighttime onto top of floating point stack


FSUBP ST(1),ST ; subtracts ST0 (sunlight value - used to determine if nighttime) from ST1 (start of nighttime value) and stores result in ST1 and pops top of floating point stack (gets range)
-- (if less than then [see pseudo-code below]) subtract game's nighttime value (0.283) from start of nighttime (0.5) - result is 0.217


FLDZ ; loads 0.0 onto top of floating point stack

FCOMIP ST,ST(1) ; compares ST0 (0.0) to ST1 (range) and pops top of floating point stack
JNB SHORT SHSim_act.088A3194 ; if negative value for range then jump

-- compare game's nighttime value (0.283) to start of nighttime value (0.5) - I do this comparison because it's possible someone may screw up and assign the start of nighttime value <= 0.283 since it's a variable in the patch file (If less than then... [see pseudo-code above])


FLD DWORD PTR DS:[EBX+ECX+28] ; loads current available light onto top of floating point stack

FSUB DWORD PTR DS:[EAX] ; subtracts sunlight value - used to determine if nighttime from ST0 (current available sunlight)
-- take current light value (say it's 0.385) and subtract game's nighttime value (0.283) - result is 0.102


FDIVRP ST(1),ST ; divides ST0 (result) by ST1 (range) and stores result in ST1 and pops top of floating point stack
-- divide 0.102 by 0.217 - result is 0.47


FLD1 ; loads 1.0 onto top of floating point stack

FSUBRP ST(1),ST ; subtracts ST1 (result) from ST0 (1.0) and stores result in ST1 and pops top of floating point stack
-- subtract 0.47 from 1.0 - result is 0.53


ADD ESI,0FAB4 ; add offset needed to ESI (Constant 3.0)
FLD DWORD PTR DS:[ESI] ; loads constant 3.0 onto top of floating point stack (nighttime multiplier)
PUSH 4C ; saves offset needed in TDWData to stack (nightime multiplier addition for other units)
CALL SHSim_act.Load_TDWData_Address_Into_EAX ; calls Load_TDWData_Address_Into_EAX
FADD DWORD PTR DS:[EAX] ; adds nighttime multiplier addition for other units to nighttime multiplier

FMULP ST(1),ST ; mutiplies % of range by nighttime multiplier for other units and stores result in ST1 and pops top of floating point stack
-- multiply 0.53 by game's nighttime multiplier for player's crew (3.0) - result is 1.59


FLD1 ; loads 1.0 onto top of floating point stack

FSUBP ST(1),ST ; subtracts ST0 (1.0) from ST1 (result) and stores result in ST1 and pops top of floating point stack
FLDZ ; loads 0.0 onto top of floating point stack
FCOMIP ST,ST(1) ; compares ST0 (0.0) to ST1 (result) and pops top of floating point stack
JBE SHORT SHSim_act.088A3177 ; if before or equal then jump

FLD1 ; loads 1.0 onto top of floating point stack
FADDP ST(1),ST ; adds ST0 (1.0) to ST1 (result) and stores result in ST1 and pops top of floating point stack
-- if result above > 1.0 then subtract 1.0 from result above - result is 0.59


088A3177:
FLD DWORD PTR SS:[ESP+20] ; loads minimum signal strength onto top of floating point stack
FXCH ST(1) ; swaps ST0 (minimum signal strength) and ST1 (result)
FLD ST(1) ; loads minimum signal strength onto top of floating point stack
FMULP ST(1),ST ; multiplies ST1 (result) by ST0 (minimum signal strength) and stores result in ST1 and pops top of floating point stack

-- load derived minimum signal strength into XMM0 and XMM1 (let's say it's 0.1)
-- multiply XMM1 by 0.59 - XMM1 = 0.059


FADDP ST(1),ST ; adds ST0 (result) to ST1 (minimum signal strength) and stores result in ST1 and pops top of floating point stack
PUSH ECX ; creates temp variable
FST DWORD PTR SS:[ESP] ; saves new minimum signal strength to stack
MOVSS XMM0,DWORD PTR SS:[ESP] ; loads new minimum signal strength into XMM0
ADD ESP,4 ; deletes temp variable
ADD DWORD PTR SS:[ESP+0C],10 ; sets new return value

-- add XMM1 to XMM0 - XMM0 = 0.159 - this is the new minimum derived signal strength


088A3194:
FSTP ST ; pops top of floating point stack
POP ESI ; restores ESI
POP ECX ; restores ECX
POP EAX ; restores EAX
XORPS XMM2,XMM2 ; zeroes out XMM2
TEST AL,AL ; tests whether is daytime (0)


088A319E:
RETN ; returns to caller


================================================== ========
End of code

As you can see, differences between your code and your pseudo-code are trascurable, and they can't affect the output of your function, which -I repeat- is not linear. Today I have double checked the formulas I had entered yesterday in the spreadsheet that my graphs are based on, and I couldn't spot any error on my part.

Trust me or not, the one possible linear function which interpolates the two extremes derived min. signal strength (x1) - derived min signal strength x game's nighttime multiplier, is the one I have suggested at post #3032. In an euclidean space, there can't be other correct solutions

gap off

Quote:
Originally Posted by TheDarkWraith View Post
I'm playing around with getting units to be 3D units and thus rendered and an active unit when it's distance from player's unit is > 40,000m (sometimes 35,000m)
__________________
_____________________
|May the Force be with you!|
...\/
gap 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 01:16 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.