Search Unity

[Released] Bolt, The new generation of networking solution for unity!

Discussion in 'Assets and Asset Store' started by fholm, May 30, 2014.

  1. novello_io

    novello_io

    Joined:
    Nov 22, 2009
    Posts:
    293
    Cool, was able to make my tree chopping script go from singleplayer to multiplayer fairly easily. I used a Global event sent by the client, sent to Client/Server/Sender as recievers:



    Code (CSharp):
    1.     public void ChopTree(Vector3 playerPos, Vector3 chopPos) {
    2.         IChopTree evnt = BoltFactory.NewEvent<IChopTree> ();
    3.         evnt.chopPos = chopPos;
    4.         evnt.playerPos = playerPos;
    5.         BoltNetwork.Raise (evnt);
    6.     }
    To the TreeLogic script attached to the terrain:

    Code (CSharp):
    1. public override void OnEvent (IChopTree evnt, BoltConnection cn) {
    2. //Tree logic stuffs
    3. }
    -Now in a real game, this probably isn't the best since the client is updating everyone else via a global event. What would be the best way to handle this?

    I was thinking of using two events: have the client send an Entity event to the server saying "I want to chop a tree at this location" and the server doing some logic checks, and if it passes send the Global event to everyone to update the tree data and make the one in question fall down. Or is there a better way?

    I didn't do anything special with the physics to sync them up, so I imagine each client is handling their own physics simulations. They looked identical on both my clients and sever, but I imagine there could be some divergence with remote clients at some point. Is this a big deal? Gameplay wise it wouldn't seem to be, even if I did have something like taking damage if it fell on you, I imagine the server would determine that based on its physics sim.

    Cool beans!
     
    Ghosthowl and red2blue like this.
  2. Ghosthowl

    Ghosthowl

    Joined:
    Feb 2, 2014
    Posts:
    178
    Wow, very cool! Kudos to having the first user made Bolt video and in getting your first networked test going. That sync up of the tree falling across the network is beautiful.

    I'm no expert but the way I handle these type of things in a live environment would be to do the following: Send a request to the server as an entity event. (not sure how the chopping would work, say 5 chops, then the tree falls? If so, this is fine, no need for it to be reliable, have the server keep track of each chop request) The server keeps track of the chops on said tree at the specified location. On the final chop, the server would do some sanity checks. Does the tree actually exist that this user is trying to chop? if it does, is the location of the tree valid? does the user actually have the weapon needed to chop this tree? is the user in the given range needed to chop this tree? etc. In this case, the server is keeping track of everything, it knows the users position, it knows which tree he is aiming at and chopping etc. The event then to chop the tree would just be a blank request that the server would then interpret by the event name.

    If the chop request is valid, the server would fire off a global event for everyone on the server with only one parameter (in this case you would need two classes - one inheriting from BoltEntityBehavior for the entity event and one from BoltCallbacks for the global event), the id of the tree that needs to fall. Depending on how many trees the game would have this number could be as small as a byte. Upon the clients receiving the global event, they would decode the id to figure out which tree it is that needs to fall (you would keep track of trees spawned somehow by a dictionary or some means to BoltEntity's or GameObjects associated with corresponding ids or hopefully with a universal id that Fholm might make available like a viewID or sender.id in unity networking or uLink - then you don't necessarily have to do this ) make the tree fall. It seems complicated and cumbersome, but by doing this, you have eliminated the need for those 2 Vectors for the position of the tree, thus saving bandwidth. Saving bandwidth makes everyone happy :D

    Usually you do all the physicals simulations locally and and just fake it for the players to think they are in sync when they are not. If your game requires players to have the physics sync up exactly, you will need some sort of rigidbody sync and smoother. Interestingly enough Bolt seems to handle the smoothing and syncing of rigidbodies INSANELY well, more so than any script or algorithm I have made or found or any example I have seen in other networking platforms. I am actually curious to try some simulations to see how far and accurate it can go. Also with it's great compression options, you really could get something going. From what I've seen in the past, it is hard to do this as the amount of bandwidth sent across the network syncing things up can get quite enormous as you can imagine. You could always do an ugly 'snap' or interpolation to the final position the server has in its calculation. (say when it collides with the player on the server, so it makes sense to the client)

    Dunno though there's always many different ways of doing things, that is just my take :)
     
  3. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,043
    Hey!

    I will respond to the final posts and suggestions in this forum thread later today, but I just wanted to post a notice saying that I have decided to open a specific support forum for Bolt.

    Currently I have been providing support the following ways: Skype, IRC, this forum thread, uservoice.boltengine.com and private messages on this forum. It's simply not feasible for me to try to do support in so many places at once, and some of them being very instant/direct mediums (Skype, IRC, mostly) making it hard for me to give proper and thought through replies when I don't have time - and me often forgetting to get back to someone on IRC, etc.

    The address to the forum is this: http://forum.boltengine.com/

    It's a standard phpbb forum, sadly you need to register a user on it as I was not able to get twitter/facebook integration working.
     
    novello_io and Ghosthowl like this.
  4. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    6,458
    Sweet. Much easier to read than a bloated forum thread.
     
  5. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,043
    Yeah, it's my goal to provide as good support on bolt as possible, but the way I'm currently doing doesn't work, because almost everyone has the same questions, and I have to type them over-and-over-and-over-again.

    I really did not want to open "yet another forum", but I really see no other way to make this work and available in a nice format.
     
  6. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    6,458
    Yeah but this will scale the best, everybody is used to Forums and its easy to register. =)
     
  7. novello_io

    novello_io

    Joined:
    Nov 22, 2009
    Posts:
    293
    To anybody on the fence, go buy this. Seriously, I'm a n00b to networking but after a few days and fholm's awesome support - I feel so empowered!
     
    Ghosthowl likes this.
  8. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,043
    Wow, don't think I could get a better review then that :)
     
  9. Rico21745

    Rico21745

    Joined:
    Apr 25, 2012
    Posts:
    409
    Yeah I'm really eyeing this asset for networking later. We're not at that stage with out project yet (building SP until its fun then we're tackling MP) but it really does look like Bolt might be the fastest way to get things going.
     
  10. RJproz

    RJproz

    Joined:
    May 19, 2013
    Posts:
    50
    I have some few questions about your Package @fholm
    1) Does it work online? I mean can players from different regions (not in same network) connect with it?
    2) If it works online then how does it handles NAT / Port forwarding. Do i need to host some NAT Middleware (just like Unity NAT Facilitator) on VPS to do so?
     
  11. pixelquaternion

    pixelquaternion

    Joined:
    Jun 28, 2014
    Posts:
    122
    Hi there,

    We were going to buy the atavism network solution and mmo so we just want to know how does your asset compared with it or other like ulink?

    Thank
     
  12. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    336
    @fholm
    PM me the next sale and i'll pick it up
     
    KyleOlsen likes this.
  13. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,043
    I'm glad you're looking into bolt, if there's any questions or ideas you want to throw around head to the bolt forums at forum.boltengine.com and I'll do my best to answer (I used to do support in this thread, but it just does not work in practice).

    1) Yes it does. Yes they can.
    2) Currently there is no NAT punching (but it's coming soon, was supposed to be this weekend but it's going to be a week or so late), so the server would have to open its own ports.

    I would say that Bolt is more targeted at non-MMO games, I am adding features for transferring players between different zone-servers. Bolt solves a lot of really hard networking things for you automatically (state sync, position sync, animation sync, to mention a few), and it's currently the only solution for Unity which does so.

    Will do
     
  14. RJproz

    RJproz

    Joined:
    May 19, 2013
    Posts:
    50
    @fholm
    Thanks for your reply.
    I m not really a master of "networking", but as per my knowledge to connect peers online some kind of port forwarding or related things is to be done to map private IPs with public ones. In some case player may be behind even more deeper private networks before they are connected online. So your package can still help players to connect online without NAT/ Port forwarding? It means your package does some sort of peer 2 peer connection via some mechanism and i don't need any third party server to do this (except MasterServer to store game metadata).
    Correct me if i m wrong.
     
  15. Shawn67

    Shawn67

    Joined:
    Jan 2, 2014
    Posts:
    2,196
    I have Atavism and it still has a long way to go to really be useable imo. They still don't have server-side collision in and the authoritative server stuff is still on the schedule. It just went into beta, but to be honest imo it isn't ready for beta. Depending on your project, it may work for you but I wouldn't recommend it if you are in any kind of hurry. I'm still hoping they pull things together and deliver on what they have promised but atm, I'm looking at other options.

    While Bolt isn't an MMO in a box solution like Atavism promises to be, I have faith in fholm from seeing him around these forums that he can deliver a solid network middleware. That is one of the reasons I went ahead and purchased Bolt yesterday even though it isn't and MMO-ready project at the moment. I'm thinking with the combination of the source and what is already done (along with the zone feature that is coming and hopefully Unity 5's core breaking the 128 user limitation), I may still be able to build a modest MMO with it.. Nothing on the scale of WoW, but hopefully something still with an MMO feel that will be fun to play.

    At any rate, if you are looking for something to do an MMO right now, I would say neither project would be a perfect fit. If you are looking for something to grow with and will be coding most of your own features, I would say Bolt would be closer to uLink or Photon. If you have time to wait and want MMO in a box type thing where a lot of the features are built for you, Atavism will hopefully be finished enough at some point to give that. I still like what they have promised and hope they come through. The results just haven't been there enough since I bought my license in January to cause me to not look at other options.
     
  16. MrMassively

    MrMassively

    Joined:
    Sep 4, 2013
    Posts:
    115
    Awesome,
    i like new fresh networking solutions for unity.

    got a few extra questions:

    1- you mentioned that you will be adding transferring players between different zone-servers. something similar of what uLink does, right?. do you have an estimate time frame for this feature?
    is it withing the next month or is it just in future general plans as in sometime within next year. if this feature would of been already i would just pick this product right away.

    2- one of the features you offer in Bolt is:
    how does this exactly work, since bolt works within a unity instance so the player will only be in the current map/scene the server is at, i am not exactly sure what you mean by the feature, you mean the same server instance can load a session based gameplay within the same instance like uLink?
     
  17. pixelquaternion

    pixelquaternion

    Joined:
    Jun 28, 2014
    Posts:
    122
    Hi Shawn,

    Thank for the in depth explanation of your experience with atavism and yes i know that many features are not yet implemented and also that it is more of an alpha at this stage.

    Regarding coding i am a slow average coder but my real strength is my 15 years in 3d modeling, rigging and animation as a professional so for me networking code is still something i am not at ease with, so that the reason i am looking at a decent solution with minimal network coding.

    We were going to go with ulink but then we saw the atavism website and now there is also Aik solution and the confusion still grow in our mind regarding what asset we should go for.
     
  18. Shawn67

    Shawn67

    Joined:
    Jan 2, 2014
    Posts:
    2,196
    I am kind of in the same boat except I had started to go down the Photon path using Photon Server (not the cloud option).. But I'm still not tied to any single engine and am exploring my options. One thing that I really like about Bolt is if I need it, I have access to the source code. Not that I'll ever need it or touch it, but the option is currently there without having to spend a ton of extra money. Plus fholm is very actively supporting it. The only things in question for me are the MMO capabilities which have been openly stated it isn't written to support. But hopefully with the zone stuff he has talked about adding and changes to the unity core in Unity 5 will help to change that... :)
     
  19. MrMassively

    MrMassively

    Joined:
    Sep 4, 2013
    Posts:
    115
    pixelquaternion

    what is the Aik solution??

    is this another networking solution for unity? i just havent heard of it yet.
     
  20. pixelquaternion

    pixelquaternion

    Joined:
    Jun 28, 2014
    Posts:
    122
    MrMassively likes this.
  21. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,043
    Yes you would require port forwarding currently for Bolt, the NAT punching will come during July, but it's not quite done yet.
     
  22. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,344
    Hello fholm,

    I've been researching some new networking solutions for my game, (was using UnityPark but the license is just too expensive for me, so i decided to switch), and i came across Bolt.
    I was looking to find a solution that would help me create the following in a easier way than from scratch:
    - Lobby System
    - Dedicated Servers ( ruled out Photon Cloud )
    - Unity server instances ( ruled out Photon Server and SmartFox )
    - Custom Authentication with message encryption
    - some others that i'm not remembering

    I also wanted a cheaper solution than the one i was using ( UnityPark is close to 700€ for a single indie game license ),

    I've seen the documentation and the tutorial on the website, and looks like a great solution for a very affordable price :) It's also quite different from the majority of networking solutions out there for Unity

    Since it's in Beta and many features are still not implemented, i wanted to know if you could tell me what are some of the major features you are planing to implement in Bolt during the next updates, or during the beta stage.

    -Tiago
     
  23. jasonMcintosh

    jasonMcintosh

    Joined:
    Jul 4, 2012
    Posts:
    71
    A roadmap is in this post. May have changed since then, but that's as official as it gets. (This should go in the FAQ page, Fredrik, for your sanity.) :)

     
  24. jackson31

    jackson31

    Joined:
    Aug 25, 2010
    Posts:
    28
    Hi fholm,
    I just bought the asset, trying to follow the tutorial but whenever a client connects to the server I get this error almost immediately

    exception thrown while unpacking data from 127.0.0.1:65406, disconnecting

    What could it be?
     
  25. jackson31

    jackson31

    Joined:
    Aug 25, 2010
    Posts:
    28
    I fixed the problem by deleting the bolt/samples folder
    Somehow my scene/project had been contaminated by the vehicle example ( I think )
     
  26. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,043
    Hi Jackson31, sorry for my late reply: Are you using the 0.2.1.1 version of Bolt? This issue was fixed there.
     
  27. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,043
  28. AwesomeX

    AwesomeX

    Joined:
    Sep 10, 2013
    Posts:
    112
    This really does look good. I wish I could get it, but I just don't have $60 right now.

    Great work though fholm, I hope I can pick it up soon!
     
  29. AwesomeX

    AwesomeX

    Joined:
    Sep 10, 2013
    Posts:
    112
    Things are a bit quiet here huh?

    I've been reading a lot of reviews on Bolt, but I'm still unsure if it will work for me.

    Coming from Photon networking, I'm wondering if Bolt is in a stable enough state to start a full fledged game?
    I know it varies for different types of games. But lets say, a simple team deathmatch FPS?

    Also, to those who have bought Bolt, how is it?
    I mean, I believe it would work for me, but I'm just wary when I go tossing $65 at something, lol.
     
  30. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,790
    Check out the Bolt forums. The link is on this page or the one before this, can't remember. :)
     
  31. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,005
    Keep in mind that Bolt is still in beta.
     
  32. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,043
    Hey!

    Sorry for the late replies in this thread (and on the bolt forums), I'm on the last week of my "vacation" (not really possible when you're trying to run your own company) and renovating a room in the house currently.
     
  33. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,043
    Yes, it's still in Beta, and a huge update is dropping pretty soon.
     
  34. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,005
    I know ... and I'm looking forward to it! Bolt is shaping up very nicely, in my opinion. :)
     
  35. AwesomeX

    AwesomeX

    Joined:
    Sep 10, 2013
    Posts:
    112
    I know I've asked before, and It's alright if you can't
    But is there any sort of discount I can get?

    This School budget isn't helping me, lol.
     
  36. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,052
    Just thought I'd mention that It is *discounted* right now since it's in Beta. It will not be $65 when it's prime time. I would try hard to find a way to scrape together the money.
     
  37. novello_io

    novello_io

    Joined:
    Nov 22, 2009
    Posts:
    293
    Incredibly worth it compared to the price of uLink or PUN in my opinion...much easier to work with as well.
     
  38. AwesomeX

    AwesomeX

    Joined:
    Sep 10, 2013
    Posts:
    112
    Upon following the tutorial on the Bolt site, I got to the step for creating the ServerBehaviour and ClientBehaviour scripts/objects.

    I then put them in the BoltDefaultConfig configuration file as it said to do.

    But upon starting it through the Map Launcher. I get this error spammed on the server. And the client can't seem to connect.

    Code (CSharp):
    1. 11:10:19:497 | thread #003 | error | could not bind socket, platform code: 10048, platform error: AddressAlreadyInUse
    2.    at System.Environment.get_StackTrace() in /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Environment.cs:line 227
    3.    at UdpKit.UdpLog.Error(System.String format, System.Object[] args)
    4.    at UdpKit.UdpSocket.OnEventStart(UdpEvent ev)
    5.    at UdpKit.UdpSocket.ProcessIncommingEvents(Boolean returnOnStart)
    6.    at UdpKit.UdpSocket.NetworkLoop()
    7.  
    Spams in the Unity console, and Bolt console.

    I only just got Bolt, and although I like it. I'm not really sure how I'd lets say. Make a server. And give the game to a friend to connect through the web.

    And the documentation on it is pretty scarce, but that's to be understood, as it's Beta.

    Thanks.
     
  39. AwesomeX

    AwesomeX

    Joined:
    Sep 10, 2013
    Posts:
    112
    And I'm not very sure how Events work exactly on Bolt..

    It's suppose to replace the RPC function that is used on a lot of other networking solutions.

    I tried to do something very simple, such as changing the color of a player to red upon pressing a key. After looking at the tutorial and docs, it seems like much, much more hassle, then just typing [RPC] before the function.

    Also, I tried setting my Event type to Color and Color 32, but it just tossed errors at me. I can't even set Trigger or Custom types for some reason.

    I managed to get it to change your player color on key press, but then to my surprize it didn't sync to other player's. I thought events automatically did that? Unless I'm mistaken, or missed something.

    I feel that Bolt has potential but at the moment, I'm very unclear on a lot of things. And the tutorial seems a tad outdated. (Not to mention it's the only real tutorial out there)

    That and these responses on the forums are very slow, lol.

    Still, looking forward to the new update!
     
  40. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,005
    Are you aware of the Bolt support forum?
     
  41. AwesomeX

    AwesomeX

    Joined:
    Sep 10, 2013
    Posts:
    112
    Indeed, but I figured more people would see it here. lol
     
  42. AwesomeX

    AwesomeX

    Joined:
    Sep 10, 2013
    Posts:
    112
    I'm wondering what the team of Bolt is currently.

    I know fholm said he's renovating a room somewhere in his house.

    But if he's doing that, who's working on Bolt lol.
     
  43. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    273
    Hi Guys, sorry for a nub-ish question here. I went through the tutorials, which used the map launcher for testing moving the robot around across 2 clients. These worked beautifully. However, I can't quite figure out how to get this working outside of the editor (e.g. in the PC standalone). I saw on page 2 or 3 someone had the same issue and simply removed BoltClearScene.

    I also looked at running via the code only:
    http://www.boltengine.com/Tutorial.aspx#But_____what_about_the_code_

    So I basically removed the BoltClearScene, and made a new gameobject in Map0 and attached
    ServerBehaviour.cs on it which has the InitializeServer command on it. This didn't work, so I guess I've stuffed something up - could someone please give me a hint?
     
  44. AwesomeX

    AwesomeX

    Joined:
    Sep 10, 2013
    Posts:
    112
    I'm pretty sure there's no documentation on starting a client/server using code outside of the editor..
     
  45. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,790
    You guys really have to use the Bolt forums. Lots of help there. Skim above and find the link.
     
  46. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    273
  47. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,790
    I don't want to be critical, but the above post is only a few posts above yours. ;) You will find a dedicated forum there pertaining to Bolt.
     
  48. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    273
    I don't want to be critical either, but did you read my post above?
    Anyway, unless someone wants to give me an actual helpful answer please don't bother replying.

     
  49. NightStorm_100

    NightStorm_100

    Joined:
    Aug 28, 2013
    Posts:
    23
    Is it possible to get a Trial?

    I dont want to waste a lot of Money again on a Networking Engine that may or may not suit my needs.
    I dont like buying things blind...
     
  50. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,005
    If you're looking to evaluate Bolt, my guess is you'll probably want to wait for a few more updates. It's in beta and there's been nearly a dozen updates in the last couple of months, with a fairly major update due shortly. Not all of the pieces are present, and it's being actively debugged.