1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[General] Random Seed during Cinematics in Reforged

Discussion in 'World Editor Help Zone' started by SpiritTauren, Jan 28, 2020.

  1. SpiritTauren

    SpiritTauren

    Joined:
    Mar 10, 2009
    Messages:
    208
    Resources:
    2
    Icons:
    1
    Skins:
    1
    Resources:
    2
    I used those
    Code (Text):
    call SetRandomSeed(bj_cineModeSavedSeed)
    and
    Code (Text):
    set bj_cineModeSavedSeed = GetRandomInt(0, 1000000)
    to get random seed during cinematics.

    Now they don't seem to work any more =( Does anyone have a viable replacement option?

    Note: I disabled fixed values in WorldEdit, so that's not the issue.

    [Update]: Ok, I found a solution. So, before Reforged you could easily use GUI cinematic on/off and simply adjust random with the scripts listed above. Now don't use the GUI command at all. Use custom cinematic commands instead if you require to change something within the cinematic on/off code. For example:
    Code (Text):
    call ShowInterface(true, 0)
    or
    Code (Text):
    call ShowInterface(false, 0)
    (0 can be replace by variable of your choice). And so on for all other cinematic-influenced elements (game speed, dusk/dawn etc.)
    Those who need decent custom function could thank Dr Super Good and PurgeandFire for this thread.


    [Update 2]: FFS... It seems that the above mentioned option provides another fixed seed (different from GUI cinematic on/off fixed seed, but still fixed).

    [Update 3]: It seems cinematic mode has nothing to do with it all. The game just refuses to have random seed, even if the cinematic is off.

    Even in-game random numbers tested via chat command follow fixed seed.

    So, the WorldEdit "Preferences" option enable/disable use of random seed does nothing, and the game just runs on fixed seed. How sweet...
     
    Last edited: Jan 29, 2020
  2. Superz_Ze_Man

    Superz_Ze_Man

    Joined:
    Aug 21, 2009
    Messages:
    398
    Resources:
    0
    Resources:
    0
    Ive run into this problem as well. The games chooses the same fixed seed every game.

    I am okay with fixed randomness based on one seed, but that one seed needs to be different on a game by game basis. Here is a cool post from 2012 that i am going to try to get map randomness back:

    [Snippet] Random Seed
     
  3. SpiritTauren

    SpiritTauren

    Joined:
    Mar 10, 2009
    Messages:
    208
    Resources:
    2
    Icons:
    1
    Skins:
    1
    Resources:
    2
    Thank you for the snippet info. The point was: why break something that worked just fine. And I've mentioned before, blizz don't address the related bug report. I hope it will get fixed eventually.
     
  4. SpiritTauren

    SpiritTauren

    Joined:
    Mar 10, 2009
    Messages:
    208
    Resources:
    2
    Icons:
    1
    Skins:
    1
    Resources:
    2
    F'in unbelievable: after almost a month maps still use FIXED default random seed for random numbers. It's so disgusting.
    I need your advice. I'm using so many instances of random number generation, that manual insertion of
    UpdateSeed call each time I need it would be VERY time consuming.

    Would it be a better idea to call UpdateSeed every 0.03 sec? I know it looks ugly and goes against optimization, but I've tried it, and so far, it does help. One line(!) fixes the whole game for me, but takes its toll in a form of memory, lol.

    Another approach would be calling UpdateSeed only ONCE at start, thus producing new fixed random seed. But I'm not feeling comfortable knowing that each instance of random is predetermined till the rest of the game.
     
    Last edited: Feb 26, 2020
  5. BizzaroFukuro

    BizzaroFukuro

    Joined:
    Dec 11, 2009
    Messages:
    201
    Resources:
    2
    Maps:
    2
    Resources:
    2
    I have an idea for a temporary workaround.
    When map loads, stop everything and ask the player to move the mouse for a while. Then use mouse coordinates to generate Random Seed (but make sure the mouse was moved at some minimal distance at least). Then proceed with starting the gameplay and everything.
    That way the Seed is pretty much guaranteed to be different every time, as it's highly unlikely to be exactly the same mouse position.
    And you won't need to update the seed after that anymore.

    If it's a multiplayer map, that's a bit worse, but you could ask, for example, only the host to do it, and then sync the coordinates for other players, I guess.
     
  6. SpiritTauren

    SpiritTauren

    Joined:
    Mar 10, 2009
    Messages:
    208
    Resources:
    2
    Icons:
    1
    Skins:
    1
    Resources:
    2
    + rep bro <3
    That's a sound idea. I'll try it as well. For now, calling the UpdateSeed from the library link above is pretty easy to use as a lazy workaround. As I mentioned above, I call it every 0.03 sec, since in my project I rely heavily on random numbers for the custom combat procedures.
     
    Last edited: Feb 27, 2020
  7. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    3,788
    Resources:
    1
    Spells:
    1
    Resources:
    1
    More simply:

    Start a timer on map init. Tell players to wait a short duration before pressing the esc key. Upon key press use the timer’s elapsed time converted to an integer and multiplied by like 10000 as the seed.