Behaviour: Simulation (and the Simulation window)
What this page is for
Section titled “What this page is for”The Simulation tool answers one question: what would the characters do? It has three tabs. Forecast reads the opening world and does not play. Simulate plays years on by itself in Play mode and counts what happens. Repeat a scheme starts one scheme again and again and counts how it ends. Each run writes a report.
The tool is one session shown in two places: the Simulation tab of the Behaviour group in the Studio, and a floating window opened from Tools ▸ MrW ▸ Intrigues ▸ Simulation. They share their settings and their last result.
When you come here
Section titled “When you come here”- You want to know how often your decisions would happen.
- You want to see whether a scheme works as often as its chance says.
What you see
Section titled “What you see”No figure is drawn. The page is a column. At the top, the window shows the title Simulation (the Studio tab does not). Then three tabs: Forecast, Simulate, Repeat a scheme. Under the tab come its fields, a button, and a status line. Below them are the last result, and a list titled Reports.
Do it, step by step
Section titled “Do it, step by step”Forecast the opening world
Section titled “Forecast the opening world”- Leave Play mode. In Play mode the button is off and the page says The forecast reads the opening world; leave Play mode to forecast.
- On Forecast, set Years (1 to 50; it starts at 1).
- Click Forecast the opening world. While it runs the button reads Stop and the status reads Reading the opening world… N %.
The intro says what you get: how often characters would carry out each decision, and the chance each pair is told for each scheme. It does not play the game.
Simulate years ahead
Section titled “Simulate years ahead”Press Play first. Outside Play mode a line says Simulate needs the game running: press Play, then come back here.
| Field | Meaning | Starts at |
|---|---|---|
| Years | Years each run plays, 1 to 50. | 5 |
| What happens | Wants only (nothing is carried out) or Carry everything out. | Wants only |
| Runs | 1 to 10. Each run after the first starts from this moment with another world seed. | 1 |
| Characters a player plays think too | Players’ characters think and answer dialogues like everyone else. | Off |
| Speed of waits in seconds | Only with Carry everything out: 1 to 20. | 1 |
| Put the game back afterwards | The game is captured in memory first and put back afterwards. Nothing is saved to a file. | On |
| Stop at the first console error | Stops and puts the game back. | On |
| Guard the scene’s objects | Puts back what game code changed in the scene’s objects. | On |
| Remove objects made during the simulation | Shows only while the guard is on. | Off |
Wants only means characters think and choose, but nothing they choose happens. It is fast, and two runs with the same seed give the same report. Carry everything out runs schemes with their dialogues, waits and results. Click Simulate; it becomes Stop. The status has the form Run N of N · day N of N · N ms per day.
Repeat a scheme
Section titled “Repeat a scheme”Press Play. On Repeat a scheme, pick Scheme, Conspirator and Target (the pickers read Enter Play mode to choose until the game runs, then Select…). Set Repeats (1 to 200, at first 20) and Stop a repeat after (days) (at first 3600). Click Repeat from now. The scheme starts again and again with new dice, and the status has the form Repeat N of N.
A repeat that has not ended after Stop a repeat after (days) is stopped and counted as Still running, not Given up. The field’s hint says given up; the report counts it under Still running. Given up counts only schemes that gave themselves up.
Read the result and the reports
Section titled “Read the result and the reports”Under the tabs, the last result shows. Buttons: Open report file and Show in folder. The list Reports names each report file with Open and Delete. Reports go into IntriguesAI/reports/ in the project, as a Markdown and a CSV file, when a forecast, a simulation or a repeat ends. Delete asks first, then moves the report and its CSV to the Trash on macOS; elsewhere it deletes them. The list shows at most 40 reports. With none, the list says Nothing written yet.
The report keeps two numbers apart: the chance characters are told (stated) and the rate the runs show (measured). The Simulate report has sections such as Schemes, Decisions per year, Never taken, Ambitions, Attitudes, Budgets and Timing. See Balance a scheme’s odds.
Open it from elsewhere
Section titled “Open it from elsewhere”On the Decisions and Formulas pages, Forecast what characters would do opens Forecast. When nothing seems to happen, See what they would do in the first year does the same. After Give this world a mind, the dialog offers See the first year.
How it connects
Section titled “How it connects”Decisions: Behaviour: Decisions. Why one character did nothing: The Thinking window and Find out why a character did not act. One scheme in the Studio: Test run: play a scheme in the Studio. Your code can learn that a simulation runs: see Behaviour from code.
Mistakes and messages
Section titled “Mistakes and messages”The button is off and a line sits under it. That line is the reason.
| Message | What to do |
|---|---|
| A simulation is running. / A scheme is being repeated. | Wait, or click Stop. |
| Enter Play mode to simulate. / Enter Play mode to repeat a scheme. | Press Play. |
| A multiplayer session is running: the simulation runs only in a game of one machine. / A multiplayer session is running: repeats run only in a game of one machine. | Leave the multiplayer session. |
| This machine does not run the characters’ minds. | Run it on the machine that does. |
| A dialogue is waiting for a player. Answer it, or switch on Characters a player plays think too. | Answer it, or switch on the option. |
| Choose a scheme. / Choose a conspirator. / Choose a target. | Fill in the picker. A scheme that needs no target skips the last one. |
Your own statics, files and PlayerPrefs are not put back. Use Mind.SimulationEnded for those (README).