How it works
How it works
This section explains the ideas behind Pelota: what the game computes, and why. Each page starts with the short version in plain words, then goes into the details with diagrams and plots. At the end of each page, a small In the code box points developers to the files that implement it.
The big picture
A match is a handful of parts that talk to each other:
- The match manager knows the rules. It watches the ball, decides who wins each point, keeps the score and tells the players when to serve.
- Each player has a controller that decides what the player does: where to move and which shot to play. A human controller turns your button presses into these decisions; the AI controller makes its own. Both drive the player in exactly the same way, so the AI has no special powers.
- The ball flies by itself, following its own physics. The same physics can also predict the ball’s flight, which both controllers use to plan where to meet it.
- The model is what you see of a player: the body, the clothes, the racket, and the animation that makes it all move.
Topics
Dimensions and directions everything else refers to.
Gravity, spin, air, bounce and net; and how a shot finds its target.
What makes a shot fast and precise: timing, position, readiness, early or late.
Speed by direction, backpedaling and turning, getting to the ball.
Retargeted motion, synced gait cycles, swings that meet the ball.
How the computer reads your shot, chooses its own and positions itself.
Nerves on big points, momentum from winning games.
What makes players different, and how they tire.
Points, faults, breaks between points, and the match clock.
TV cameras, benches and players who sweat.