Ludii Forum
There is something wrong with the RNG - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Problems (https://ludii.games/forums/forumdisplay.php?fid=5)
+--- Forum: Grammar Problems (https://ludii.games/forums/forumdisplay.php?fid=24)
+--- Thread: There is something wrong with the RNG (/showthread.php?tid=1201)



There is something wrong with the RNG - Michael - 09-02-2022

If you run a random playout in the attached .lud, you will see in the move list that the state at indices 37 and 38 is set several times.

But throughout every playout the states are set to the same values.

This shouldn't be possible, because the only time the script sets the state at these sites is when the following ludeme is called:
Code:
    (and
        (set State at:(handSite Shared 0) (value Random (range 1 6)))
        (set State at:(handSite Shared 1) (value Random (range 1 6)))
    )

Which means those values should be random. But they aren't.


RE: There is something wrong with the RNG - Eric Piette - 09-05-2022

Hi,

I tried what you said, and I do not get the same behaviour as you. All seems fine here. I have 37 and 38 set with different values thought the game and between different playouts.

Eric


RE: There is something wrong with the RNG - Michael - 09-05-2022

How is that possible? I have no idea what kind of thing could make the game behave differently on different computers. And I don't know how to test the script when it doesn't behave correctly on my computer..


RE: There is something wrong with the RNG - Michael - 09-06-2022

Oh, I see. When you do a random playout, the rolls are different. But when you make the moves yourself, the rolls never change. I have attached a trial where the state is always set to 3 (incidentally at both sites) throughout.


RE: There is something wrong with the RNG - Eric Piette - 09-06-2022

Hi,

I tried in playing manually too, I still get different values for the values set.
I am not sure why this would happen on your laptop.
Could you try on another?

Regards,
Eric


RE: There is something wrong with the RNG - Michael - 09-06-2022

I just tried it on a different laptop. Same thing happens there. Both are Macs, though.


RE: There is something wrong with the RNG - Michael - 09-17-2022

So.. Do I need to buy a PC to finish this game?


RE: There is something wrong with the RNG - Eric Piette - 09-17-2022

Hi,

Dennis (who did the code about the RNG usage) is saying that to avoid your problem you should not use a ludeme involving the RNG in the consequence. In some rare cases, this can create some isues with the GUI (which is your case here), even if in reality the logic behind the game is working correctly.

I added an issue to him to look at this, but he is really busy by the writing of his thesis currently.

Eric


RE: There is something wrong with the RNG - Michael - 09-17-2022

Ok, thank you for that! I'll see what I can do.