MLAPI while still supporting Local/Couch coop multiplayer

How would I go about supporting both local (couch coop) AND online multiplayer?

Seeing as NetworkManager singleton’s client is only meant to be one player, would I need to seperate implementations for local/online multiplayer?

Yeah at the moment you would need a separate implementation. We’ve removed the singleton restriction and with our next release you might be able to run multiple NetworkManager instances in the same application. But it won’t be a fully supported workflow and might have some limitations.

Gotcha.

You can do it by separating the concepts of “player” from “character” so a player (representing a connection) owns and controls multiple characters.

1 Like

Sorry for bumping quite an old thread but I was wondering if any progress has been made for this?

I have a test project which is working fine in single player and online co-op using Netcode for GameObjects but I want to test local co-op before going forward any further.

If not Neto_Kokku’s workaround seems interesting and I’ll likely attempt that if this is still the best current setup.

Hi @HeliocentricStudios , AFAIK there are ways to connect multiple players from the same machine (we use these in our automated tests), but it requires workarounds too and, in the end, would probably be more complicated than what Neto suggested.

I’d start the game as a Host and create 2 “local” players. Easier said than done, but it’s a starting point.