Chance, dice and seeds
Stories need luck: the poison might fail, the rumour might not spread. Intrigues takes its luck from one place, called the dice. This page says what the dice are and why the same game can give the same luck again.
One source of chance
Section titled “One source of chance”Every chance in a story goes through the dice. A roll is not drawn from a hidden random generator, but worked out from the world seed, a number the game keeps, and a count of the rolls already made. So the same game gives the same rolls.
Two schemes never disturb each other’s dice: each running scheme has its own sequence of rolls. A save keeps where the dice stand.
The designers’ rule is that there is no hidden randomness. Anything in a story that depends on luck is a node or a setting you can see.
Where luck appears
Section titled “Where luck appears”| Where | What is random |
|---|---|
| Chance node | Success or Failure, by a percent. Bonuses add the values of variables to the chance, and the result stays between 0 and 100% |
| Random Branch node | One of the linked nodes. Each branch can have a weight, and equal weights give equal odds |
| Wait node, with Random Length | A time between two numbers, chosen each time the node runs |
| Show Dialogue, when nobody plays the actor | The answer, when NPC Answer is At random |
| Picking an actor | Some nodes pick one actor out of several. Their ranking can be Random, and a tie can be broken at random |
| Characters’ decisions | A decision is a chance of doing it, rolled when the character thinks |
- Start, output Start, goes to Chance.
- Chance, output Success, goes to Succeed Scheme.
- Chance, output Failure, goes to Fail Scheme.
Chance can also come from a formula or from a scheme’s own odds, instead of a fixed percent. See Schemes.
The world seed
Section titled “The world seed”Each new game gets a world seed, and save files keep it.
In Behaviour > Settings there is a Dice seed row. Its note says: 0 means a new seed for every new game, and with a seed other than 0, every new game rolls the same dice. Leave it at 0 to get new luck every game.
The seed also decides each character’s day of the year for growing older, when ageing is on.
Code can set the seed too, with IM.SetWorldSeed. The dice start over, so the same seed set at the start of a game
replays the same rolls. 0 is not a valid seed.
Loading a save
Section titled “Loading a save”The Save System has a setting for what the dice do after a load, Dice After Load:
- New rolls (the default): chances and random picks can turn out differently than before the save.
- Same rolls: a scheme’s dice continue where they stood, so loading again does not change what a scheme rolls next.
Heirs decided by luck stay the same either way.
Repeating a run in the Studio
Section titled “Repeating a run in the Studio”A test run uses the dice too. In Run with setup… there is a Dice seed field and a Keep this seed switch.
- Keep this seed on: every Run uses this seed and replays the same rolls.
- Keep this seed off: every Run rolls new dice, unless the database’s Dice seed is not 0. Run again always replays its own.
That is how you can run the same scheme again, change one thing, and see whether the result changed because of your change or because of the luck. See Test run.
Seeing where a graph uses luck
Section titled “Seeing where a graph uses luck”On the Schemes page, the More menu of the toolbar has Randomness and picks in this graph. It lists every node of the graph that picks among actors or rolls the dice, each with a sentence saying how it decides. See The Element Inspector.