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.

What's the best solution for a 4-player co-op game, and where's the tutorial?

Discussion in 'Multiplayer' started by Procles, Jan 4, 2014.

  1. Procles

    Procles

    Joined:
    Nov 29, 2012
    Posts:
    1
    Hi, I've been banging my head against the monolith of multiplayer for a while, so I figured I'd inquire here. A question in 2 parts.

    1) What would be the best solution for a simple ~4 player co-op game? Co-op means there's no need for cheat protection or other such validations, as there's no point in getting advantage over other players. You invited everyone present. You only need one person to host who can then pass out his IP to his friends. I don't need server browsers, dedicated servers, or any such complications and couldn't afford the overhead in the first place.

    2) Where's a good, free tutorial for this solution?

    (TLDNR can stop here, the following is only for clarification)

    To get more complicated, I'm looking to make a simple, co-op, D&D style dungeon crawler. Players would either host, or enter a host's IP, then be asked to choose their class. They would need to communicate their locations, current statistics equipment to one another as well as those of the enemies present and the state of the world itself. Certain things like enemy spawns, item drops, and such will need to be kept consistent across the experience, but minor differences in, say, the exact path of a projectile would be irreverent.
     
  2. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    1) The unity networking is built for this stuff.
    2) There is none.
     
  3. Siddown

    Siddown

    Joined:
    Jun 13, 2013
    Posts:
    45
  4. ELD65

    ELD65

    Joined:
    Aug 4, 2022
    Posts:
    1
    4 PLAYER FOR NINTENDO SWITCH
     
  5. Punfish

    Punfish

    Joined:
    Dec 7, 2014
    Posts:
    282
    Literally anything will work for this. It depends on your budget, do you need match making, what platform? ect...
     
  6. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    458
    Conecting using the ip can be dangerous, and the host would need to port forward, which people doesnt like. I would use a relay like steamworks. If you don want to use it directly, you can use a steam transport for netcode, which, as fholm said, was made for this.
     
  7. CreativeChris

    CreativeChris

    Unity Technologies

    Joined:
    Jun 7, 2010
    Posts:
    452
    Netcode for GameObjects is well suited for co-op games, as are similar third-party solutions.

    With Netcode for GameObjects, we are actively developing an up to 8-player co-op game called Boss Room.
    Boss Room is a fully functional co-op multiplayer RPG. It is built to serve as an educational sample that showcases certain typical gameplay patterns that are frequently featured in similar networked games.

    You can use everything in this project as a starting point or as bits and pieces in your own Unity games. The project is licensed under the Unity Companion License. See LICENSE.md for more legal information.