1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

GMS 2 Random_Set_Seed() seems different for GMS 2 and no longer consistent between platforms.

Discussion in 'Programming' started by RyanC, Jun 20, 2019.

  1. RyanC

    RyanC Member

    Joined:
    Jun 24, 2016
    Posts:
    373
    I've just had to update my app to support 64 bit so I purchased GMS 2 and imported my game.

    Within a few hours I had it running on Android but now my game is totally different.

    I spent many days selecting random seeds that would generate levels and nearly 100 of them were tested which took weeks.

    I've also noticed that GMS2 is not consistent between Windows and Android regarding the random seed.
    Does anyone know how to make the random seed the same as GMS1?

    Any help greatly appreciated!
     
  2. BaBiA Game Studio

    BaBiA Game Studio Member

    Joined:
    Jun 20, 2016
    Posts:
    872
    I can't answer the GMS1/GMS2 random_set_seed question, but for the different platforms the manual does say this:
    So there is most likely going to be differences between platforms.
     
  3. RyanC

    RyanC Member

    Joined:
    Jun 24, 2016
    Posts:
    373
    Thanks

    I've been testing the game for about 1 year and it's been the same on Windows and hundreds of Android phones on different OS versions, and even emulators.

    The minute I run it through GMS 2 it's different. Obviously Yoyo changed something.
     
  4. BaBiA Game Studio

    BaBiA Game Studio Member

    Joined:
    Jun 20, 2016
    Posts:
    872
    You may have just been very lucky, because that same line is in the GMS1 manual too.
     
  5. RyanC

    RyanC Member

    Joined:
    Jun 24, 2016
    Posts:
    373
    No, it's definitely different in GMS2, that's why I created this post. Anyone know how to change it back?
     
  6. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,736
    Just because it gave the same results across targets before, doesn't mean you can deny that it literally says in the manual that results may vary across targets.
    There is nothing to change back to - it's expected behaviour as per the manual definition for both 1.4 and 2.x.

    Maybe get in touch with YYG and explain the issue, they might be able to give you further details on any changes made regarding this between 1.4 and 2.x which may help you generate similar seeds if that is possible.
     
  7. Guest

    Guest Guest

    Are you using game_restart()? There was a bug with random_set_seed not working properly with game_restart()... I thought it was eventually fixed, but maybe I'm wrong, it wasn't, or you're not using the fixed version of the runner.
     
  8. RyanC

    RyanC Member

    Joined:
    Jun 24, 2016
    Posts:
    373
    I was using action_if_dice() and I think GMS2 uses some kind of compatibility scripts on this now.

    Not sure if I can find out the original random code for action_if_dice() and re-implement it to save my game.
     
  9. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,736
    Just did a quick Google for you and found this on reddit
    Not sure if it will work for you, but you never know!
     
  10. RyanC

    RyanC Member

    Joined:
    Jun 24, 2016
    Posts:
    373
    Thanks mate, the compatibility scripts seem really heavy. I changed it back but it just produced other random results.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice