Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[NO CCU LIMIT] Forge Networking now OPEN SOURCE

Discussion in 'Assets and Asset Store' started by Brent_Farris, Dec 22, 2014.

  1. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Thats what I was trying to do with starting a host and client in the same app, why can Forge not have a host and a client, why do I have to have a separate server app that needs to be started?
     
  2. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    I think the way Forge is designed, the server is a client but receives special obligations for the game. If you need a real-time server separate from the application, you can always look into Bare Metal but that doesn't sound like the solution for your game.
     
  3. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Indeed, the server is a client in the application by design. It doesn't have to be though and can be completely separated (as seen in Bare Metal). You have no need to start a client on the machine that is the server because the server runs as a client already :). The "Hello Cube Resources" scene does just this idea :).

    Indeed, :)
     
  4. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hey, just wanted to let you know that I am working on this now! :)
     
    Zaddo67 likes this.
  5. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Thanks for this, I will look into this now too now that I have fixed the reading of the raw data 2x on the server.

    No worries, this is part of our garbage collection caching strategy. All of those 0's are definitely not sent. :)
     
  6. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    I am getting a little confused now, a while back it was said that I cant have a host and a client running in the same app but now you say it is possible?
     
  7. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    HI SpookyCat.

    You have some awesome assets in the store!!

    I have been sitting on the sidelines reading your questions and the answers you are getting. And just cringing at the confusion.

    I'll try to clarify and hopefully not add more confusion to the conversation.

    At it's most basic, Forge is a Networking tool. It can send and receive packets.
    When you start a host within Unity, other players can connect to your host. At the same time as the host is playing his game. (effectively client and host in the same app)

    Forge adds another layer on top of the networking for sending updates about player and object movements, plus other stuff. This saves you the hard work of doing this low level coding yourself.

    But those objects and players it is sending updates about, must exist in your active scene. The intent being the world everyone is connected to, looks the same for all players. They are just viewing the world from their character's camera viewing position.

    So now you have a networked multiplier game with the Host computer also behaving like a client for the person on it.

    The confusing bit:

    You were asking about clients connecting to your host and walking around your world, while the host then goes to another scene and plays a sub-game.

    Out of the box, Forge networking does not allow the host to have many games running at once in different scenes. I will call this a multi-game host. Forge is a single game host.

    You could possibly achieve this with some very tricky programming, but it all needs to exist in the one single scene. As you know unity does not allow you to run multiple scenes at once.

    You could achieve what you want by running a game server that can support multiple games such as SmartFox and I believe Photon (but I have never used it).

    I don't know of any networking package that allows you to do this in a single unity app.

    Or, you can try the tricky programming approach. For example you could have multiple areas in the one big scene. One for the hosts world. And one for the game area. You would just move the characters to, the different areas of the scene as appropriate.

    But remember, as soon as the host shuts his app down. It is no longer running the Forge host software and so current players will be disconnected and no-one will be able to connect.

    I hope this helps.....
     
    Last edited: Mar 2, 2015
    jpthek9 likes this.
  8. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    @Zaddo67 - Thank you for your helpful answer :) I guess I don't quite understand why there cant be two instances of Forge running in the same app (I mean apart from the way it is coded ie Singletons or something) I would have thought it would have been simple to have multiple Forges running at the same time talking to different players, that is what I did many moons ago with our own game engine and the Direct Play system, had a local lan based system going that could also talk to internet players. For example it would be possible in theory to have Forge setup as a Host and have Bolt running in the same app as a client, not that you would but just saying there is nothing to stop a host and a client in the same app as far as I am aware, but then my knowledge is limited and I suspect outdated :)
     
  9. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    If there were 2 instances that means 2x the processing overhead. Plus, there's no benefit to that since the host and server have the same basic features. There is something stopping Forge from being run as a host and a client and that's uselessness and inefficiency.
     
  10. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Why would the overhead be any worse than having a whole separate server running on the device as suggested by the authors, surely there would be less overhead if both were in a single app.
     
  11. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    Forge exists inside a Unity app and so it can only be aware of gameobjects in the active scene.

    You can have multiple host sockets running. But they still only have the current active scene to replicate GameObjects from. Would you want to replicate the entire current scene to all connected clients or only part of the scene?.

    You are absolutely correct. You could do this.

    Also note, that Forge can be installed on a server. They have a bare metal server, which would allow you to run multiple Unity instances/Games at once.

    They also have the Arbiter server (SAAS). But I am not sure if this can do what you want.
     
  12. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hmmm, I am very sorry for all of the confusion. So I'm still confused why you would need the app to run a server and a client (this is possible if it uses a separate port, however the amount of coding you will need to do in order to say which network controller is doing what). Basically, when you run a server, you are already running a client. So by starting up a server, you are starting up a client at the same time. The server acts as a client, it's game logic can run like a client and it can be used as a client. Now if you want to connect yet another client to the server in the same application, you will need to use a different port and handle the NetWorker separately. Also if you do start up a client in the same application as the server that would mean that out of the box you now have 2 clients in one application, the server's client and the new client you just created, I am assuming this is not the behavior you are looking for.

    So in short, when you start a server with Networking.Host, you automatically have a client for that host server. You can do everything you would normally do with a client with this new NetWorker that is created from Networking.Host. We are working with a partner right now and here is the game flow:

    PlayerA clicks the "Find Online Match" button, if no match is found, then playerA becomes a server with Networking.Host. If PlayerA finds a match online with PlayerB (who is hosting because of the previous sentences logic) then PlayerA will connect to PlayerB. Both PlayerA and PlayerB run the same exact logic in the game scene when it comes to working with their characters. The host player is just in charge of telling the connected player what scene to load into and when to start. So effectively the player that is hosting the game is a client. They work like a client and they play like a client, they are just hosting the communication between the two. This is exactly the same type of "host is a player" logic that you would find in the referenced game "Fantasy Life" in which case, one player becomes a server and the other player joins the hosting players "world". Fantasy Life can be played on a LAN with this same logic without any extra servers running.

    Please let me know if this helps :)
     
    jpthek9 likes this.
  13. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    That matchmaking system sounds awesome! Do you think it can be expanded to pair players up by their 'skill level' or Elo?

    i.e. Networking.FindOnlineRankedMatch(..., byte MaxPlayers, byte ValueID, ushort Range, ushort TimeIncrease).

    When a client calls this method, they look for a viable room (more on that later) and if not viable rooms are found, they create and host the room. The room's Elo is set to the host's Elo and this is used to match players. When a player searches for a room, they can only join rooms that are within the room's Range of their own Elo. So that rooms won't have to look forever, the Range is increased per search tick by TimeIncrease. The Elo is a value stored in Arbiter and is identified by ValueID.

    For example (If needed), Half Life 3 has just been released the day before and uses Forge Networking. Player A is the first player to play HL3 today and calls FindOnlineRankedMatch(..., 2, 233, 100, 50). Player A finds that there are no rooms at all so he creates a room. The room's Elo is set to the player's Elo defined by '233'. Player A is a new player so his Elo is 1200 which makes the room's Elo 1200. After 4 matchmaking ticks since Player A started his server, Player B logs on and calls FindOnlineRankedMatch(...,2,233,100,50). Player B's Elo is 1400 and the room hosted by Player A has 300 (100 + 4 * 50) range which puts Player B within its range, so he joins Player A's game. At the same time, Player C logs on and calls FORM(.........). His Elo is 2000 which isn't within 300 of Player A's room's Elo so Player C starts and hosts a new game.

    Developers can decide for themselves what values to set based on their individual game but matchmaking considering skill is crucial to multiplayer games so players can not only have space to learn, but also have consistently challenging, rewarding matches. Do you think this is possible to implement? If not by default, how about through custom code?
     
    Last edited: Mar 3, 2015
  14. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hello all, sorry for any late replys (will reply to you @jpthek9 soon) :)

    Just wanted to let everyone know that there will be an update tonight with Forge working in Unity 5 as it is in 4.x
     
  15. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    Hey there, i have a Problem with the connecting over the Arbiter API.



    Below you see the Code and a Image with Debug information is attached.

    What i want...

    I click the Button - Multiplayer -
    Then it checks the Arbiter if a Server exist, if yes then connect to it!
    If not, then Host a Server after 5 Seconds.

    Hosting works, and searching also. He also finds a Server. See Debug informations.

    The Only thing, that doesn't work is the connection.

    I must say, i have no idea how delegate () works...
    So i used for all of this Code a Courotine.

    I hope you can help me...



    A Firewalltest is also in a other Script



    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. using BeardedManStudios.Network;
    5. using BeardedManStudios.Network.API;
    6.  
    7. public class Mutliplayer : MonoBehaviour
    8. {
    9.     HostInfo hostFound=null;
    10.     NetWorker socket=null;
    11.     bool ready=false;
    12.  
    13.  
    14.     IEnumerator WaitForHosting ()
    15.     {
    16.         yield return new WaitForSeconds (5);
    17.  
    18.         HostGame ();
    19.     }
    20.  
    21.  
    22.     public void CheckServer ()
    23.     {
    24.  
    25.         ServerAPI.Instance.GetHosts (delegate (HostInfo[] hosts)
    26.         {
    27.             ArbiterAPI.CallOnMainThread (delegate ()
    28.             {
    29.                 foreach (HostInfo host in hosts)
    30.                 {
    31.                     if (host != null)
    32.                     {
    33.                         hostFound = host;
    34.                         JoinGame (host);
    35.                         Debug.Log ("HostInfo in der Abfrage: " + host);
    36.  
    37.                     }
    38.                     Debug.Log ("HostInfo nach der Abfrage: " + host);
    39.  
    40.                 }
    41.             });
    42.         });
    43.  
    44.  
    45.  
    46.  
    47.         StartCoroutine (WaitForHosting());
    48.  
    49.  
    50.  
    51.  
    52.  
    53.     }
    54.  
    55.  
    56.  
    57.  
    58.     private void HostGame ()
    59.     {
    60.         if (hostFound == null)
    61.         {
    62.             Debug.Log (hostFound);
    63.  
    64.  
    65.  
    66.  
    67.             socket = Networking.Host ((ushort)15937, Networking.TransportationProtocolType.UDP, 31, false);
    68.  
    69.             Debug.Log ("Server hosted");
    70.  
    71.             if (ServerAPI.Instance.Initialized)
    72.             {
    73.                 socket.connected += delegate ()
    74.                 {
    75.                     ServerAPI.Instance.ServerStarted (socket, null, "Oncoming Death", "Test", string.Empty, "This is a demo server", 31, "multiplayer map", 0);
    76.                 };
    77.  
    78.                 socket.playerConnected += UpdatePlayerCount;
    79.                 socket.playerDisconnected += UpdatePlayerCount;
    80.  
    81.                 socket.disconnected += delegate ()
    82.                 {
    83.                     ServerAPI.Instance.ServerStopped (socket, null);
    84.                 };
    85.             }
    86.  
    87.             Go ();
    88.         }
    89.  
    90.  
    91.  
    92.     }
    93.  
    94.     void JoinGame (HostInfo host)
    95.     {
    96.         Debug.Log ("IP: " + host.ipAddress);
    97.         Debug.Log ("Port: " + host.port);
    98.         Debug.Log ("Protocol: " + host.connectionType);
    99.  
    100.  
    101.         NetWorker socket = Networking.Connect (host.ipAddress, host.port,
    102.             host.connectionType == "udp" ? Networking.TransportationProtocolType.UDP : Networking.TransportationProtocolType.TCP, false);
    103.  
    104.         Debug.Log ("Socket: " + socket);
    105.  
    106.         Debug.Log ("Scene Name: " + host.sceneName);
    107.  
    108.         Networking.SetPrimarySocket (socket);
    109.         if (socket.Connected)
    110.             Application.LoadLevel (host.sceneName);
    111.         else
    112.             socket.connected += delegate () { Application.LoadLevel (host.sceneName); };
    113.  
    114.         Debug.Log ("Verbunden: " + socket.Connected);
    115.  
    116.     }
    117.  
    118.     private void Go ()
    119.     {
    120.  
    121.         socket.serverDisconnected += delegate (string reason)
    122.         {
    123.             NetworkingManager.CallOnMainThread (delegate (object[] args)
    124.             {
    125.                 Debug.Log ("The server kicked you for reason: " + reason);
    126.                 Application.Quit ();
    127. #if UNITY_EDITOR
    128.                 UnityEditor.EditorApplication.isPlaying = false;
    129. #endif
    130.             }, null);
    131.         };
    132.  
    133.         if (socket.Connected)
    134.             ready = true;
    135.         else
    136.             socket.connected += delegate () { ready = true; };
    137.     }
    138.  
    139.     bool loading = true;
    140.     private void Update ()
    141.     {
    142.         // Doing this in an update because the connected event is fired from a separate thread
    143.         // and Application.LoadLevel cannot be ran from a thread.
    144.         if (ready)
    145.         {
    146.             if (loading)
    147.             {
    148.                 Networking.SetPrimarySocket (socket);
    149.                 Application.LoadLevel ("multiplayer map");
    150.                 loading = false;
    151.             }
    152.         }
    153.  
    154.  
    155.     }
    156.  
    157.     private void UpdatePlayerCount (NetworkingPlayer player)
    158.     {
    159.         ServerAPI.Instance.UpdateServer (socket, null, socket.Players.Count, Application.loadedLevelName);
    160.     }
    161.  
    162. }
     

    Attached Files:

  16. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hello everyone! Sorry for the slight hick-up in our communication. We have been sorting out business related things and various other studio here related tasks. We are now getting back on track and should be replying to everyone once again. Sorry for the inconvenience if any.
     
  17. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hi there, we were actually messing around with the arbiter to test it just the other night and found that there seems to be a connection based bug that must have been introduced recently. We will be sorting out this issue asap! Thank you for your report! :) Everything seems like it should be working in your code and we will use it as a sample once we fix this issue to verify.
     
  18. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    Found it, and it is to simple ...

    The Port "15937" is closed in my Router. I opened it and then it works. He can connect, but i don't want that all user must create a Port Forwarding in theirs Routers. It is Possible that Forge can create it automatically or use a NAT PunshThrough or similiar like this. :)


    Next Problem is...

    He connects and then load the map... after loading this map he is disconnected... why?
     
  19. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    AAAAAND.....

    My Client Game freeze.

    He connects, if i want to quit my Game then it freezed... In Editor or as builded game.
    I think it is something in a delegate Function, but what exactly... no idea :(
     
  20. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Oh yes, servers would need to open up their ports in order to host. We actually have NAT punchthough setup in the system, however un-tested. The reason it wasn't a huge priority is because generally the idea of NAT hole punching is for a peer-2-peer networking system like VoIP and video streaming. Since we are going the authoritative route then generally ports would need to be opened manually. However, we can verify our NAT hole punching system if this is what you would like to use (note, only the server needs to open their ports, not the clients). Also, note that NAT hole punching requires a 3rd "route" server, this would be a server the clients would have to ping in order to be forwarded/routed to the new connection. If all goes well we might be able to provide this server in the long run.

    This is very odd, all of our examples do just this, they connect on the menu scene and then load up the scene in which the server is in. We also added a new feature with our Unity 5 release that allows for the server and the clients to move around to different scenes easily and not be stuck in one scene. Do you have any further information on how you transported the player differently? Was it using the code your provided earlier?
     
  21. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Are you using any of the Arbiter settings? I am curious if the bug we found earlier could be related to this issue.
     
  22. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    Yes it is the Code.
     
  23. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    firewallscript.cs
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using BeardedManStudios.Network;
    4.  
    5. public class firewallscript : MonoBehaviour
    6. {
    7.     private void Start ()
    8.     {
    9.         Networking.InitializeFirewallCheck (15937);
    10.     }
    11.  
    12. }

    Multiplayer.cs - attached to the Arbiter API
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. using BeardedManStudios.Network;
    5. using BeardedManStudios.Network.API;
    6.  
    7.  
    8. public class Mutliplayer : MonoBehaviour
    9. {
    10.     HostInfo hostFound=null;
    11.     NetWorker socket=null;
    12.     bool ready=false;
    13.  
    14.  
    15.  
    16.  
    17.     IEnumerator WaitForHosting ()
    18.     {
    19.         yield return new WaitForSeconds (5);
    20.  
    21.         HostGame ();
    22.     }
    23.  
    24.  
    25.  
    26.  
    27.  
    28.     public void CheckServer ()
    29.     {
    30.  
    31.         ServerAPI.Instance.GetHosts (delegate (HostInfo[] hosts)
    32.         {
    33.             ArbiterAPI.CallOnMainThread (delegate ()
    34.             {
    35.                 foreach (HostInfo host in hosts)
    36.                 {
    37.                     if (host != null)
    38.                     {
    39.                         hostFound = host;
    40.                         JoinGame (host);
    41.                         Debug.Log ("HostInfo in der Abfrage: " + host);
    42.                    
    43.                     }
    44.                     Debug.Log ("HostInfo nach der Abfrage: " + host);
    45.                  
    46.                 }
    47.             });
    48.         });
    49.  
    50.  
    51.  
    52.  
    53.         StartCoroutine (WaitForHosting());
    54.  
    55.  
    56.      
    57.  
    58.  
    59.     }
    60.  
    61.  
    62.  
    63.  
    64.     private void HostGame ()
    65.     {
    66.         if (hostFound == null)
    67.         {
    68.             Debug.Log (hostFound);
    69.  
    70.  
    71.  
    72.  
    73.             socket = Networking.Host ((ushort)15937, Networking.TransportationProtocolType.UDP, 31, false);
    74.  
    75.             Debug.Log ("Server hosted");
    76.  
    77.             if (ServerAPI.Instance.Initialized)
    78.             {
    79.                 socket.connected += delegate ()
    80.                 {
    81.                     ServerAPI.Instance.ServerStarted (socket, null, "Oncoming Death", "Test", string.Empty, "This is a demo server", 31, "multiplayer map", 1);
    82.                 };
    83.  
    84.                 socket.playerConnected += UpdatePlayerCount;
    85.                 socket.playerDisconnected += UpdatePlayerCount;
    86.  
    87.                 socket.disconnected += delegate ()
    88.                 {
    89.                     ServerAPI.Instance.ServerStopped (socket, null);
    90.                 };
    91.             }
    92.  
    93.             Go ();
    94.         }
    95.  
    96.  
    97.        
    98.     }
    99.  
    100.     void JoinGame (HostInfo host)
    101.     {
    102.         Debug.Log ("IP: " + host.ipAddress);
    103.         Debug.Log ("Port: " + host.port);
    104.         Debug.Log ("Protocol: " + host.connectionType);
    105.  
    106.  
    107.         NetWorker socket = Networking.Connect (host.ipAddress, host.port,
    108.             host.connectionType == "udp" ? Networking.TransportationProtocolType.UDP : Networking.TransportationProtocolType.TCP, false);
    109.  
    110.         Debug.Log ("Socket: " + socket);
    111.      
    112.         Debug.Log ("Scene Name: " + host.sceneName);
    113.  
    114.         Networking.SetPrimarySocket (socket);
    115.         Application.LoadLevel (host.sceneName);
    116.         if (socket.Connected)
    117.         {
    118.             Application.LoadLevel (host.sceneName);
    119.             Debug.Log ("Connected: " + socket.Connected);
    120.         }
    121.         else
    122.         {
    123.             socket.connected += delegate () { Application.LoadLevel (host.sceneName); Debug.Log ("Else Connected: " + socket.Connected); };
    124.         }
    125.  
    126.      
    127.  
    128.     }
    129.  
    130.     private void Go ()
    131.     {
    132.  
    133.         socket.serverDisconnected += delegate (string reason)
    134.         {
    135.             NetworkingManager.CallOnMainThread (delegate (object[] args)
    136.             {
    137.                 Debug.Log ("The server kicked you for reason: " + reason);
    138.                 Application.Quit ();
    139. #if UNITY_EDITOR
    140.                 UnityEditor.EditorApplication.isPlaying = false;
    141. #endif
    142.             }, null);
    143.         };
    144.  
    145.         if (socket.Connected)
    146.             ready = true;
    147.         else
    148.             socket.connected += delegate () { ready = true; };
    149.     }
    150.  
    151.     bool loading = true;
    152.     private void Update ()
    153.     {
    154.         // Doing this in an update because the connected event is fired from a separate thread
    155.         // and Application.LoadLevel cannot be ran from a thread.
    156.         if (ready)
    157.         {
    158.             if (loading)
    159.             {
    160.                 Networking.SetPrimarySocket (socket);
    161.                 Application.LoadLevel ("multiplayer map");
    162.                 loading = false;
    163.             }
    164.         }
    165.  
    166.      
    167.     }
    168.  
    169.     private void UpdatePlayerCount (NetworkingPlayer player)
    170.     {
    171.         ServerAPI.Instance.UpdateServer (socket, null, socket.Players.Count, Application.loadedLevelName);
    172.     }
    173.  
    174. }
    175.  
    in the new loaded map
    there is only one NetworkMonoBehaviour for the TestCube. After load this map and connected = true then Instantiate this Cube.


    SpawnMultiplayerPlayer.cs
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. //using UnityEditor;
    4.  
    5. using BeardedManStudios.Network;
    6.  
    7. public class SpawnMultiplayerPlayer : MonoBehaviour
    8. {
    9.  
    10.     void OnDrawGizmos ()
    11.     {
    12.         DrawGizmo ();
    13.     }
    14.  
    15.     void DrawGizmo ()
    16.     {
    17.         Gizmos.color = Color.green;
    18.         Gizmos.DrawCube(this.transform.position,new Vector3(1,2,1));
    19.  
    20.      
    21.         //Handles.Label (this.transform.position + new Vector3 (-0.5f, 1.5f, -0.5f), "SpawnPunkt");
    22.      
    23.     }
    24.  
    25.     void Start ()
    26.     {
    27.         Debug.LogError ("Bin ich verbunden? " + Networking.PrimarySocket.Connected); // Connected ? as server = true as client false...
    28.         Debug.LogError ("Socket? " + Networking.PrimarySocket);
    29.  
    30.  
    31.  
    32.  
    33.         if(Networking.PrimarySocket.Connected)
    34.         {
    35.             Networking.Instantiate ("Cube", NetworkReceivers.AllBuffered);
    36.         }
    37.         else
    38.         {
    39.             Networking.PrimarySocket.connected += delegate ()
    40.             {
    41.                 Networking.Instantiate ("Cube", NetworkReceivers.AllBuffered);
    42.             };
    43.         }
    44.     }
    45.  
    46. }
    47.  
    In the new level i doesn't have the ArbiterAPI, but if i load the map from my menu the ArbiterAPI goes into the new level. So i don'T need a extra ArbiterAPI on the new level, or?
     
  24. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    forge network.png Pictures attached :) maybe help you ;) :)
     
  25. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    If i use localhost (127.0.0.1) to connect with server it stays in connection. then it is a new problem.. o_O
    Why it is the NetworkManager disable o_O ... with ArbiterAPI(Online IP) it doesn't work (disconnect after loading map)
    ArbiterAPI doesn't destroy on load new map, so the API is present in the new scene.. ... no idea what it is... after forge loading.png
     
  26. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Awesome, thanks. I'll take a look at these as soon as I get home! :)
     
  27. zapoutix

    zapoutix

    Joined:
    Jan 2, 2015
    Posts:
    44
    Hi guys,

    Are you planning to make the library compative with WP8 api or just stay on Windows Universal Apps api ?

    Because i have some other plugin need to be compile as Windows phone 8 project

    Regards,
     
  28. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    Server instantiate Cube and the Client gives this error...
     
  29. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    On Server it spawned both Objects.... but the second one don't fall and he has a rigidbody attached ;)

    forge new one.png
     
  30. Mikeedee

    Mikeedee

    Joined:
    Jan 5, 2015
    Posts:
    42
    I think I may be missing something here, but do we have the option to host Arbiter ourselves instead of using your servers/cloud ?
    For me, it isn't so much the monthly cost that scares me,but rather having to rely on a third party that could go bust the next month, basically losing the whole backend and probably its database, as well as the whole networking part if it relied on said backend.

    Also I've been looing around for info on Forge and this looks great so far :)
     
    Zaddo67 and jpthek9 like this.
  31. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    I have some things I'm not sure about concerning:
    NetWorker.Write
    (uint updateidentifier,
    NetworkingPlayer player,
    NetworkingStream stream,
    bool reliable = false,
    List<BMSByte> packets = null)

    1. How does 'updateidentifier' work? For my game, I send 1 packet per frame (at 8fps) and assign to each packet the frame number. Can I use the frame number as the updateidentifier and retrieve this number from the receiving end (4 less bytes :D)?
    2. Is 'player' the target player? If so, can I still set the NetworkReceivers of the send? Is the player parameter only for the server?
    3. What is the 'packets' parameter? Is this similar to the feature request I posted where many packets can be aggregated into 1 packet for distribution? If so, how can I retrieve the individual packets from the NetWorker.dataRead event?
    Thanks in advance for clearing things up. Also, I agree with Mikeedee. You guys have my faith but options are always nice.
     
    Last edited: Mar 11, 2015
  32. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    It may take us some time to backdate to Windows Phone 8 as it isn't really supported much anymore. Especially while pushing to Windows Phone 10 later this year as a free update.
     
  33. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Do you happen to have more than 1 Networking Manager in your hierarchy?
     
  34. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hi there! Thank you! :D

    The answer is yes and these are the droids you are looking for. Just check out the last portion (after last quote). Sorry, I know the thread is pretty big and hard to find little snippets like this.
     
    Last edited: Mar 11, 2015
  35. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Just a note to everyone. We have decided that we will be releasing our Forge Networking plugin with full source code :)
     
    jpthek9 and Zaddo67 like this.
  36. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    That is Awesome!!!!

    Unity 5 Announcements and now this, I am in game development heaven :)
     
    Last edited: Mar 11, 2015
  37. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Yes :)

    Yes it is the target player, it can only be used on the server. You can use receivers otherwise but not combined.

    This is actually the second lowest level of write (lowest being actually sending on socket yourself). This write will take the packets given to it and write them to the network. At this level it is expected that all of the header information is already delegated to the packets. The layer above this would be the Networking.Write___ Methods

    No problem, I replied to him here if you missed my previous post about this topic :)
     
  38. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    When we set out to make a networking package for ourselves and others we wanted to make it as user friendly as possible with fully featured extensibility. We have talked about it here at the studio and have decided that what could be more user friendly than source code as well :)
     
  39. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    Only one Manager in the Hierachy. It is attached to the Spawner Object (see images)
    I also try the Prefab only and also doesn't work.
     
  40. Mikeedee

    Mikeedee

    Joined:
    Jan 5, 2015
    Posts:
    42
    Awesome !
    Just one more question, does it support/will support NAT punchthrough?
    If so, then this is the definite networking plugin for Unity :)
     
  41. Neo-Gamefactory

    Neo-Gamefactory

    Joined:
    Oct 18, 2012
    Posts:
    145
    Come on.... i ask this on the same page!... ;)

     
  42. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Thanks for the info. How do I get the list of packets on the receiving end? Will they each call a readData event with their own NetworkingStream's or will they end up in the Bytes of 1 event's NetworkingStream? Also, do you mean that there won't be the overhead of sending the packets individually when sending them in a list?
     
  43. Mikeedee

    Mikeedee

    Joined:
    Jan 5, 2015
    Posts:
    42
    Oh whoops. Thanks, got my reply :)
    Here's to hoping it makes it to the final release.
     
    Neo-Gamefactory likes this.
  44. Razouille

    Razouille

    Joined:
    Jan 25, 2013
    Posts:
    44
    Hey thx for adding me for the beta test, the plugin works well (except for a 30 seconds freeze each time i launch the first scene, or when i exit unity), i was looking for a solution to open a scene in the server current state (camera position, instantiated objects with their current parameters, ...), do i have to add a NetworkedMonoBehavior with many serialize data on every object or is there any faster/better way to do that ?
     
  45. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    It currently does support NAT punchthrough, although it hasn't been heavily tested. :)
     
  46. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Seems like a bug where it freezes for 30 seconds. Depending on what you are trying to do, you can store the necessary information on one particular NetworkedMonoBehavior. I will have to confirm with Brent but that is what I believe should be reasonable.
     
  47. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    We will be making it to final release! Don't you worry. :)
     
  48. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Hey guys. I know it's because you guys have probably been super busy but we're dying for information on what's up and coming for Forge. Do you think you can spare some updates for the poor?
     
  49. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    We are extremely sorry that our development cycle for Forge got halted for a Week, while we do have bug fixes we have not pushed up yet as we had some fires to put out on our contracts.

    When we started Forge it was during the time when everything was planned as possibly can be in that we had hoped to have already been ready for release at the end of this month. But because of things coming up with work, complications, and Wedding planning (I'm getting married :p). We have taken things a bit slow and have been mostly focused on our contract jobs that we have and making sure that those will meet their deadlines. I think you can only plan so much then there is Mordor.

    So as it will hopefully bring the peace and inform our users, we plan on continuing the development cycle starting Monday next week. We should be able to be back on track and hope for no further delays. Expect the next build to be released on Monday night and the following days after. If you have any questions feel free to use our forums on our website and we will respond to any issues there.

    Currently we are still adding users to Forge Networking and that hasn't changed and has been on going since our slow down. Thank you so much everyone for being involved and helping out, we are currently using this in our games and are loving every second of it.
     
    jpthek9 likes this.
  50. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hello all, just here to let you know that we are transitioning back into getting this system to release :). We'll be updating you all soon! :D