Bug Issue: Random number generation in Android


Pages: 1

mbergoei

  • Subscriber - Stencyl Studio
  • *
December 27, 2020, 12:23:49 pm
Please see post http://community.stencyl.com/index.php/topic,61477.new.html#new

I have a problem generating random numbers in Android. It happens either with integers or float. So I made up a quick demo project:

It has a starting scene with a button that takes you to the scene where the RNG is. In a When Created I generated 10 random numbers between 1 and 100. Every time the app was launched it generates the same 10 numbers: 1, 65, 94, 35, 48, 67, 37, 33, 1 and 30. If I reload the scene from within the scene, the numbers are different. If I go back to the starting scene and then back to the RNG, numbers are different. Only when re launching the app the numbers are the same.

Tested in Mac and Flash, no problem whatsoever. Didn't test in iOS since generating the certificates and the profiles just for this is a PITA.

Thanks



New attachment added by mbergoei - December 27, 2020, 12:24:14 pm


New attachment added by mbergoei - December 27, 2020, 12:24:54 pm


Pages: 1

Details

  • Reported
    December 27, 2020, 12:23:49 pm
  • Updated
    December 27, 2020, 12:24:54 pm

  • View Status
    Public
  • Type
    Bug
  • Status
    New
  • Priority
    Normal
  • Version
    (none)
  • Fixed in
    (none)
  • Assigned to
    (none)
  • Category
    Engine

Tags


Attachments

* RNG.stencyl (463.21 kB - downloaded 5 times.)
* log-2020-12-27.zip (1064.77 kB - downloaded 5 times.)