UNET
From Unify Community Wiki
(Difference between revisions)
m (→Unity’s demo projects) |
|||
Line 1: | Line 1: | ||
+ | We have an IRC channel dedicated to UNET! Join us on Freenode in the #unity3d-unet channel. | ||
+ | |||
+ | <br/> | ||
+ | |||
= Refs = | = Refs = | ||
Line 11: | Line 15: | ||
* http://blogs.unity3d.com/2014/06/11/all-about-the-unity-networking-transport-layer/ | * http://blogs.unity3d.com/2014/06/11/all-about-the-unity-networking-transport-layer/ | ||
* http://blogs.unity3d.com/2015/04/14/unity-networking-in-super-dungeon-bros/ | * http://blogs.unity3d.com/2015/04/14/unity-networking-in-super-dungeon-bros/ | ||
+ | |||
+ | <br/> | ||
= Tutorials (video) = | = Tutorials (video) = | ||
Line 18: | Line 24: | ||
* [https://www.youtube.com/watch?v=63UaLA790iI&feature=youtu.be&t=3285 Unite 2015 (June 24th) - UNET example (Tanks demo) <- should be put on asset store soon] | * [https://www.youtube.com/watch?v=63UaLA790iI&feature=youtu.be&t=3285 Unite 2015 (June 24th) - UNET example (Tanks demo) <- should be put on asset store soon] | ||
* [http://forum.unity3d.com/threads/unity-5-unet-multiplayer-tutorials-making-a-basic-survival-co-op.325692/ Unity 5 UNET Multiplayer Tutorials - Making a basic survival co-op] | * [http://forum.unity3d.com/threads/unity-5-unet-multiplayer-tutorials-making-a-basic-survival-co-op.325692/ Unity 5 UNET Multiplayer Tutorials - Making a basic survival co-op] | ||
+ | |||
+ | <br/> | ||
= Unity’s demo projects = | = Unity’s demo projects = | ||
Line 23: | Line 31: | ||
* http://forum.unity3d.com/threads/unet-sample-projects.331978/ | * http://forum.unity3d.com/threads/unet-sample-projects.331978/ | ||
: Network starter is nice, also scroll a little down to find transport layer demo; also note the [http://forum.unity3d.com/threads/unet-sample-projects.331978/#post-2183703 comment by Evil Otaku] if you are having issues connecting with iOS, Android or WP8) | : Network starter is nice, also scroll a little down to find transport layer demo; also note the [http://forum.unity3d.com/threads/unet-sample-projects.331978/#post-2183703 comment by Evil Otaku] if you are having issues connecting with iOS, Android or WP8) | ||
+ | |||
+ | <br/> | ||
= Other info = | = Other info = | ||
− | https://www.assetstore.unity3d.com/en/#!/content/40756 Unity 5 Survival Shooter (NOT UNET) | + | https://www.assetstore.unity3d.com/en/#!/content/40756 Unity 5 Survival Shooter (NOT UNET, but due to be updated) |
− | = Architecture | + | <br/> |
+ | |||
+ | = Architecture ideas = | ||
http://www.neatcorporation.com/Projects/Flowstorm/TempFiles/ChatRelay.jpg | http://www.neatcorporation.com/Projects/Flowstorm/TempFiles/ChatRelay.jpg | ||
+ | |||
+ | <br/> | ||
= Known issues & workarounds = | = Known issues & workarounds = | ||
+ | |||
+ | === Matchmaker working from the same pc but not working from a different pc === | ||
Example from http://docs.unity3d.com/Manual/UNetInternetServicesOverview.html does not work: | Example from http://docs.unity3d.com/Manual/UNetInternetServicesOverview.html does not work: | ||
+ | * http://forum.unity3d.com/threads/matchmaker-issue-working-from-the-same-pc-not-working-from-different-pc.336945/ | ||
+ | |||
− | + | === Occasionally required for online matchmaking === | |
<syntaxhighlight lang="csharp"> | <syntaxhighlight lang="csharp"> | ||
− | |||
// This is your 5-digit project UNET ID at multiplayer.unity3d.com | // This is your 5-digit project UNET ID at multiplayer.unity3d.com | ||
// This is due to be fixed in an upcoming patch release (was not in 5.1.1p3) | // This is due to be fixed in an upcoming patch release (was not in 5.1.1p3) | ||
Line 46: | Line 63: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | <br/> | ||
= Snippets = | = Snippets = |
Revision as of 19:02, 3 July 2015
We have an IRC channel dedicated to UNET! Join us on Freenode in the #unity3d-unet channel.
Contents |
Refs
- http://docs.unity3d.com/ScriptReference/Networking.NetworkManager.html
- http://docs.unity3d.com/Manual/UNetActions.html
- http://docs.unity3d.com/Manual/UNetMessages.html
- http://docs.unity3d.com/Manual/UNetLobby.html
- http://docs.unity3d.com/Manual/UNetConverting.html
- http://docs.unity3d.com/Manual/UNetManager.html
- http://docs.unity3d.com/Manual/UNetClientServer.html
- http://blogs.unity3d.com/2014/05/29/unet-syncvar/
- http://blogs.unity3d.com/2014/06/11/all-about-the-unity-networking-transport-layer/
- http://blogs.unity3d.com/2015/04/14/unity-networking-in-super-dungeon-bros/
Tutorials (video)
- Unite 2014 (Aug. 27) - New Unity Networking in 5.x
- UNET Part 1 - Setup and Movement Syncing (parts 2, 3, and 4 linked from video)
- Unite 2015 (June 24th) - UNET example (Tanks demo) <- should be put on asset store soon
- Unity 5 UNET Multiplayer Tutorials - Making a basic survival co-op
Unity’s demo projects
- Network starter is nice, also scroll a little down to find transport layer demo; also note the comment by Evil Otaku if you are having issues connecting with iOS, Android or WP8)
Other info
https://www.assetstore.unity3d.com/en/#!/content/40756 Unity 5 Survival Shooter (NOT UNET, but due to be updated)
Architecture ideas
http://www.neatcorporation.com/Projects/Flowstorm/TempFiles/ChatRelay.jpg
Known issues & workarounds
Matchmaker working from the same pc but not working from a different pc
Example from http://docs.unity3d.com/Manual/UNetInternetServicesOverview.html does not work:
Occasionally required for online matchmaking
// This is your 5-digit project UNET ID at multiplayer.unity3d.com // This is due to be fixed in an upcoming patch release (was not in 5.1.1p3) void Awake() { PlayerPrefs.SetString( "CloudNetworkingId", "12345" ); }
Snippets
// ClientRpc is called on the server - invokes on clients [ClientRpc] public void RpcMyMethod( string msg ) { Debug.Log( "Got message from the server: " + msg ); }
// Commands are called on clients - invokes on the server // Note that you can only send commands if you own the object it calls from [Command] public void CmdMyMethod( string msg ) { Debug.Log( "Got message from a client: " + msg ); }
// SyncVars are automatically sent from the server to other clients. // Note that you still need a command to notify the server of the change // if it comes from a client. Hook is optional [SyncVar(hook="OnSomeoneChangedMyString")] public string myString; public void OnSomeoneChangedMyString( string myString ) { this.myString = myString; Debug.Log( "Changed myString to " + myString ); }