Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Tower Defense Multiplayer - complete networking project (Netcode)

Discussion in 'Assets and Asset Store' started by Baroni, Jun 19, 2023.

  1. Baroni


    Aug 20, 2010
    Interested or looking for support? Ask me anything in this thread - from developer to developer :)

    Tower Defense Multiplayer is a new take on the popular tower defense genre, in the form of a co-op multiplayer template using Unity Netcode for GameObjects. By default, it allows up to 8 players per room, to shoot down waves of incoming enemies and compete for the highest score. It features player class selection, tower placement and shooting, upgrades, defense points with health, networked object pooling, several Unity services and more. This template is laying the ground for a successful multiplayer game, by demonstrating common network tasks such as connecting players to a lobby, fully authoritative server actions, commands & RPCs, synced variables / object states, but also monetizing players using in-app purchases and video ads to keep your servers running. I’ve included an in-depth documentation about all approaches I took while building this and commented each and every method, so you can follow along easily.


    ✅ Online Matchmaking & Player Lobby
    ✅ Supports Local Area Network (LAN) game discovery
    ✅ Supports Offline mode (solo)
    ✅ Class Selection: players choose a tower class in the lobby before they ready up
    Synchronized Player Properties: name, class, color, score, currency balance
    Authoritative Player Actions: tower placement, upgrade or sell own towers
    ✅ Authoritative Defense Points: server calculates damage and remaining health
    ✅ Shared Towers: upgrade each others towers using your own currency balance
    Networked Object Pooling: synced client pools for enemy units & projectiles
    Unit Movement: making use of Unity Splines, C# Jobs System and Burst
    Minimap: updates and displays unit positions periodically in a RenderTexture
    Reusable Manager Scripts: audio, pools, Unity IAP, Unity Ads
    Ads: display video ads between waves (playing solo) or on game end
    In-App Purchases: buy different tower classes (visual or game impact)
    ✅ Unity UI: menus, wave status, player scores, mobile scroll
    ✅ Input for Mobile (touch) & Standalone (keyboard + mouse)
    Documentation: scripting reference & step by step guide

    (Optional) Use of Unity Services:
    • Unity Ads
    • Unity IAP

    Scripting Reference and Guides:
    Get it here:
    Try it out:
    Last edited: Aug 29, 2023
    toddkc and BetaMark like this.
  2. BetaMark


    Sep 27, 2014
    Interested in seeing what you've built here. I'm a Mirror guy right now and I've evaluated a few other net stacks, but I'm very interested to see how your template works with the new NetCode for GameObjects.

    A couple of quick questions that I didn't see answered in your checklist:
    * Will the template include 2d and 3d examples?
    * Are matches able to be played across client types (e.g. one player with webGL, another with Windows, and another on mobile iOS/Android)?
    * How does this template handle auth?
    * Is there Steam Auth? Google auth? Apple Auth?
    * Does this template handle persistence across matches?
    * Does the matchmaking do any MMR for players?
    * What unity version is the baseline for this template?

    Optionally, do you have a low poly kits you recommend I purchase to use with the kit?
  3. Baroni


    Aug 20, 2010
    Thanks for the questions @BetaMark! Since this is a new asset, of course I am very interested to hear what you expect from it.

    The asset will include two 3D maps, one with tower placement grids only available to a specific player (+multiple defense points), and one with shared placement grids where all players can place their towers (+one shared defense point).

    In the Netcode for GO version, online cross-play is supported and done using Unity Relay. In LAN that works without Relay, but firewalls need to be disabled and a desktop client needs to host the game.

    Authentication has not been a focus of the asset (yet) due to no current features requiring it. Unity Relay and Lobby use anonymous authentication at this point.

    No, since nothing needs to be persisted currently. Matches are real-time sessions, which are "destroyed" if the host or all players leave. In this context, note that host migration with Unity Netcode is also not supported in this asset, but featured in my other asset, Tanks Multiplayer.

    There is no MMR, but that could be easily added in Unity Lobby as an additional filter criteria when searching for open matches. However the question is if you really want to have that, since players do not play against each other, but together, where MMR would not matter that much I guess.

    The asset will be released using Unity 2022.3.0 (LTS) due to Unity Transport requiring at least Unity 2022.2.

    Honestly I have not looking into existing 3D models that much... I am currently working on creating some for demonstration purposes myself, which go in a similar military direction as this or that one.

    Thanks again!
    BetaMark likes this.
  4. Baroni


    Aug 20, 2010
    The asset has been submitted to the Asset Store for review!

    Asset Store - Tower Defense Multiplayer - Unity_007.png Asset Store - Tower Defense Multiplayer - Unity_010.png Asset Store - Tower Defense Multiplayer - Unity_014.png

    Documentation and a WebPlayer will be available on release. In the meantime, let me know if you have any questions. Thanks!
    BetaMark likes this.
  5. Baroni


    Aug 20, 2010
    Tower Defense Multiplayer has been released!

    It is not visible on the Unity Asset Store just yet, but will probably be in a few hours. Please see the first post for a direct link to the asset (that works). Thank you!
    BetaMark likes this.