Search Unity

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

[NO CCU LIMIT] Forge Networking now OPEN SOURCE

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

  1. Rowell

    Rowell

    Joined:
    Sep 22, 2014
    Posts:
    27
    Yup, definitely registered on the developer site, and I have downloaded the latest files there. But not able to get into Slack.
    Thanks for highlighting the RPC issue...it's been killing me.
     
  2. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    No problem! Thanks for the update. Do you mind sending a support email asking for a slack invite using the email address you used to sign up athttp://developers.forgepowered.com/? Just have "Registered User Slack Invite" in the subject line so I can filter for it :)
     
  3. GCatz

    GCatz

    Joined:
    Jul 31, 2012
    Posts:
    282
    hey, is there any updates in regards for supporting WebGL ?
     
  4. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    @CarterG81, Are you by chance sending the RPC right off the bat when it is created? Can you put it in NetworkInitialized instead?
     
  5. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Just wanted to make another post on what Brent said earlier. I am indeed taking on the project and will be pushing out updates throughout this week to our GitHub Users. After that I will push an update over the weekend to Asset Store with the latest and greatest. If you need GitHub Access, please PM on Slack so that I can validate your information. Thanks!
     
    nxrighthere and elias_t like this.
  6. pauarb

    pauarb

    Joined:
    Oct 22, 2013
    Posts:
    13
    This is amazing to hear that you guys are back. Really wanted to use forge for my project, but was sceptical when there was no response from you guys for such a long time. Might look into reviving the project now, but will need to keep an eye if you truly keep up with updates, or disappear again ;s

    Best of luck to you, I really really hope everything will be stable and i'm stoked to hear about all the upcoming updates, new documentations, tutorials and everything else.
     
  7. Milad

    Milad

    Joined:
    Aug 17, 2010
    Posts:
    67
    Is it possible to create lobby and room?
    thanks.
     
  8. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hey, if you get setup with Forge, feel free to ask for GitHub access via PM to me or @Cranick that way if we are out for a week or so you still have the support of the community who is submitting pull requests.
     
  9. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Yes :). Are you a part of the Slack chat? If so I know a few people have already done this in there. They may have some suggestions on what they have done. We can definitely make a tutorial for this at some point as well.
     
  10. sakdeniz

    sakdeniz

    Joined:
    Jul 21, 2015
    Posts:
    7
    Hi guys, i am using a kit for fps game but its using Photon framework. I want to use Forge on my project, but i am not sure possible convert Photon codes to Forge. Is it hard this process and can somebody do this job for money?

    Kind regards.
     
  11. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Absolutely! Instead of room properties, we made a mechanism that is somewhat similar called 'Cache'. You can take a look at ForgeDemoCache to see how it is we are setting properties in what you would consider a 'room' and then requesting that data from the server on the client.

    This allows you to keep the flexibility that forge is while also allowing you to expand on what you are used to in photon. :)

    Hope this helps and please feel free to reach out to us on Slack if you need further assistance.

    Edit: Also want to note that there are a few people already who are hiring others to convert their code to Forge out there but I do not know of them personally. It isn't necessarily a hard process but could be a tedious one if you have a lot of networked code not already encapsulated as standard procedures we recommend encapsulating your code so that you are free to choose any networking solution that works best for your needs.
     
  12. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    We plan on supporting it in the future but it does not work with it out of the box yet.
     
  13. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94
    I am developing an online multiplayer football style with Forge Networking. In my game each client player has a sphere collider trigger in front of them, there's a ball in the scene already(not network instantiated), when the ball enters the sphere trigger it becomes a child of that gameObject and moves with the player. Now any other player can take this ball from the player which has the ball just by going towards it and letting the ball come in their sphere collider(trigger). If they do so the ball now becomes a child of that other player.

    I was able to sync player positions but when I tried the same with the ball it doesn't work(it lags on the clients)
    Here's link of what I exactly mean:


    Thanks for your time! :)
     
  14. pauarb

    pauarb

    Joined:
    Oct 22, 2013
    Posts:
    13
    When can we expect more tutorials and documentation? Another thing is, the video tutorials that are available have horrible quality. It's near impossible to see most of the things in the videos.
     
    nxrighthere likes this.
  15. minhthinh

    minhthinh

    Joined:
    Sep 22, 2013
    Posts:
    2
    It seem LanDiscovery function not work for Android. I have built with version 18 and run the example on Android device, when press the button Find on Lan, I get this message "Unable to find libc". Any wrong with me? This feature support for Android?
     
  16. wahyuway

    wahyuway

    Joined:
    Oct 7, 2013
    Posts:
    84
    I had a problem with AndroidJavaClass and AndroidJavaObject :
    Assets/Bearded Man Studios Inc/Forge Networking/MainScripts/Bluetooth/BluetoothSocketWrapper.cs(36,39): error CS0246: The type or namespace name `AndroidJavaClass' could not be found. Are you missing a using directive or an assembly reference?

    How can i fix this? i use unity 5.3.2. Tks
     
  17. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    There is a bug in Firefox that loads HTML5 videos in 320p. You will either need to enable the Flash player or use a different web browser like Edge or Chrome. I have looked into various export options to test this but YouTube seems to have HD for some and not for others in Firefox. At this point I think it is a way with how YouTube encodes the videos. We are working on new tutorials now and there should be updates along the way along with comment documentation updates in the code.
     
  18. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    I believe that we have a fix for this on our GitHub repo that hasn't been pushed out as a release. @Cranick should be pushing out the merge release soon. Otherwise you can PM me or him on Slack for GitHub access.
     
  19. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    This can be fixed by deleting the Bluetooth folder for your version. There are fixes for this on the GitHub repo (same as previous post) that should go out for this issue.
     
  20. Brent_Farris

    Brent_Farris

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

    So you are probably going to send out an RPC to everyone once a client "picks up" the ball. This way the clients simulate the ball as if it were attached to another player. Otherwise they are simulating it without the notion of the ball being picked up. I would suggest that you implement a system where updates for the ball's position stop once that RPC is sent. Then once you stop the messaging for the position, simulate the ball as if it were parented to the player. When the collision happens call an RPC for stealing, and if it was dropped then turn back on the replication for position :).
     
  21. wahyuway

    wahyuway

    Joined:
    Oct 7, 2013
    Posts:
    84
    Ok thank you. FIx that problem.

    But i got constant crash, the 2nd i run the scene to connect to my server. Been search slack but the suggestion there doesnt work. I just play the demo to connect to my server to learn how the forge work. Any other suggestion?

    PM you on slack for accessing github repo. Tks
     
    Last edited: Mar 5, 2016
  22. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94

    [EDITED / Updated]

    Thanks :) ! It works like a charm. But sometimes (probably when I can an RPC to make the ball's transform.position = ballholder.transform.position every frame) I get an execptional error :

    Code (CSharp):
    1. Exception: Only NetworkedMonoBehaviors can be used for serialization and deserialization across the network, object with id 2 is not a "NetworkedMonoBehavior"
    2.   at BeardedManStudios.Network.NetworkingStream.Consume (BeardedManStudios.Network.NetWorker socket, BeardedManStudios.Network.NetworkingPlayer sender, BeardedManStudios.Network.BMSByte message) [0x00000] in <filename unknown>:0
    3.   at BeardedManStudios.Network.CrossPlatformUDP.PacketReceived (System.String endpoint, BeardedManStudios.Network.BMSByte bytes) [0x00000] in <filename unknown>:0
    4.   at BeardedManStudios.Network.CrossPlatformUDP.ReadAsync (System.Object eventSender, System.ComponentModel.DoWorkEventArgs e) [0x00000] in <filename unknown>:0
    5. UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    6. UnityEngine.DebugLogHandler:LogException(Exception, Object)
    7. UnityEngine.Logger:LogException(Exception, Object)
    8. UnityEngine.Debug:LogException(Exception)
    9. BeardedManStudios.Network.CrossPlatformUDP:ReadAsync(Object, DoWorkEventArgs)
    10. System.ComponentModel.BackgroundWorker:OnDoWork(DoWorkEventArgs) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/System/System.ComponentModel/BackgroundWorker.cs:168)
    11. System.ComponentModel.BackgroundWorker:ProcessWorker(Object, AsyncOperation, SendOrPostCallback) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/System/System.ComponentModel/BackgroundWorker.cs:125)
    12.  
    Looks like when I press left click to shoot it occurs at that time. And also theres no object with ownerID or networkID 2 if I have not mistaken. What does that error really mean and why does it come?

    We are group of 5+ people working on this game for a Steam release. I kinda have no idea what will be the next step after we get the networking done, like do we need to buy our own servers or we can ask other people to host it, what is a master server etc etc. And how long will you continue supporting Forge? I read somewhere that you already stopped working on Forge......

    We appreciate your time and help! :)

    [EDITED : END]


    [OLD and can be ignored...]
    What should that RPC do? How should I tell to stop syncing the position of the ball whilst other player has it?

    I kinda fixed the problem by changing the owner(OwnerID) of the ball to whoever owns it and if nobody does then the server will own the ball. Is this a more efficient way to do or should I do as you suggested? Also I am getting few BRPC errors if you can help me with it here's a link :



    *Watch the video then....*
    No where in any of my script i have call that "ServerChangeOwner" BRPC still I am getting that error. What is it really about? Can you help me fix it? Also there was that lag just after I try to shoot the ball....

    Thanks for your time! :)
     
    Last edited: Mar 6, 2016
  23. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    This looks like you are getting the wrong id, probably the id of a SimpleNetworkedMonoBehavior instead of a NetworkedMonoBehavior when serializing object member data. This may be a bug, are you using the latest version from GitHub?

    You can pick what works best for your game. The cheaper option would be to have your players host the game. Otherwise you will need to host all of the games and without a long term plan for consistent income (like subscriptions) that could get expensive.

    I am not sure where people are saying this but Forge is very much alive and vibrant. We are working on bug fixes and I committed some new fixes to GitHub today. There are no plans for support to stop for Forge Networking. :) So come join us, we are here to stay :D
     
  24. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94
    I have the free version from your website (which i downloaded on 1st March) as I kinda cant afford the paid one I will buy it after we are done with the networking of our game.

    About the error I'lll try removing SimpleNetworkedMonoBehavior where ever I have used. Can it be a problem with the free version?
     
  25. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Ah, no problem

    It might very well be. The free version was built out of a stable version a while back for evaluating the system. We have had a huge amount of updates since the free version, I'll have to see what is going on with that. I'll have to look what version the free version was built from and see what updates there have been since that is* :)
     
    Red_Kay likes this.
  26. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94
    Ok thanks :) Can you tell me when should I check for the update?
     
  27. daddylonglegs2014

    daddylonglegs2014

    Joined:
    Feb 13, 2016
    Posts:
    7
    I was testing the authoritative and client prediction feature, but I've noticed some jerky moving, rubber-band as showing in the following video. Even I've changed the Sync Distance to 50 but it still happens.
    On the latency 500ms, you can observe the object jumping. I think the correct result should be allowing player on the client side to control the object moving smoothly without any jerky. As currently, this make the game unplayable.
    This is my brief code:


    Code (CSharp):
    1.  private void InputUp(KeyCode keyCode, int frame)
    2.     {
    3.         Debug.Log(keyCode.ToString() + " was released and this is " + (!OwningNetWorker.IsServer ? "not" : "") + " the server");
    4.         switch (keyCode)
    5.         {
    6.             case KeyCode.UpArrow:
    7.                 arrowKeyDowns[0] = false;
    8.                 //transform.position += Vector3.up * speed * Time.deltaTime;
    9.                 break;
    10.             case KeyCode.LeftArrow:
    11.                 arrowKeyDowns[1] = false;
    12.                 //transform.position += Vector3.left * speed * Time.deltaTime;
    13.                 break;
    14.             case KeyCode.DownArrow:
    15.                 arrowKeyDowns[2] = false;
    16.                 //transform.position += Vector3.down * speed * Time.deltaTime;
    17.                 break;
    18.             case KeyCode.RightArrow:
    19.                 arrowKeyDowns[3] = false;
    20.                 //transform.position += Vector3.right * speed * Time.deltaTime;
    21.                 break;
    22.         }
    23.     }
    Code (CSharp):
    1. private void InputDown(KeyCode keyCode, int frame)
    2.     {
    3.         switch (keyCode)
    4.         {
    5.             case KeyCode.UpArrow:
    6.                 arrowKeyDowns[0] = true;
    7.                 //transform.position += Vector3.up * speed * Time.deltaTime;
    8.                 break;
    9.             case KeyCode.LeftArrow:
    10.                 arrowKeyDowns[1] = true;
    11.                 //transform.position += Vector3.left * speed * Time.deltaTime;
    12.                 break;
    13.             case KeyCode.DownArrow:
    14.                 arrowKeyDowns[2] = true;
    15.                 //transform.position += Vector3.down * speed * Time.deltaTime;
    16.                 break;
    17.             case KeyCode.RightArrow:
    18.                 arrowKeyDowns[3] = true;
    19.                 //transform.position += Vector3.right * speed * Time.deltaTime;
    20.                 break;
    21.         }
    22.     }
    Code (CSharp):
    1.  
    2.     private void Update()
    3.     {
    4.         // Check for a right arrow down or up and request on server if changed
    5.         InputCheck(KeyCode.RightArrow);
    6.  
    7.         // Check for a left arrow down or up and request on server if changed
    8.         InputCheck(KeyCode.LeftArrow);
    9.  
    10.         InputCheck(KeyCode.UpArrow);
    11.  
    12.         InputCheck(KeyCode.DownArrow);
    13.         // Check for a left mouse button down or up and request on server if changed
    14.         //MouseCheck(0);
    15.     }
    Code (CSharp):
    1.  private void FixedUpdate()
    2.     {
    3.  
    4.         if (arrowKeyDowns[0])//up
    5.         {
    6.             transform.position += Vector3.up * speed * Time.fixedDeltaTime;
    7.         }
    8.         else if (arrowKeyDowns[2])//down
    9.         {
    10.             transform.position += Vector3.down * speed * Time.fixedDeltaTime;
    11.         }
    12.  
    13.         if (arrowKeyDowns[1])//left
    14.         {
    15.             transform.position += Vector3.left * speed * Time.fixedDeltaTime;
    16.         }
    17.         else if (arrowKeyDowns[3])//right
    18.         {
    19.             transform.position += Vector3.right * speed * Time.fixedDeltaTime;
    20.         }
    21.     }
    Am I doing any wrong?. Anyway thanks for creating an awesome networking library.
     
  28. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94
    Even I tried using server authorative controls and it was rubber banding as hell for me. Are you too using the free version of Forge Networking?
     
  29. tr1stan

    tr1stan

    Joined:
    Jan 23, 2009
    Posts:
    150
    Hello,

    I'm new to Forge and I have a few quesions

    1. I used uLink before and I'm looking for swtich to Forge. I heard Forge is like ulink that runs on Unity instance and understands physics. I'm going to develop a game where all clients send command to a headless server, the server controls all the game logic and sync units state with clients. Can you give me some hints on how to create such struture with Forge? I saw all the demo and tutorials for Forge so far looks like a P2P structure where the server is also a client.

    2. How does Forge handle multiple session in one game instance? My game is room-based so there will be many game session running at the same time. Previously with uLink we have the Group function to separte physics between each game sessions. How about Forge?

    Thanks
     
  30. cr4y

    cr4y

    Joined:
    Jul 12, 2012
    Posts:
    44
    Hi,

    We decided that we need to embed (simplest possible) http server inside our game. We need to be able to send JSON to it from Java (or commandline for test purposes).
    Does your library support such thing?

    Cheers,
    Kris
     
  31. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94

    [Updated]

    Also can you tell how do I go about syncing game time? I tried by using [NetSync] on "float time" and then update "time" every frame but it makes everything buggy and slow as hell. I dont think so serverTime will help as I also want the game time to pause at certain points.....

    [Updated - END]

    Hey!

    I have a new doubt can I clear all the values that were synced while disabling the position sync on the ball. Something like ClearBuffer(). Basically everything is fixed but now I am facing some rubber banding when I try to shoot the ball from the client. Looks like it tries to go to the previous position where Ball position sync was enabled.......

    And to disable and enable ball position sync I am calling 2 RPCs:
    Code (CSharp):
    1. [BRPC]
    2.     void BallTaken()
    3.     {
    4.         iHaveBall = true;
    5.         ballGO.transform.position = this.transform.position;
    6.         ballGO.transform.parent = this.transform;
    7.         ballRB.velocity = Vector3.zero;
    8.         ballRB.angularVelocity = Vector3.zero;
    9.         ballRB.Sleep();
    10.         this.GetComponent<SphereCollider>().radius /= 2f;
    11.         RPC("DisableBallPositionSync");
    12.         Debug.Log("Ball Taken!");
    13.     }
    14.  
    15.     [BRPC]
    16.     void BallDropped()
    17.     {
    18.         iHaveBall = false;
    19.         this.transform.DetachChildren();  
    20.         StartCoroutine(ResetCollider());
    21.         //StartCoroutine(CallEBPS());
    22.         RPC("EnableBallPositionSync");
    23.         Debug.Log("Ball Dropped!");
    24.     }
    25.  
    26.     [BRPC]
    27.     void EnableBallPositionSync()
    28.     {
    29.         ballNMB.serializePosition = SerializeVector3Properties.XYZ;
    30.         ballNMB.interpolateFloatingValues = true;
    31.         ballNMB.lerpPosition = true;
    32.         ballNMB.lerpRotation = false;
    33.         ballNMB.lerpScale = false;
    34.         ballNMB.authoritativeSyncDistance = 0.5f;
    35.         ballNMB.authoritativeTeleportSyncDistance = 50f;
    36.         ballNMB.authoritativeSyncRotation = 0f;  
    37.     }
    38.  
    39.     [BRPC]
    40.     void DisableBallPositionSync()
    41.     {
    42.         ballNMB.serializePosition = SerializeVector3Properties.None;
    43.         ballNMB.interpolateFloatingValues = false;
    44.         ballNMB.lerpPosition = false;
    45.         ballNMB.lerpRotation = false;
    46.         ballNMB.lerpScale = false;
    47.         ballNMB.authoritativeSyncDistance = 0f;
    48.         ballNMB.authoritativeTeleportSyncDistance = 0f;
    49.         ballNMB.authoritativeSyncRotation = 0f;
    50.     }
     
    Last edited: Mar 7, 2016
  32. wahyuway

    wahyuway

    Joined:
    Oct 7, 2013
    Posts:
    84
    I had to force close application or unity editor hundreds time. This bug annoy me and slow down my development.
    Please fix this.. please. Tks
     
  33. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Was this using version 19? If so could you describe the actions you take to cause the crash?
     
  34. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Interesting, are you using the latest version? If so do you have access to Slack?
     
  35. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Forge is an authoritative server structure (Not P2P), however it does allow for the server to act like a client. Since Unity's built in Physics system is not deterministic you may see some issues on simulations, but if you are syncing those objects on the network then they should simulate pretty well. Could you give a little more on what you are looking into doing? Like sending one packet with unit states or constantly updating all units at any given moment?

    You can run many "rooms" and we as well as our users have done such a thing. The one thing you need to be aware of is the Unity scene and Physics will have issues if the server is trying to simulate many things in the same place.
     
  36. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    We support sending text over the network, are you looking to have a HTTP server though?
     
  37. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    The NetworkingManager has the ability to sync the game time, just set the update interval to something like 1.0 and the clients will simulate the time in-between each update locally.

    Hmmm, let me double check this. Are you a part of the Slack chat? I'm about to head to so if you have Slack maybe someone can help you out faster on there than I can. I'll also ask @Cranick to have a look at this
     
  38. wahyuway

    wahyuway

    Joined:
    Oct 7, 2013
    Posts:
    84
    Yea its latest 19.

    I produce it like this:
    1. Play with ForgeQuickStartMenu and click "Join server with above ip Address"
    2. when the game cannot reach the server, it throw "Connection could not be established"
    3. Press play mode off and then press play mode again the game again, unity will freeze and not responding.Been tried some suggestion on slack channel (such as put Networking.NetworkingReset() in OnDestroy), but still crash. Cant found any solution.

    Any help please.
     
    Last edited: Mar 9, 2016
  39. daveywj

    daveywj

    Joined:
    Mar 9, 2016
    Posts:
    1
    Hi there Farris, I'm really new to this (even Unity itself) so I hope you won't mind the amateurish question but I hope you can point me in the correct direction and I will be really grateful.

    I have completed watching all your tutorials and I think I'm getting a good grasp of how things work with Forge, however I'd like to know how can I handle databases? Is this a Forge networking relevant question?

    This is the context, I am trying to make an MMO mobile game with an authoritative server, and this server will presumably be in charge of ensuring that the players' data, such as what items they have, what is their stats (damage, armor, hp), to not be tampered with on the client side. Hence to capture the players progression, I will need a database to contain each players information and not leave it to the client side to store that data. Am I right to say that somehow I should be having the server store these data in a local database or bridge to another server to store that data?

    For example I want to store :
    username : asd159
    Level : 6
    Item IDs : 001,003,005

    I will need these to be stored every time something is done on the client side and when it communicates with the server. Is there some documentation on this or should I be looking at another unity custom asset to deploy to the server build?

    I hope I am making sense in what I said as I am very amateurish but I really hope I can successfully create this game. Would really really appreciate any guidance you can give me.

    P.S. I am looking at using Amazon Web Services as a cloud hosting solution, that is viable right? I think I saw something about EC2 in one of the tutorial sections.


    Dave
     
  40. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    @wahyuway and @nxrighthere I'll create a bug report for this for the 2 guys to check out. It seems like when you fail to connect in the latest version a thread will stay open, should be an easy fix and we'll add it to the next build if this is indeed the case. Your ticket has been created as FN-109, see the attached bug report.

    Thanks
     

    Attached Files:

    Last edited: Mar 9, 2016
  41. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    No problem! :D

    This isn't really a Forge related question but I can say that we have a basic built in HTTP client. So you can do any REST calls you need to an external (or internal) API for interacting with a database. It is my professional opinion that your database does not have direct interaction with the game client, this is a huge security risk. Instead, use a common protocol like HTTP with a REST pattern. You can do this pretty easily with some PHP, Apache and MySQL.

    Yes, :) you will want to persist the user data to an accessable database. If you are using an authoritative server then you can easily gain a ton of security by only allowing access to localhost, even on your HTTP port so you don't have to even open a firewall to the REST api. Of course you can also have your database reside on another server in your internal network and do about the same and only allow connections to the internal IP address range that you use. But you are correct, you will want to persist this data to an external database.

    We don't have documentation directly but some strategies you will want to use is a relational database (like MySQL or MSSQL) which will hold the data for a long period of time and then a caching layer (like Memcachd or Couchbase) to quickly grab data without having to ping the database all the time. These cache systems often are "in-memory" with the option to persist to disc. In Forge we actually have our own Key-Value cache store on the game server that you can use as well as seen here - http://developers.forgepowered.com/Tutorials/MasterClassIntermediate/Using-The-Cache-System

    My advise is to do some research on the LAMP (linux, apache, mysql, php) stack and learn a bit about how to create a REST/HTTP service for your game to access. That is a good starting point when it comes to databases, after that you can move on to cache systems and how they can greatly improve performance at the cost of memory (RAM).

    Yes, there is a free tier on Amazon EC2 that you can use for testing. You can also use other hosting providers like Rackspace or Microsoft Azure :)

    Hope this helps!
     
  42. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94
    I did'nt quite understood what you meant? Update interval is already 1.0 and there's no networkManager.gameTime.
    As of now the owner with ID 0 (i.e the host) can only update gametime clients cant they get the time synced from the host...............

    No I am not as I have the free version. I am going buy it soon,

    And did you guys seriously forgot to make a way of getting the instantiated gameObject(player)? It's pain in the ass to get it!
     
    Last edited: Mar 10, 2016
  43. jjobby

    jjobby

    Joined:
    Nov 28, 2009
    Posts:
    160
    Hi Farris

    If possible, I would like to do something like this.

    At the start, player interacted with NPC to trigger quest. Then the player were transferred to their own world (or instance?) to fight boss or play mini-game. After finish the objective, the player were transferred back to server world as you can see at 6:00 It would be really nice if the process is seamless like in the video. Is it possible for Forge to do it? Or do you have any solution for this scenario?

    Another question, do you have any tutorial or demonstration about how to hand over player or object from map server to other map server? For example, when the player or object move from current map to another map.
     
    Red_Kay likes this.
  44. ivendar

    ivendar

    Joined:
    Feb 18, 2010
    Posts:
    242
    I'd like to ask some questions that maybe have already been answered but I'm sorry to ask as I'm not able to find those answers.

    1. Would Forge work with using root motions for mecanim. If looking at this tutorial it shows that it uses the variables for mecanim animations, but it also says do not use serializing of variables to move the characters across the network. So I'm not sure how that is meant and better ask, as the controller I have is using root motions. So would I have to get rid of the root motions for this to work ?

    2. Has this been tested with playmaker already or is there any info if it works, or any tutorials ? Same here I just can't be able to find better infos or tutorials anywhere. Basically I would expect if I make a variable global then Forge should be able to read it and send it over the network ? But if that's really the case. Hmmh not sure as I'm no programmer.

    Thank you
    Best Regards
     
  45. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Hello there!
    Brent was referencing the NetworkingManager.Instance.ServerTime, that would be the one that is always correct and up to date with what the server has.

    The Instantiated gameobject has a callback which will return the GameObject in the callback that you provide.

    Hope this helps! :)
     
  46. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    That's pretty awesome. To us it is really just all visual. You can just transfer the player to a temporary location outside of what the other players are at or you can layer it in the Camera for it only only show those monsters in that world for those users in it. There are many different ways to tackle it but it can be possible if done right.

    We don't have any example of handling data from 'map' to another 'map' as it is just Networking and the whole game itself is still designed and implemented by you to determine how that transition should take place. I recommend on storing that data in an object to send to each client as necessary when they move from 'zone' to 'zone'. There is a lot of methods to handle this interaction but from what I understand is that you can just simple have zones in the world that are outside normal player interaction that clients would then connect to.

    You can even have a dedicated instance server that the players would connect to where you would pass the information from one server to the next of that player in that way the servers handle their data separately.

    Hope this helps!
     
  47. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    If I am to understand your first question, I presume that all clients would handle everything in the same way. In that way yes you would want to make sure that the base layer of the animation is syncing properly by the network, the rest of the animations can simply just be running as normal w/o syncing any additional variables. Depending on the complexity of the animations and how much of it you want to be EXACTLY synced over the network is where you would handle in your own ways.

    Playmaker is a separate tool, we do not say we support it out of the box but I don't see why it couldn't have some basic support on what it does. You would have to understand how the networking works with playmaker for it to be as usable but at the moment the answer to that is it doesn't support it out of the box, but it can if needed to. So yes and no that if it had a global variable it would indeed sync that over the network, but how those objects are created and used is entirely separate.
     
  48. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Version 19.1 Released!
    • Bug fixes for Resources are now loading all subfolders instead of the listed folder
    • Additional null reference checks on instantiate for offline play
    • Allowed optional params in RPC
    • Resources are now loading all subfolders instead of the listed folder
    • Offline play fixes
    • Additional null checks if connected or not
    • Added additional Debug Logs for the null Locate
    • Fixed WinRT (Windows Phone Builds)
    • Removed warnings on project
    • Added 4.7 Support
    • Fix CurrentFrame being sent as byte for Authoritative Input Events
    • Fixed a possible null reference in the networking

    Please go check out the change log below for further details on our release
    http://developers.forgepowered.com/Changelog

    We will be updating our sites documentation and other information needed to make sure we are as visible as possible.

    Also note that we will be updating our site more regularly now with fresh updates so please make sure to register your invoice on our website if you have not done so already to get the latest and greatest when it is released.
     
    GD-Darren and code-blep like this.
  49. jjobby

    jjobby

    Joined:
    Nov 28, 2009
    Posts:
    160
    Thank you for your reply. I need server to handle physics collision and sync the position. If I just use layer then the normal monsters can still attack player even if they are not rendered on the screen. And other player who are not in the party can also be hit from boss monster. Moving player to other location is probably better solution. On server side, may be create a plain for each player party in different Y axis. It's to make sure that the physics doesn't intervene between each party. I'm not sure if this is practical or not if there are many many player doing quest at the same time.
     
  50. GD-Darren

    GD-Darren

    Joined:
    Jan 12, 2013
    Posts:
    53
    Hi i'd like to ask on how some of these would be best implemented using forge if possible.

    1) I want my server to be able to host multiple different scenes. Is this possible? An example is the lobby is an actual room where the player can interact with the environment and choose a mission/have other players join him there. Once they are full party they will be transferred to the chosen scene. Of course all players may join someones room or host and make other players join their room.

    2) If it's possible what's the best way to implement and are there any examples of room creation or any links that can be helpful (maybe some networking methods that are already in forge?)

    3) If multiple scenes can be hosted on the same server can it do physics for all different scenes too?