Inspiration

Most football games test your twitch reflexes and button timing. But in reality? Taking a free kick is a complex physics problem. A strike that hits the back of the net at sea level will sail entirely over the crossbar in thin air.

We built FreeKick Earth to make learning about aerodynamics visceral, slightly frustrating, and a lot of fun. It is a game where you have to master the environment before you can master the ball.


What it does

FreeKick Earth is a 3D physics puzzle disguised as an educational sports strategy game. Players travel to famous real-world stadiums and configure their kick—power, aim, launch angle, and spin—based on live, local environmental data.

  • Dynamic Aerodynamics: The engine calculates real-world physics in real-time, pulling altitude, temperature, humidity, and wind data.
  • The "Ghost" Trajectory: We render a baseline sea-level trajectory alongside your actual shot, visually proving exactly how the environment warped the ball's flight path.
  • Reactive Goalkeeper AI: The AI doesn't just guess; it attempts to intercept the shot based on the physics engine's projected math.
  • Multiplayer Rooms: Turn-based kicking and goalkeeping, synced via WebSockets.

How we built it

We split the architecture to balance heavy math with smooth web rendering. Because coding heavy logic for us means focusing on C++, we built the core engine there for maximum performance:

[ SYSTEM ARCHITECTURE ]

┌─────────────────────────┐      WebSockets      ┌─────────────────────────┐
│  FRONTEND (React + 3D)  │◄────────────────────►│    MULTIPLAYER ROOMS    │
└────────┬────────────────┘                      └─────────────────────────┘
         │ REST API
         ▼
┌─────────────────────────┐      HTTP Request    ┌─────────────────────────┐
│   BACKEND (FastAPI)     │─────────────────────►│ LIVE WEATHER API        │
└────────┬────────────────┘  (Temp/Humidity/Wind)└─────────────────────────┘
         │ pybind11 Bridge
         ▼
┌─────────────────────────┐
│  C++ PHYSICS ENGINE     │
│  - RK4 Integration      │
│  - Magnus Effect (Spin) │
│  - Aerodynamic Drag     │
└─────────────────────────┘

Challenges we ran into

Integrating a standalone C++ physics engine into a Python-based FastAPI backend took some serious iteration to ensure data structures mapped perfectly without bottlenecking simulation time.

The Goalkeeper AI was the biggest headache. We had to build a tight predictive logic pipeline in the backend:

[Player Kicks] --> [Calculate Trajectory] --> [Find Goal Intercept] --> [Check GK Reaction Time] --> [Save or Goal]

Top that off with managing WebSocket state for the multiplayer rooms to keep animation timing synced across both clients, and we spent a lot of time deep in the debugging trenches.


Accomplishments that we're proud of

We are incredibly stoked that we engineered a custom gravity and aerodynamics engine entirely from scratch rather than leaning on an off-the-shelf game engine physics system.

Watching a heavily spun ball actually curve mid-air purely because of our Magnus force calculations is deeply rewarding. We are also very proud of the "ghost trajectory" feature—it instantly communicates the educational value of the game by visually proving how the environment changes the math without the player needing to read a textbook.


What we learned

  • Applied Physics: We walked away with a massive understanding of how deeply interconnected air density, temperature, and aerodynamic drag really are.
  • Hybrid-Stack App Dev: We leveled up our ability to bridge C++ performance with Python's API management.
  • Real-time State: We seriously refined our skills in managing multiplayer sync using WebSockets and React Three Fiber.

What's next for FreeKick Earth

  1. Live Weather Integration: Tying into live APIs so players are forced to kick in whatever conditions are actively happening at that stadium in the real world.
  2. Smarter AI: Allowing the goalkeeper to anticipate spin and curve.
  3. Dynamic Visuals: Adding a Three.js particle system to physically render the wind inside the stadium.

Built With

Share this project:

Updates

Submission history