Pages: 1 [2] :: one page |
|
Author |
Thread Statistics | Show CCP posts - 11 post(s) |
Captain Thunk
Sniggerdly Pandemic Legion
187
|
Posted - 2015.10.13 21:57:27 -
[31] - Quote
It doesn't help me at all, I'll spend months trying to work out what the hell that says.
But you've given me exactly what I asked for and you are wonderful wonderful people for doing that. I appreciate it a lot.
CCP #1 |
|
CCP FoxFour
C C P C C P Alliance
4143
|
Posted - 2015.10.14 08:07:02 -
[32] - Quote
Captain Thunk wrote:It doesn't help me at all, I'll spend months trying to work out what the hell that says. But you've given me exactly what I asked for and you are wonderful wonderful people for doing that. I appreciate it a lot. CCP #1
If you figure it out, because **** if I understand it either, feel free to update the documentation with something a bit easier to understand.
@CCP_FoxFour // Technical Designer // Team Size Matters
Third-party developer? Check out the official developers site for dev blogs, resources, and more.
|
|
Captain Thunk
Sniggerdly Pandemic Legion
187
|
Posted - 2015.10.14 09:06:00 -
[33] - Quote
CCP FoxFour wrote:Captain Thunk wrote:It doesn't help me at all, I'll spend months trying to work out what the hell that says. But you've given me exactly what I asked for and you are wonderful wonderful people for doing that. I appreciate it a lot. CCP #1 If you figure it out, because **** if I understand it either, feel free to update the documentation with something a bit easier to understand.
Sure, I'm pretty sure that python random seeding is not going to produce the same numbers as in PHP, so I'll whizz through all the affected IDs and produce a table with what Pythons going to return for non-python apps.
It'll be a couple of weeks yet before I look at this as I'm still laughing at PL having won ATXIII and I'm nowhere near done yet. |
|
CCP FoxFour
C C P C C P Alliance
4146
|
Posted - 2015.10.14 09:50:27 -
[34] - Quote
Captain Thunk wrote:CCP FoxFour wrote:Captain Thunk wrote:It doesn't help me at all, I'll spend months trying to work out what the hell that says. But you've given me exactly what I asked for and you are wonderful wonderful people for doing that. I appreciate it a lot. CCP #1 If you figure it out, because **** if I understand it either, feel free to update the documentation with something a bit easier to understand. Sure, I'm pretty sure that python random seeding is not going to produce the same numbers as in PHP, so I'll whizz through all the affected IDs and produce a table with what Pythons going to return for non-python apps. It'll be a couple of weeks yet before I look at this as I'm still laughing at PL having won ATXIII and I'm nowhere near done yet.
>.<
@CCP_FoxFour // Technical Designer // Team Size Matters
Third-party developer? Check out the official developers site for dev blogs, resources, and more.
|
|
Megarom
Fistful of Finns Paisti Syndicate
15
|
Posted - 2015.10.14 10:09:18 -
[35] - Quote
Captain Thunk wrote: Sure, I'm pretty sure that python random seeding is not going to produce the same numbers as in PHP, so I'll whizz through all the affected IDs and produce a table with what Pythons going to return for non-python apps.
I took a quick look in to python source code here https://hg.python.org/cpython/file/2.7/Lib/random.py It should be relatively simple to come up with a function snippet that generates the first pseudorandom value from given seed, but there is some nasty looking comments about hardware specifics affecting the result.
|
Captain Thunk
Sniggerdly Pandemic Legion
187
|
Posted - 2015.10.14 11:53:21 -
[36] - Quote
Megarom wrote:Captain Thunk wrote: Sure, I'm pretty sure that python random seeding is not going to produce the same numbers as in PHP, so I'll whizz through all the affected IDs and produce a table with what Pythons going to return for non-python apps.
I took a quick look in to python source code here https://hg.python.org/cpython/file/2.7/Lib/random.py It should be relatively simple to come up with a function snippet that generates the first pseudorandom value from given seed, but there is some nasty looking comments about hardware specifics affecting the result.
hardware specifics are going to be awkward.
|
|
CCP Tellus
C C P C C P Alliance
22
|
Posted - 2015.10.14 12:55:26 -
[37] - Quote
Megarom wrote:It should be relatively simple to come up with a function snippet that generates the first pseudorandom value from given seed, but there is some nasty looking comments about hardware specifics affecting the result. I don't think there's anything hardware specific in the method used to generate the random numbers. From what I can tell, the default Mersenne Twister algorithm is used, which for CPython is implemented in C.
$ for i in {1..10}; do python -c 'import random; print(random.Random('$i').random())'; done 0.13436424411240122 0.9560342718892494 0.23796462709189137 0.23604808973743452 0.6229016948897019 0.793340083761663 0.32383276483316237 0.2267058593810488 0.46300735781502145 0.5714025946899135
Here's a sample implementation of computing a planet's warp-in in Python:
import math import random
def warpin(id, x, y, z, r): j = (random.Random(id).random() - 1.0) / 3.0 t = j - math.asin(x/abs(x) * (z/math.sqrt(x**2 + z**2))) s = 20.0 * (1.0/40.0 * (10 * math.log10(r/10**6) - 39))**20.0 + 1.0/2.0 s = max(0.5, min(s, 10.5)) d = r*(s + 1) + 1000000
return (d * math.sin(t), 1.0/2.0 * r * math.sin(j), d * math.cos(t)) |
|
Captain Thunk
Sniggerdly Pandemic Legion
188
|
Posted - 2015.10.14 17:42:57 -
[38] - Quote
You're pretty damned awesome CCP Tellus |
Arden Bastilla
Defiance LLC
2
|
Posted - 2015.10.15 21:03:49 -
[39] - Quote
HAHA, I love how even the Devs have derailed this thread about the Bookmarks API endpoint into orbital/warpin calculations. I love the math btw.
However, can a dev/someone please explain the value of having bookmark API endpoint? What what I can tell we can't use the endpoint data to import BMs into Eve, correct that if I'm wrong. Does the Endpoint help with Alliance/C2C BM management at all? |
Captain Thunk
Sniggerdly Pandemic Legion
188
|
Posted - 2015.10.16 12:15:05 -
[40] - Quote
CCP Tellus wrote:import math import random
def warpin(id, x, y, z, r): j = (random.Random(id).random() - 1.0) / 3.0 t = j - math.asin(x/abs(x) * (z/math.sqrt(x**2 + z**2))) s = 20.0 * (1.0/40.0 * (10 * math.log10(r/10**6) - 39))**20.0 + 1.0/2.0 s = max(0.5, min(s, 10.5)) d = r*(s + 1) + 1000000
return (d * math.sin(t), 1.0/2.0 * r * math.sin(j), d * math.cos(t))
This is not working as expected.
Using Mies I as an example, the SDE shows the values for id, x, t, z and r as: id = 40314597 x = 51241559888 y = -1328521670 z = -43622755751 r = 5100000
warpin returns these as (5261845.3655822901, -357459.55161051254, 8307355.203655405) When added to the original vector for the planet it's: (51236298042.634415, -1328879129.5516105, -43631063106.203659)
While the Y is within 1km of the expected value the x and z values are massively incorrect, a BM at 0km shows the true expected values to be: (51234245041.1568, -1328878026.30105, -43629232504.5183) with a small margin of error due to warp jitter and intended randomness
|
|
|
CCP Tellus
C C P C C P Alliance
29
|
Posted - 2015.10.16 13:15:44 -
[41] - Quote
Captain Thunk wrote:This is not working as expected. Oh my, you're right! Here's the corrected implementation:
import math import random
def warpin(id, x, y, z, r): j = (random.Random(id).random() - 1.0) / 3.0 t = math.asin(x/abs(x) * (z/math.sqrt(x**2 + z**2))) + j s = 20.0 * (1.0/40.0 * (10 * math.log10(r/10**6) - 39))**20.0 + 1.0/2.0 s = max(0.5, min(s, 10.5)) d = r*(s + 1) + 1000000
return (x + d * math.sin(t), y + 1.0/2.0 * r * math.sin(j), z - d * math.cos(t))
Note that x, y, z, and r need to be floats and not integers when passed into that function. |
|
Captain Thunk
Sniggerdly Pandemic Legion
188
|
Posted - 2015.10.16 13:22:39 -
[42] - Quote
Ahh yes, Python isn't my native language.
You truly are awesome, it wouldn't have been unreasonable to assume it could be days or weeks for a reply, yet you've delivered in mere minutes.
Thanks a lot.
CCP #1 |
|
|
|
Pages: 1 [2] :: one page |
First page | Previous page | Next page | Last page |