First-Person Online 2v2 / 3v3 Volleyball — Solo Dev

Backyard Volley

Unity 6 / C# Photon Fusion 2 Custom Netcode AI Teammates Procedural Animation Steamworks Solo Dev

The mini trailer, cut from in-engine captures: the new backyard map, first-person spikes and serves (scripted through the real input path), the four serve types, a 3v3 rally between AI players and the slow-mo instant replay. Turn the sound on for the audio pass.

7 bot personalities 2v2 or 3v3 — empty seats fill with AI Every point ends in a replay synced by one networked int

Overview

Backyard Volley is a first-person, online 2v2 / 3v3 grass volleyball game for Steam, built solo. The hook: your mouse is your arm. Every touch — spike, tip, bump, set, block, serve — is a physical flick, and the game works out what you meant from your state at contact: airborne or grounded, button held, where you're looking. No context buttons, no menus.

It's deliberately loud and silly — built for a Discord call, where failure is funny — and underneath that are custom low-latency netcode, a full AI teammate system, procedural animation, a synced instant replay, an overlay-free Steam social layer, and a two-tutorial onboarding flow. The core shipped in a six-week sprint; everything since is a scoped pre-launch push.

01 Netcode

The Ball Is Five Numbers

Replicating the ball as a physics rigidbody put 200–300 ms between a flick and the ball reacting — fatal for a game whose premise is “your mouse is your arm.” So the ball has no physics. It's kinematic, and its position is a closed-form parabola of five networked values that every client evaluates each frame. A hit sends the hitter's own start position and tick to the authority, which writes them verbatim: the local prediction and the networked trajectory are the same curve, so there is nothing to reconcile and no snap to hide. Bounces and net contact are solved analytically on the same five values, and because the flight is deterministic, the AI can predict landings exactly.

5 networked values 0 physics on the ball 200–300 ms delay removed
C# · Photon Fusion 2 Assets/Scripts/Gameplay/Ball.cs · trimmed
// The whole trajectory, replicated. Every client computes pos(t) from these — no transform sync.
[Networked] int     TrajectoryStartTick  { get; set; }
[Networked] Vector3 TrajectoryStartPos   { get; set; }
[Networked] Vector3 TrajectoryStartVel   { get; set; }
[Networked] float   TrajectoryGravity    { get; set; }
[Networked] int     TrajectoryGeneration { get; set; }

// A hit on a non-authority client: render the new parabola NOW, and hand the authority OUR
// start position + tick. It writes them verbatim, so the prediction and the networked
// trajectory describe the exact same curve from the exact same baseline — the handoff is invisible.
if (!HasStateAuthority) {
    int     startTick = (int)Runner.Tick;
    Vector3 startPos  = transform.position;
    SetLocalOverride(startPos, newVelocity, gravity, TrajectoryGeneration + 1, startTick);
    Rpc_ApplySpikeImpulse(newVelocity, gravityMultiplier, rollAmount, originatingSideLayer,
                          startPos, startTick, hitterId);
    return;
}

Photon Fusion 2 is the transport and replication layer. The trajectory model, every hit system, the AI and the tooling are mine.

Up close: the trail, the shards, the impact rings and the squash are local visuals on every client, all derived from the same five values — zero extra networking.

02 Input

Your Mouse Is Your Arm

Swing strength is measured in camera rotation per second, not mouse pixels, so DPI never changes the game, and a per-player calibration fits the skill curve to gentle and aggressive flickers alike. Power composes three independent axes — flick intensity, flick timing, and where in the jump you made contact. Hit type is never chosen: it's derived from body state at the moment of contact, so adding one is a single branch in a single method. The serve is the newest: a release tosses the ball, and the shape of the swing picks the serve — punch and stop for a float, swing through for topspin, flick up for a sky ball, jump into it for a jump serve.

First person: a float, a topspin, a sky ball and a jump serve, with two AI opponents reading them on the far side. Every hit is a physical mouse flick.

03 AI

A Bot Is Just a Second Producer of Input

A volleyball game needs a full court; a solo developer has one player. So a bot is a second producer of input — one branch at the point where input enters the simulation — and everything downstream (movement, hits, scoring, netcode, visuals) is shared with humans. What began as a test harness ships as a feature: seven personality archetypes fill empty seats in online matches.

C# · FixedUpdateNetwork Assets/Scripts/Player/VolleyPlayer.cs
// Input source: a bot synthesizes its input on the state authority via its brain;
// a human pulls input from Fusion's GetInput. Everything below this is identical for both.
PlayerInput input;
if (_isBot) {
    if (!HasStateAuthority) return;            // bots are simulated only on the master
    input = _botBrain != null ? _botBrain.ProduceInput() : default;
} else {
    if (!GetInput(out input)) return;
}

