Skip to content
TheChatArchiveThe Chat Archive
Qwenqwen3-235b-a22b-no-thinking· Alibaba (Qwen)Hugging Face LMArena Human Preference 140K

By no sessions saved I mean that there is session multiplayer, which is more simple…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Qwenqwen3-30b-a3b’s answer.
  1. User

    By no sessions saved I mean that there is session multiplayer, which is more simple alternative to mmo which can be extended into mmo later

  2. Qwen Assistant

    Ah, got it! You're referring to a session-based multiplayer game — where players join a temporary server (like a match or lobby), play together, and when the session ends, everything resets. This is a great starting point before jumping into full MMOs with persistent worlds and databases.

    We'll walk through how to create a session-based multiplayer game in Unity, using a modern networking solution like Mirror Networking (which is actively maintained and built on top of Unity's Transport Layer).


    ✅ Step 1: Choose Your Tools

    Recommended Stack:

    • Unity: Use LTS version (e.g., 2020.3 LTS or newer)
    • Mirror Networking: GitHub - Mirror Networking – easy-to-use networking layer
    • Transport Layer: Use Unity's Netcode for GameObjects (formerly Netcode Transport) or Telepathy (simple TCP/UDP transport)

    ⚠️ Note: Unity’s old HLAPI/UNet is deprecated. Mirror is the best lightweight alternative.


    🧪 Step 2: Set Up a New Unity Project

    1. Open Unity Hub
    2. Create a new 3D Core project (or 2D if you're making a top-down game)
    3. Name it something like SessionMultiplayerDemo

    🔌 Step 3: Install Mirror Networking

    There are two ways to install Mirror:

    Option A: via Package Manager (Recommended)

    1. Go to Window > Package Manager
    2. Click the + button > "Add package from git URL"
    3. Enter: https://github.com/MirrorNetworking/Mirror.git?path=/Packages/com_mirror

    Option B: via Unity Asset Store

    1. Open Unity Asset Store
    2. Search for Mirror Networking
    3. Import the package

    🕹️ Step 4: Basic Multiplayer Scene Setup

    1. Create a Network Manager

    1. Right-click in Hierarchy → Create Empty → Name it NetworkManager

    2. Add the NetworkManager component (from Mirror)

    3. Also add NetworkManagerHUD to easily test hosting/joining

      ![Screenshot suggestion: NetworkManager setup]

    4. Save the scene as MainScene

    2. Create a Player Prefab

    1. Right-click in Hierarchy → 3D Object > Capsule

    2. Rename it to Player

    3. Add a NetworkIdentity component

    4. Add a NetworkTransform so movement syncs over network

    5. Drag this object into the Assets folder to make it a prefab

    6. Remove it from the scene

    7. In the NetworkManager inspector, set:

      • Player Prefab = your Player prefab
      • Auto Create Player = true

    🏃‍♂️ Step 5: Run the Game

    1. Hit Play
    2. Click Start Host or Start Server / Start Client
    3. You’ll see a local multiplayer environment working!

    📦 Step 6: No Saved Data Between Sessions

    This part is already handled by default:

    • When the server shuts down, all data is lost.
    • There’s no database or persistent storage.
    • Players reconnecting later will not have their previous state saved.

    You can now focus on gameplay mechanics without worrying about databases or servers running 24/7.


    🧱 Step 7: Expand Into MMO Later

    Once you’re comfortable with session-based multiplayer, you can evolve into an MMO by adding:

    FeatureDescription
    Persistent WorldStore world state in a database
    Login SystemAuthenticate users
    Player ProfilesSave inventory, stats, etc.
    MatchmakingAuto-join lobbies or zones
    Dedicated ServersRun servers 24/7
    Sharding / ZonesSplit world into regions
    Anti-Cheat & SecurityProtect against exploits

    🛠️ Optional: Hosting a Dedicated Server

    To run a public session server:

    1. Build your game (File > Build Settings)
    2. Build a dedicated server version:
      • Enable “Headless Mode” in build settings
      • Run it separately (on a VPS or cloud machine)

    Clients connect via IP address or matchmaking service.


    📚 Useful Tutorials


    🎯 Summary

    GoalHow to Achieve
    Session-based multiplayerUse Mirror Networking + NetworkIdentity + NetworkTransform
    No saved dataDon’t implement saving/loading; reset each session
    Extendable to MMOLater, integrate databases, login systems, dedicated servers

    Would you like a sample GitHub repo or starter template to get going faster? I can provide one that includes Mirror setup and player movement.

  3. User

    Why you prefer mirror over new unity network system?

  4. Qwen Assistant

    Great question! The choice between Mirror Networking and Unity’s newer networking system — currently called Netcode for GameObjects (formerly known as Netcode for Unity Multiplayer or MLAPI) — depends on your project's goals, experience level, and what kind of development workflow you prefer.

    Here’s a breakdown of why Mirror is still preferred by many developers today — especially for session-based multiplayer games, indie projects, and those transitioning from older Unity networking systems like UNet:


    ✅ Why Mirror Is Still Preferred in Many Cases

    1. Mature, Stable, and Battle-Tested

    • Mirror is a community-maintained fork of the original UNet HLAPI, with years of real-world use.
    • It powers many shipped games and has a large community and ecosystem.
    • If you're starting small or want something that "just works", Mirror is often more approachable.

    2. Familiar API for Unity Developers

    • Mirror uses an object-oriented, component-based model:
      • NetworkIdentity, NetworkBehaviour, Cmd, Rpc, etc.
    • This makes it easier to learn if you're used to Unity’s MonoBehaviour-style scripting.
    • Very little boilerplate code required to get started.

    3. Built-in Tools & Editor Support

    • Mirror includes useful editor tools like:
      • NetworkManagerHUD (for testing)
      • Spawn System
      • SyncVars, NetworkTransform, etc.
    • These reduce the amount of custom code you need to write.

    4. Easier to Extend and Customize

    • Because it's open-source and well-documented, it's relatively easy to modify or extend Mirror to suit your game.
    • You can swap out transports (like using Telepathy for TCP/UDP instead of Netcode Transport).

    5. Active Community and Plugins

    • There are many free and paid plugins built around Mirror (e.g., authentication, voice chat, inventory systems).
    • A lot of existing tutorials and YouTube content use Mirror.

    🧪 Unity’s New Netcode for GameObjects: Pros

    Unity's new official solution is Netcode for GameObjects, part of their larger Transport and Netcode packages. Here's where it shines:

    1. Future-Proof and Officially Supported

    • Actively developed and supported by Unity.
    • Designed with scalability and performance in mind.
    • Intended to replace all previous networking solutions.

    2. More Performant and Scalable

    • Lower-level API gives you more control over network behavior.
    • Built for high-performance scenarios like AAA games or large-scale servers.

    3. Better Security and Modern Practices

    • Uses modern serialization (with System.Text.Json).
    • Enforces better practices for secure communication and authoritative servers.

    4. Cross-Platform Ready

    • Works across platforms including mobile, consoles, and standalone builds.

    ⚖️ Mirror vs Netcode for GameObjects – Comparison Table

    FeatureMirrorNetcode for GameObjects
    MaturityMature, stable, widely usedActively developed, improving
    Learning CurveGentle, familiar to Unity devsSteeper, lower-level
    Editor ToolsRich GUI tools (Hud, Spawning, etc.)Limited tooling so far
    PerformanceGood for indie/small-scale gamesOptimized for high-performance
    CustomizationEasy to customizeRequires deeper understanding
    Community / ResourcesLarge, many tutorialsGrowing, but fewer guides
    Future ProofCommunity maintainedOfficially supported by Unity
    Use CaseIndie games, session-based MP, fast prototypingAAA, large-scale MMOs, long-term support

    🎯 When Should You Choose Mirror?

    Use Mirror if:

    • You’re building a small-to-medium scale multiplayer game
    • You want fast prototyping and ease of use
    • You're not ready to dive into low-level networking
    • You're learning multiplayer concepts
    • You're targeting a session-based multiplayer game, not a full MMO

    🎯 When Should You Choose Netcode for GameObjects?

    Use Netcode for GameObjects if:

    • You're building a high-performance multiplayer game
    • You plan to scale up to thousands of players eventually
    • You want official Unity support
    • You're comfortable writing lower-level networking logic
    • You're working on a professional or enterprise-level product

    🧠 Pro Tip: Hybrid Approach

    You can even start with Mirror for rapid prototyping, then transition to Netcode for GameObjects later once your core mechanics are solid and you're ready to optimize.


    🔗 Useful Links


    Would you like a basic Mirror starter template or a Netcode for GameObjects starter template to see how each looks in practice? I can give you a minimal working example of either one.

  5. User

    My game is TPS close combat fighting game.

  6. Qwen Assistant

    Got it! You're making a TPS (Third-Person Shooter) close-combat fighting game, likely with multiplayer. That gives us a solid foundation to tailor the approach.


    🔥 Recommended Approach: Mirror Networking

    Since you're building a close-combat TPS fighting game, your priorities are:

    • Fast-paced, responsive movement and combat
    • Synchronized player actions (attacks, dodges, health)
    • Session-based multiplayer (no persistent data between sessions)
    • Quick iteration and prototyping

    For these reasons, Mirror Networking is still the better choice for now.


    🎮 Core Multiplayer Features Needed

    FeatureDescription
    Player Movement SyncEnsure all clients see smooth movement
    Input Prediction / ReconciliationMake controls feel responsive
    Attack & Hit DetectionHandle combat logic on server
    Health & Death SystemTrack damage and respawn players
    Session MatchmakingHost/Join lobbies without saved profiles
    Match Timer / ScoreboardOptional: Add win conditions

    🧱 Architecture Overview

    Client (Player 1) ----\
                            \
    Client (Player 2) -------> [Server]
                            /
    Client (Player 3) ----/
    
    • The server runs the authoritative game logic (damage, hit detection, win conditions).
    • Clients send inputs (movement, attack buttons), and receive updates from the server.
    • No database or persistent storage needed at this stage.

    ✅ Getting Started – Minimal Setup with Mirror

    Step 1: Install Mirror Networking

    Use Git URL in Unity Package Manager:

    https://github.com/MirrorNetworking/Mirror.git?path=/Packages/com_mirror
    

    Step 2: Create NetworkManager

    • GameObject > Create Empty > Name it NetworkManager
    • Add component: NetworkManager
    • Add: NetworkManagerHUD (for testing UI)

    Step 3: Create Player Prefab

    • Capsule → Rename to Player
    • Add components:
      • NetworkIdentity
      • NetworkTransform (synchronizes position/rotation)
    • Drag into Assets folder as a prefab
    • Set it as Player Prefab in NetworkManager

    Step 4: Add Basic Movement Script

    using UnityEngine;
    using Mirror;
    
    public class PlayerMovement : NetworkBehaviour
    {
        public float moveSpeed = 5f;
        public float jumpForce = 5f;
        private Rigidbody rb;
    
        void Start()
        {
            rb = GetComponent<Rigidbody>();
        }
    
        void Update()
        {
            if (!isLocalPlayer) return;
    
            float x = Input.GetAxis("Horizontal");
            float z = Input.GetAxis("Vertical");
    
            Vector3 move = transform.right * x + transform.forward * z;
            rb.velocity = new Vector3(move.x * moveSpeed, rb.velocity.y, move.z * moveSpeed);
    
            if (Input.GetButtonDown("Jump"))
            {
                rb.AddForce(Vector3.up * jumpForce, ForceMode.Impulse);
            }
        }
    }
    

    Attach this to your Player prefab.


    ⚔️ Close Combat Fighting Logic

    You’ll need to implement:

    1. Attack Input & Animation Trigger

    void Update()
    {
        if (!isLocalPlayer) return;
    
        if (Input.GetMouseButtonDown(0)) // Left click
        {
            CmdDoMeleeAttack();
        }
    }
    

    2. Server-Side Damage Handling

    [Command]
    void CmdDoMeleeAttack()
    {
        RaycastHit hit;
        if (Physics.Raycast(Camera.main.transform.position, Camera.main.transform.forward, out hit, 2f))
        {
            if (hit.collider.CompareTag("Player"))
            {
                RpcApplyDamage(hit.collider.gameObject, 20);
            }
        }
    }
    
    [Rpc]
    void RpcApplyDamage(GameObject target, int damage)
    {
        Health health = target.GetComponent<Health>();
        if (health != null)
        {
            health.TakeDamage(damage);
        }
    }
    

    3. Health Component

    public class Health : NetworkBehaviour
    {
        [SyncVar]
        public int currentHealth = 100;
    
        public void TakeDamage(int amount)
        {
            if (!isServer) return;
    
            currentHealth -= amount;
            if (currentHealth <= 0)
            {
                Die();
            }
        }
    
        [Server]
        void Die()
        {
            // Respawn or despawn player
            NetworkServer.Destroy(gameObject);
        }
    }
    

    🧪 Testing Your Game

    1. Click Play
    2. Press Start Host in the HUD
    3. Launch another instance of the game (or build client)
    4. Join the server IP
    5. Fight!

    🧠 Tips for Close Combat Games

    • Use interpolation and prediction to make movement smoother.
    • Consider input delay compensation for fairness in hits.
    • For advanced hit detection, use raycasts on the server only to prevent cheating.
    • If latency becomes an issue later, look into snapshot interpolation or switch to Netcode for GameObjects.

    🛠️ Next Steps

    GoalWhat to Do
    Improve network performanceLearn about sync intervals, interpolation
    Add abilities or combosExtend Cmd and Rpc methods
    Add matchmaking systemUse Steamworks, Photon PUN, or simple LAN discovery
    Build dedicated serverExport headless build and run on VPS

    📦 Want a Starter Template?

    I can provide a minimal GitHub repo or Unity package that includes:

    • Mirror setup
    • Basic player controller
    • Melee attack system
    • Health & death system
    • Network HUD for testing

    Would you like that? I can give you a zip file or GitHub link with everything ready to go.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.