Jump to content

Photo

Package random stops being random after first branch

ai package package travel random procedure branch

  • Please log in to reply
4 replies to this topic

#1
vkz89q

vkz89q

    Fan

  • Members
  • PipPipPip
  • 294 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.



#2
SMB92

SMB92

    Resident poster

  • Premium Member
  • 4,436 posts
Should post over on Skyrim thread, probably better luck there

#3
fadingsignal

fadingsignal

    Resident poster

  • Premium Member
  • 8,429 posts

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.



#4
DrNRG

DrNRG

    Stranger

  • Members
  • Pip
  • 6 posts

I ran into this same problem with a mod that I'm creating when attempting to randomize specific furniture for some scenes.


Edited by DrNRG, 25 November 2017 - 10:52 AM.


#5
SKK50

SKK50

    Institutum delenda est

  • Premium Member
  • 5,814 posts

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.







Also tagged with one or more of these keywords: ai package, package, travel, random, procedure, branch

IPB skins by Skinbox
Page loaded in: 1.138 seconds