Feasibility question - Monte Carlo sim to drive game

I have a game: https://teamsgame.agilepainrelief.com/ (pre-alpha stage). The game is an attempt to help Agile teams make better choices about the practices that might improve their work. It also attempts to introduce the importance of resilience through gremlins that strike the team as they work.

As we get close to finishing the game I realize that the number of possible choices for game play is large. In some cases people will be curious about what the optimal path(s) are. I also want to see if game play is well balanced. Clearly I need a Monte Carlo simulation. (Letā€™s ignore the fact that Iā€™m not a strong JavaScript developer).

The game consists of 8 rounds, each round they have 5-6 additional actions they could choose from. So round #1 has 5 actions, round #2 has another 5 (I think), ā€¦ until the 8th round. The game will also have 10+ gremlins by the time it is finished - think manager yells at a team member or production support issue.

To simplify simulation I imagine that I will set up my Monte Carlo sim to pick 3 actions per round over the 8 rounds. There some relationship requirements that force precedence - example: you can do ā€œRefactoringā€ without a ā€œBuild Serverā€. Iā€™m aware that the combinatorics is insane. However letā€™s say I limited this to 30-50,000 rounds.

This doesnā€™t need to be run very often, basically only as often as the sim is updated. The goal is two fold:

  • is my game balanced?
  • to help a team see where they might want to put their energy first? (i.e. Working Agreements vs. Build Server)

Is this viable in JavaScript in the first place?
Is Observable the right tool to get me there? If not where would you look?

1 Like

Let me recommend you try to implement your simulation, and ask for concrete help with a link if you get stuck, or if it runs too slow.

A web browser on a typical modern computer or smartphone should have no trouble doing millions of computations in a short amount of time.

Personally I think Observable is a great environment for prototyping this kind of thing. But YMMV.

Thanks - where can I find a good example of a Monte Carlo Sim in Observable? - Cheers Mark

Heh. Hereā€™s a relevant sounding notebook:

There are 90 total notebooks mentioning ā€˜Monte Carloā€™:

https://observablehq.com/search?query=monte%20carlo

1 Like

Thanks - with apologies for basic question. Iā€™m new to Observable and Iā€™m also new to JavaScript - Iā€™m here because @TroyMagennis plays here.

Donā€™t hesitate to ask for help if you get stuck.

If you can write down the rules of your game precisely, someone might be able to help you figure out how to organize your implementation.

1 Like