Author Topic: getRandom returning different results on mac and pc  (Read 2544 times)

Except that's slow and off topic.

Can someone please tell me why they return different results?
Not really.. If you weren't aware, Torque is REALLY slow. Doing all calculations in an external program relieves Torque of a heavy load and the <1ms lag time to transmit the message to a local server is far superior. Don't judge something until you've tried it.

I've tried making a python RPG. it was quite bitchy but it was much faster.

Port told you why and you said NO THAT CAN'T BE IT

It returns different results because the algorithm is different, that's the only explanation. There's a good chance that it's not even written directly into Torque, and is simply using the host OS' generator, or some minor difference in execution is causing it. No, you can't "fix" it, it's an issue with the engine. If you don't like it, write your own generator in Torque or set it up as a TCP offloader. Look at your code. No, using a TCP offload is not going to make it "slow" unless you are dumb enough to be expecting it to return at execution time. Read up on asynchronous IO and you'll be fine. Now look back to me. The code is now diamonds.

Why do you want unrandom randomness?

It returns different results because the algorithm is different, that's the only explanation.
M, I already tested that.
That isn't the problem.

That's why I posted the help topic.

M, I already tested that.
That isn't the problem.

That's why I posted the help topic.

What is the problem then? You just neglected the title of this topic.

What is the problem then? You just neglected the title of this topic.
I neglected that as the CAUSE of the problem.
The problem still exists.

I neglected that as the CAUSE of the problem.
The problem still exists.

How did you "test" that the engine uses the same algorithm for PRNG on Windows and Mac?

How did you "test" that the engine uses the same algorithm for PRNG on Windows and Mac?
By generating 50 random numbers using the same seed on both a windows and a mac, then comparing them.

They were exactly the same.

By generating 50 random numbers using the same seed on both a windows and a mac, then comparing them.

They were exactly the same.

"getRandom returning different results on mac and pc"

I'm not the only one completely confused here right?

I'm making a script that utillizes PRNG's, and when I gave it to a friend that uses a mac, and it returned different results.

I'm making a script that utillizes PRNG's, and when I gave it to a friend that uses a mac, and it returned different results.

Yes?

Port told you why and you said NO THAT CAN'T BE IT

It returns different results because the algorithm is different, that's the only explanation. There's a good chance that it's not even written directly into Torque, and is simply using the host OS' generator, or some minor difference in execution is causing it. No, you can't "fix" it, it's an issue with the engine. If you don't like it, write your own generator in Torque or set it up as a TCP offloader. Look at your code. No, using a TCP offload is not going to make it "slow" unless you are dumb enough to be expecting it to return at execution time. Read up on asynchronous IO and you'll be fine. Now look back to me. The code is now diamonds.

Yes?

I neglected that as the CAUSE of the problem.
The problem still exists.

I need help figuring out how to AVOID this problem.

I tried what you said before port, but still around half the time it returned different results.

I need help figuring out how to AVOID this problem.

I tried what you said before port, but still around half the time it returned different results.

No, you can't "fix" it, it's an issue with the engine. If you don't like it, write your own generator in Torque or set it up as a TCP offloader. Look at your code. No, using a TCP offload is not going to make it "slow" unless you are dumb enough to be expecting it to return at execution time. Read up on asynchronous IO and you'll be fine. Now look back to me. The code is now diamonds.