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’:


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