Search Unity

[NO CCU LIMIT] Forge Networking now OPEN SOURCE

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

  1. zapoutix

    zapoutix

    Joined:
    Jan 2, 2015
    Posts:
    44
    I have a question,

    You said before that you are working on bluetooth communication.

    Will it be possible to mix Wifi connection and bluetooth one on the same server socket?
     
    Last edited: Feb 16, 2015
  2. imgodot

    imgodot

    Joined:
    Nov 29, 2013
    Posts:
    212
    That makes perfect sense though I can't make it work.
    My goal is to have a globally accessible set of RPCs that can be called from anywhere in my code.
    To that end, I have a static class called "PGM" (does not inherit from anything) that I can reference from anywhere in my code. "PGM" contains a reference to a class called "GlobalRPC" which inherits from NetworkedMonoBehavior and contains my RPCs. Note: It inherits from NMB because I reference "OwningNetworker", etc.
    I thought about using a singleton, but I don't know if that would make any difference with the problems I am experiencing.

    TEST 1:
    GlobalRPC is assigned in the editor as a component of an empty gameobject.
    During startup code I assign PGM.GlobalRPC to the component assigned to the empty gameobject.

    When I run the application, I get the following error:
    ==================================================================
    Argument cannot be null.
    Parameter name: source
    System.Linq.Check.Source (System.Object source)
    System.Linq.Enumerable.First[KeyValuePair`2] (IEnumerable`1 source)
    BeardedManStudios.Network.NetworkingManager.Awake ()
    UnityEngine.Object:Instantiate(Object)
    BeardedManStudios.Network.SimpleNetworkedMonoBehavior:Initialize()
    BeardedManStudios.Network.SimpleNetworkedMonoBehavior:Start()
    BeardedManStudios.Network.NetworkedMonoBehavior:Start()
    ==================================================================

    I can see that there are two networking managers in the scene which, I presume, it is objecting to.
    I don't know if there is any way around that, so I tried TEST 2.

    TEST 2:
    GlobalRPC is assigned in the editor as a component of the Networking Manager.
    During startup I assign PGM.GlobalRPC to the component on the Networking Manager.
    The application runs fine, my player instantiates, etc., but ....

    When I try and call the RPC like this: PGM.GlobalRPC.RPC("DummyRPC", NetworkReceivers.Server, this.NetworkedId);

    I get the following error:
    ==================================================================
    NullReferenceException: Object reference not set to an instance of an object
    BeardedManStudios.Network.NetworkingStream.PrepareFinal (BeardedManStudios.Network.NetWorker socket, IdentifierType identifierType, UInt64 behaviorNetworkId, BeardedManStudios.Network.BMSByte extra, NetworkReceivers receivers, Boolean bufferedRPC, System.String customidentifier)
    BeardedManStudios.Network.NetworkingStream.Prepare (BeardedManStudios.Network.NetWorker socket, IdentifierType identifierType, BeardedManStudios.Network.SimpleNetworkedMonoBehavior networkedBehavior, BeardedManStudios.Network.BMSByte extra, NetworkReceivers receivers, Boolean bufferedRPC, System.String customidentifier)
    BeardedManStudios.Network.SimpleNetworkedMonoBehavior.GetStreamRPC (System.String methodName, BeardedManStudios.Network.NetWorker socket, NetworkReceivers receivers, System.Object[] arguments)
    BeardedManStudios.Network.SimpleNetworkedMonoBehavior.RPC (System.String methodName, BeardedManStudios.Network.NetWorker socket, NetworkReceivers receivers, System.Object[] arguments)
    BeardedManStudios.Network.SimpleNetworkedMonoBehavior.RPC (System.String methodName, NetworkReceivers rpcMode, System.Object[] arguments)
    PlayerController.Update () (at Assets/Scripts/PlayerController.cs:92)
    ==================================================================

    What can I do to make my RPC dream a reality?
    Thanks.
    -- Paul
     
  3. zapoutix

    zapoutix

    Joined:
    Jan 2, 2015
    Posts:
    44
    When i try to compile on WP8 i have an exception :

    Code (CSharp):
    1. Error building Player: Exception: Error: type `System.Net.Sockets.TcpClient` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.NetWorker::Disconnect(BeardedManStudios.Network.NetworkingPlayer,System.String).
    2. Error: type `System.Net.Sockets.TcpClient` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.NetWorker::Disconnect(BeardedManStudios.Network.NetworkingPlayer,System.String).
    3. Error: method `System.Void System.Net.Sockets.TcpClient::Close()` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.NetWorker::Disconnect(BeardedManStudios.Network.NetworkingPlayer,System.String).
    4. Error: method `System.Void System.Net.Sockets.Socket::Connect(System.Net.EndPoint)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DoConnect(System.Net.IPEndPoint).
    5. Error: type `System.Net.Sockets.SocketOptionLevel` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DoConnect(System.Net.IPEndPoint).
    6. Error: type `System.Net.Sockets.SocketOptionName` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DoConnect(System.Net.IPEndPoint).
    7. Error: method `System.Void System.Net.Sockets.Socket::SetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,System.Int32)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DoConnect(System.Net.IPEndPoint).
    8. Error: method `System.Void System.Net.Sockets.Socket::Connect(System.Net.EndPoint)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DoConnect(System.Net.IPEndPoint).
    9. Error: type `System.Net.Dns` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::Connect(System.String,System.Int32).
    10. Error: method `System.Net.IPAddress[] System.Net.Dns::GetHostAddresses(System.String)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::Connect(System.String,System.Int32).
    11. Error: type `System.Net.Sockets.MulticastOption` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DropMulticastGroup(System.Net.IPAddress).
    12. Error: method `System.Void System.Net.Sockets.MulticastOption::.ctor(System.Net.IPAddress)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DropMulticastGroup(System.Net.IPAddress).
    13. Error: type `System.Net.Sockets.SocketOptionLevel` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DropMulticastGroup(System.Net.IPAddress).
    14. Error: type `System.Net.Sockets.SocketOptionName` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DropMulticastGroup(System.Net.IPAddress).
    15. Error: method `System.Void System.Net.Sockets.Socket::SetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,System.Object)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DropMulticastGroup(System.Net.IPAddress).
    16. Error: type `System.Net.Sockets.IPv6MulticastOption` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DropMulticastGroup(System.Net.IPAddress).
    17. Error: method `System.Void System.Net.Sockets.IPv6MulticastOption::.ctor(System.Net.IPAddress)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DropMulticastGroup(System.Net.IPAddress).
    18. Error: type `System.Net.Sockets.SocketOptionLevel` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DropMulticastGroup(System.Net.IPAddress).
    19. Error: type `System.Net.Sockets.SocketOptionName` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DropMulticastGroup(System.Net.IPAddress).
    20. Error: method `System.Void System.Net.Sockets.Socket::SetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,System.Object)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DropMulticastGroup(System.Net.IPAddress).
    21. Error: type `System.Net.Sockets.IPv6MulticastOption` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DropMulticastGroup(System.Net.IPAddress,System.Int32).
    22. Error: method `System.Void System.Net.Sockets.IPv6MulticastOption::.ctor(System.Net.IPAddress,System.Int64)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DropMulticastGroup(System.Net.IPAddress,System.Int32).
    23. Error: type `System.Net.Sockets.SocketOptionLevel` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DropMulticastGroup(System.Net.IPAddress,System.Int32).
    24. Error: type `System.Net.Sockets.SocketOptionName` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DropMulticastGroup(System.Net.IPAddress,System.Int32).
    25. Error: method `System.Void System.Net.Sockets.Socket::SetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,System.Object)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::DropMulticastGroup(System.Net.IPAddress,System.Int32).
    26. Error: type `System.Net.Sockets.MulticastOption` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress).
    27. Error: method `System.Void System.Net.Sockets.MulticastOption::.ctor(System.Net.IPAddress)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress).
    28. Error: type `System.Net.Sockets.SocketOptionLevel` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress).
    29. Error: type `System.Net.Sockets.SocketOptionName` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress).
    30. Error: method `System.Void System.Net.Sockets.Socket::SetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,System.Object)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress).
    31. Error: type `System.Net.Sockets.IPv6MulticastOption` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress).
    32. Error: method `System.Void System.Net.Sockets.IPv6MulticastOption::.ctor(System.Net.IPAddress)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress).
    33. Error: type `System.Net.Sockets.SocketOptionLevel` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress).
    34. Error: type `System.Net.Sockets.SocketOptionName` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress).
    35. Error: method `System.Void System.Net.Sockets.Socket::SetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,System.Object)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress).
    36. Error: type `System.Net.Sockets.IPv6MulticastOption` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Int32,System.Net.IPAddress).
    37. Error: method `System.Void System.Net.Sockets.IPv6MulticastOption::.ctor(System.Net.IPAddress,System.Int64)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Int32,System.Net.IPAddress).
    38. Error: type `System.Net.Sockets.SocketOptionLevel` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Int32,System.Net.IPAddress).
    39. Error: type `System.Net.Sockets.SocketOptionName` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Int32,System.Net.IPAddress).
    40. Error: method `System.Void System.Net.Sockets.Socket::SetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,System.Object)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Int32,System.Net.IPAddress).
    41. Error: type `System.Net.Sockets.SocketOptionLevel` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress,System.Int32).
    42. Error: type `System.Net.Sockets.SocketOptionName` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress,System.Int32).
    43. Error: method `System.Void System.Net.Sockets.Socket::SetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,System.Int32)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress,System.Int32).
    44. Error: type `System.Net.Sockets.SocketOptionLevel` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress,System.Int32).
    45. Error: type `System.Net.Sockets.SocketOptionName` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress,System.Int32).
    46. Error: method `System.Void System.Net.Sockets.Socket::SetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,System.Int32)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress,System.Int32).
    47. Error: type `System.Net.Sockets.MulticastOption` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress,System.Net.IPAddress).
    48. Error: method `System.Void System.Net.Sockets.MulticastOption::.ctor(System.Net.IPAddress,System.Net.IPAddress)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress,System.Net.IPAddress).
    49. Error: type `System.Net.Sockets.SocketOptionLevel` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress,System.Net.IPAddress).
    50. Error: type `System.Net.Sockets.SocketOptionName` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress,System.Net.IPAddress).
    51. Error: method `System.Void System.Net.Sockets.Socket::SetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,System.Object)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Void BeardedManStudios.Network.CachedUdpClient::JoinMulticastGroup(System.Net.IPAddress,System.Net.IPAddress).
    52. Error: method `System.Int32 System.Net.Sockets.Socket::ReceiveFrom(System.Byte[],System.Net.EndPoint&)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at BeardedManStudios.Network.BMSByte BeardedManStudios.Network.CachedUdpClient::Receive(System.Net.IPEndPoint&,System.String&).
    53. Error: type `System.Net.Sockets.SocketFlags` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Int32 BeardedManStudios.Network.CachedUdpClient::DoSend(System.Byte[],System.Int32,System.Net.IPEndPoint).
    54. Error: method `System.Int32 System.Net.Sockets.Socket::Send(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Int32 BeardedManStudios.Network.CachedUdpClient::DoSend(System.Byte[],System.Int32,System.Net.IPEndPoint).
    55. Error: type `System.Net.Sockets.SocketFlags` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Int32 BeardedManStudios.Network.CachedUdpClient::DoSend(System.Byte[],System.Int32,System.Net.IPEndPoint).
    56. Error: method `System.Int32 System.Net.Sockets.Socket::SendTo(System.Byte[],System.Int32,System.Int32,System.Net.Sockets.SocketFlags,System.Net.EndPoint)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Int32 BeardedManStudios.Network.CachedUdpClient::DoSend(System.Byte[],System.Int32,System.Net.IPEndPoint).
    57. Error: type `System.Net.Sockets.SocketOptionLevel` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Int32 BeardedManStudios.Network.CachedUdpClient::DoSend(System.Byte[],System.Int32,System.Net.IPEndPoint).
    58. Error: type `System.Net.Sockets.SocketOptionName` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Int32 BeardedManStudios.Network.CachedUdpClient::DoSend(System.Byte[],System.Int32,System.Net.IPEndPoint).
    59. Error: method `System.Void System.Net.Sockets.Socket::SetSocketOption(System.Net.Sockets.SocketOptionLevel,System.Net.Sockets.SocketOptionName,System.Int32)` doesn't exist in target framework. It is referenced from BeardedManStudios.Network.dll at System.Int32 BeardedManStudios.Network.CachedUdpClient:
     
  4. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Are you building to WP8.1?

    screen_8.jpg
     
  5. zapoutix

    zapoutix

    Joined:
    Jan 2, 2015
    Posts:
    44
    Of course not ... i saw Windows Phone 8 then i select it ... thank you

    But it still does not compile
    Code (CSharp):
    1. Reference Rewriter: Error: field `System.String BeardedManStudios.Network.HostInfo::name` doesn't exist in target framework. It is referenced from Assembly-CSharp.dll at System.Void ServerListItem::SetupServerListItem(BeardedManStudios.Network.HostInfo).
    2. Reference Rewriter: Error: field `System.String BeardedManStudios.Network.HostInfo::gameType` doesn't exist in target framework. It is referenced from Assembly-CSharp.dll at System.Void ServerListItem::SetupServerListItem(BeardedManStudios.Network.HostInfo).
    3. Reference Rewriter: Error: field `System.String BeardedManStudios.Network.HostInfo::password` doesn't exist in target framework. It is referenced from Assembly-CSharp.dll at System.Void ServerListItem::SetupServerListItem(BeardedManStudios.Network.HostInfo).
    4. ....
     
  6. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Thanks for the report, we will look into this asap. Lot of new features have to be replicated to windows phone, must have missed this one.
     
  7. maki47

    maki47

    Joined:
    Feb 16, 2015
    Posts:
    29
    Can I use Forge to create offline multiplayer by hotspot(wifi), Its android. And if yes? where can I download or buy this plugin? thanks
     
  8. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Yes you will be able to create Lan games with Forge. You can join in our open Beta by sending an email to support@beardedmangames.com and test it out yourself.

    Feel free to ask us any other questions you may have.
     
  9. maki47

    maki47

    Joined:
    Feb 16, 2015
    Posts:
    29
    I already sent an email. My game is only a checkers-like game. Turn based game. Do you have a demo of Forge networking for Mobile? specially Android? thanks.
     
  10. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hey! Sorry for the late reply. We will be sending you a beta access key tonight after we return from work.

    This sounds like a perfect game to be pure RPC :)

    Our demo's are very rigid at the moment (all about features on cubes). We will be making some fully featured demos soon. The good news is that if it works on PC it works on Android :). We can patch together a mobile device demo in one of these upcoming beta releases (they release quite rapidly) :).
     
  11. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Just to confirm: is the new WriteRaw's NetworkingPlayer parameter the player to send it to (after the message goes to server)? Also, what does the NetworkingPlayer parameter in HandlerawDataRead represent?
     
  12. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    This is currently only for use by the server, if you pass a player parameter it will be delegated to the specified player by (if used on the server). Therefore it can't be used by the client. If you would need to send from one player to another we would have to make another write-raw so that the header can be extended to support the target player. Is this something that is needed?

    On the server, this represents the player that sent the message. On the client, it will always represent the server because it was the server that delegated the message to them.
     
  13. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Oh, nothing extra, just needed some clarification. Thanks!
     
  14. imgodot

    imgodot

    Joined:
    Nov 29, 2013
    Posts:
    212
    So, any thoughts on my prior post regarding being able to have a global RPC class inherited from Simple/NetworkMonoBehavior?

    The goal is to have all the server-specific code, including server-specific RPCs in a script attached to an empty GameObject sitting in the scene. That was any client code could call a server-specific RPC like: ServerRPCScript.RPC("TestRPC", NetworkReceivers.Server);

    Can this work or am I confused?

    -- Paul
     
  15. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    If you don't need to ID an object, I think you could do WriteCustom or something like that which doesn't require you to instantiate anything.
     
  16. imgodot

    imgodot

    Joined:
    Nov 29, 2013
    Posts:
    212
    I have a very basic authoritative server question:
    If a client joins the server and the server network.Instantiates an object for that client, then how do I tell the client which player object is theirs to control?
    And, what data do I send to the client when I tell them?

    Thanks.
    -- Paul
     
  17. maki47

    maki47

    Joined:
    Feb 16, 2015
    Posts:
    29
    I already receive your email. I will use it now. Sadly my deadline for this feature to be implemented is tomorrow. That is why I'm in rush now. I hope I can easily learn to use your plugin.

    That's okay. I hope you'll have some demo for mobile soon. Maybe I can use your current demos on Android?

    Really? that's great to know. Did you already test it before on Android?

    Can't wait for next beta release. I'll keep on using your plugin to help you on your development. Thanks again!
     
  18. maki47

    maki47

    Joined:
    Feb 16, 2015
    Posts:
    29
    I run the latest beta and encountered this problem.

     
  19. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    That's a very strange error. Does this happen when you import Forge into a new project? By the way, welcome to the Forge family :D.

    Also, I have a question of my own: when sending information through WriteRaw, will bytes be guaranteed to arrive in order?

    I.e. BMSByte bite = new BMSByte();
    bite.bytearr = new byte[]{1,2,3,4,};
    WriteRaw(bite);

    Will the bytes arrive as 1,2,3,4? If not, what's the UDP equivalent of WriteRaw that guarantees packet integrity? I think those few extra bytes will actually be the least of my concerns.
     
    Last edited: Feb 18, 2015
    maki47 likes this.
  20. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Are you running on Unity 4.6? If not are you able to update? That particular start scene uses the new Unity UI. Though you can use our system on older versions of Unity, you will need to make your own start screen if that is the case. Sorry about this. :(
     
    maki47 likes this.
  21. maki47

    maki47

    Joined:
    Feb 16, 2015
    Posts:
    29
    Yes, after I imported Forge, this Error shows.

    thank you. Happy to test Forge
     
  22. maki47

    maki47

    Joined:
    Feb 16, 2015
    Posts:
    29
    Now I know the problem, my unity version is 4.5. thanks farrisarts

    I have another question, about Forge with Android Basic. In your tutorial here: http://developers.forgearcade.com/Tutorials/GettingStarted/Forge-With-Unity-Basic

    Recommends to use : Good ol Sockets

    If I will use the latest Beta version, do I still need to buy that plugin? thanks
     
  23. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    That plugin is the only way to use sockets (our networking solution) on Unity Free currently. We have plans to develop our own solution down the line but it isn't on our highest priority at the moment as Good ol' Sockets works just fine.
     
  24. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Is this not on the Asset Store? I saw a plugin called Forge but it's not about networking. I was hoping to read some reviews about the plugin. Either way, how is it purchased?
     
  25. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    It's still in beta which means a bunch of features are being developed and polished right now. Haven't heard of a release date yet but the library works and you can try it out by asking one of the creators.
     
  26. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok thanks.
     
  27. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hi there! So you probably would want the client to call Networking.Instantiate so that it has control (isOwner) of the object. If you spawn it on the server and tell the client that they can move it, then you will need to make a bool or a separate identifier to say who is in control of the object.
     
  28. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hi there! :) We are still in beta and already have a lot of features built in out of the box. If you would like, you can send me a message or send an email to support@beardedmangames.com with the subject "Forge Networking Beta" and we can get you in on the beta :)
     
  29. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hello all now that I got all the mid term grading out of the way I'm ready to work on Windows Phone 8. I will be working on getting this plugin up to date with other plugin. Look out for the update soon and thank you all for your feedback. :)
     
  30. imgodot

    imgodot

    Joined:
    Nov 29, 2013
    Posts:
    212
    If I did that then it would not be an authoritative server.
    That's okay, but I'm a little fuzzy on implementation?
    Would the bool be set in Awake()?
    If so, and there are four clients all connecting at once and, therefore, four new objects popping into being in the client's scene, how does any one client know which object is "theirs"?

    If this was standard Unity, I would probably have the server instantiate the object, send an RPC to all players passing the networkview ID. The player would find the object with that networkview ID and set the I-have-control bool to TRUE. What would I use in Forge in place of networkview ID to be able to "link" objects together?

    Thanks.
    -- Paul
     
    Last edited: Feb 18, 2015
  31. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    do forge have an equivalent to the offline mode in photon ?
     
  32. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    What is "offline mode" in photon? If it is just LAN (offline but via local area network) then yes, that comes out of the box :)
     
  33. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    it allow to simulate your client to be directly connected to a server, so you can dev/test your gameplay and features with 0 ping and instant connection.
     
  34. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    There isn't anything that you do in Forge that makes it non-authoritative. An authoritative server is a server that routes all messages from clients through itself and then the server delegates those messages to the clients. Our implementation of networking requires all messages that are sent from the client to be sent to the server first. This is what makes it an authoritative implementation. A non authoritative server implementation would be that clients can talk to each other without going through the server, known as "Peer-to-Peer". We do not support peer-to-peer. All messages are routed through the server, so our system is fully authoritative. Nothing you can do in Forge can change the fact that our server is authoritative. :) We do this because it is the industry standard and no serious game would ever pick peer-to-peer as their form of communication outside of VOiP or video streaming as these have nothing to do with gameplay.

    That being said, here is what Networking.Instantiate does:
    1) Client sends RPC to server with its id and what object it would like to spawn
    2) Server gets message and then creates an object
    3) Server gives a networked id to the newly created object that doesn't conflict with other objects
    4) Server creates a spawn RPC that gets sent to all clients
    5) Server sends out the spawn RPC
    6) Networking.Instantiate requesting client gets the object spawn RPC with networking id
    7) Requesting client checks to see if it's id is the target owner id
    8) Requesting client spawns object and then sets the "isOwner" bool to true

    So basically we are already doing what you want to do in our Networking.Instantiate method. :)

    Let me know if this helps.
     
  35. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    I'm not sure if this'll suit your needs, but hosting a server is pretty much offline mode.

    @farrisarts Does WriteRaw guarantee the correct ordering of bytes? If not, what's the UDP equivalent because I don't think it's worth the effort writing my own implementation.
     
  36. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Oh cool, so basically it runs all of your messages through the networking system but then doesn't send them and just simulates them locally? Our system already does all of this. If there are no clients connected, the server still goes through the preparation of packets (just so that everyone is working with raw data when it is routed and consumed locally), it just stops when it gets to the actual send method.
     
  37. imgodot

    imgodot

    Joined:
    Nov 29, 2013
    Posts:
    212
    Brent, that helps IMMENSELY! Thank you.
    I had no idea that Networking.Instantiate() was doing all that.
    I thought that if I called Networking.Instantiate() on the client side that it was creating a P-2-P object.
    I think it would be a REALLY good idea to put this information into the docs for Networking.Instantiate().

    Two questions (one related to this post, one related to a prior post):
    1) Is there an event on the server that I can hook into to capture when a Networking.Instantiate() is called?

    2) I would like to have all my server-specific code, including server-specific RPCs in a script attached to an empty GameObject sitting in the scene. That way any client can call a server-specific RPC like:
    ServerRPCScript.RPC("TestRPC", NetworkReceivers.Server);
    The script, "ServerRPCScript", inherits from NetworkedMonoBehavior, but throws an error.

    When I run the application, I get the following error:
    ==================================================================
    Argument cannot be null.
    Parameter name: source
    System.Linq.Check.Source (System.Object source)
    System.Linq.Enumerable.First[KeyValuePair`2] (IEnumerable`1 source)
    BeardedManStudios.Network.NetworkingManager.Awake ()
    UnityEngine.Object:Instantiate(Object)
    BeardedManStudios.Network.SimpleNetworkedMonoBehavior:Initialize()
    BeardedManStudios.Network.SimpleNetworkedMonoBehavior:Start()
    BeardedManStudios.Network.NetworkedMonoBehavior:Start()
    ==================================================================
    I'm presuming this happens because there are two networking managers in the scene.
    How can I make this work?

    Thanks.
    -- Paul
     
  38. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Yes, it guarantees it. If you have data to support otherwise please let us know so that we can make sure everything is alright on our end. :)
     
    jpthek9 likes this.
  39. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Currently, no. However if this is something that you would like to see you can file a feature request on the website so that we can track it and make sure we add a ticket to get it done: http://developers.forgearcade.com/

    Hmmm, you should only have 1 NetworkingManager in the scene, are you able to make sure there is only 1?
     
  40. imgodot

    imgodot

    Joined:
    Nov 29, 2013
    Posts:
    212
    I was thinking to use such an event in case I wanted to create a list of objects that have been instantiated.
    Is there some other way I can get that information?
    I was using one of the example projects from V12.2 as a starting point.
    In the sample, there is a disabled networking manager in the scene and during the startup it is enabled.
    I guess I can try leaving it disabled, but I presumed it was doing something important.
    What is the networking manager being used for?

    Okay, I disabled the NetMan in the scene and left my "global" script (that inherits from NetworkNonoBehavior) in the scene.
    When I run the app, an object called "Network Manager(Clone)", is created.
    It has a network manager script attached but it is disabled.

    For the life of me I can't seem to enable the script.
    It doesn't show as an option in GetCompnent<T>.
    It doesn't work if I GetComponent<Monobehavior>().enabled = true.
    Is there some trick to getting a reference to the "NetworkManager" script?

    -- Paul
     
    Last edited: Feb 18, 2015
  41. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    One of the features that drew my eye to the Bolt Engine was its ability to replicate a MecAnim character and animations over a network with no special coding, what would be the recommended way of handling that with Forge, or in fact any hierarchy of objects in general?
     
  42. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    I am not sure what Bolt does, however I'm sure that replicating animation states across the network lacks the control over bandwidth and performance. If you check out the featured video of ours in the first post (or I'll just add it to this one) I show you how you can replicate every part of an animation from Mechanim with FULL control. Using variable synchronization is the best way to control bandwidth and performance of networked Mechanim animations. That being said, there are a couple of lines of code you need to write to get this done. After learning the technique you may find the power and flexibility more liberating. If however you do not find it as such, do feel free to leave a feature request on our website: http://developers.forgearcade.com/ and we would be happy to try to get it into the system! :D

    The featured video from the 1st post here so you don't need to go back :)

    Note: This is not special coding for Mechanim, this is just how you can serialize variables across the network in a super simple, flexible and powerful way through Forge :)
     
  43. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Yes, we keep a static list of all of the objects that are currently NetworkedMonoBehaviors. However this is not an exclusive list of objects that were instantiated. If you would like I could add in an extra bool in the SimpleNetworkedMonoBehavior "wasInstantiated" that will be set to true if it was instantiated via the network.

    Something you can do otherwise is to go through all of the objects in that list and determine if their ownerId is the server's network id. If they are not, then it was instantiated from a clients request.

    The networking manager takes care of all of the in-game, real time, unity specific things. It is required however you only need 1, it is a thread safe singleton.

    You can just enable it in the scene. If you are not using that manager to house a list of objects that you are instantiating, then you can actually delete it and a dynamic one will be created. It could be possible that a dynamic one is being created because the other one is disabled and therefor never becomes enabled and initializes, however when it does then there is 2.
     
  44. imgodot

    imgodot

    Joined:
    Nov 29, 2013
    Posts:
    212
    Thanks, I will check that out.
    I cannot leave the existing NetworkManager because I have a script (inherited from NetworkMono) on a game object and because that script is present, a second NetMan is created and I get the error.

    If I leave the existing NetMan disabled, and run my app, a second, enabled NetMan is automatically created but the script on the NetMan is disabled and I get the error.
    And, I was not able to find a way to programmatically enable the script on the NetMan.

    -- Paul
     
  45. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    The network manager needs to be enabled in the editor when you save the scene because it does a lot of startup work to prepare the scene and its objects for networking. Are you able to enable your object when you save the scene rather than having it disabled at start?
     
  46. imgodot

    imgodot

    Joined:
    Nov 29, 2013
    Posts:
    212
    To be clear, it's not "my" object that is disabled, it's the NetMan from the V12.2 sample project and it saves and operates just fine with it starting off disabled in the editor.
    If that NetMan is enabled when the appication starts then it gets this error:
    =====================================
    Argument cannot be null.
    Parameter name: source
    System.Linq.Check.Source (System.Object source)
    System.Linq.Enumerable.First[KeyValuePair`2] (IEnumerable`1 source)
    BeardedManStudios.Network.NetworkingManager.Awake ()
    UnityEngine.Object:Instantiate(Object)
    BeardedManStudios.Network.SimpleNetworkedMonoBehavior:Initialize()
    BeardedManStudios.Network.SimpleNetworkedMonoBehavior:Start()
    BeardedManStudios.Network.NetworkedMonoBehavior:Start()
    =========================================

    If I leave the existing NetMan disabled and let it enable when the app runs (using the original code from the sample project), then everything is fine, UNLESS I put my own script (inherited from NetMono) into the scene.
    Then, it complains with the same error message as above.

    -- Paul
     
  47. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    Brent, could you please clarify what you mean by guaranteeing the correct order of bytes. Do you mean:

    A) The payload BMSByte will be delivered in tact
    B) BMSByte delivered in tact and the transmitted packets are guaranteed to be delivered in the correct sequence

    The reason I ask is that I assumed that writeraw, just sent a UDP packet and so there was no guarantee in what sequence it is delivered or that it will be delivered at all.
     
  48. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Sorry about that, I do not guarantee the order of packets. I meant you suggestion in "A", for the order of bytes in BMSByte. Since this is a dynamic structure that is designed for performance, before it is sent out I make sure to do things like remove the beginning bytes that are before the start index and such. So the byte order and sequence should be correct from pointA to pointB. If your payload is < 1024 bytes then it will be packed into 1 packet. To guarantee the sequence would add too much overhead to UDP and would reduce its effectiveness as a fast paced protocol, so I do not validate the order of the packets. However the headers will re-package them into one data payload once all packets are received.
     
    Zaddo67 likes this.
  49. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Thank you for the clarification. Sorry about that! Okay so I will run this sample to make sure that we didn't introduce any bugs with our previous release. Thank you! :)
     
  50. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Ah, that make sense. Do I still need a checksum then?