Butterfly.exe — Discover the Consequences Before They Happen
Inspiration
Complex systems rarely fail in isolation. Closing one road can redirect traffic across an entire city. Changing one variable in an ecosystem can trigger a chain of effects. Removing one connection can reshape how an unfamiliar network behaves.
Yet, when we make decisions about interconnected systems, we often see only the immediate outcome—not the consequences that emerge afterward.
We built Butterfly.exe around one question: What if we could experiment with a decision before committing to it, and discover what changes beyond the obvious?
What it does
Butterfly.exe is an interactive consequence-discovery simulator that lets users intervene in a system, run a simulation, and compare what happens before and after the intervention.
It currently features three interactive 3D worlds:
- City: Explore a road network, observe commuter movement, close a road, and measure the resulting changes in routing, queues, and travel delays.
- Ecosystem: Explore interactions in an interconnected environment and investigate how changes can propagate through a system.
- Unknown: Experiment with an evolving connection network and observe how its structure changes during simulation.
Rather than presenting a prediction as an unquestionable answer, Butterfly.exe makes the experiment and its consequences visible. Users can inspect the system, intervene, rerun it, and examine the resulting evidence.
How we built it
We built Butterfly.exe as a full-stack JavaScript application.
- Frontend: React and Vite, with an interactive interface and native WebGL-based 3D rendering.
- Backend: Node.js and Express, providing the simulation API and experiment workflows.
- Persistence: MongoDB integration for experiment data.
- Simulation engine: Deterministic simulation logic for reproducible experiments and before-and-after comparisons.
The City experiment demonstrates the core approach: establish a baseline, apply an intervention, rerun the simulation, and compare measurable outcomes. This makes it possible to inspect not just what changed, but how the change affected the simulated system.
A concrete experiment
In our City simulation, six commuters travel through a road network over a 10-step horizon.
In the baseline run, commuters use the home-central → central-work route. We then close the home-central road and rerun the experiment. The commuters reroute through home-market → market-work.
In the implemented deterministic model, the baseline records 15 queue waits and 15 delay steps, with an average travel time of 4.5 steps. After the road closure, the simulation records 6 queue waits and 6 delay steps, with an average travel time of 4 steps. All six trips complete in both runs.
This result is specific to our simulated network and its capacity assumptions; it is not a claim that closing roads generally improves traffic. That distinction is important: the goal is to reveal the consequences of a particular intervention under explicit model conditions.
Challenges we faced
One of our main challenges was making the simulations understandable rather than simply visually impressive. A 3D environment is useful only when users can connect what they see to measurable outcomes.
We also worked on keeping simulation evidence consistent across steps, making the Unknown world's connections respond to playback, and ensuring that the interface clearly communicates changes between baseline and intervention runs.
Another challenge was building interactive 3D worlds without relying on a heavyweight 3D framework, using native WebGL rendering instead.
What we learned
Building Butterfly.exe reinforced that simulation tools need more than visualizations. They need reproducible experiments, clear comparisons, and evidence that helps people understand why an outcome occurred.
We also learned that unexpected results are most useful when users can investigate the conditions behind them instead of treating a model's output as a universal truth.
What's next
We want to expand the range of interventions users can test, improve explanations of cause-and-effect chains, and make experiments easier to reproduce and share. Future versions could explore more complex networks, richer system dynamics, and tools for comparing multiple possible interventions.
The vision
Butterfly.exe is an experiment in making hidden consequences visible.
By letting people change a system, observe what follows, and compare the evidence, we hope to make complex systems easier to explore—and help people ask better questions before making consequential decisions.
Built With
- 3d
- artificial
- data
- development
- graphics
- intelligence
- javascript
- node.js
- open
- react
- simulation
- systems
- thinking
- visualization
- web
Log in or sign up for Devpost to join the conversation.