Issue with SeedRandom Plugin

0 favourites
  • 5 posts
From the Asset Store
The I18N (Translation) is a Construct plugin created to translate text in game.
  • I know this is a long shot, but I am having an issue with this plugin (or I am creating an issue with it): construct.net/en/forum/extending-construct-2/addons-29/plugin-seedrandom-53718

    I'm using this plugin to freeze the seed in order to generate rooms without having to save them.

    The system works by building a dungeon map in an array. The array stores a room seed value for each room. When the player moves rooms in the dungeon, the game is simply regenerating the layout based on the world seed value + the room seed value, which it sets via this plugin.

    Most of the time, this works fine. But probably 3/10 times it generates the same room differently, despite having the same seed. My gut feeling is that this might be caused due to delays in the generator process. I have 2 functions in the process that use "Wait 0 seconds" to give the process a moment to finish up what it is doing, and my assumption is that if the device you are playing on hiccups or slows down during this, it generates a different room.

    The problem is that I am having a lot of trouble rewriting that aspect of the generator, and I am also worried that I'm going to do all of this and find out that this isn't the case. What other variables commonly could be interfering with the seed generation to cause this?

  • It's hard to tell what can be the problem, but from my experience with this plugin, you should avoid doing anything else that can utilize random generator until you finish building the level.

    Don't create any particles, don't use choose() or random() expressions in other events that can run during or before dungeon generation.

  • It's hard to tell what can be the problem, but from my experience with this plugin, you should avoid doing anything else that can utilize random generator until you finish building the level.

    Don't create any particles, don't use choose() or random() expressions in other events that can run during or before dungeon generation.

    That is actually really helpful! It is possible I have interference then from things like enemy routines. I'm going to try isolating that stuff and see if I can eliminate the issue there.

    In your experience, do wait commands or system hiccups potentially contribute to this as well? Thank you so much for replying!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • In your experience, do wait commands or system hiccups potentially contribute to this as well?

    No, I didn't have this problem. But I had to deactivate all groups of events that create random objects, particles, have "Every random(N) seconds" in them etc. Only when the seeded level generation is finished, I activate those groups.

  • > In your experience, do wait commands or system hiccups potentially contribute to this as well?

    No, I didn't have this problem. But I had to deactivate all groups of events that create random objects, particles, have "Every random(N) seconds" in them etc. Only when the seeded level generation is finished, I activate those groups.

    Good to know, this helps me narrow it down a bit more! Thank you so much.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)