Teams coordinate with explicit volleyball rules rather than emergent hope — distinct roles, near-side attack lanes, the setter clears out, no two bots ever share a destination — and a bot reads a human teammate's intent from position, velocity, facing and body state, not a message. Difficulty degrades perception, never buffs physics: a Rookie reacts late and reads a serve's landing as a wide circle that only shrinks as the ball nears; a Pro reads it tight. Both obey identical movement. The attack planner does real projectile math — a closed-form minimum flight time to clear the net, then a bisection for the launch speed.

C# Assets/Scripts/Player/AI/BotBrain.cs
// Minimum time-of-flight for a contact→aim parabola to cross the net plane (z=0)
// at >= netTop+margin. Net-plane height grows monotonically with T² → closed-form min T.
float MinTimeToClearNet(Vector3 contact, Vector3 aim, float margin) {
    float g = -Physics.gravity.y;
    float cz = contact.z, az = aim.z, cy = contact.y;
    float k = Mathf.Clamp(Mathf.Abs(az - cz) > 0.01f ? -cz / (az - cz) : 0.5f, 0.05f, 0.95f);
    float netClearY = ResolveNetTopY() + Mathf.Max(0f, margin);
    float rhs = (netClearY / (1f - k) - cy) / (0.5f * g * k);
    return rhs > 0f ? Mathf.Sqrt(rhs) : 0f;
}

Vector3 ComputeSpikeDrive(Vector3 contact, Vector3 aim, float targetSpeed) {
    float g = -Physics.gravity.y;
    float horizDist = new Vector2(aim.x - contact.x, aim.z - contact.z).magnitude;
    float dy = aim.y - contact.y;
    float lo = 0.2f, hi = Mathf.Max(0.3f, config.returnMaxTimeOfFlight);
    for (int i = 0; i < 22; i++) {       // |v0| falls as T grows on this branch → bisect for it
        float mid = 0.5f * (lo + hi);
        float vh  = horizDist / mid;
        float vy  = dy / mid + 0.5f * g * mid;
        if (Mathf.Sqrt(vh * vh + vy * vy) > Mathf.Max(1f, targetSpeed)) lo = mid; else hi = mid;
    }
    float T = Mathf.Clamp(Mathf.Max(hi, MinTimeToClearNet(contact, aim, config.spikeNetClearanceMargin)),
                          0.2f, config.returnMaxTimeOfFlight);
    Vector3 v0 = (aim - contact) / T;
    v0.y += 0.5f * g * T;
    return v0;
}
04 Replay Cam

Instant Replay, Synced by One Integer

Every landing point ends in a slow-motion replay — a Cinemachine orbit with a dolly that rides the scoring ball's path — and it adds no ball networking. Each client re-plays its own render-frame ring buffer of already-replicated state on pooled ghost players; a single networked “go” pulse puts every client in lockstep, and the deterministic ball guarantees they're replaying the same event. Slow-mo scales the replay's own clock, never Time.timeScale. Any player can vote to skip.

05 Steamworks

An Overlay-Free Steam Social Layer

Steam lobbies carry the Photon room code as metadata, so a Steam invite and a typed room code are two producers of the same session handoff. When the Steam overlay proved unusable in the dev sandbox, the invite flow was rebuilt overlay-free on the raw Steamworks API — a friends panel with avatars and per-row Invite/Join, incoming-invite cards, friends-list “Join Game” rich presence, and host-left handling. Tested across two machines.

06 Tooling

Built for a One-Person Feel-Tuning Loop

Tuning by feel, solo, needs fast loops: an in-editor telemetry window graphs every swing against the player's calibration; ball machines feed sets and spikes on demand; every tunable lives in ScriptableObjects read live during Play, so A/B testing is swapping an asset; and scripted Play-mode probes drive the real input seam to verify serves, tutorials and bot behaviour without a second player. A doc-camera rig with its own recorder filmed every clip on this page.

07 Process

Shipped on a Clock

A design document as the binding spec. A kill-gate in week one: if the swing didn't read to an outside playtester, the project stopped. Networking front-loaded behind a hard week-three gate — two clients, a full rally, no desync. A written out-of-scope list and a risk register with per-risk mitigations. Both gates passed on schedule; the six weeks delivered the playable game, and everything since — 3v3 and the bot overhaul, the replay cam, the Steam layer, the art and audio passes, serves, tutorials — runs as a sequenced launch pass with an explicit cut-priority list.

Week 1 swing kill-gate — passed Week 3 networking gate — passed 6 hit types, one input seam

As of October 2026 the game is in pre-launch polish — Steam page, trailer and the real App ID are next. Source available on request.

Previous Project ← Tectonic Tactics