Jump to content

Package random stops being random after first branch


vkz89q

Recommended Posts

So, I'm trying to make a travel package with random locations. My problem is that I noticed that it isn't random at all. It's only random the first time the package starts, not when its supposed to repeat itself.

 

Heres a picture of 2 packages. They both seem to work exactly the same:

 

Package 1:

DM2apQ8.jpg

 

Package 2:

sA3xK7I.jpg

 

Here is what happens when I spawn actor with this package:

 

1. They always skip the first travel destination and go either travel2 or travel3 first(nice random??).

2. After they reach travel2 or travel3, the package is supposed to start over and it does, BUT it completely forgots any randomness and just loops from travel1, travel2, travel3 and then starts over.

3. I have tried LOT of Random branches, like random inside a random that is inside a random but at some point they always stop being random.

 

Like I said, the first time the package starts it IS random, but not after first destination is reached.

 

Now, what wiki says about random branch is:

Random - This branch will run and pick one and only one valid branch or procedure to do. Once it does that branch or procedure, the branch will finish.

 

I have tried ticking Success completes package on the Travels, but it doesn't change anything.

 

I have checked other mods with Random packages and I have couple of my own that use random packages. This is just the first time I actually paid attention how it really works. It's not random at all when the package completes and continues. Then its just basic go from top to bottom.

 

Any ideas what I'm doing wrong or is this just "feature" ? The images I posted make NO difference at all, I'm testing on a clean save and using quest with high priority so nothing else messes with the packages. I can't even find a single vanilla package that uses Random branch.

Link to comment
Share on other sites

  • 2 months later...

I'm necro'ing this from the dead. I discovered this issue with Skyrim SE in the "Travellers of Skyrim" mod. They each have packages that have random sequences for travel destinations, but they all travel together exactly the same, all the time in a tight pack. It's never random, always sequential.

Link to comment
Share on other sites

  • 2 months later...

The game engine random function does not seem to generate decent probability distributions, with result clustering on the smaller ranges I have looked at around 10 options.

 

Doesn't help with travel packages, but to help poke the Utility.RandomInt() function, record the last value and force a re-roll until different:

While iThisRoll == iLastRoll
   iThisRoll = Utility.RandomInt(0, 10)
EndWhile
iLastRoll = iThisRoll

In itself this breaks probability curves, but is a quick n dirty solution to get what I needed based on observed results.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...