[Release] SlimNet Public Alpha (Free)

Discussion in 'Multiplayer Networking' started by fholm, Nov 9, 2011.

  1. Wikened

    Wikened

    New Member

    Joined:
    Oct 31, 2011
    Messages:
    271
    Hey :) I want to try this out but how do I build the files? I do not have Microsft Visual Studios and that software cost money to get?
     
  2. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
  3. Wikened

    Wikened

    New Member

    Joined:
    Oct 31, 2011
    Messages:
    271
    Thanks so much man, I really excitted because this is what I am looking for :)
     
  4. goat

    goat

    Member

    Joined:
    Aug 24, 2009
    Messages:
    2,985
    The script doing the xcopy doesn't have admin rights. I got it.
     
    Last edited: Dec 11, 2011
  5. JanHelleman

    JanHelleman

    New Member

    Joined:
    Oct 11, 2009
    Messages:
    116
    Where can I find 1.1.3? Looks promising!
     
  6. Tomo Games

    Tomo Games

    Member

    Joined:
    Sep 20, 2010
    Messages:
    215
    0.1.3 ? --> It's been several weeks. I suspect he's been busy, which is understandable. The upcoming holidays don't help the situation. ;)

    I still haven't seen parts 4/5 of the tutorials uploaded to youtube...
     
  7. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
    I'm sorry guys, been working double time at my job and taking care of my pregnant wife :) I'm working on it, but expect it to land after new years.
     
  8. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
    Just want to give a quick status update, I'm still working on the next version and it's coming a long nicely, it's taking a bit longer because I wan't it to be rock solid and almost feature complete. I have not forgotten or abandoned it :)
     
  9. appels

    appels

    Member

    Joined:
    Jun 25, 2010
    Messages:
    2,679
    Thanks for the update.
     
  10. DongLee

    DongLee

    New Member

    Joined:
    Jan 30, 2010
    Messages:
    1
    Thank you:) Heroes!
     
  11. Marcel Champagne

    Marcel Champagne

    New Member

    Joined:
    Oct 3, 2011
    Messages:
    1
    This tool will be very handy to test the MMO Network inside-out.
    Or to make a MMO if you sale the code a binary, I will be one of the first to buy your product.

    Keep up the good work, thank you
     
  12. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
    Hey! THanks for the support, working on the next version 0.2 beta, as fast as I can :)
     
  13. SevenBits

    SevenBits

    Member

    Joined:
    Dec 26, 2011
    Messages:
    1,956
    Link is down. I get a 404. Too bad, too. I really wanted to try this out...
     
  14. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
    Aw crap, my webhost went bankrupt and shut down (true story). Will put it up again in the morning :)
     
  15. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
    Also, it might be worth mentioning that the next version, named 0.2B, will be available as open source software :)
     
  16. -HONOR-

    -HONOR-

    New Member

    Joined:
    Jan 21, 2012
    Messages:
    2
    Nice job I was watching the vids but when will be the links again on? I cant download it :(
     
  17. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
    I can't find the 0.1.2 version locally, I think it's stored on my work computer so this might have to wait till monday.
     
  18. -HONOR-

    -HONOR-

    New Member

    Joined:
    Jan 21, 2012
    Messages:
    2
    Thanks for the answer. I hope this tool will come to a final version.
     
  19. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
    Two major new features in the next version (0.2B):

    The server code can now be run both inside Unity and as a stand alone server with no ties to Unity. This allows for the greatest amount of flexibility, for example you can build a game that uses unity physics on the server or allows players to host their own games. And you can also build larger games which scale to more users where doing physics simulation or having players hosting their own games is not realistic by running the server as a stand-alone executable without any ties to unity.

    To my knowledge this is the only networking middle-ware for unity which allows this flexibility.

    The second news is that I've decided to open source all of SlimNet, it's not yet publicly available - but it will be once 0.2B is made available and from then on all development will done on a public github repository.

    Enjoy!
     
  20. Tomo Games

    Tomo Games

    Member

    Joined:
    Sep 20, 2010
    Messages:
    215
    Wow very cool. I like the idea / option of having Physics for non-standalone games where as the User gets to host. Maybe there is a way to run headless too I suppose. :D

    Does this mean you are skipping the release of SlimNet 0.1.3?

    Did you add the Mac Lidgren patch then ?
     
  21. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
    Skipping the release of 0.1.3 yes.
    Yes added the lidgren version using the mac patch, I'm at rev. 272 of lidgren atm which should contain it.
     
  22. Doddler

    Doddler

    Member

    Joined:
    Jul 12, 2011
    Messages:
    189
    This definitely seems like a worthwhile thing to check out. I was going to go with a Lidgren server and run server in c# outside of the unity environment, but this seems to be just that with some of the additional legwork done to manage things as well. The videos do make it look pretty cool! I'll have to wait till you get a new version up to try though since the link is broken. :)
     
  23. goat

    goat

    Member

    Joined:
    Aug 24, 2009
    Messages:
    2,985
    I was going to try this out, I look forward to 0.2B.
     
    Last edited: Jan 25, 2012
  24. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
    Small video updates:

     
  25. Doddler

    Doddler

    Member

    Joined:
    Jul 12, 2011
    Messages:
    189
    That's pretty awesome, can't wait to try it. :D

    I'm curious, is it possible to have more than one server? IE: A standalone matchmaking server, and then the client runs a server to connect individual players to a game? I guess realistically in that scenario you could probably make do with web calls or similar, but I'm curious if it could be done.
     
  26. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
    Yes, this is very possible. But there is no real "built in" support for this, but it's very possible no doubt.
     
  27. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
  28. goat

    goat

    Member

    Joined:
    Aug 24, 2009
    Messages:
    2,985
    Thanks very much. I think I'll just to something 2 player peer to peer with Unity's and then use your 0.2B.
     
  29. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
    Small update, the server is in it's releasable 0.2 Beta state. I'm working on a demo game and manual (expecting it to take a week or so to build something that works) to demonstrate all the functionality.
     
  30. goat

    goat

    Member

    Joined:
    Aug 24, 2009
    Messages:
    2,985
    Good to hear.
     
  31. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
    Small preview and discussion of the demo game:

     
  32. goat

    goat

    Member

    Joined:
    Aug 24, 2009
    Messages:
    2,985
    Looks like you've made it easy on us. Thanks.
     
  33. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
    Slight update again, only code this time. Explains how slimnets "statically typed" RPCs work.

     
  34. appels

    appels

    Member

    Joined:
    Jun 25, 2010
    Messages:
    2,679
    Yep, been there... :)
    Good solution.
     
  35. HGarry

    HGarry

    Member

    Joined:
    Sep 25, 2009
    Messages:
    198
    I thought that you went awol, glad to see some nice progress :).
     
  36. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
    My wife got pregnant, so that took up a lot of time (and still is ;p)
     
  37. ant001

    ant001

    Member

    Joined:
    Dec 15, 2010
    Messages:
    114
    now how did that go and happen?
     
  38. Zhosay

    Zhosay

    New Member

    Joined:
    Dec 12, 2011
    Messages:
    98
    Guess congratulations on that part :).

    How are the accounts in your demo game saved as you say in the server? SQL or Just as a blank file like a config?
     
  39. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
    Not decided on this atm, what would you like to see? SQL or blank file?
     
  40. HGarry

    HGarry

    Member

    Joined:
    Sep 25, 2009
    Messages:
    198
    Congrats dude!, database abstraction, or direct riak implementation :D.
     
  41. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
    thanks everyone :)

    The reason im leaning towards flat file for the demo is that I want it to be possible to run it on osx, windows and linux... adding a database dependency to that complicates stuff a lot.
     
  42. appels

    appels

    Member

    Joined:
    Jun 25, 2010
    Messages:
    2,679
    Flat file is just fine for me, it's not hard to add mysql.
     
  43. Zhosay

    Zhosay

    New Member

    Joined:
    Dec 12, 2011
    Messages:
    98
    Yeah for the demo flat file would be better anyways as it runs on every system then and for small games a complex database is an overkill. Was just asking.
     
  44. HGarry

    HGarry

    Member

    Joined:
    Sep 25, 2009
    Messages:
    198
    I think that's why it's better if you provide general method or class for database abstraction and putting some example for mysql / flat file driver, anyway flat file seems work. Or could be a paid (affordable :D)extra addon for these abstraction ?.
     
  45. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
    I don't know, things like these get so game dependant it's hard to make them into a generic/abstract extensions, and you already have all the DB abstractions you will ever need through .NET libraries.
     
  46. Zhosay

    Zhosay

    New Member

    Joined:
    Dec 12, 2011
    Messages:
    98
    Yes and a DB abstraction won't help somebody who knows nothing about a DB like sql. And if you know sql it should be no problem for you anyways.
     
  47. goat

    goat

    Member

    Joined:
    Aug 24, 2009
    Messages:
    2,985
    I prefer a flat file as well. That is easy enough to fetch with psuedo-SQL if anyone is so inclined.
     
  48. Zhosay

    Zhosay

    New Member

    Joined:
    Dec 12, 2011
    Messages:
    98
    Solved my problem.

    In case someone is facing the same problem.

    Server worked local -> server moved to a root server -> didn't work anymore.

    Faced the same problem by the way with the demo.client <-> demo.server.

    Port 14000 was forwarded wasn't the problem. As the server worked 90% (only on some player actions it crashed).

    The final fix "seems" to be installing Microsoft Visual c++ Redistributable on the server. Works now perfect but not sure if that really was the problem, as its only for c++ created projects or am i wrong there?
     
    Last edited: Feb 7, 2012
  49. fholm

    fholm

    Member

    Joined:
    Aug 20, 2011
    Messages:
    1,696
    Sorry it's been quiet for a while, IRL keeps occupying my time. Anyway, quick status update: Work on the demo is going forward, but also fixed a bunch of bugs in the engine and added a few more nice-to-have features.

    Let me dig deeper into one feature, more specifically RPCs. I already posted a video about parts of this, but I figured I would explain it text. There are a couple of things with RPCs in traditional networking middlewares that has been bothering me: They are not statically typed, You can't return values from them. I set out to solve both of these issues with SlimNet, here's a quick rundown of how RPCs work in SlimNet.

    RPCs In SlimNet

    The first thing you should know is how to define an RPC in SlimNet, you do so by creating a public static field on a static class, here's is an example from the Demo project:

    Code (csharp):
    1.  
    2. using SlimNet;
    3.  
    4. namespace Demo
    5. {
    6.     public static class RPC
    7.     {
    8.         public static RPCFunc<string, string, Pair<bool, string>> CreateAccount;
    9.     }
    10. }
    11.  
    There are two types of RPC classes, SlimNet.RPCFunc and SlimNet.RPCAction. The difference between them is that Func returns a value while Action does not.

    The RPC above, CreateAccount takes two strings (username and password) as arguments and returns a boolean and a string (if we succeeded, and any possible error message).

    This method is supposed to be called from the client and on the server, so, we will create a static function somewhere to intercept this call on the server, it would look like this:

    Code (csharp):
    1.  
    2. [SlimNet.RPC(typeof(RPC))]
    3. public static Pair<bool, string> CreateAccount(string username, string password, RPCInfo info)
    4. {
    5.     ContextPlugin plugin = (ContextPlugin)info.Context.Peer.ContextPlugin;
    6.  
    7.     string error = null;
    8.     bool success = plugin.Accounts.CreateAccount(username, password, out error);
    9.  
    10.     return Tuple.Create(success, error);
    11. }
    12.  
    While the body of the function might not be obvious, all it does is create an account and return a Pair (a 2-Tuple) with the result. You can see the third argument to the function is RPCInfo, this is an extra argument you can add to get data about the RPC call itself (things like who it came from, the context we're running in, the time of the call, etc.)

    And now there is only one thing left, how do we actually call this and fetch the return value on the client?

    Code (csharp):
    1. Demo.RPC.CreateAccount.InvokeOnServer(username, password).OnComplete +=
    2.     (result) =>
    3.     {
    4.          // Code that runs when the result is received back on the client
    5.     };
    Looks pretty simple yes? It is! It's also statically typed so you get auto-completion on everything and there is no risk of changing parameter types or count of an RPC and forgetting to update your calls in your code, as it will not compile unless you modify your calls also.
     
    Last edited: Feb 12, 2012
  50. goat

    goat

    Member

    Joined:
    Aug 24, 2009
    Messages:
    2,985
    Very nice tutorial, I've ever only debugged RPCs calls as a sys admin.