agentsclimarketplace

Unity netcode

Skill a5c-ai/babysitter/library/specializations/game-development/skills/unity-netcode

Unity Netcode for GameObjects skill for multiplayer networking, RPCs, state synchronization, and server-authoritative gameplay.From its SKILL.md

Install
npx -y skills add a5c-ai/babysitter --skill unity-netcode

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

2.5 KB, 447 tokens by cl100k_base, as published. Nobody here has run it

Unity Netcode Skill

Multiplayer networking using Unity Netcode for GameObjects.

Overview

This skill provides capabilities for implementing multiplayer games using Unity's Netcode for GameObjects, including state synchronization, RPCs, and network topology configuration.

Capabilities

Network Architecture

  • Configure client-server topology
  • Set up network manager
  • Handle player spawning
  • Manage scene loading

State Synchronization

  • Implement NetworkVariables
  • Configure sync modes
  • Handle prediction
  • Manage network transforms

Remote Procedure Calls

  • Implement ServerRpc methods
  • Create ClientRpc methods
  • Handle RPC parameters
  • Manage RPC batching

Player Management

  • Handle player connections
  • Implement player spawning
  • Manage player state
  • Handle disconnections

Prerequisites

  • Unity 2021.3+
  • Netcode for GameObjects package
  • Transport layer (UTP recommended)

Usage Patterns

Network Object

public class PlayerNetworkBehaviour : NetworkBehaviour
{
    private NetworkVariable<int> health = new NetworkVariable<int>(100);

    public override void OnNetworkSpawn()
    {
        if (IsOwner)
        {
            // Initialize owned player
        }
    }

    [ServerRpc]
    public void TakeDamageServerRpc(int damage)
    {
        health.Value -= damage;
        if (health.Value <= 0)
        {
            DieClientRpc();
        }
    }

    [ClientRpc]
    private void DieClientRpc()
    {
        // Play death effects on all clients
    }
}

Network Manager Setup

// Configure in NetworkManager component
networkManager.ConnectionApprovalCallback = ApprovalCheck;

void ApprovalCheck(NetworkManager.ConnectionApprovalRequest request,
                   NetworkManager.ConnectionApprovalResponse response)
{
    response.Approved = ValidatePlayer(request.Payload);
    response.CreatePlayerObject = true;
}

Best Practices

  1. Use NetworkVariables for state
  2. Validate all RPCs on server
  3. Minimize network traffic
  4. Handle disconnections gracefully
  5. Test with simulated latency

References

What ships with it: 1 file

901 B alongside SKILL.md

Keep looking

Skills are one crate of 326,059. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.