Had a good long look at the Role Weights of the core ships, Griff's ships, and the many OXZ/OXP ships that inhabit my Ooniverse. Been doing this because many of the particularly nice looking OXZ/OXP ships have not been showing up with enough regularity to satisfy me. Fairly sure my understanding of how the Role Weights work is correct. As an example of where my current thoughts have lead me. If my Ooniverse has 10 ships with the variable role = "pirate"; (note lack of any weight numbers in parenthesis) then each of these ships has a 1 out of 10 chance of being called by the System Populator to create a Pirate Ship when a system is created. If role = "pirate (#)"; is used then the number in the parenthesis would change that 1 out 10 chance based on the positive (>1) or negative (<1) effect of that number.
Would giving all of the ships in my Ooniverse a Role Weight of role = [whatever role]; with no additional numbered weight in parenthesis cause the System Populator Run Times to increase by any significant amount? Currently this takes about 1 second with the very large amount of OXZ/OXP's that my Ooniverse consists of.
Thank You in advance for any and all answers.
Role Weights and System Populator Run Times
Moderators: winston, another_commander
Role Weights and System Populator Run Times
Humor is the second most subjective thing on the planet
Brevity is the soul of wit and vulgarity is wit's downfall
Good Night and Good Luck - Read You Soon
Brevity is the soul of wit and vulgarity is wit's downfall
Good Night and Good Luck - Read You Soon
Re: Role Weights and System Populator Run Times
It could be a relative weight instead of absolute -- you have to consider ALL other ships' role weights before determining the odds of a particular ship appearing.
Re: Role Weights and System Populator Run Times
It shouldn't affect a populator run time significantly (or even at all) - if a role has no explicitly specified weight, it has an implicit 1.0 weight.
When the game loads ships, it creates probability sets for each role - essentially a list of shipkeys and their weights. When the game tries to create a ship in the role it rolls a random number in the range [0; total sum of all weights in the set), and searches in the list shipkey with the lowest commutative weight (weight of shipkey in the role plus sum of weights of previous shipkeys) that is greater than the random number.
There is no special treatment for roles with explicit or implicit weights and whether all ships have the same weight or not doesn't matter too.
What can significantly affect a populator run time is a lot of ships with conditions/condition scripts that often forbid spawning - if the first rolled ship cannot be used the game creates a copy of the probability set and starts to reroll ships and remove them from the set, if it can't be used too, until the game finds one that pass conditions or the set run out of candidates.
When the game loads ships, it creates probability sets for each role - essentially a list of shipkeys and their weights. When the game tries to create a ship in the role it rolls a random number in the range [0; total sum of all weights in the set), and searches in the list shipkey with the lowest commutative weight (weight of shipkey in the role plus sum of weights of previous shipkeys) that is greater than the random number.
There is no special treatment for roles with explicit or implicit weights and whether all ships have the same weight or not doesn't matter too.
What can significantly affect a populator run time is a lot of ships with conditions/condition scripts that often forbid spawning - if the first rolled ship cannot be used the game creates a copy of the probability set and starts to reroll ships and remove them from the set, if it can't be used too, until the game finds one that pass conditions or the set run out of candidates.
Re: Role Weights and System Populator Run Times
Which oxp (with populator and/or condition scripts ) will then take precedence?Alnivel wrote: ↑Sun Sep 24, 2023 11:28 amWhat can significantly affect a populator run time is a lot of ships with conditions/condition scripts that often forbid spawning - if the first rolled ship cannot be used the game creates a copy of the probability set and starts to reroll ships and remove them from the set, if it can't be used too, until the game finds one that pass conditions or the set run out of candidates.
Re: Role Weights and System Populator Run Times
Sorry, I don't understand the question, could you please elaborate?cbr wrote: ↑Sun Sep 24, 2023 6:05 pmWhich oxp (with populator and/or condition scripts ) will then take precedence?Alnivel wrote: ↑Sun Sep 24, 2023 11:28 amWhat can significantly affect a populator run time is a lot of ships with conditions/condition scripts that often forbid spawning - if the first rolled ship cannot be used the game creates a copy of the probability set and starts to reroll ships and remove them from the set, if it can't be used too, until the game finds one that pass conditions or the set run out of candidates.
Re: Role Weights and System Populator Run Times
If you have many oxp/oxz installed with ships and conditions and populators,
which script will be eh dominant?
which script will be eh dominant?
Re: Role Weights and System Populator Run Times
It's not like there is the one and only condition script for all ships, each shipdata entry can have its own condition script. If there are multiple overrides for one entry, the latest loaded wins. And you can have multiple scripts with a populator function, if they set the same populator key, one that sets the latest will prevail, but otherwise they not meddle with each other.