Inspiration

What if the laws of physics weren't fixed? What if you could rewrite them?

That question inspired UNIVERSE.EXE — Hack Reality.

Most physics simulations ask users to observe how objects behave under predefined rules. I wanted to create something different: a playable universe where users become the architects of those rules.

What happens when gravity suddenly reverses? What if colliding spheres generate new objects? Could you solve a puzzle by changing physics instead of controlling a character?

UNIVERSE.EXE explores these questions through a real-time 3D laboratory that combines creative experimentation, programmable physical behavior, and interactive challenges.

The goal was to make physics feel less like a collection of equations and more like a world you can break, rebuild, and share.

What it does

UNIVERSE.EXE is an interactive 3D reality laboratory running directly in the browser.

Players can experiment with genuine rigid-body physics and create their own cause-and-effect systems.

🌌 Break Reality

A guided first experience introduces players to the concept immediately.

One interaction activates a validated physics rule that reverses gravity for 2.5 seconds. Objects rise through the chamber and fall again when normal gravity returns.

The movement is produced by the real physics simulation—not by a prerecorded animation.

⚡ Manipulate the Universe

Players can:

  • Reverse, disable, or adjust gravity.
  • Freeze and resume simulation time.
  • Change collision elasticity.
  • Spawn spheres, cubes, and heavy objects.
  • Apply impulses, spin, and directional nudges.
  • Select, clear, reset, save, and restore physical worlds.

🧬 Create Reality Recipes

The Reality Compiler system allows players to define event-driven rules using WHEN/THEN logic.

For example:

  • When two spheres collide, spawn another sphere.
  • When a sphere hits a cube, launch it upward.
  • When a cube hits the floor, temporarily reverse gravity.

These rules respond to actual Rapier collision events.

The project also includes an optional natural-language AI compiler that produces validated rule proposals. This server-side capability is not configured on the current Render Static Site deployment; manual rule creation and deterministic commands work independently.

🎮 Solve Reality Challenges

Three physics puzzles turn experimentation into gameplay:

Gravity Escape: Reverse gravity at the correct moment to guide a sphere into an energy ring.

Chain Reaction: Trigger collisions that create enough new spheres to complete the objective.

Quantum Launch: Use a collision-driven impulse to launch a sphere into its target.

Challenge completion is determined through actual physics events and goal sensors.

🔗 Share Reality DNA

Players can generate shareable links containing validated world configurations, including objects, gravity settings, and rules.

Recipients can open an experiment, inspect its configuration, play it, and remix it.

Sharing works without accounts or a database, using compact URL-encoded world data.

How we built it

UNIVERSE.EXE was developed using Kiro's specification-driven workflow, with implementation divided into focused milestones.

Technology stack:

  • React and TypeScript for the application and interface.
  • Three.js and React Three Fiber for interactive 3D rendering.
  • Rapier for real rigid-body physics, impulses, and collision detection.
  • Zustand-style application state management through the project's custom store.
  • Vite for development and production builds.
  • Vitest for automated testing.
  • Render Static Site for public frontend deployment.
  • Kiro for requirements, design, implementation assistance, debugging, and testing workflows.

The development process began with the core 3D sandbox and gradually introduced programmable rules, physics challenges, world persistence, first-time onboarding, and experiment sharing.

Kiro helped translate feature goals into structured requirements, technical designs, and implementation tasks. The repository preserves this process in its .kiro/specs/ and .kiro/steering/ directories.

Rather than treating generated code as automatically correct, development incorporated validation, repeatable tests, and targeted fixes.

The main application reached 127 passing automated tests, covering the rule engine, physics interactions, challenge logic, saving, sharing, and state restoration. A separate experimental Force Lab branch later reached 154 passing tests; those additional mechanics are not part of the verified public experience yet.

The live application is available at:

Play UNIVERSE.EXE

Source code and development specifications:

GitHub Repository

Challenges we ran into

1. Sleeping physics bodies ignored gravity changes

One particularly interesting bug involved Rapier's sleeping-body optimization.

Objects at rest can enter a sleeping state. Changing the world's gravity vector did not necessarily make those sleeping objects start moving.

That meant a dramatic gravity reversal could appear to do nothing.

We reproduced the behavior in a headless physics test and fixed it by waking relevant rigid bodies when gravity changed.

This became particularly important for the Break Reality experience.

2. Making physics puzzles reliably solvable

A physics puzzle can look correct while failing unpredictably.

The Chain Reaction challenge initially completed in only 12 of 16 seeded headless simulation runs.

By testing the intended solution repeatedly, adjusting the rule cooldown from 1.5 seconds to 0.8 seconds, and refining the object arrangement, the challenge reached 16 of 16 successful headless runs.

This demonstrated why deterministic testing matters even for highly dynamic gameplay.

3. Preventing runaway rule chains

Programmable collision reactions introduce the risk of uncontrolled spawning and repeated event loops.

We implemented validation, cooldowns, collision deduplication, object limits, effect-rate limits, and bounded spawn generations to keep user-created rules safe and predictable.

4. Preserving worlds across different experiences

Moving between Sandbox, Challenges, and guided experiences required careful state handling.

The application needed to preserve object configurations, velocities, gravity settings, and rules while preventing stale collision events and temporary effects from leaking into restored sessions.

Versioned snapshots and validation helped make transitions more robust.

Accomplishments that we're proud of

Building a real 3D simulation rather than a visual imitation is the project's biggest technical accomplishment.

Other highlights include:

  • A functional browser-based 3D physics sandbox using Rapier.
  • A rule engine that turns physical events into new physical effects.
  • Three physics challenges with real collision-driven objectives.
  • A guided Break Reality experiment using genuine gravity reversal.
  • Shareable Reality DNA experiments without user accounts or backend storage.
  • Save slots that preserve and restore experimental worlds.
  • Safety limits that constrain potentially runaway user-created rules.
  • 127 passing automated tests on the main implementation.
  • Public deployment and a documented Kiro specification-driven development process.

Browser testing has confirmed core sandbox interactions, Reality Recipes, Break Reality, save/load behavior, and successful Chain Reaction completion. Some newer workflows and challenge completions still require additional verification.

What we learned

A visually convincing simulation is not automatically a technically correct simulation.

Developing UNIVERSE.EXE reinforced several important lessons:

Physics needs testing. Small changes to cooldowns, body states, and collision timing can produce major differences in behavior.

Validation enables creativity. Users can experiment more confidently when potentially dangerous or unstable rule combinations have clear boundaries.

State management is part of gameplay. A reliable experience depends on restoring worlds correctly, not just making objects move.

Good onboarding matters. Break Reality was introduced to communicate the application's central idea through interaction rather than lengthy instructions.

AI-assisted development still requires engineering judgment. Kiro helped structure and accelerate implementation, but correctness depended on explicit requirements, testing, iteration, and identifying limitations.

What's next for UNIVERSE.EXE — Hack Reality

UNIVERSE.EXE is designed as a foundation for increasingly creative physics experimentation.

Future improvements could include:

  • Additional physics powers such as Shockwave, Implosion, and Vortex Pulse, currently developed on a separate experimental branch pending browser verification.
  • More sophisticated programmable physical interactions.
  • Additional challenge levels and user-created puzzles.
  • Improved world-sharing and remixing workflows.
  • A securely deployed live natural-language compiler with appropriate API abuse protection.
  • More accessibility and performance improvements across devices.

The long-term vision is simple:

Turn physics from something people only observe into something they can experiment with, program, challenge, and share.

UNIVERSE.EXE — Hack Reality.

Don't just play by the rules. Rewrite them.

Built With

Share this project:

Updates

Submission history