Dec/31
2009

[This is a featured article, scroll down for more recent entries]

Welcome back, I haven't written a tutorial in a while so I thought I would make this one worth having waited for.

The purpose of this guide is to help you, the developer, to create a networked virtual environment without having to do any coding whatsoever. It goes without saying that the fastest methods of content creation are usually the best when working as an independent professional (or even as a member of a small team). With that having been said, I'm aware that this information is highly sought after and that I could probably benefit more by selling it as an eBook. As things are however, I will be providing this information free of charge (88|) with the only cost being for the project file ($2), should any of you want it. Moving on, we need to discuss the following...

  • The difference between an authoritative server and a non-authoritative server
  • The different server solutions Unity supports
  • The SmartFox multi-user server

  • An authoritative server, understood in the context of gaming, is a process which simulates the virtual environment and updates all clients/users with objective data. As an example, if we imagine a group of physics objects colliding with one another, an authoritative server would simulate the collisions by itself and update the client(s) as changes occur whereas a non-authoritative server would simply ignore the complexities involved with the simulation and not bother updating the clients (which then leads to inconsistencies regarding what each user sees). An authoritative server is significantly more complex to create/set up than an otherwise non-authoritative version, it is also more demanding of system resources. This is an incredibly brief summary of a subject which is infinitely more complex than I have hinted at here but, for now, that's all you need to be aware of. We're going to look at a non-authoritative solution, just the very basics. Unity does have its own built-in solution for creating multi-user environments. It is, however, a bit more complex to set up than the method I am about to show you. Some alternatives to Unity's integrated solution are SmartFox, NetDog and Photon. Today, we'll be looking at SmartFox. A bit of background, to quote from the SmartFox website:

    SmartFoxServer was originally designed to specifically target Flash Player based applications and games. Thanks to its popularity it has quickly gained interest among other technologies such as Java, Director, .Net/Unity 3D etc...

    So, moving on to the first step on the next page...

    Pages: 1 · 2 · 3 · 4 · 5

    17 comments »
    Trackback address for this post

    Trackback URL (right click and copy shortcut/link location)

    17 comments, 2 trackbacks
    Comment from: Martijn Zandvliet [Visitor] · http://www.synthode.com
    Great stuff! Look at how cute those little green capsules are, awwww.
    01/01/10 @ 11:36
    Comment from: Andrew Marunchak [Member] Email
    Yes, watch out for Green Capsules Online, the only real free sandbox MMO coming your way soon.! ;p

    Hehe, I didn't want to give away any models. This really is bare bone stuff.
    01/01/10 @ 17:17
    Comment from: steve [Visitor]
    Your stingy (couldn't resist saying it).
    01/04/10 @ 13:42
    Comment from: David Golds [Visitor] Email · http://mygamebuilder.com
    Nice article. I wish I'd found it 3 months ago.. sigh!

    Also, take a look at ExitGames' Photon server - http://blog.exitgames.com/?p=677
    01/05/10 @ 09:02
    Comment from: Sentinel3dsm [Visitor]
    this realy sounds great!
    but i got some problem when importing the package... when i push the import button unity crashes
    01/15/10 @ 21:21
    Comment from: Andrew Marunchak [Member] Email
    Sentinel, which version of Unity are you using?
    01/17/10 @ 18:31
    Comment from: Sentinel3dsm [Visitor]
    hehe... sorry! i had 2.5
    you need 2.6 (maybe good idea to put it in front of your tutorial)

    so now it works! now i can finish my game... Great WORK!! thnx
    01/17/10 @ 19:41
    Comment from: Mirage [Visitor]
    When I run the game I get an error on line 62 of the LoginGUI.cs script (smartFox.ProcessEventQueue). Any Idea what causes this?
    01/23/10 @ 19:29
    Comment from: Gotmilk [Visitor]
    Hey Zante,

    Great tutorial you have here. This is probably very stupid question, but how do you host your server? Do you have a personal computer acting as a webserver and it has smartfox service running?

    Or do you have a host somewhere where you can run your server and you got smartfox to run there 24/7 ???
    01/26/10 @ 07:11
    Comment from: Andrew Marunchak [Member] Email
    Gotmilk, good question. You need to make sure that you have a static IP address or a DNS routing service. That way, if your connection goes down, once it comes back up people will still able to connect to it.

    I host my server from my office at the university. I have a machine dedicated to acting as a server for a few projects I'm working on.

    If this is a problem for you, try asking around on the smartfox forums for more hosting solutions.

    01/26/10 @ 15:12
    Comment from: Milos Stojanovic [Visitor]
    I love this tutorial! Once correction though, I think you forgot one important step in making player able to see remote player.. Add remote player prefab to player spawn controller. Other then that little thing this tutorial totally rocks.
    01/27/10 @ 13:56
    Comment from: Fabio [Visitor] Email
    Can u give me the unity 3d project files free, i dont have paypal. Please :(
    02/17/10 @ 17:03
    Comment from: Andrew Marunchak [Member] Email
    You don't need a paypal account, you can just use a credit card when the option comes up. To ask me to pass it on for free when it's so cheap is something I can't do, sorry. :[

    If you need any help regarding the tut just ask.
    02/20/10 @ 11:55
    Comment from: College Term Papers [Visitor] · http://www.ghostpapers.com
    A great constructive article will help to understand the issue.
    03/06/10 @ 09:22
    I’m so excited to have your guest post on my blog today, and such a great post too.
    03/09/10 @ 17:25
    Great post about something that is probably undertaken by many of us.
    03/09/10 @ 18:59
    Comment from: Tomaz Saraiva [Visitor] Email
    First of all I have to thank you for saving my life. This was exactly what I was looking for eheh

    Although I have one question. In my game I have an elevator and i want to synchronize it between both players. My goal is that both players can use the elevator together.

    How can I do this?

    Thanks for any help
    03/13/10 @ 22:54
    Comment from: Malidian [Visitor]
    I'm getting this error when I hit play to test connection...

    Assets/Pro Standard Assets/Image Based/BlurEffectIsland.cs(131,25): error CS0103: The name `ImageEffects' does not exist in the current context
    03/15/10 @ 22:44
    Comment from: Malidian [Visitor]
    I was missing the ImageEffects.cs...i found one online and it had this problem

    "Unsafe requires 'unsafe' command line something....i couldn't figure that out so i just removed all the scripts that were giving errors until it worked. I removed the BlurrEffectIsland.cs, GlowEffectIsland.cs, UnderwaterEffects.js...I don't have the pro version, I am sure this is why it did not work or why I did not have the right ImageEffects.cs...If all I was missing was the correct ImageEffects.cs then maybe someone can provide that.
    03/15/10 @ 23:48
    Leave a comment

    Your email address will not be revealed on this site.

    Your URL will be displayed.
    (Line breaks become <br />)
    (Name, email & website)
    (Allow users to contact you through a message form (your email will not be revealed.)