Search Unity

Zapnet - Game Networking Framework for Programmers

Discussion in 'Multiplayer' started by zaekona, Feb 9, 2020.

  1. zaekona

    zaekona

    Joined:
    Jan 17, 2020
    Posts:
    14
    Hi Unity community, we'd like to introduce our first asset to you. We're using this to build our own game on Steam :)

    Useful Links

    Asset Store
    https://assetstore.unity.com/packages/tools/network/zapnet-161336

    Discord
    Join us on Discord for support and discussion.
    Please keep all Zapnet related chat to the #support channel.

    Documentation Wiki
    https://zapnet.dead.gg
    The wiki is constantly being added to based on feedback from our customers, we offer direct support via PMs on Discord too if you want quick help getting started!

    About Zapnet

    Zapnet is a multiplayer games framework for Unity developed specifically for programmers. Many other assets try to make their frameworks more accessible to less experienced developers by integrating visual editing into the Unity Editor by sacrificing performance and speed.

    Zapnet trusts that the programmer knows what they're doing.

    The full source code and access to the Git repository is available on request for a small additional price.

    Zapnet will always remain a single one-off cost for a license and will NEVER switch to the model of requesting a percentage of your hard earned revenue.

    Documentation

    See the Zapnet/Docs/index.html file for a short getting started guide and access to the Zapnet API scripting reference.
    • Every method and class in the Zapnet API is fully documented.
    • The package also includes an example game to demonstrate movement and shooting.

    Getting Started

    See the Getting Started page to start using Zapnet but be sure to read about the concepts and features below.

    Concepts & Features

    Zapnet has an array of concepts and features that make it easy for a programmer to make any game multiplayer, whether its a turn based game, a fast-paced multiplayer action game or shooter, or even a large open world survival game.

    Network Prefabs

    Instantiate any prefab with the NetworkPrefab component easily by transmitting its unique 2 byte identifier and instantiating it with one simple method call on the other side.

    Delivery Modes

    Makes use of all delivery modes that Lidgren supports such as Reliable, Unreliable Sequenced, Reliable Unordered, Reliable Sequenced and Reliable Ordered.

    Entities

    Network entities are the main concept behind Zapnet, all objects you want to be replicated across the network will inherit the entity class. By default, the position and rotation of entities are automatically synchronized and interpolated smoothly.

    States

    Every entity has its own state class that inherits a basic state class. The state will contain variables relating to the entity that need to be sent very frequently with entity state updates. It's very simple to use.

    Events

    With the event system you can create an event data type that can be serialized and sent over the network, deserialized, and then invoked on all subscribers for that event. Events can be transmitted globally or for a specific entity.

    Synchronized Variables

    Entities can have synchronized variables that are separate to state variables and are only synchronized when they have changed.

    Remote Calls

    While it is recommended to use events because they are faster and more performant, you can use remote calls which are Zapnet's version of the RPC. They do not use reflection like some other networking alternatives.

    Network Hitboxes

    A build in network hitbox rewinding system. Simply attach the NetworkHitbox component to an entity (or any prefab) with a trigger collider. When a raycast is performed using Zapnet's raycast methods, hitboxes will be automatically rewound to the position they were at on a particular server tick before the raycast is made.

    Controllables

    The base controllable entity can be inherited by your player class to handle the transmitting of input data, client-side prediction, and server reconciliation with very minimal effort on your part except from defining which inputs are being pressed and how to handle the application of those inputs with regards to your character controller.

    Entity Subsystems

    Entity subystems are additional components that can be added to entities. Each subsystem can contain its own Synchronized Variables, State, and can make Remote Calls. Subsystems have an Entity accessor to get the entity they belong to. Infact, an Entity is just a Subsystem, so everything a subsystem can do an entity can do too.

    Media and Examples







     
    Last edited: Feb 9, 2020
    kurozael likes this.
  2. TiToMoskito

    TiToMoskito

    Joined:
    Jan 28, 2014
    Posts:
    66
    This library is really amazing! Easy to understand and best support i seen.
     
    kurozael and zaekona like this.
  3. kurozael

    kurozael

    Joined:
    Jan 8, 2014
    Posts:
    4
    Please feel free to PM myself or @zaekona for support with Zapnet, we'll be happy to help you :)
     
  4. NaughtyMoleGames

    NaughtyMoleGames

    Joined:
    Jan 25, 2018
    Posts:
    51
    I'm loving this asset. The code is clean and easy to understand. And no matter how much I bug them with questions or concerns they always are there to help!
     
    zaekona and kurozael like this.
  5. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    Unfinished documentation... €53.60

    Usually you go with a cheaper early access price point for something that is unfinished... Just saying
     
  6. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,168
    Basing the lib on Lidgren is a bad idea. Lidgren is fairly slow, has a few security flaws where you can remote alloc large blocks of memory and it's not maintained.
     
    Joe-Censored likes this.
  7. zaekona

    zaekona

    Joined:
    Jan 17, 2020
    Posts:
    14
    Hi @TwoTen we are maintaining our own fork of Lidgren. Lidgren has also proven very fast with 500 clients and a low footprint:
    upload_2020-2-10_20-5-3.png
    Regarding documentation @Player7, our customers have been very satisfied and have given 5 star reviews for our service. The online guides are being finished this week, but we provide direct support to our customers and assistance with everything they need. We even helped one of our customers directly with Zapnet integration of Kinematic Character Controller.

    The code is fully documented and an offline scripting reference is provided with the package.

    If you have any questions about Zapnet, we will be happy to answer here or on our Discord :)
     
    Last edited: Feb 10, 2020
    kurozael likes this.
  8. TwoTen

    TwoTen

    Joined:
    May 25, 2016
    Posts:
    1,168
    Those numbers do not translate into Unity. Not even close.

    Is your fork open source?
     
  9. zaekona

    zaekona

    Joined:
    Jan 17, 2020
    Posts:
    14
    Hi @TwoTen, I do not want this to turn into some argument about whether or not Lidgren is the right solution for our product. We are offering Zapnet as a fast, easy solution to get decent multiplayer into a game with an aim to support up to 300 players with our scoping system.

    We are using Zapnet for our own Steam game and we are not experiencing any problems with numbers like this. At this time, no, our fork is not open-source. However our fork has fixed various issues relating to Unity specifically.

    If you have any other questions about Zapnet, I'd be happy to answer them :)

    I would also just like to add to my previous point, @Player7, Zapnet itself is not unfinished. It is fully fledged and includes all the features listed in the OP. The only thing that is unfinished, are the guides outlining each feature.
     
    Last edited: Feb 10, 2020
    Joe-Censored and kurozael like this.
  10. kurozael

    kurozael

    Joined:
    Jan 8, 2014
    Posts:
    4
    We'll be pushing version 1.13 later on this week which includes some improvements to Network Hitboxes and a new IControllable interface that all controllables implement :cool:
     
    zaekona likes this.
  11. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    Well stuff like that certainly helps (the more bare bones the better in a way, so far mirror has a few asset packages but they are all heavily intermixed with other gameplay stuff, ie vis2k other mirror related assets, that you would have to spend additional time just trying to pull it apart and they are all tcp based character controllers) still not much good if it isn't documentated or script examples provided for other asset integration..
     
  12. zaekona

    zaekona

    Joined:
    Jan 17, 2020
    Posts:
    14
    Yep @Player7, the remaining guides will be done soon, and Zapnet will soon have a Dissonance Voice Chat integration, we are working with the Dissonance team and that should be going live as soon as they’ve finished reviewing it :cool:
     
  13. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Took a quick look at the asset as posted to the store and it looks like Zapnet and Lidgren are provided as separate DLL's. What is the cost associated with the above comment, and does it include the source for both or just the Zapnet dll?
     
  14. zaekona

    zaekona

    Joined:
    Jan 17, 2020
    Posts:
    14
    Hey @Joe-Censored, at this time that would be 25 dollars for the Git repository access :) PM me on Discord or @kurozael for any pre-sale questions we’ll be happy to answer!
     
    Joe-Censored likes this.
  15. NaughtyMoleGames

    NaughtyMoleGames

    Joined:
    Jan 25, 2018
    Posts:
    51
    @Player7 I have used mirror in the past, and while it provides so much, it also has over complex code that's a nightmare to change since its all so heavily tied together.

    I can say that is the best thing about Zapnet, the code is direct and makes logical sense. Even though the documentation is lacking (they published a couple pages this week) they have answered all my questions on discord within a few hours at most.
     
    zaekona likes this.
  16. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    I don't doubt it, Mirror is a bit of complex beast and never ceases to have problems with newer Unity versions that are in beta, with all its reflection and certain libraries... still it is well supported.

    For me the price point just isn't what I'd consider throwing money at to try out, considering most the addons I buy I only ever just end up trying out. Time to learn and implement is a dedication to the hobbyist gamedev in me just doesn't get around to alot so I look for things that are well supported, easy to implement, and have the features or at least have implementation support with other related unity assets. Maybe at half its current price on an asset store sale I'll pick it up. Does it even support webgl/websockets, tcp transports?
     
  17. zaekona

    zaekona

    Joined:
    Jan 17, 2020
    Posts:
    14
    Hey @Player7 part of the reason for the higher price tag is due to its purpose being very specific. Zapnet is centered around UDP and designed primarily for fast-paced server authoritative multiplayer, and it manages that very well.

    It could be used for a turn based or strategy game too, it remains flexible but it’s there to help you as a programmer get support in for fast paced multiplayer as quickly as possible while remaining extremely performant (no allocations where possible and extremely limited use of reflection - only once per entity type to get which synchronized variables exist.)

    At this time there are two particular reasons:

    1. Higher price because of its specific purpose, this usually results in less sales than something made to fit every possible circumstance which would be ultimately be less performant and more bulky because of it.

    2. The higher price means we still get paid for our work even though less sales come in, but we can focus on giving great direct support to the customers we do have, and expanding on the product to help with our customer’s needs.

    I hope this gives an adequate explanation for our reasoning, at least for the time being. :oops:
     
  18. zaekona

    zaekona

    Joined:
    Jan 17, 2020
    Posts:
    14
    Hey everybody :cool:

    For the next week Unity has Zapnet on sale for 50% off, so now is a great time to give it a try for your multiplayer project.

    Please feel free to join us in Discord if you have any pre-sale or post-sale questions and we’ll be happy to help you out!

    We are building a friendly community around Zapnet that we’d love for you to be a part of :)
     
    kurozael likes this.
  19. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,408
    nice, purchased! looks pretty interesting.

    i hope there is some simple (and perhaps more complicated) example scenes coming up (if not already there),
    that would be great it want to quickly prototype something.
     
  20. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
  21. zaekona

    zaekona

    Joined:
    Jan 17, 2020
    Posts:
    14
    Hey @mgear, thank you, it's great to have you aboard! If you can send a PM to @zaekona or @kurozael on the dead.gg Discord server we can give you access to the #customers channel. Zapnet does include a simple demo that covers networked player movement, input, and projectiles / lag compensation but we will endeavor to create more examples soon.

    @Player7 at this time we have no plans to support WebGL, but there's no reason why Zapnet wouldn't work on the other platforms. We are using Facepunch's Steamworks wrapper with our game and it works great! Our documentation shows how login packets are handled and we simply use this system to include the player's Steam ID and authenticate with Steam when a player connects to the server.

    I don't see why it would be any different to integrate with any other Steamworks wrapper, because Zapnet is just providing you with the tools to handle communication, events, synchronized variables, client-side prediction, server reconciliation, and lag compensation. You can hook up any additional processes for authentication inside your implementation of the IClientHandler and IServerHandler interfaces.

    Please feel free to Join our Discord and we'd be more than happy to answer your questions and provide support if you've already purchased Zapnet :D
     
    Last edited: Oct 29, 2020
  22. zaekona

    zaekona

    Joined:
    Jan 17, 2020
    Posts:
    14
    Hey Unity community!

    The latest version of Zapnet is now available on the Asset Store! We now have 10 fantastic 5 star reviews from our friendly customers and we look forward to growing the community further :D

    In addition, Zapnet is still on sale until the 29th February!

    Zapnet 1.2
    • Started adding [Server], [Client] and [Shared] tags to method documentation to indicate where they should be used
    • Can use the Zapnet.Entity.PreventSpawning method on the client to prevent entities being spawned until the client is ready to accept them
    • Avoid creating a new NetClient every time a connection attempt is made
    • Added a way to customize or disable the compression of entity positions
    • Added a way to completely freeze an entity so that it does not get included in state updates
    • Added SyncByte, SyncVector3, SyncQuaternion, SyncColor and other primitive synchronized variable types
    • Added an Enable Interpolation option to all entities so that developers can implement their own method of interpolating remote entities
    • Added an overload to select which network address to bind to
    • Added IControllable support and Synchronized Variables can now be properties too
    • Added the Zapnet.Prefab.LoadWithId method to force a network prefab to be loaded with the supplied identifier
     
  23. LukeDawn

    LukeDawn

    Joined:
    Nov 10, 2016
    Posts:
    404
    Thanks for the update @zaekona and @kurozael that's quite a lot of new stuff - and mostly everything I've seen people ask for in Discord. Top work guys.

    Really enjoying working with Zapnet - it's so much simpler workflow-wise than many other frameworks I've come across, and I'm not having to waste my time untangling game code - it's pure network control (all the stuff I don't want to deal with).
     
    kurozael likes this.
  24. kurozael

    kurozael

    Joined:
    Jan 8, 2014
    Posts:
    4
    Thanks @LukeDawn it’s awesome to have feedback and your contributions and requests have been great in Discord too :cool:
     
  25. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,408
    Finally testing a bit, few questions:
    - in docs is says "Server Build which can be ticked in the Unity Build Settings.", but is that actually the checkbox in initializer component?
    - what should happen with the demo scene when its run? (maybe could add some UI text info there)
    - is there some easy way to quickly test both client and server in same project in playmode? (instead of opening 2 projects one as client and one as server?)
     
  26. zaekona

    zaekona

    Joined:
    Jan 17, 2020
    Posts:
    14
    Hey @mgear, apologies we mostly reply in Discord!

    1. Server Build in Build Settings will create a headless Unity server, this will make Zapnet a server by default.
    2. When the Demo Scene is run as a Client and a Server is up, you will spawn as a player and can move and shoot. But I agree some UI would be good here.
    3. At the moment no, however one of our customers has created an extension that does something like this which can be found in the #sharezone channel on our Discord :)
     
  27. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,408
    Thanks! no problems (posted here because not in a hurry :) , ill check discord for that (3).
     
  28. William4458

    William4458

    Joined:
    May 8, 2016
    Posts:
    3
    I would love to see some youtube tutorials just to see how it works and how it's designed.
     
  29. jhbyhuangzejie

    jhbyhuangzejie

    Joined:
    Mar 10, 2017
    Posts:
    7
    Hello, can you support IOS and Android?
     
  30. zaekona

    zaekona

    Joined:
    Jan 17, 2020
    Posts:
    14
    Hi everybody! We are doing a Spooky Halloween Sale :eek:, join our Discord for more information :oops:

    The Zapnet Beta (for those with source access) includes a bunch of fixes and features not quite ready for public release, but very stable. Join us to find out why our customers think Zapnet is awesome :D
     
    zyzyx likes this.
  31. zaekona

    zaekona

    Joined:
    Jan 17, 2020
    Posts:
    14