Search Unity

[NO CCU LIMIT] Forge Networking now OPEN SOURCE

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

  1. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    I'm not sure exactly what you are asking for, NetSync can be synced manually, I think that is what you are asking for.
    http://forgepowered.com/ForgeNetwor...worked_mono_behavior_1_1_manual_net_sync.html
     
  2. 0000FF

    0000FF

    Joined:
    Jun 21, 2015
    Posts:
    1
    Hi, after update to 19.1 I have this message when I want to join client (hosts starts and works normal):

    Load can only be called from the main thread.
    Constructors and field initializers will be executed from the loading thread when loading a scene.
    Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.

    Cound someone give any hint?
    Thanks.
     
  3. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94
    I am sorry to swear but why the F*** there's no way of getting the spawned GameObject? Why does Networking.Instantiate returns void? If there's a way please show.....
     
  4. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Please see this tutorial:


    If you want to jump to the part where you get the object visit this link: youtu.be/p9TLa8zY504?t=1m50s

    The reason this is in a callback and not returned from Network.Instantiate is because Forge runs on it's own thread and doesn't stop the Unity thread to validate GameObjects.

    Code (CSharp):
    1. using System.Collections;
    2. using BeardedManStudios.Network;
    3.  
    4. public class CreateTest : MonoBehavior
    5. {
    6.     public GameObject target = null;
    7.  
    8.     private void Update()
    9.     {
    10.         if (Input.GetKeyDown(KeyCode.Space))
    11.             Networking.Instantiate(target, callback: OnCreated);
    12.     }
    13.  
    14.     private void OnCreated(GameObject newObject)
    15.     {
    16.         Debug.Log("We just created a new object: " + newObject.name);
    17.     }
    18. }
     
  5. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94
    oh thanks for the reply. It worked! I was actually loosing my mind.....
     
  6. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94
    Now I know I have questioned this before but never got a appropriate answer.......... How to sync game time? Right now I am [NetSync]ing a variable which changes every second (i.e the timer), I cant use serverTime because I want the game time to pause and reset at certain point in the game and netsyncing a variable which changes every second I guess would be very inefficient so how do I do this?
     
  7. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Awesome :) no problem

    You can use a NetSync variable but that will most likely cause an update time to be sent at your update interval. Another thing you can do is use a URPC (un-reliable RPC) and call a function passing the current time. By doing this you can make the time update interval whatever you want. Just make the server call URPC at the interval you wish to update the clients (like every 5 seconds). Then have logic on the clients to override the time they have with the update from the server. Now between the updates from the server, you can have the clients simulate the time between updates with += Time.deltaTime. Lastly you can use a standard RPC to tell the clients when to pause or reset their times. :)
     
  8. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94
    Okay I'll use NetSync for now. Another problem is I get an error on the client when I try to Debug.LogError their OwningPlayer.NetworkID. Basically I want to print NetworkID of all the players that join.

    So I did this:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using BeardedManStudios.Network;
    5.  
    6. public class networkManager : SimpleNetworkedMonoBehavior {
    7.     protected override void NetworkStart()
    8.     {
    9.         base.NetworkStart();
    10.         Debug.LogError("NetworkedID: " + OwningPlayer.NetworkId);
    11.     }
    12. }
    But I get a null exception at line 9. Weird thing is i dont get the error on the server it just prints the networkID. I think its because I am using the free version. And that gameobject is kinda like a network manager and will spawn the players with their team color.
     
  9. maglat

    maglat

    Joined:
    Jul 9, 2010
    Posts:
    111
    After I'm very new in networking, I tried to get basic stuff up and running. Sadly the tutorials on the Forge side didn't helped me so far to be successful in this matter. Is it possible to translate these tutorials http://unity3d.com/learn/tutorials/topics/multiplayer-networking just to Forge? That would be great! I think these network tutorial series is very beginner friendly.

    Many thanks in advance.
     
  10. o1o101

    o1o101

    Joined:
    Jan 19, 2014
    Posts:
    639
    @maglat
    I was able to get a working headless linux server up and going today on an nfo server following the video tutorials from the Forge documentation site. They are geared towards beginner and intermediate, and I found them clear and very helpful.
    Maybe I'm alone here, but the parts I struggle with are conceptual network ones...like I can see that I am able to connect to the headless exe instance running on my server, I can build to a windows exe and build to android and they both connect fine, but I don't really understand what "headless" is, and I'm not sure how to create a master server to see a list of running games to connect to etc. And it's a bit confusing knowing whether the tutorial you are following relates to the version of Forge you have, like whether you still need to override Update or Start methods anymore...?. It may be all there in the docs... haven't got there quite yet.
     
    Last edited: Apr 18, 2016
  11. o1o101

    o1o101

    Joined:
    Jan 19, 2014
    Posts:
    639
    The "Authoritative Client Side Prediction" video tutorial does not work using the latest version of Forge. Is that a known thing, or what do I have to do to make that work now? When I try running the example hosting the server from the editor the cube is floating in space and does not move as expected. When I join that host from the built out game, no movement data is passed back and forth. Also, when I go back to the server after having connected as a client, I get the error:
    IndexOutOfRangeException: Array index is out of range.
    BeardedManStudios.Network.NetworkingStream.Read (System.Byte[]& readBytes, Int32 count) (at Assets/Bearded Man Studios Inc/Forge Networking/MainScripts/Core/NetworkingStream.cs:447)

    We really want to get a an example working so we can keep moving ahead. Does anyone have a super basic working example that meets the following:

    1. Can be built to run as a headless linux server (we already have the server and can connect with examples)
    2. A small project that has a character, say the Ethan character with basic mechanim animation, that can be synced using the mechanim variables as per the video tut "Integrating with exisiting code"
    3. A client connects to the server, his character is instantiated
    4. If another player is already in the game, their character is automatically instantiated
    5. Movement is authoritative with client side prediction as per: http://www.gabrielgambetta.com/fpm1.html
    6. The two players have their positions and rotations and mechanim variables synced properly

    With a working example of that we feel we could really dive in and get somewhere, right now we seem to be spinning our wheels trying to figure out which tutorial is relevant and which are not.

    Thanks anyone and everyone!






     
  12. PlayICG

    PlayICG

    Joined:
    Jul 17, 2014
    Posts:
    6
    hi guys, is forge networking in asset store includes Forge Bare Metal?

    if not, where should i buy the forge bare metal version?
     
  13. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    We have just pushed out version 19.2, which contains a really in depth documentation on everything for Forge Networking. Please look at the pdf ForgeNetworking_Documentation.pdf in the package for any questions that you need answered.
     
    nxrighthere likes this.
  14. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    This seems like a really good idea. We did have a Mechanim video that showcased how to sync the animation over the networking here
    ,
    the project is also available on our website developers.forgepowered.com/Profile and is available to download there. We do not have client side prediction enabled there but we can work on a more thorough example of it as well. I'll add it to our todo list.
     
  15. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    It does not include Bare Metal, bare metal is a product still under development as we had to focus on Documentation and Stability for Forge Networking before we came back to it. After we push out this next big bug update, we plan on working on some integration packages for people as well as Bare Metal. :)

    When it is available, it will be located here: http://developers.forgepowered.com/Profile
     
  16. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94
    Is there any way of getting a list of all the players in game? Like NetworkingManager.Instance.Players, but it is not synced..........
     
  17. connectt01

    connectt01

    Joined:
    Aug 14, 2014
    Posts:
    4
    Hello, I have a couple of quick questions, no one seems to respond at the other Forge forums so I'll just ask here.

    So when I join my own server, maybe 50% of the time I get an error message on the server ("Mal-formed defalut communication from IP", it also has a type-o) and as a result the client will not connect to the server even though it fires the connected event. Also, when I do manage to connect, the client will randomly disconnect after a while which might be related. Note: it doesn't happen for others joining my server. This problem is not a really big deal though, but it's a bit annoying.

    The other question is not specific, it's more like a request for advice. We moved our almost ready for publishing game to Unity mainly because of networking problems (for example, high bandwidth). When I've found Forge, I was really excited when I saw that it pretty much has all the features that I needed to implement. Everything works great, but recently I've found that the server's upload rate can go as high as 100-250 KB/s, which way too much for 2 players and it's like 10x more than we used to have on the other engine and we currently don't even have many things being synced. So I would like to ask if the developers of Forge could sometime add some useful optimization tips for usage of their engine to the documentation or also answer here. For the record, I'm using quite a few NetSync vars (around 10 per game object, quite a few of them usually don't change, but most vars are float and Vector2, which I think should be expensive) and a bunch of RPCs.

    Thank you for any support!
     
  18. BadViking

    BadViking

    Joined:
    Jul 16, 2015
    Posts:
    15
    I'm having trouble with server authority and client side prediction (in a 2D project). I get very jittery movement (even using the 3D examples). I've tried playing around with disabling/enabling client-side prediction, playing with the lerp values, changing the authoritative sync distance. Nothing seems to result in smooth movement.

    I don't actually even need 100% real-time updates for my game, it would be acceptable to have a slight delay if it meant smoother movement. Any help would be much appreciated!
     
  19. digitalzombie

    digitalzombie

    Joined:
    Dec 10, 2007
    Posts:
    86
    Hello,

    How can/does Forge support the concept of rooms? Lobby, area or game 1, 2, etc.

    Thanks.
     
  20. digitalzombie

    digitalzombie

    Joined:
    Dec 10, 2007
    Posts:
    86
    Where is the best place for pre-sales questions?
     
  21. TheGrimsey

    TheGrimsey

    Joined:
    Feb 10, 2016
    Posts:
    3
    How does the Resource Directory in Networking Manager work?
    I don't seem to be able to make it work.
    I have a folder structure like this: Game -> Resources
    and when I put in Game\Resources\ into the Resources Directory it doesn't work and I can't Instantiate it over the network.
    I have tried using / instead of \ and removing the \ from the end.
     
  22. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    to the first thing - Does this occur when a client is already connected from the same ip?

    to the second thing - ManualNetSync is definitely what you want to use for net syncs that aren't updated often. Unless it needs to be constantly streamed to all clients, I strongly recommend using ManualNetSync
     
  23. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    We'd need a lot more information about your setup, and perhaps a trimmed down version of the project. But this sounds like something that occurs when you have multiple NMBs with one or more parented to another NMB. This is not currently supported, but you could always set it up yourself.
    Also if you want custom interpolation you need to make that yourself, we can't make interpolation settings to fit every scenario, just a useful one to fit most cases.
     
  24. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    You can find query contact information on our website, send a direct message to me or write into this thread.
     
  25. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    At the moment, you need to put the objects into the NetworkingManager object's inspector, with the NetworkingManager in the scene
     
  26. TheGrimsey

    TheGrimsey

    Joined:
    Feb 10, 2016
    Posts:
    3
    Ok. I did that and now when I instantiate an object it makes 2. Code for spawning:

    Networking.Instantiate("Cube", NetworkReceivers.AllBuffered, OnPlayerSpawn);
     
  27. serdar-tepeyurt

    serdar-tepeyurt

    Joined:
    Dec 5, 2014
    Posts:
    1
    Hello,

    Can you give an estimate on when you're going to release Bare Metal? In our next project we're going to need that functionality.

    I like your stuff, and I really want to use Forge Bare Metal. So if release is not coming anytime soon, can we get beta version for development?

    Thank you.
     
  28. robinlancee

    robinlancee

    Joined:
    Feb 7, 2013
    Posts:
    20
    Hello, i try to get Serverping like 1-999 in serverbrowser but i can't make it working.

    is there something like host.ping
     
  29. djgriff

    djgriff

    Joined:
    May 29, 2014
    Posts:
    279
    Hi i am new to Multiplayer and been reading up on different frameworks for this.. i got PUN+ some time ago on sale but never got round to use it.

    I found a thread discussing the differences in available networks/frameworks and Forge was being shouted out as a really cool good way to go until i got to the end of the forum thread and a guy who was raving about it suddenly damns Forge.. apparently there is some major bugs.

    He states it was really hard to get hold of support and when he did you were kinda dismissive. see the post below.
    ( can be found here :http://forum.unity3d.com/threads/mu...link-darkrift-forge-and-playfab.294852/page-4 ).

    Im kinda looking for some reassurance that you guys are still active on this asset.. also there is no way to contact you guys via email or anything on your site.. not very encouraging..

    Thanks

    Daniel
     
  30. robinlancee

    robinlancee

    Joined:
    Feb 7, 2013
    Posts:
    20
    I need some help i have portforward 15937 and 15939

    When i run masterserver and host an server, on local it works perfect, server show up in Serverbrowser.
    When i send the Client files to friend of mine he don't see any servers in the serverbrowser.!


    Normally if we open the socket port need open for all when have portforwarded but it will not be opened! Other ports 80 etc works fine.

    I help someone can help my with this!
     
    Last edited: May 9, 2016
  31. djgriff

    djgriff

    Joined:
    May 29, 2014
    Posts:
    279
    you shouldn't have to pay for it, you already have ;) . hope support comes back to you . GL with it
     
  32. djgriff

    djgriff

    Joined:
    May 29, 2014
    Posts:
    279
    I hope this isn't a dead asset it looks really cool.. come on guys check your forum ;)
     
  33. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    Where are you executing that line?
     
  34. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    Hey there!

    Yes bare metal is still being actively worked on. Please keep an eye on our blog site for news on Bare Metal.
    http://beardedmanstudios.com/
    It is still an active priority but we aren't quite ready to give a specific date for a full release of Bare Metal.
     
  35. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    Hey, I'd that is a tricky question to answer especially as I'm sure you'd find it more reassuring if it was coming from someone who is unbiased and doesn't represent forge at all but I'll do my best :).
    First I'd like to briefly explain the support pipeline for forge as that seemed to be a primary point.

    Everyone who purchases forge is added to a community slack chat, you have numerous people who can offer beginner support and direction to tutorials as well as all of the devs being contactable there. We all have our emails accessible there and the Unity Asset store page lists our support email support@beardedmangames.com.
    We have developers on the West Coast (USA) and in the UK so support is available to a pretty wide variety of timezones.

    We are absolutely active on this asset on a daily basis. Feature additions, bug fixes and documentation is being added regularly.

    In response to the thread you linked,
    Unfortunately it is a reality of programming middleware that it can be frustrating getting the system working for certain use cases. And although we strive to provide the best user experience wherever we are not succeeding people will inevitably be frustrated.

    We've addressed this massively in 2016 by completely revamping our large collection of tutorials, providing both text and video versions for each tutorial. And making a completely new API documentation with formatted examples and information attached to every major class/member. We've heavily focused on stability and certainly improved forge's overall reliability considerably.

    We respond to messages consistently, help address even use case issues and are transparent about it when we find an internal bug in forge and update the affected users with hotfixes asap.

    Hope this reply is helpful!
    Cheers
    - Mark
     
  36. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    Check if your firewall has a rule for the port
     
  37. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    Haha the answer is going to be a little technical I am afraid, a server can't register to the master server with it's ping. Because it is the client looking at the server browsers's ping to each server that needs to be displayed. So you'd need to make the client ping each server and display the result when the response is received.
    1. I'd start by testing a ping to a server if you haven't with forge yet. (API Documentation)
    2. Then create a space in the UI for the ping to be displayed.
    3. Iterate over the servers, ping each of them.
    4. In the delegate/method that handles the response from the ping, the method will need to find the appropriate space in the ui to display the ping.
    Step 2,3 and 4 all need to be done on the client when the response from the master server is received.

    There are a few ways you could do this, feel free to ask any further questions on the forge slack or contact me at mark@beardedmangames.com
     
  38. djgriff

    djgriff

    Joined:
    May 29, 2014
    Posts:
    279

    Hi Mark,

    Thank you for taking your time to come back to me in detail. I'm not sure how i missed your email address, please excuse me for this.

    Its great to know that it is fully supported as i was just about to delve into DarkRift and see what that has to offer.

    As this is fully supported and actively being developed i think i will invest some time and see what its got to offer. Sounds good that your tutorials are upto date as this is normally a big stumbling point with assets on the store.


    Many thanks

    Best

    Daniel
     
  39. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    No problem!
    Best of luck :)
     
  40. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    UPDATE

    Websockets Alpha is getting ready to go out! Also we have been working extremely hard on many new and exciting things. One of the exciting things (which is the largest news since Forge Released) is something that Brent came back to work on. Forge is under extreme development; we have many expectations for its growth and its future. These changes, of course are free to Forge Owners. We expect Forge to be the #1 go to platform for networking. Thank you to all of our supporters and feedback that has made this networking solution possible.
     
  41. ddesmond

    ddesmond

    Joined:
    Feb 9, 2010
    Posts:
    163
    This package looks interesting and after a couple of hours of reading posts, just purchased it. I haven't had the time to use Unity for over 6 months, but this has got me interested again and will need to make some time. Are there any docs for wifi games?
     
    CarterG81 likes this.
  42. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hello there! :)

    So all of the tutorials we have, the documentation that comes with the package, and the API work on WiFi. This is because WiFi acts the same as the standard internet, just with a few less steps and things to do. Messages are sent and received in the same way which makes building local and internet games a breeze as there is one code base :).

    Also thank you so much for supporting! We have a ton of updates coming out soon so be sure to sign in on Slack (if you haven't already) and subscribe to our subreddit :)
     
    CarterG81 likes this.
  43. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94
    Okay. Now I am new to Forge so please bear with silly questions.

    "Join Server with above IP address" will search the internet for the IP or just join the server with that IP on LAN?
     
  44. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    IPs themselves are either a lan IP or an IP over the internet
    for example 127.0.0.1 is the typical lan ip
     
  45. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94
    So if I provide a internet IP it will join an internet game hosted by some1 else in the world?
     
  46. FisherM

    FisherM

    Joined:
    Dec 28, 2013
    Posts:
    366
    correct, if there are issues with connecting you need to make sure the port you are using is port forwarded and a rule in your firewall allows the port to have connection
     
  47. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94
    Oh ok thanks for the reply :D ! So I will need to port forward if I want to make an online game without server.......
     
  48. Leonid

    Leonid

    Joined:
    Aug 20, 2013
    Posts:
    90
    Hi guys!

    In my game there is a bonus which is spawned by server (owner = server).
    And i have a client player, which supposed to get that bonus by coming close to it, and then the bonus must be destroyed, and client player should get a extra health.
    I was trying to use [NetSync], but it only translate FROM owner, but not TO owner.

    Shorter - i'm trying to find a way to pass data from serialized objects to owner.

    Please help me to solve this problem.
    Thank you!
     
  49. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Yes, but some new stuff may be coming very soon that will change this :)
     
  50. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hi there :) Give this logic a shot with BRPC instead of using NetSync. You can detect on the server when the client gets close to this bonus. When the client should get the bonus, the server can send an RPC that the client has received it and then the client can do any logic that it needs for when it gets the bonus :)
     
    CarterG81 likes this.