Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[NO CCU LIMIT] Forge Networking now OPEN SOURCE

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

  1. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Most of our documentation is on the Wiki, you are free to browse any examples there as well as get 1-1 support using our Slack channel.

    Rooms are another term for sockets, and yes we do support multiple socket connections. We are not similar in the way that Photon works so the concept of JoinRoom() or OnJoinedRoom() is more or less just connection callbacks being successful. If you want to use the server browser you can easily host your own master server so that it can hold all the 'rooms' that the game is going to host.

    Hosting a servers is relatively straightforward.

    http://developers.forgepowered.com/Tutorials/GettingStarted/Hosting-A-Server

    More comments might help make it clear as to what is happening on that particular script as we thought it was a good baseline for people to get started with. We are trying not to enforce coding standards to our users so we take on the approach that this is how you get it working and how you go about it is up to you.
     
  2. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Hello there and glad to have you ask us these questions. :)

    1) Yes, we do have plans to support it further in the future but for now most of our users are able to easily implement steam into their games w/o too much of a hassle.

    2) We do have some developers working on Xbox One and PS4, this will hopefully allow us to do any debugging with them to make sure that it is working properly on those platforms so that we can change our opinion from 'if it supports sockets it should work' to 'it works on X and X'.

    There are so many great developers in this community that I am sure that somebody on the slack is more than willing to give you the rundown until we have a documented tutorial about it on our Wiki. We will support it completely in the future but for now we are focused on stability and core bug fixes this month.
     
  3. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    Thanks for the warm welcome!

    All of that sounds good. One of the things that I've seen when checking out the documentation is the heavy reliance of "naked strings", specifically for RPCs. Is there a separate way to pass in a reference to the methods themselves (or an Action/delegate, etc) that's a bit more compile-time safe?

    Overall I'm very impressed with what I'm seeing, so hopefully my pre-purchase questions don't seem too dumb. I particularly like that this seems a bit more code-oriented, as Bolt had a lot of Editor GUI stuff that interrupted my programming workflow.
     
  4. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
    yay for level 11,
    i just registered on the site but I'm not receiving the email verification,
    possibly because of the + symbol i used in the email address field (something i do for multiple reasons)


    also what version would you recommend me starting with when building specifically for windows store universal 10,
    v14 v15 v16?
     
  5. Bionicle_fanatic

    Bionicle_fanatic

    Joined:
    Jun 8, 2013
    Posts:
    368
    Just so you know: That's not a documentation, that's a collection on incomplete and confusingly arranged lines of code. Just saying.

    So how do I join this Slack thing? It's not realtime chat, is it?
     
  6. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    We can definitely look into having it not be 'naked strings' for our function calls in a future update as it is a great recommendation. Thanks for mentioning it! Currently there isn't an easy one for the NetSync but for the other function callbacks we do allow it. We can expand on this in the future so that it is standardized and is more easily used.

    Thanks, they are not. There are no dumb questions =). We are very heavily programmer oriented for our needs that we need some artist love on our GUI as it was something I designed to make it easily usable. Will definitely need some re-tinkering to make it as nice looking as Bolt is moving forward.
     
    jasonMcintosh likes this.
  7. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Thanks, we definitely are glad that Unity wanted us to be part of the sale this month for Level 11 and are really grateful that they have been extremely helpful in our goals.

    I might be, if you could please send an email to support@beardedmangames.com so that we can correct this mistake that would be awesome.

    I recommend starting on v16 as it was just released, but if you want to start on a safer road then we have a specific button under the profile for downloading forge labeled 'stable release' which will give you the most battle tested release.
     
  8. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Sorry, I meant it as a community driven documentation that is constantly updated. Can take some time for it to polish on it so that it's true documentation shines better but it is a different form of documentation. There is currently 3 paths for documentation: Tutorials, Wiki, Code Documentation. With slack being our main line of communication between other developers as well as other people able to pitch in on their ideas.

    The Slack invite is automatically sent when you register your invoice on the profile page. If you have already registered on the website, then you may need to check your spam folder in your email to see if it is in there.

    If you have any problems getting the slack invite then please send us an email to support@beardedmangames.com
     
  9. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    177
    A couple more questions, if it's not too much trouble.

    1. Can you only view the wiki after you've bought Forge? I'm trying to gather all the information I can so I can make an informed purchase decision, but some of the docs are pretty incomplete, and the wiki seems to be member-only.
    2. Do you have a basic (or advanced!) comparison rundown between Forge and Bolt?
    3. Does Forge have raycast/hitbox rewinding? (e.g. Something like Bolt's, as it's pretty handy!)
     
  10. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    +1
     
    Cranick likes this.
  11. daudau505

    daudau505

    Joined:
    Jul 19, 2014
    Posts:
    27
    Hi,
    Do you guys plan on making Playmaker Action for this?I have been prototying my game with photon, and I'm very interested in this, but don't have much knowledge on coding.
    Thanks.
     
  12. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    1) Correct, because it is a community driven Wiki, the community is free to post full source code in there for whatever it is that they are trying to document or convey. The docs are more or less a get started and definitely need some refinement but definitely not a showstopper to figuring things out. There is plenty of resources whether that is people, code examples, or simple documentation to get you on your feet for any questions you may have.

    2) Not at the moment, we are don't have any direct comparisons at the moment from using Forge over Bolt, I would be biased to say it is better in any way at this point and would recommend that you ask the community for this answer.

    3)Not at the moment sadly, we will have that as a planned feature to come so it isn't out of our road map for the future.

    Hopefully this answers your questions. :)
     
  13. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Brent was prototyping some stuff with Playmaker and don't exactly know how far he has gotten with it. It is planned to be done in our networking package so definitely on our internal hit list for the future updates to come.
     
  14. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310

    Level 11 Sale! 50% off (October 1st - October 31st, 2015)
    Photo Credits:
    Top Center - Rocket Fist - Daniel Snd
    Top Left / Center - Soccer Rage, Stamina-Games
    Bottom Left / Top Right / Bottom Right - Angry Bots, Unity Technologies

    Thank you to everyone that made this possible! :)
     
    Brent_Farris likes this.
  15. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,366
    After various experiments with other solutions me too have ended up here. And I will buy Forge in the next days.

    You guys are getting any sleep? You did a very good job!

    My turn to make some questions now I guess:

    I plan to make a point and click adventure style game with shooting action and various npcs.
    So I guess that this would require less bandwidth, since the player would send minimal input to the server,
    and the server to the other clients just the commands of the other players.
    I mean not having to press a lot of keys to move around would help, bandwidth wise.

    It will have a top down camera so the viewfield will never have a lot of other players.

    I plan to make a persistent world with zones. The player should switch server when leaving a zone?

    If I rent a server on the cloud, could I get away by running an instance of the server for the respected zone?

    Could somebody of the developers give me a rough method to achieve that with Forge?

    Also your cloud server solution looks very promising, and I read that you already entered beta phase.
    Any ETA for when it sees the light?

    Thank you.
     
    Last edited: Oct 7, 2015
  16. kfc

    kfc

    Joined:
    Dec 17, 2010
    Posts:
    27
    Hi,

    I would like to know whether the server executable can be run from a ubuntu server in terminal?
    The server that we are using don't have any interface.


    Thanks.
     
  17. Kheryo

    Kheryo

    Joined:
    Oct 7, 2015
    Posts:
    6
    Hi there.

    I'm currently using Forge Networking for the implementation of an online arcade versus game.
    I'm using enum variables to hold the state of each character, and of various gameplay elements, e.g. :
    Code (CSharp):
    1. public enum CharacterState { Idle, Running, Dashing, Blocking };
    2. private CharacterState _state;
    Is there a way to carry these variables around with the NetSync attribute ?
     
  18. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Pass the enum as an int. Then change the cast on the other side. So you send as "(int)_state" and on the other side get "(CharacterState)_stateInt".
     
    Cranick likes this.
  19. Kheryo

    Kheryo

    Joined:
    Oct 7, 2015
    Posts:
    6
    I've already been doing that with RPCs.
    What I'm asking here is if there would be a way to implement support of my enums to the NetSync attribute.

    Hunting every character state change in the code and turning it into a RPC would be pretty tiresome, whereas simply being able to NetSync _state would work just as well :|
     
    Last edited: Oct 7, 2015
  20. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    AH, I misunderstood. We stopped using the NetSyncs a while back and have been moved to pure RPC for a while now. We kept seeing too much overhead with the NetSync variables since they seemed to sync all of them regardless if just one changed or all of them. At the worst you could make the _state into a property and use that to set an int that is netsynced.
     
  21. Kheryo

    Kheryo

    Joined:
    Oct 7, 2015
    Posts:
    6
    Thanks for your answer.
    I didn't investigate performance issues yet, and you might have saved me some trouble here.
    I'll go with RPCs then. Thanks and have a nice day :D
     
  22. funnybunnymobile

    funnybunnymobile

    Joined:
    Mar 4, 2015
    Posts:
    5
    I've watch your tutorial videos and still have some question before I buy (as I'm new to multiplayer and have no experiences in networking):
    How are obstacle objects and enemies initiated during the game (not when the game starts, if I want to initiate them at some points in the game)? Is there supposed to be a server to control them in case the host disconnects?
     
  23. starstriker1

    starstriker1

    Joined:
    Jul 15, 2012
    Posts:
    38
    Some questions: for the server authoritative networking, your example code shows the network monobehaviour polling inputs under the hood. I have entirely an entirely separate input apparatus that might even be pulling from AI characters; can I feed my own input structures into this system? I had this working in Bolt before I ended up abandoning it.

    My other question: the tutorials seem to indicate that network monobehaviours do their syncing in update; is it possible to sync on a specified tickrate instead (IE, on fixed update?)
     
  24. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Haha, we do! :)

    Depending on the server load that you are having. If there is say like 200 players max that one server can handle and you want to support more than that, then yes you would switch servers so the load isn't all on one location. However if you are just wanting to support up to 200 players but only want them to update relative to their area they are in, you can easily do proximity based updates on the server and restrict the updates to people within a certain zone.

    Yes, you can have multiple socket connections in Forge, and we do support this out of the box.

    Basically you would want to have a server dedicated to handling whatever zone you made your build on and just have the players connect and send their information from one server to the next. i.e. You would hold the room listing behind the scenes, pass the server information to the client (user) and let the user then connect to that other server while killing the connection from the previous server. The Two servers themselves can be connected to a socket internally to share any data information that you want to transfer over from one server to the next.

    I don't have the exact date as we are waiting a response on our Microsoft contact to pull the trigger but definitely something we are excited about.

    Hopefully these answer your questions, feel free to ask anything else to us at support@beardedmangames.com
     
    Last edited: Oct 8, 2015
    elias_t likes this.
  25. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Passing the enum as an int would be best. i.e.
    Code (CSharp):
    1. public enum CharacterState { Idle = 0, Running, Dashing, Blocking };
    2.  
    3. private CharacterState _myState = CharacterState.Idle;
    4. [NetSync]
    5. private int CurrentState
    6. {
    7.        get
    8.        {
    9.             _return (int)_myState;
    10.        }
    11.        set
    12.        {
    13.             _myState = (CharacterState)value;
    14.        }
    15. }
    Edit: Sorry, looks like somebody already was helping you out. Let me know if you need any further help on this.
     
  26. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Yes, we currently do that ourselves when we are doing testing and making builds. :)
     
  27. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,366
    @Cranick . That was very informative. Thank you! Just what I wanted to hear.
     
    Cranick likes this.
  28. kfc

    kfc

    Joined:
    Dec 17, 2010
    Posts:
    27
    Thank you.
    I just realised that unity build can be output in headless mode. Really cool.

    My next question is how do we make multiple rooms in an instance of a server? Do we have sample code in the asset or we have to code our own solution?

    Cheers.
     
  29. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    :D Awesome, thanks for watching

    You can do this with Networking.Instantiate if the object you are creating is a networked object, if it is an object that doesn't have to be replicated on the network you can use a RPC to call the standard instantiate across all of the connections :)

    Please let us know if you need more information on this :D
     
  30. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Yes, currently we are working on finishing up our new Authoritative input structure. The way that it works is that you can dictate what is and is not sent from clients to the server. Since we give you full control over every part of the system, you can actually mix both non-authoritative as well as authoritative code. This makes it so that you can easily support other input methods such as controllers, joysticks, motion sensors, etc.

    The update rate is fixed for all of the objects, this is per object so that you can have some objects update at faster intervals than others. Is your question related to making one unified update "tick" that all things conform to?
     
  31. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    There are currently 3 ways of doing this:
    1. You can write your own vision of 'rooms' of how you would want the data to be send to players and handled as such.
    2. You can make multiple servers connect to an instance that delegates the clients to connect to the correct 'room' in which the main server would act as a funnel for players and would be connected to each server to get their player count and such.
    3. We are currently working on our own idea of 'Rooms' as I speak and will have this feature implemented coming forward, if you want to wait until it is released to use that instead you are free to do so. As far as ETA I don't have a time frame in mind right now but we are testing it at the moment to make sure it is stable before we release a new build for it.
    Hope this helps!
     
    kfc likes this.
  32. starstriker1

    starstriker1

    Joined:
    Jul 15, 2012
    Posts:
    38
    I'm mainly concerned about whether my physics updates will be seeing artifacts from being updated out of sync with the network rate. Pretty much all of my game logic is on the fixed update, I just want to verify that there's no conflict with that.
     
  33. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    There should be no conflicts. As in all parts of the system though, if your project doesn't play well with the default setup, you can easily extend our classes or base classes to alter the behaviors to what you need :).
     
  34. kfc

    kfc

    Joined:
    Dec 17, 2010
    Posts:
    27
    Thank you for your answer.
    I'll buy it to give it a go. Best of luck.
     
    Cranick likes this.
  35. BigAppear

    BigAppear

    Joined:
    May 15, 2015
    Posts:
    7
    Hello !

    Have you got any news about uFPS integration ? When a solution is released about that, I think I'll get Forge ! :)
     
  36. acriticalstrike

    acriticalstrike

    Joined:
    May 25, 2013
    Posts:
    75
    It turns out that both of the codes referenced in these tutorials no longer compiles.
    Here are the Images -- how can i fix this? I need to know ASAP -- my team needs this system to run!

    http://developers.forgepowered.com/Tutorials/GettingStarted/Custom-Networked-MonoBehavior



    http://developers.forgepowered.com/Tutorials/WriteCustom/Write-Custom-Sending-Classes-Across-the-Network


    Guys I don't know what's going on here but I need this working on Monday or my boss is going to be stressing over these issues....I have no doubt that there's a simple solution...
    All I need to do is send an int across the network to all the other games playing on it so that the other games know the score in order to decide who wins and who loses...Anyway get back to me as soon as you can and our team will write wonderful comments in the unity asset store about your work!
     
  37. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,511
    Hi.

    I have just bought the package and there seems to be serveral warnings such as :

    There are inconsistent line endings in the 'Assets/Bearded Man Studios Inc/Forge Networking/Scripts/QuickStartMenu/ForgeClickToRegister.cs' script. Some are Mac OS X (UNIX) and some are Windows.
    This might lead to incorrect line numbers in stacktraces and compiler errors. Many text editors can fix this using Convert Line Endings menu commands.

    and

    Assets/Bearded Man Studios Inc/Forge Networking/MainScripts/Default/UnityHandle.cs(85,50): warning CS0618: `UnityEngine.Application.isLoadingLevel' is obsolete: `This property is deprecated, please use LoadLevelAsync to detect if a specific scene is currently loading.'

    Assets/Bearded Man Studios Inc/Forge Networking/Editor/ForgeNetworkingEditor.cs(224,17): warning CS0618: `UnityEditor.EditorWindow.title' is obsolete: `Use titleContent instead (it supports setting a title icon as well).'

    These are warnings so they are not critical for me to test the package, but it is kinda annoying when I compile script these warnings keep popping up.

    Using 5.2.1
     
  38. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,511
    Also, here is some suggestions.

    NetworkingManager nice and all good. But it could improve a bit to give us a better way to manage the prefabs we add to it.

    What I mean is that there must be some way to get the objects to be instantiated into organized fashion than just adding all and every types of prefabs without some cool inspector editor.

    We should be able to have multiple instances of list for these so we can organize our prefabs into categories , types, etc...

    Also, one thing I have noticed is that when NetworkedMono was syncing the transform info, it was sometimes creating 1.7kb GC... also took 1ms to complete.

    Looking at the profiler , I could see about 30 objects with around 4.2kb GC with 1.5ms. (not all of them are moving I guess)

    I am not trying to say it is really bad.. I am trying to see if this is normal in networking programming, since I am pretty new to this area.
     
    Last edited: Oct 10, 2015
  39. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,511
    I have another question about custom class and transport object.

    Is it possible to send array or list of say int or list of custom class?
     
  40. Slick_Nick

    Slick_Nick

    Joined:
    Jan 4, 2014
    Posts:
    37
    Maybe you should read the changelog before posting a panic message? :)
    Boght the asset myself a few days ago and just got to this video.

    You could also just search the solution for where its called and see how it is used now, a handy tip for any kind of development ;)

    You will then find the file ForgeExample_WriteCustom.cs (This is an updated version this tutorial)

    Regards Niklas
     
    Cranick and CarterG81 like this.
  41. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,511
    While I was going through server authoritative with client side prediction stuff, I hit a brick wall with input delegates not having virtual button as input.

    I am testing the system using a controller and delegate need to have version that can accept Input.GetButtonDown type.
    I also think this part needs to be able to handle some more generic way of handling things as there are many good input wrapper plugins in asset store ( such as InControl ) that wraps up many inputs so there must be a way to add the delegates that can handle some different inputs.

    Otherwise, I am chugging through the examples and so far, this package is not too bad!

    Hopefully Dev can come to thread soon to answer some questions.
     
  42. acriticalstrike

    acriticalstrike

    Joined:
    May 25, 2013
    Posts:
    75

    I found version 16.2 I'll see how that works out... I was running version 14.2 on unity 5.2.1f1

    I didn't realize that the asset store was so behind >.<

    I hope things go better today...
     
    Last edited: Oct 11, 2015
    Cranick likes this.
  43. acriticalstrike

    acriticalstrike

    Joined:
    May 25, 2013
    Posts:
    75
    So I ended up figuring it out on Sunday -- I'm now able to put all of the game clients into an array so that each game element of the array represents a game object with the unique data needed to determine the score. In other words every game playing on the network has a list of all the games connected to the network. Each of the elements of that list contains a link to the gameobject which represents every piece of data that is important for each of the games to continue operating as a unit. I'm not sure that it's the best way of doing this but it does work and it's awesome. -- I look forward to fleshing out my knowledge of the rest of this framework in the near future! So far so good!

    I should also report that I'm using forge networking version 16.2 and unity 5.2.1f1
     
    Last edited: Oct 12, 2015
    Cranick likes this.
  44. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    I currently haven't been too focused on the uFPS integration as much as our stability and other core fixes we have planned for this month. Although I will say that it should be coming next month if all goes as planned. :)

    Thanks for your interest and feel free to ask me any other questions that you may have.
     
  45. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Sorry for not answering your email as fast as we usually do. We generally take the Weekend off to relax as we spend time with our loved ones and families. I have answered your questions in an email and will just let others know here that these tutorials are updated based on the version from our Website. Asset store is not as up to date as our Website as there is an approval process that takes place and it takes time for it to come through. As such we tend to make sure to release the most stable version we have available to the Asset store and keep all minor bug fixes and major improvements to our website.

    Thanks!
     
  46. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Which version of Forge Networking are you using? I will do an additional check on our end to make sure that any future updates for OSX doesn't have those warnings as yes that can be annoying. (Sorry).
     
  47. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Haha, when we get time to work on our editors I'll be sure to spice them up and make them extremely robust to look as cool as others. For now this month is focused on Core stability, bug fixes, minor features and support.

    I am curious as to what version of forge networking you are using and is there multiple NetworkedMonoBehaviors on that object or just one? I think that the GC should be a bit lower as well as the ms but I will check it internally to make sure the numbers are correct.
     
  48. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Yes, you can serialize a class or any type of object that you can cast down to simple bytes on your own and send it over. There are a few examples on the Wiki that showcase this and feel free to reach out to us on the Slack chat if you need any further information.
     
  49. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Glad to have you on-board! Thanks for helping others out, really appreciate it. :)
     
  50. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Are you talking about "ForgeExample_AuthoritativeController.cs" in the AuthoritativeAndClientPrediction example? This already handles the inputDownRequests type of deal and hopefully this answers your question. If not feel free to reach out to us on Slack or contact me at support@beardedmangames.com. Thanks!