Search Unity

[NO CCU LIMIT] Forge Networking now OPEN SOURCE

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

  1. LastDude

    LastDude

    Joined:
    Aug 5, 2015
    Posts:
    15
    But if I used NetworkCallers.Owner instead of NetworkCallers.Everyone (from the link you posted) it would still send the "number" variable to everyone, but would only call the "print" method on the Owner, correct?! What I want is to send the "number" variable only to the owner.
     
  2. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Correct. :)
     
  3. SORELLE

    SORELLE

    Joined:
    Jun 26, 2015
    Posts:
    3
    Hi every body. i am new wwith forge networking and i want you to help me with some tutorials. i want to make an authoritative server but i don
     
  4. Litwin

    Litwin

    Joined:
    Aug 15, 2013
    Posts:
    70
    Forge supports large-scale MMO? It has physic support server to the client and how work about lag compensation? Example: send the gravity of the server to the client.
     
    Last edited: Sep 21, 2015
  5. Kirsche

    Kirsche

    Joined:
    Apr 14, 2015
    Posts:
    121
    Did a little bit of research, I think what you're looking for was added in version 14.6:
    • Added [NetSyncToServer] where variables marked with this only go to the server and not other clients
    http://developers.forgepowered.com/Changelog

    The only weak point of this network libary from the outside seems to be the documentation.
     
  6. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
  7. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    You are able to send the gravity of the server to the client yes. =)

    There is an automatic compensation for if the distance between two objects go too far it will automatically teleport it's position to the correct one. As far as any lag compensation you can easily check the latency of the client and do any of your predictions based on their latency. It's a bit of a vague question to answer as there are so many different ways to handle it but for the most part you shouldn't be worried about it and can easily get support on what specifically you are interested in handling.
     
  8. Litwin

    Litwin

    Joined:
    Aug 15, 2013
    Posts:
    70
    Thank's! You forgot to answer the first question. :p
    There is possibility to create a stress test video?
     
  9. kasulogamestudio

    kasulogamestudio

    Joined:
    Mar 22, 2012
    Posts:
    130
    Hello everyone,
    We are also using Forge now for some of our projects. Looks really nice.

    But just a tip: you seriously need to add something like this in your tutorial / Portal.
    http://forum.unity3d.com/threads/fo...ly-cross-platform.286900/page-21#post-2193096
    (sorry if already has in any place, but we did not find it)

    And I really mean it ;)
    For us, we took some time today testing and studying, but doing something like this is really more simple and self-explanatory.
    Also, some of your "Tutorials" in Youtube / Developer portal is not a tutorial at all... a video showing "how to make a chat" just throwing some scripts on it and "hey, you see, it works" is not the way to do. Maybe doing some stuff, from scratch, is way better than just put the script and telling it works. I could say it is an "example", not a "tutorial".
    We hope to see more and more updates coming, Forge looks like one of the best system/tool we ever worked with.
     
    Last edited: Sep 23, 2015
  10. Diesen

    Diesen

    Joined:
    May 14, 2013
    Posts:
    2
    Hello,
    I'm using SimpleNetworkedMonoBehavior to send and receive data from Cleint/Server via RPC.
    I have two related questions about the Server side
    1) if RPC method was called on server, how the Server will know what what Client did call the RPC ( in Unet i had NetworkMessage.conn)
    2) How the Server can call a RPC method on specific Client ( basically reply to the client in one)
     
  11. Razouille

    Razouille

    Joined:
    Jan 25, 2013
    Posts:
    44
    For the first question, just compare the NetworkedId of the NetworkingPlayer, i'm doing this to know which one disconnect :
    Code (CSharp):
    1. Networking.PrimarySocket.playerDisconnected += PlayerDisconnected;
    2.  
    3. private void PlayerDisconnected (NetworkingPlayer player)
    4. {
    5.     for (int i = 0; i < players.Length; i++) {
    6.         Player p = players[i];
    7.         if (p == null || player.PlayerObject == null || player.PlayerObject.NetworkedId != p.GetComponentInParent<NetworkParent>().NetworkedId) {
    8.             continue;
    9.         }
    10.                 // do stuff
    11. }
    For the second one i don't know, there is a "NetworkReceivers.MessageGroup" property for RPC, but no idea if it's the good way, and how to use it.
     
  12. cyby89

    cyby89

    Joined:
    Apr 30, 2014
    Posts:
    35
    hello,

    1) I was checking how the delta compression works and found out that you send everything, if just one variable (NetRef) is dirty. Do you have plans to improve this? (e.g. dirty mask)
    2) Do you have plans to add Lists as network variables?
    3) Do you have plans for a multi-server setup for large worlds? Bare metal is a good starting point of the gateway-server (handles messages between a player and multiple game server). But you also need a master-game-server-manager that keeps track of all objects and initiates the handover. If you want to talk in detail about a distributed object system, please contact me.

    Apart from that, the source code looks clean and simple. I like how you implemented some complex features in a simple way!
     
    Last edited: Sep 24, 2015
  13. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hi there :D did you get setup on the wiki page and in our slack chat?

    On the wiki we have a tutorials page, code samples page, complete samples page, and so forth. :) Please let us know if you need any help with this
     
  14. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hello there @Diesen ! :D

    We now have MessageInfo built into our RPC calls. You can see this being used in the UnitRPC scene and UnitRPC.cs file.

    To use the MessageInfo object, all you need to do is add it to your method signature (parameters) and it will automatically be populated with the correct information.

    You can do this with the AuthoritativeRPC method. :)

    Please let us know if you need further information on this. Have you setup your slack chat user? If you purchased through the asset store and have gone to the developer site to register your invoice number, then you will automatically be invited via email :)
     
  15. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Yes, this is a complex topic because you will need to identify each property in the payload (which can be done with a byte), then it will need to break down piece by piece on send and receive. We have plans to add this to the system as we continue to work on the core. If you have variables that change based on input and are not constant changes I would recommend using a RPC in order to change that value rather than relying on NetSync.

    We have plans on arrays, lists have not been discussed but you can do this with .ToArray() once we implement more array functionalities :)

    Yes, we have always had plans for this and developed from the start with it in mind :). This is why we allow you to setup multiple sockets in one unity instance, this will allow for branching and connecting to other servers (even on the same machine) to scale up virtually infinitely. We do also have plans on rooms and room management as well. This has started to be worked on with the new Message Group implementations.

    The fact that we allow for multiple sockets per instance means that many servers can both be a host (as a server) and still connect to any centralized server (and sustain this connection if needed). This is how the current Master Server (server listing) works. You host a server, then while hosting make a connection to the master server and send/receive information from it. In the case of the master server. Please let us know if you would like more information about these base subsystems. We have yet to really document them all. We may be in touch in the near future to discuss specific needs for this distributed server system you require as well :D.

    Thanks! We worked really hard to make sure our architecture was as simple, clean and easily extendable as possible. There are always areas of improvement as things get added or updated but we are glad that we are able to make it simple to follow (and possibly even extend) by users. :D

    Thanks for the feedback. Feel free to shoot us an email or send us some messages on the Slack chat! :D
     
  16. Bionicle_fanatic

    Bionicle_fanatic

    Joined:
    Jun 8, 2013
    Posts:
    368
    Getting these errors:

    From this code

    Code (csharp):
    1. void Awake()
    2.  {
    3. Networking.Host(15937, Networking.TransportationProtocolType.UDP, 25);
    4. Networking.Sockets[15937].connected += JoinedForgeServer;
    5.  }
    6.  
    7. Networking.Sockets[15937].disconnected += DisconnectedForgeServer;
    8.  
    9. void JoinedForgeServer()
    10.  {
    11. Debug.Log("Connected to Forge server");
    12.  }
    13.  
    14. void DisconnectedForgeServer()
    15.  {
    16. Debug.Log ("Disconnected from forge server");
    17.  }

    Code is exactly the same as it is in the doc. Why is this?
     
  17. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi.

    I have been looking at using your network system for a game I am developing. Currently I am using Photon with my own server plugin but it does not support windows universal buillds.

    How would I set up a server using Forge networking to host multiple games at the same time? Can it be set up with the option to connect to a certain room/game when connecting?
     
    Bionicle_fanatic likes this.
  18. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Yes to both. We can definitely have some of those moving forward. :)
     
  19. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Are you using the latest version from the website?
    What version are you running on?
    Also feel free to reach out to us in our slack chat! Those invites get automatically sent out when you register your invoice on our website.
     
  20. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Yes, all of this is possible. Feel free to talk to us on Slack so that we can help you get it set up towards your needs and concerns you may have.
     
  21. Bionicle_fanatic

    Bionicle_fanatic

    Joined:
    Jun 8, 2013
    Posts:
    368
  22. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Our most updated tutorials can be found on the wiki here - http://wiki.forgepowered.com/index.php/Tutorials

    Our most tested version of forge is 14.7, our latest version is 15.3. We recommend that you to try out these versions as 14.1 will contain various bugs that have been fixed in the latest versions.

    Here is a tutorial to setup your account for getting the latest downloads and gaining access to the wiki and the slack chat - http://developers.forgepowered.com/...nityAssetStore/How-to-Register-Invoice-Number

    Please let us know if you have any further questions :D
     
  23. RdxC4

    RdxC4

    Joined:
    Jun 25, 2013
    Posts:
    5
    Hello Guys,
    I am planing to create a pong game and evaluating networking libraries and came across forge.
    I would like to know, how can i create a authoritative server where the ball is simulated on server while clients control there respective pongs something like this,the above is implemented using uLink.
    I really don't want to use uLink, cannot afford it for now


    Regards
     
  24. Bionicle_fanatic

    Bionicle_fanatic

    Joined:
    Jun 8, 2013
    Posts:
    368
    That's great, farrisarts. [:)] Just one problem: There is no way to register on here: http://wiki.forgepowered.com/index.php/Tutorials . Therefore, I can't sign in, therefore I can't view any of the pages, because you need to be logged on to do the latter. Is that normal, or is it a glitch my side?
     
  25. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
  26. Rubacava

    Rubacava

    Joined:
    Apr 12, 2013
    Posts:
    11
    Can anybody use server discovery on LAN? Even the example scene is not working.
     
  27. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Mine works fine. You still need to have your selected port open for it to see the server on a different machine. It might even need to be open for local calls depending if you are running any other firewall apps.
     
  28. Rubacava

    Rubacava

    Joined:
    Apr 12, 2013
    Posts:
    11
    I dont think that it occurs because of the firewall or any other security measure since none of the code is called which comes after (ForgeMasterServer.GetHosts)
    I put a Debug.Log put it is not running
     
  29. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    I would recommend getting onto their site and signing in so you can get access to the Slack channel. There are a lot of folks there that can help you out. We are running our master server remotely, so I am not sure what might be the issue for you locally. I just recall that when we first tested that it worked local before we uploaded it to the EC2 instance.
     
  30. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Here is the registration link for all of Forge portals: http://developers.forgepowered.com/Register
    If you purchased through the Asset Store, here is how to register your purchase to access secure parts of the site: http://developers.forgepowered.com/...nityAssetStore/How-to-Register-Invoice-Number
     
  31. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hello there, I am assuming that you are on an older version of the system, 14.7 is the most tested and 15.3 is the latest version. You can get both of these from the website described in the post above this one. :) Please let me know if this helps. :D
     
  32. Rubacava

    Rubacava

    Joined:
    Apr 12, 2013
    Posts:
    11
    nope its pretty v15.3
     
  33. kasulogamestudio

    kasulogamestudio

    Joined:
    Mar 22, 2012
    Posts:
    130
    Hello farrisarts,
    I need your help please. There is an error that is making me crazy here... XD

    please, look the error below...
    Code (CSharp):
    1. IndexOutOfRangeException: Array index is out of range.
    2. BeardedManStudios.Network.NetworkingStream.Read (System.Byte[]& readBytes, Int32 count) (at Assets/Bearded Man Studios Inc/Forge Networking/MainScripts/Core/NetworkingStream.cs:447)
    3. BeardedManStudios.Network.ObjectMapper.MapString (BeardedManStudios.Network.NetworkingStream stream) (at Assets/Bearded Man Studios Inc/Forge Networking/MainScripts/Core/ObjectMapper.cs:182)
    4. BeardedManStudios.Network.ObjectMapper.Map (System.Type type, BeardedManStudios.Network.NetworkingStream stream) (at Assets/Bearded Man Studios Inc/Forge Networking/MainScripts/Core/ObjectMapper.cs:49)
    5. BeardedManStudios.Network.SimpleNetworkedMonoBehavior.InvokeRPC (BeardedManStudios.Network.NetworkingStreamRPC stream) (at Assets/Bearded Man Studios Inc/Forge Networking/MainScripts/Unity/SimpleNetworkedMonoBehavior.cs:574)
    6. BeardedManStudios.Network.NetworkingStreamRPC..ctor (BeardedManStudios.Network.NetworkingStream stream, Boolean skipCall) (at Assets/Bearded Man Studios Inc/Forge Networking/MainScripts/Core/NetworkingStreamRPC.cs:97)
    7. BeardedManStudios.Network.NetWorker.DataRead (BeardedManStudios.Network.NetworkingPlayer player, BeardedManStudios.Network.NetworkingStream stream) (at Assets/Bearded Man Studios Inc/Forge Networking/MainScripts/Core/NetWorker.cs:832)
    8. BeardedManStudios.Network.DefaultServerTCP.StreamReceived (BeardedManStudios.Network.NetworkingPlayer player, BeardedManStudios.Network.BMSByte data) (at Assets/Bearded Man Studios Inc/Forge Networking/MainScripts/Default/DefaultServerTCP.cs:238)
    9. BeardedManStudios.Network.DefaultServerTCP.ReadAsync (System.Object sender, System.ComponentModel.DoWorkEventArgs e) (at Assets/Bearded Man Studios Inc/Forge Networking/MainScripts/Default/DefaultServerTCP.cs:280)
    10. UnityEngine.Debug:LogException(Exception)
    11. BeardedManStudios.Network.DefaultServerTCP:ReadAsync(Object, DoWorkEventArgs) (at Assets/Bearded Man Studios Inc/Forge Networking/MainScripts/Default/DefaultServerTCP.cs:290)
    12. System.ComponentModel.BackgroundWorker:ProcessWorker(Object, AsyncOperation, SendOrPostCallback)
    13.  
    This happens every time I try to send an RPC.
    It is simple as this:

    Code (CSharp):
    1. CharacterData soldierToSend = networkProfileActive.soldiersList[0];
    2.         RPC("Receive_PlayerDataUpdate", NetworkReceivers.Others, 123, soldierToSend.alias, (int)soldierToSend.weaponPrimary, (int)soldierToSend.weaponSecondary,
    3.             (int)soldierToSend.gadget1, (int)soldierToSend.gadget2);
    Also, what is the best place to send you these questions? =)
    Thanks

    EDIT: can we send int through RPC calls? Or just your network types?
     
    Last edited: Sep 28, 2015
  34. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hmmm, I'll double check this. Do you mind sending in a bug report to support@beardedmangames.com and have the subject as "Forge Networking Bug Report" and just do the steps you take to cause this issue?
     
  35. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    We've got this one in the Slack chat a few times. We have pretty much finished moving and such and would like to tackle this issue. Do you mind sending in a bug report to support@beardedmangames.com with the subject line "Forge Networking Bug Report". We would need reproduction steps and if you don't mind, we would also need a sample unitypackage that will reproduce this so that we can quickly find the issue. We haven't gotten a detailed report on this yet other than the stack trace and so it will greatly help. Thank you! :D
     
  36. Rubacava

    Rubacava

    Joined:
    Apr 12, 2013
    Posts:
    11
    v14.7 does work so there must be a bug in the latest build.

    Edit : I modified the PingHostThread method in MasterServer script to use InvokeRepeating instead of while(true) now it uses a lot less cpu.
     
    Last edited: Sep 29, 2015
  37. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
    Has this been tested working with build target: Windows Store Universal 10? On the latest Unity 5.2.1p1
     
  38. edufurla

    edufurla

    Joined:
    Mar 7, 2014
    Posts:
    19
    Hi.
    I am not a programmer but I trying figure out if is possible use Forge Network with Playmaker to do simple stuff and carry information in network.
    Basically I want to have some variables shared in network in way everyone can change and read this variables.
    I watch some tutorials and did this very very simple script:

    Code (CSharp):
    1.  
    2. using UnityEngine;
    3. using BeardedManStudios.Network;
    4.  
    5. public class variables : NetworkedMonoBehavior {
    6.  
    7.     [NetSync]
    8.     public int int01 = 0;
    9.    
    10. }
    I am using Playmaker to set the int variable in this script to other value and works fine when the change is triggered on server, but when I do the same in the client the script change on that client but nothing happen on server or other clients.

    Any tips?
     
  39. Bionicle_fanatic

    Bionicle_fanatic

    Joined:
    Jun 8, 2013
    Posts:
    368
    Okay, I created an account, I registered the invoice number, and the dawn wiki still says login required. And yet there's no place to create an account. What's going on?
     
  40. luochuanyuewu

    luochuanyuewu

    Joined:
    Jul 19, 2013
    Posts:
    8
    Hi,Just using your "http://developers.forgepowered.com/" account to login.
     
    Cranick likes this.
  41. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Which version are you referring to? If 14.7 then yes it has been battle tested a bit.
     
  42. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Are you using Server is Authoritative? If so, you can try turning that off and see if it is showing up on the server. Also I don't know how this variable is being used outside of it, but you can also just call a function after the variable changes [NetSync("PlayMakerFunction", NetworkCallers.Everyone)] so that it would call any Playmaker functions.
     
  43. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    The account that was registered on the site is the same account you would use to access the Wiki and internal Forums. If you are having any issues accessing the Wiki with your login credentials send us an email at support@beardedmangames.com and we will get it sorted out for you.
     
  44. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
    noticed your asset store listing says 14.2, are you still supporting asset store updates ?
     
  45. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    They can submit changes to the asset store and it can takes more than a week or two to get approved. By then they (Bearded Man Studios) are more than 20 changes ahead because of their quick responses to developers.
     
  46. Bionicle_fanatic

    Bionicle_fanatic

    Joined:
    Jun 8, 2013
    Posts:
    368
    Managed to get logged in (finally), and I'm now facing another problem: Is there no simple way to code a host/connect system? I tried looking at the StartGame script, but it was so messily coded and annotated that I thought I'd ask before attempting to clean it up and implement it into my current network handler.

    And another thing: Does Forge support multiple "Rooms"? I couldn't see anything like JoinRoom() or OnJoinedRoom() in what little documentation is given.

    Sorry for all these questions, by the way. Normally I'd be looking things up for myself on the docs, but apparently they're still in development, so...
     
  47. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
    thanks for the info :)
    i wonder what would help them cut the approval process down,
    all i can think of is implementing a github like model for the asset store,
     
    Cranick likes this.
  48. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    As a Bolt user looking at other options, Forge seems like a really good (and actively developed!) alternative. I'm curious about a couple of things, though.

    1. Any current/planned support for Steam's networking backend?
    2. Any current/planned console support?

    It looks like you guys already have a way to register an Asset Store invoice number to get earlier updates, which is great as well. Honestly, Steam support is my biggest concern as that sort-of worked in an earlier version of Bolt and I'll be needing to make use of Steam's networking features without having to roll my own solution if I go with Forge.
     
  49. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Yes, the asset store still takes some time to approve updates as we submit them, so we tend to upload only the stable versions that we have and then make sure the hotfixs and immediate updates remain on the website. So our website will always be ahead as far as updates go.
     
  50. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Haha, pretty much. :)