I'm using this function repeatedly over a timeout period with a timestep inbetween calls, i.e. numerically integrating, then getting the total and using it to reward the player.
Following is a reversed version of the function given in:
http://forum2.egosoft.com/viewtopic.php ... sc&start=0
Code: Select all
002 $value = $newnoto - $oldnoto
003 $modifier = $value / 5
004
005 $absmodifier = $modifier
006 skip if $absmodifier > 0
007 $absmodifier = 0 - $absmodifier
008
009 $absvalue = $value
010 skip if $absvalue > 0
011 $absvalue = 0 - $absvalue
012
013 skip if not $absmodifier != 1 AND $absvalue < ( $absmodifier * 5 )
014 return $modifier
015
016 $modifier = ( 100 * $value ) / $oldnoto
017 skip if not $oldnoto < 0 AND $modifier > 0
018 return $modifier
019
020 $modifier = ( $value * 100 ) / ( $oldnoto + 1000 )
021 return $modifier
What happens: The first couple of attacks and destructions of enemy stations result in a large (approx 100) value returned from my integrator. Subsequently, smaller values are returned, and this seems to stay the same no matter the notoriety from that point on. Following is a list of some values I got in a run wiping out Blue Profit of all stations (and any offending ships):
Started with high notoriety - could buy all but M1/M2, didnt look at notoriety originally and didnt store in logbook, doh.
New notoriety | Normalized value of difference
Lots | 0
-1044 | -101
-2104 | -85
-3129 | -40
-3249 | -3
-2104 | -85
-3984 | -14
-6294 | -33
-6559 | -3
-7644 | -14
-8239 | -7
-9947 | -15
-10622| -4
-12012| -9
-14717| -15
-16837| -7
-18342| -4
-18652| -1
-19082| -1
-19662| -1
-20161| -2
So it seems as if, after an initial period of high value, probably because of the surprise attack, it 'cools down' to around 15 for destroying a station and bits and bobs lower than that as stations/ships are attacked. Do these numbers make sense?
If someone is willing to take the time to check this, make sure that mathematically it should work, I would be most grateful. I have stared at the function in the sticky several times and still dont 'get' it, so the above function could easily be wrong. I just attempted to reverse its functioning, without understanding what its trying to do.
Excepting this, I am about ready to release my Cold War script that uses this function, and naturally dont want to do so if its bugged at all.
Also, if this does turn out to work and anyone wants to use this library, feel free to do so.
Let me know what you think,
Voxol.