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. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    We absolutely did not forget. We actually have it pushed back because of the load testing on the Cpu, iOS issues, and other gremlins that were necessary for v3 and v4.

    As you can tell by the quick beta itterations, we are working non-stop to make this beta as fluid as possible. We actually have all the issues and feature requests on our Jira to be implemented.

    So if it has been requested, we are working with the current priority and pulling from there. Thanks to everyones feedback we are able to get to where we are now. I'll have a talk with the guys and see if we can prioritize this for v6.

    Thanks everyone, Happy MLK day!
     
  2. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Absolutely agree with you. Will make notes on it as I continue to work on documentation.
     
  3. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Will have Brent take a look at your post and give his feedback. Thanks for the suggestion!
     
  4. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Yes, the ping is called when a message is received from a client on the server. This method doesn't return the ping time, its purpose is to tell the server that the client is still alive and not to disconnect it. In V6 NetworkingPlayer now has a InactiveTimeoutSeconds int that is per-player so that you can set the timeout time in seconds for each individual player (default 180 seconds).

    We have a public ping function to get the time to the server and back in our features list and it will look something like: int ping = NetWorkerInstance.Ping(); You will then be able to feed this int into a timespan class from seconds :)
     
    Last edited: Jan 19, 2015
  5. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Actually, you currently have the tools to get started with this now because we have slowly integrated the features needed for AOI. Your NetworkedMonoBehavior can mark the "isPlayer" bool to true and then the server will track that objects position. You can then iterate through the list of the players on the server myServerNetworker.Players[0].Position (this is a vector3) and do any logic on sending them information. This combined with the AuthoritativeRPC method that I talked about you seeing in V6 shows that we are building up to this being nearly automatic.

    We have a sneak peek of this working in this tutorial we made yesterday; however we have yet to make a tutorial showing this feature off fully.

    This is more of a thing for the Arbiter, however if you are speaking of using 2 servers from a non-centralized server (the Arbiter will be centralized) then you can actually work this in by opening up a TCP connection between the two. I am open to feature suggestions as well if you have any that will help you out!

    Haha, yeah we are putting all the feature requests you guys say now in Jira because all of them are so good and we don't want to forget any of them! So yes, no worries, we have been slowly rolling out the features that are required to do these larger scale operations and you can actually start playing with some of them now :D
     
    Last edited: Jan 19, 2015
  6. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    :D Yes, we love making our video tutorials and documentation. As Brett mentioned, we actually have these kinds of things planned as part of our "Masterclass" as we want to teach everyone about networking and how to use our system effectively (and just network program games effectively).
     
  7. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    No worries, you won't find us defending our current design against suggestions :)

    Hmm, this seems like a bug. Let me check the code....

    *brb*back

    Ah yes! It looks like this is the feature we were working on when we were hit with performance problems. Okay, so the way that it will be working is that the Networking.Instantiate will take in a NetWorker argument which will allow you to specify which socket is in control of that object. As of right now the PrimarySocket is the controller of the created objects.

    Well, rather than change the current Host and Connect methods, we can add an overloaded function to do something like this :). We will sketch up a design that will work well with this. That way we are able to keep the simplicity that @zapoutix speaks of as well as the simplicity that you wish to see :)

    This method should have been patched in V5 and now can send the data across different NetWorkers. All you should need to do is change the Networking.PrimarySocket.AddCustomDataReadEvent to myNetWorker.AddCustomDataReadEvent and then change Networking.WriteCustom to be Networking.WriteCustom(id, myNetWorker...

    Please let me know if this is working for you if you try it out. We did some micro tests on our end that worked out well, however that was at the start of V5, just want to make sure it is still kicking (we do have it on a todo test list).

    Ah, yes, currently we bind to any IPAddress but we will tack it on as an optional argument or overloaded Host method.
     
    Last edited: Jan 19, 2015
    Zaddo67 likes this.
  8. GraphXCreations

    GraphXCreations

    Joined:
    Jul 6, 2014
    Posts:
    121
    thanks guys, ill be eager to see all those features implemented,
    hopefully it will be sooner than later :)

    it will be very handy and useful if you can add the AOI/network LoD to be automatic, instead of us have to do all the required mambo jumbo procedure to achieve this.

    allowme to post some features that really got my attention when i found massivenet library,
    please do not take this as advertisement since the massivenet project is no longer supported hence gone opensource MIT.
    so i do not see it as compettitor of Forge since it is a dead fish on the water. yes it is free but i rather pay for a more complete and robust networking plugin that will be supported like Forge.

    but even the way it is now to me it has the most appealing features to create a very large mmo game using unity game servers instances .

    and would really like to see those features in Forge.

    some of you might say why dont i just stick with massivenet, well like said before for the reason that massivenet does not support room instances for private mini games/pvp battlegrounds.
    which my project will be based on.


    so once i heard about Forge with all its features ie: room instances for private game sessions plus mmo features for large open world, then i thought of switching over since it will cover all my needs for my prototype game i am working on.

    anyways here are some main features of massivenet for you to consider for Forge.
    some you might already implemented in forge,


    you can read more about and look in the code that way it might help you to get some ideas to add to Forge to make it more robust and mmo native feature capabilities out of the box.

    https://github.com/jakevn/MassiveNet/wiki
     
    Last edited: Jan 19, 2015
  9. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Awesome, we will check it out and have a look through its feature set to see what we are missing and how we can implement it into our system. Since it is MMO style networking we probably will already have some of the features implemented into our Arbiter structure, but we will make sure they all work well together. :)

    MMO is a pretty big topic for networking and we would love for our system to soften the blow as much as possible to make it so that developers worry less about networking and more about the lovely design of their games! Yet, we wish to give the power and configurability to the developers that need it as we know power users (such as ourselves) love those kinds of things!

    No worries we have added a ticket in Jira for "Automatic mambo jumbo aria of interest". We are designing out how we would like to do this in the back-end so that there is tons of control (like most all of our other features) and yet it has the option to work like "magic" behind the scenes with little to no editing required by you, the developers.

    :) We will do our best to make sure that Forge always builds around it's users needs and helps everyone bring their imagination and designs to life! Thank you for the kind words :)
     
  10. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Just an update: @GraphXCreations - I have just completed the implementation of automatic proximity based updating. The server will of course always be up to date; however, when you turn the system on, clients will only get updates from the server about other clients that are within range. Look for the new Menu and Demo scene in V6 tonight (tonight for me that is)!
     
  11. GraphXCreations

    GraphXCreations

    Joined:
    Jul 6, 2014
    Posts:
    121
    awesome,

    you guys really act fast, will look forward for the v6 tonight to test.
    now, this will be handled by server side, right?

    and the client will turn off or disable all network objects automatically outside players area of interest or radius right?
    or is that something we need to do ourselves?
     
  12. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Yes, this is all taken care of server side :)

    Currently the client just stops receiving update on a player until they come within range. To soften the load on the server you are able to check the same distance parameters on the client side to turn on and off the objects visually. I will look into a system of doing this kind of check in if needed as well.
     
  13. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    261
    Hi, could I join the beta? Thanks
     
  14. Mcdoogleh

    Mcdoogleh

    Joined:
    Jan 19, 2015
    Posts:
    2
    Hi Brent!

    I was wondering if I could also possibly please be put on that list for the beta!

    Please let me know!

    Thanks :)
     
  15. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Of course! :D

    Why yes of course! :D

    I've sent you both a message
     
  16. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hey all, check out our new featured video of how to convert existing code (like the unity 4.6 beta sample assets 3rd person controller) to be networked!

    Edit NOTE: The NetworkedMonoBehavior by default serialized the position of the character. If you are making networked games, do NOT rely on inputs of the user to control the position. These can easily get out of sync and cause many problems. You are better off serializing the position. :) In the following video, I am only serializing the inputs because they control the MechAnim animation. So if we serialize those inputs purely for mechanim, we will see that animation carry over without any heavy sending of animation states (especially when those states are controlled by a float).



    Notes: To figure out what variables to send, it took me a few tests to see which ones were the ones that controlled the movement... then I ran across the character.Move (DUH!). So you may have to look through other code to find the main variables, but once you do, its a piece of cake to convert :)

    We have added this to the site and will be working on getting some text about what we have done in these videos on those pages as well for people to convert to their native language! :)
     
    Last edited: Jan 20, 2015
  17. GraphXCreations

    GraphXCreations

    Joined:
    Jul 6, 2014
    Posts:
    121
    nice and easy implementation, very clean and quick.

    farris btw, you have all of us drooling with all this quick updates and all this new features for Forge,
    but you havent even told us what will be the total damage like?
    how soft or hard you gonna hit our pockets.
    some of us dont want to get cought in the features then to
    find out it will be out of our reach :) or not what we thought to invest.

    i know it is difficult to do it whithout knowing the final product features, but you might already have an idea of hat you guys want , right??

    so just give us a ballpark figure, just to see if we would like to continue drooling. :)

    cheers
     
  18. AlexFormoso

    AlexFormoso

    Joined:
    Aug 12, 2012
    Posts:
    25
    Amen!.

    As a WP8 user, seeing that this package has Self-Hosting available im up for the Beta! (PUN doesn't allow that so im screwed)... Asked already on reddit.
     
  19. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hey man! So we are still working out the price for the package as compared to other networking packages out there. I promise that we will have some numbers for everyone soon. We will just do some more R&D!
     
  20. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Responded, please send your email to support@beardedmangames.com or send me your email in a private message! :)
     
  21. ibyte

    ibyte

    Joined:
    Aug 14, 2009
    Posts:
    1,047
    Thanks for including me in the Beta. My plan is to see if I can integrate it with the uFS - Unity Flight Simulator which I purchased from the asset store.

    http://unityfs.chris-cheetham.com/
     
  22. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Awesome! Let us know how it goes and what questions you have. We just finished our tests and integrated Forge into both of the following:
    https://www.assetstore.unity3d.com/en/#!/content/12175
    https://www.assetstore.unity3d.com/en/#!/content/10

    We will be releasing the source and doing tutorials for both of these projects :)
     
  23. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Beta V6 has been sent out to everyone. Please send some feedback on your thoughts, suggestions and maybe even some of the new stuff that you like!
     
  24. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hello everyone. Don't expect many new features in V7 tomorrow night! I will be doing a very VERY HEAVY refactor of the logic in the core system. Now that I have tons of features in and working, it is time to clean up all of this Garbage Collection. It's not difficult work, just a lot of planning and designing caching strategy as well as cleaning up a lot of these objects. They were loosely designed for me to be able to implement features blazing fast just in case I needed to modify the core part of the library when adding features. Since the core library hasn't had any huge changes in the last couple of days I feel it is finally safe to go in and really clean it up.

    This should be a pretty huge performance increase! Why did we not do heavy checking for GC in the beginning? The answer is simple, we wanted fast iteration, and really... cleaning up GC is one of the easiest parts (at least for me I guess).

    Please forgive the lack of features in tomorrows V7, I probably won't get all of the GC I want, but it will be a GC day unless there are no fires that we need to fix!

    Edit: After this I plan to work on network compression :)

    Thanks!!
     
    Last edited: Jan 20, 2015
  25. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    Both Beta5 and Beta6 are broken for me.

    I invested a couple hours making sure it wasn't my environment. 4.1 is the last version that is working.

    These are the errors I get in console when I try to build with Beta 6:

    ==================================================================

    BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.
    Mono.Cecil.PE.ImageReader.ReadImage ()
    Mono.Cecil.PE.ImageReader.ReadImageFrom (System.IO.Stream stream)
    Mono.Cecil.ModuleDefinition.ReadModule (System.IO.Stream stream, Mono.Cecil.ReaderParameters parameters)
    Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters)
    Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName)
    Mono.Cecil.AssemblyDefinition.ReadAssembly (System.String fileName)
    UnityEditor.AssemblyHelper.ExtractInternalAssemblyName (System.String path) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/AssemblyHelper.cs:69)
    UnityEditor.AssemblyHelper.CheckForAssemblyFileNameMismatch (System.String assemblyPath) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/AssemblyHelper.cs:19)
    UnityEditor.HostView:OnGUI()

    BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.
    Mono.Cecil.PE.ImageReader.ReadImage ()
    Mono.Cecil.PE.ImageReader.ReadImageFrom (System.IO.Stream stream)
    Mono.Cecil.ModuleDefinition.ReadModule (System.IO.Stream stream, Mono.Cecil.ReaderParameters parameters)
    Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters)
    Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName)
    Mono.Cecil.AssemblyDefinition.ReadAssembly (System.String fileName)
    UnityEditor.AssemblyTypeInfoGenerator..ctor (System.String assembly) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/BuildPipeline/AssemblyTypeInfoGenerator.cs:45)
    UnityEditor.AssemblyHelper.ExtractAssemblyTypeInfo (System.String assemblyPathName) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/AssemblyHelper.cs:261)
    UnityEditor.HostView:OnGUI()

    Internal compiler error. See the console log for more information. output was:error CS0009: file `Assets/Plugins/BeardedManStudios.Network.dll' has invalid `assembly' metadata

    Internal compiler error. See the console log for more information. output was:Error: System.BadImageFormatException: Could not load file or assembly 'Assets/Plugins/BeardedManStudios.Network.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
    File name: 'Assets/Plugins/BeardedManStudios.Network.dll'
    at (wrapper managed-to-native) System.Reflection.Assembly:LoadFrom (string,bool)
    at System.Reflection.Assembly.LoadFrom (System.String assemblyFile) [0x00000] in <filename unknown>:0
    at us.UnityScriptCompilerFactoryModule.loadAssembly (System.String name) [0x00000] in <filename unknown>:0
    at us.UnityScriptCompilerFactory.FromCommandLineOptions (us.CommandLineOptions options) [0x00000] in <filename unknown>:0
    at us.UsModule.compile (us.CommandLineOptions options) [0x00000] in <filename unknown>:0
    at us.UsModule.runWithCommandLine (System.String[] commandLine) [0x00000] in <filename unknown>:0
    at us.UsModule.Main (System.String[] argv) [0x00000] in <filename unknown>:0

    Error building Player because scripts had compiler errors

    Internal compiler error. See the console log for more information. output was:Error: System.BadImageFormatException: Could not load file or assembly 'Assets/Plugins/BeardedManStudios.Network.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
    File name: 'Assets/Plugins/BeardedManStudios.Network.dll'
    at (wrapper managed-to-native) System.Reflection.Assembly:LoadFrom (string,bool)
    at System.Reflection.Assembly.LoadFrom (System.String assemblyFile) [0x00000] in <filename unknown>:0
    at us.UnityScriptCompilerFactoryModule.loadAssembly (System.String name) [0x00000] in <filename unknown>:0
    at us.UnityScriptCompilerFactory.FromCommandLineOptions (us.CommandLineOptions options) [0x00000] in <filename unknown>:0
    at us.UsModule.compile (us.CommandLineOptions options) [0x00000] in <filename unknown>:0
    at us.UsModule.runWithCommandLine (System.String[] commandLine) [0x00000] in <filename unknown>:0
    at us.UsModule.Main (System.String[] argv) [0x00000] in <filename unknown>:0


    Internal compiler error. See the console log for more information. output was:error CS0009: file `Assets/Plugins/BeardedManStudios.Network.dll' has invalid `assembly' metadata
     
  26. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Seems to me this error is most likely related to Unity Free. When we put the obfuscation on it, we have been testing it on all platforms in Unity Pro. I'll do more tests on Unity Free tonight and hopefully find which part is causing the issues.

    As everyone knows, we are doing our best to get a solution that works for both of us as we want to protect our IP.

    Thanks for letting us know, we'll have this solved by tonight.
     
  27. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Due to my obvious conflict-of-interest I want to preface this post with something: I am simply trying to offer the developers some advice on what to improve and what issues I've found during my beta testing (somewhat limited time, maybe ~7h in total). I am not posting here to try to claim some networking solution X is better then Y, but simply to offer my feedback as another beta tester.

    I am also posting this only after asking permission from the 'Forge Networking' developers.


    Here's my feedback after doing some testing of the V4, V5 and V6 beta versions. I'm sure the developers are aware of several points I am going to raise here. I will mainly focus on things I've found issue with instead of trying to praise what works well, this is not because I want to be negative but simply because my experience with networking technology I can offer a critical point of view which might be hard to find among people who are just looking for something to build their next game on.

    A lot of garbage is generated

    The library generates a ton of garbage objects, the three mail culprits seem to be: object[] arrays, byte[] arrays and tons of boxing and unboxing, once you start transferring around 20-30kb/s per player (which is not uncommon for a modern, decently high player count game) the amount of garbage that's generated makes the game stutter constantly if you are not playing on a top of the line desktop machine (and even then you get the occasional stutter)

    I know the developers are aware of this and are working on correcting it.

    No compression or bit-level packing

    The smallest concept the engine seems to deal with is a 'byte', which means there is a lot of wasted space when sending small values. There's also no compression at all (that I could find, at least) which causes a lot of bandwidth to be wasted, mostly by transferring floats and ints at a level of precision not required.

    My recommendation here is having both bit-packing and advanced compression techniques implemented in an easy to use manner is incredibly important, and should be done asap.

    Implementation of UDP sockets

    There are several smaller issues, which together creates a larger one (UDP is not really usable).
    • If I understand the code correctly (a bit hard due to the obfuscation) there are actual string identifiers sent over the network for things like ack:ing received packets, this is incredibly wasteful in terms of bandwidth (the developers are free to correct me on this, if this is not the case).
    • The UDP implementation does not handle out-of-order or duplicated packets (again this one is hard to determine, but it looks like this is the case)
    • The reliable-UDP implementation while under stress from a lot of traffic/heavy spirals out of control, this can be produced simply by constantly sending a decent amount of large binary data over the socket and never stop, and run the packets through a packet-loss simulator, the way loss/resend are handled basically causes the network to be flooded with data.
    • The reliable-UDP implementation does not seem to support 'reliable ordered', it only supports 'reliable un-ordered' (I could be wrong on this one).
    • No bandwidth adaption, if you start sending to more data then what can be received on the remote end you will simply overflow the socket/nat-devices and start dropping almost all packets.
    I would strongly advice the developers to implement a proper UDP implementation akin to UdpKit/Lidgren/RakNet, as for many games this is the only viable option, and the current implementation is not up to the task.

    I would also recommend you to use the normal System.Net.Sockets.Socket objects instead of UdpClient/UdpServer as they will let you get around the issues with only one client/server per machine, etc. very easily.

    Combining UDP and TCP

    The current solution to the lacking UDP implementation is to try to combine UDP and TCP at the same time, and even though I have not tried this there are several general issues with this approach which makes it unfit for most games (yes, I know there are a couple of famous games built with an UDP+TCP combo, but if you look at them they are mostly older games before people 'knew' better).
    • There are known cases where routers will give one of the traffic types priority, so either you end up with only TCP getting through or only UDP getting through.
    • Pairing up a TCP and UDP connection on the server so you know they are from the same client is a non-trivial task.
    • Handling the case where one of the sockets disconnects and not the other (say the TCP socket disconnects but the UDP traffic is still flowing) is also a non-trivial task to solve.
    My recommendation on this is simply that the overall the use-case for combining both UDP and TCP is almost non-existent today, you either have a game which is fine to run on TCP or you have one that requires UDP, and thus allowing the combination of TCP/UDP is a waste of development resources.

    Using only TCP

    The other solution to the UDP/TCP issue is to only use TCP, there's two problems with this.
    • If your game is a fast-paced/real-time game the guarantees that TCP offers and the price it pays for them (delay) makes it simply unusable
    • If you want players to be able to host their own servers, so you can easily play with vs. a friend or two (say by using the steam 'invite friend' feature) then you need to instruct your users in opening ports in their routers as doing NAT-punch-through on TCP is not well supported at all (compared to the UDP version which works on 95%+ of all modern routers)
    My recommendation is that it's fine to offer TCP support as an option to UDP, but a proper UDP implementation can't be replaced.

    No support for UPnP or NAT-punch-through

    The library offers no support for core technologies like UPnP and NAT-punch-through which are both paramount for actually launching a game where your users can easily play against each other. This ties into the above point of 'Using only TCP' where the end result is that you have to have your users manually open their ports in the router (which people today are not going to do).

    This simply needs to exist, you can't launch a game on the platform otherwise.
     
    Meltdown likes this.
  28. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Yes, this is due to Good Ol' Sockets. We will do some more testing on this! Thanks for the trace!
     
  29. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    @fholm Excellent review! Thank you so much for giving the time to have a look at the system! Let's begin this lengthy reply to your very thorough review :)

    This is true, we have not enabled NAT-punch-through. We will be enabling this after our GC fixes. The idea is actually really simple to implement so we haven't focused on that but it has been on the REQUIRED todo list before launch. We haven't started on UPnP yet, but that too is planned, but not as important as Nat punchthrough.

    The only reason we support the idea of TCP only is because it is REQUIRED for WebPlayer. If you use UDP on webplayer you will find that it is much, much slower than TCP because on every packet it will have to request permission for cross-domain. TCP will only request upon connection. See Unity's documentation for a more thorough explanation: http://docs.unity3d.com/Manual/SecuritySandbox.html

    I haven't tested this prioritizing of protocols myself. In my opinion I personally would use UDP for the main transmission protocol and then have TCP for any other information if needed. Thank you for pointing this out so that I can study the idea further!

    Actually we convert all of the strings that are used for identity to a number using a mapping system. So yes, you pass an id into a method for sending the packets but they are mapped to a number before they are actually sent across the wire. We are using a char in one of our transportation methods but that soon will be replaced with couple of bits once we have finished adding new options to this feature.

    We have code in place for redundancy control. This code will control how the system ignores older packets. It is not fully functional and should be completed around the same time that we finish our GC pass.

    In V6 we actually released some code to modulate the re-sending of the packets for the packet loss. This is not complete but it does have a new flow control structure.

    Correct, currently the system does not support 'reliable ordered' packets on UDP. We will be adding that in after we have finished the reliability flow I mentioned above.

    No bandwidth adaption: This is a bug, thank you for pointing this out!

    Correct, we do not have any level of compression at the moment, that is our next stage after the GC post I mentioned before. Now that the features are well in, we have already began on refactoring all of the slow calls, such as lists.ToArray and AddRange, etc.

    We will be working with our bit level implementation after our refactor of the GC :) so no worries there. We will be implementing well known as well as our own algorithms for controlling bit level information within our transferred bytes. This is when compression will really come in.

    As you have noted, we have actually started on this pass :). There is a ton of Garbage Collection happening up to V6. We are working with each of our transportation layers in the system as these are the main areas of GC. We only used slower classes and methods so that we could rapidly implement features blazing fast (as many on the testers have noticed).

    Final Notes:
    We are actually aware of all of the problems pointed out. The system was originally written for blazing fast iteration. We wanted to get as many features into the system as fast as possible. Never fear, we will have all the fancy bit shifting, xoring, etc/twiddling done for compression before release!

    I would also like to point out that this system is actually a pretty young system, we actually have had at least 2 developers personally emailing us telling us about some of the same problems noted here recently and we filled them in with the same information.

    I know its easy to see things as mentioned and think that it will never be in place or to see it in the system and then say that it will never be in there, but that is hardly the case. Now that major features are in we are beginning our optimization passes :).

    Never Fear! We WILL NOT RELEASE without finishing these VERY IMPORTANT strucutres :)

    Thank you so much again in taking the time to test out the system. Please stick around as our future iterations and continue to help out! :)
     
    Last edited: Jan 20, 2015
    Cranick and Meltdown like this.
  30. zapoutix

    zapoutix

    Joined:
    Jan 2, 2015
    Posts:
    44
    I am using Unity free and i don't have this error, it is working fine for me on V6.
     
    Cranick likes this.
  31. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Oh! Sorry about that, I think that @Zaddo67 is using Good Ol' Sockets if I am not mistaken? Good Ol' Sockets uses Cecil to re-write the namespaces of the DLL for System.Net.Sockets which is probably where the error is coming in? I'll review the error again.
     
  32. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hey guys, I teach on Tuesday night so I haven't had all that much time to get a lot done for V7, expect an update tomorrow! :) - 11:30pm here
     
  33. GraphXCreations

    GraphXCreations

    Joined:
    Jul 6, 2014
    Posts:
    121
    no worries mate,
    take your time.

    i do have a request tho, offcourse when you have a little bit of time in your hands, so no rush,
    since you already implemented the automatic network lod or AoI (area of interest)
    i havent tested yer, but i imagine it is only done server end,
    any chance for a quick video tut on how to get this feature functional?
    maybe by attaching a script to the networked playerobject with public vars where we can edit the radius of area of interest, or even better to add the component to the non player owner networked objects so each object can have its own different perception distance.
    so the (ghost or proxy will automatic disable its mesh render once it has gone out of perception radius distance specified? )
    or what ever way or method you think is best for the current setup.
    thanks again.
    good day.
     
    Cranick likes this.
  34. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    I agree that we should cover it in a tutorial and go over how to use it as well as what additional logic you can add to it. Thanks for pointing this out so that we can suit your needs. :)
     
  35. zapoutix

    zapoutix

    Joined:
    Jan 2, 2015
    Posts:
    44
    Hi guys,

    Is it possible add the feature to send a WriteCustom to a specific NetworkingPlayer.

    for the moment for "simulate" this i do :

    Server scene :
    Code (CSharp):
    1.  
    2.     protected override void Start ()
    3.     {
    4.         base.Start();
    5.  
    6.         Debug.Log("I am the server");
    7.         Networking.PrimarySocket.AddCustomDataReadEvent("server", ReadFromNetwork);
    8.     }
    9.  
    10.     private void ReadFromNetwork(NetworkingPlayer player, NetworkingStream stream)
    11.     {
    12.         string name = ObjectMapper.Map<string>(stream);
    13.         string action = ObjectMapper.Map<string>(stream);
    14.  
    15.         Debug.Log("ReadFromNetwork name:" + name + " action:" + action);
    16.         Networking.WriteCustom(name, Networking.PrimarySocket, ObjectMapper.MapBytes("hello from server " + name));
    17.     }
    18.  
    Client scene:
    Code (CSharp):
    1.  
    2.     protected override void Start()
    3.     {
    4.         Debug.Log("I am the client");
    5.         base.Start();
    6.         name = "name_" + (int)Random.Range(1, 100);
    7.         Networking.PrimarySocket.AddCustomDataReadEvent(name, ReadFromNetwork);
    8.  
    9.         Networking.WriteCustom("server", Networking.PrimarySocket, ObjectMapper.MapBytes(name, "hello from client"));
    10.  
    11.     }
    12.  
    13.     private void ReadFromNetwork(NetworkingPlayer player, NetworkingStream stream)
    14.     {
    15.         string str = ObjectMapper.Map<string>(stream);
    16.         Debug.Log("ReadFromNetwork from server " + str);
    17.     }
    18.  
    For make simple i use the id of the method AddCustomDataReadEvent and WriteCustom as a filter,
    When a client send a message to the server it will also send his id, then the server can know where the message came from.
    The problem is that all the connected clients get all the messages sent by the server and filter then by id
     
    Last edited: Jan 21, 2015
    Zaddo67 likes this.
  36. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Well, WriteCustom is best suited for you to write custom classes across the network. So you would basically map all of the variables from one class to another.

    Something that you can do on the server to send a message to a particular player is to use the AuthoritativeRPC method. You can mark a method in your class with "[BRPC]" and then you can have the server target a particular player and call the RPC method just for them.

    Eg:

    Code (CSharp):
    1. // A method on the client
    2. [BRPC]
    3. public void SayHello()
    4. {
    5.     Debug.Log("Server says hello to just you!");
    6. }
    7.  
    8.  
    9. // A method on the server
    10. protected override void Update()
    11. {
    12.     base.Update();
    13.  
    14.     if (Networking.PrimarySocket.IsServer)
    15.     {
    16.         AuthoritativeRPC("SayHello", Networking.PrimarySocket, Networking.PrimarySocket.Players[0]);
    17.      
    18.         Debug.Log("Said hello to client 1");
    19.     }
    20. }
     
  37. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489

    @farrisarts: In a previous response to me you wrote:

    I am really hoping that we can get an optional player parameter on WriteCustom so that we can send data to just one player. Even better, make this parameter a collection of player's, so you can send data to the players in the collection. Similiar to zapoutix example above.

    One reason this is needed is when a player joins a game, the server will send them updates on the current world state. You wouldn't want this broadcast to all players...
     
    Brent_Farris likes this.
  38. zapoutix

    zapoutix

    Joined:
    Jan 2, 2015
    Posts:
    44
    I know, but as a beta tester i am doing beta testing :)
    In General it will be nice that all the sending method can send data to a specific user
    - WriteCustom
    - Write
    - WriteTCP
    - WriteUDP
    - ...

    Taking about BRPC, why you made the choice to have a different method name for the one player RPC send (AuthoritativeRPC)?
    Why don't you just add some oerloads to the RPC method NetworkingPlayer inseed of NetworkReceivers?
     
    Last edited: Jan 22, 2015
    Brent_Farris likes this.
  39. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hey! Sorry for the late reply! Almost have the core rewrite for the GC optimization done :)

    So yes! I can see that. I see that I still have it on my feature request list. I will promote that issue so that it can go out with this new GC optimized build! :) In the way that we have the feature system laid out it may actually not be so difficult to get in quickly :)
     
  40. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    The only real reason I have it separated out right now is so that you know that the server is the only one that can use the function properly

    I am designing a system of pushing out all of the players id's to each player so that they are able to identify and request for the server to send targeted RPC calls and other information from one player to another, rather than the default Unity style, all, server or others.

    Once we get the targeted player messaging in, it will open up a whole new world of possibilities and allow for us to expand all of our messaging functions to target players from clients, rather than just from the server! :)

    I have promoted this issue to the top of our ticket system now too!

    Also, sorry for my late replies! I am usually much faster at responding that I was today. Just a lot of Garbage Collection code workings today :)

    Edit: I would like to append that I will be allowing for a "name" variable as a part of the players, so that clients can then easily identify other players by something other than an indexed number
     
    Zaddo67 likes this.
  41. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    That is fantastic :D

    Server sending targeted client messages will be great. I can't think of a use for a client to send a message directly to another client, but if the feature is there, it might come in handy down the track.
     
  42. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    We believe so as well. I believe when you want to have a private conversation within your game that this can be a handy feature to deal with it as well as many other cases in where the user needs a targeted message or to send one.

    As Brent mentioned, we have primarily focused on GC as it was on our list after rapid implementation. Now hopefully with the new GC crush we hope that users can tell the difference on a larger scale project.

    Thanks again for your feedback everyone, we are still on track for getting this networking solution to be more flushed out; with more documentation, more sample projects, more features, showcasing, and much more. We are just as excited as you are to have this closer to its final stages for release.
     
  43. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Just an update to everyone :)

    We just finished getting our Garbage Collection from 86k to 384 bytes. We will continue to comb over to get this number as close to zero as possible! I think that we may have it in a stable enough state to get a new build out either tonight or tomorrow night!

    It is a LOT faster now :)
     
    Last edited: Jan 23, 2015
  44. zapoutix

    zapoutix

    Joined:
    Jan 2, 2015
    Posts:
    44
    Hi,

    You will try to fix this issue on V7 ?

    Regards,
     
    Last edited: Jan 23, 2015
  45. Brent_Farris

    Brent_Farris

    Joined:
    Jul 13, 2012
    Posts:
    881
    Hello!

    Yes, Brett will run tests tomorrow to make sure that Good Ol' Sockets will be working with V7 :)
     
  46. zapoutix

    zapoutix

    Joined:
    Jan 2, 2015
    Posts:
    44
  47. Wh00pAss

    Wh00pAss

    Joined:
    May 2, 2013
    Posts:
    3
    Hi, could you add me to the Beta list for this please? I've just read the whole thread and watched all the videos (nice job on those btw) and its looking great.

    Thanks.
     
  48. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    I have been busy migrating my server code across into Unity. Making good progress. Once complete, I was going to run some performance tests to ensure I don't have any scalability issues down the track; using the benchmarks in this document (Scaled to the limits of what I can do at home of course):

    http://www.smartfoxserver.com/downloads/sfs2x/documents/SFS2X_WP_PerformanceAndScalability.pdf

    But I don't want to waste my time if you are going to do a similar exercise. Can you please let me know if you are planning to execute and release performance benchmarks for Forge Networking?

    Thx.
     
  49. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    Sure, please send an email to support@beardedmangames.com and we will add you for our next beta releases!

    :)
     
  50. Cranick

    Cranick

    Joined:
    Nov 20, 2011
    Posts:
    310
    We actually will be releasing our own performance benchmarks in the coming days.

    This has been planned to have our performance benchmarks to be public as a standard for every release that we send out starting now.

    Also we have plans for our own Unity sample packages that people can run on their local machines to do benchmark tests on their machines/specs.

    I hope this answers your question. :)
     
    Zaddo67 likes this.