MMO - Trying to get the hang of how an Auth server works.

Could be fun to make an MMO shell as a community project. I’d be interested.

I want to mention that Unity Developer Magazine issue two actually begins a series of articles (written by Thomas) about using SFS with Unity. The first article actually discusses this exact setup - SFS for authentication and other backoffice stuff like chat and buddy lists and Unity for the game servers.</shameless plug>

Lol you always seem to have articles based on stuff I’m struggling with at the time :P! Nice timing :).

Still wud like a digital download of it with the cost of printing knocked off though hint hint.

Ok next question; If I’m using Smart Fox Server, why do I need to also have a unity game server also? Can I not just have client side prediction and then check it with the Smart Fox Server/ update the player on the location etc of other players in that particular room?

If I do in fact need to use a Unity server as well then what exactally will it do, and how does it tie into everything (an example of where the data would go and what checks happen when (for instance) the player pressed the up key would be appreciated)!

Ie does the data travel from the client to the smart fox server, to the unity game server or what? And what checks happen along the way?

Thanks again for everyones continues support/ patience.
Adam

You don’t need to use the Unity server that is built into it. You just use the SmartFox server. You write your client so that it talks to the SmartFox server. Get the download example project from the SmartFox site that is a Unity project that Thomas wrote.

I’ve downloaded the unity project thanks :)!

Ok in which case how exactly does client side prediction work in terms of governing player movement? I assumed (going back to my pressing up example) that the player presses up, the client then makes the player move forwards using prediction, meanwhile there is a unity server which checks it (somehow) and confirms the client is correct / if not changes it to the correct position? How would this work on a SmartFoxServer?

Also in regards to using a think client; how does one go about doing this :S?

Thanks
Adam

That depends on what you are doing. You might not need to have one, but if, for example, your gameplay relies on physics or something else that Unity is going to be much more efficient at dealing with, having your game server(s) in Unity, with SFS to handle all of the other backend services is probably a path that makes sense.

For an MMO, that might not make sense at all.

You press up and the player moves, announces to SmartFox the key press and current location, smartfox just passes this into your custom extension (all smartfox does other than your code is queue the message received from client A and broadcasts it to all players, those players get the announced message and you have to have code to respond to the message)

You are starting now to get into coding questions with regards to networking.

A player for example would have at the very basic skeleton model for scripting:

Mesh information
Location information
Action information
Generic information (aka hit points, blah blah)

Now lets take your key press question.
You press up, you hold the key for 4 seconds and let go.

The moment you had pressed up, your code has to send a packet to the smartfox server saying that you pressed the up key, at this point the server sends an action note to all other players that you have the up key pressed. The code on their end that is hooked to your player model in there scene takes action on this key press.

When you let go of the up key, this triggers a message to the other players through the server that the key was let go, again your action information acts on this event.

Location information is matched as you pass it to the other computers through the server. hopefully only minor adjustments have to be made, so you do not immediately jump the player to the x,y,z location, you adjust them gradually and gracefully otherwise you get a jitter movement.

Now in MMO’s you can keep this to a minimum. For instance, (and you can test this with 2 computers side by side), if you have a warcraft account (2 of them) load it up, stand 2 players side by side, perform an action on one player, there will be a milisecond to second delay before the other player sees the action.

If you do an action that is a generic action, like emote or dance for instance, you have a random action on your end play, and you will see that on the other players monitor, you could have the same action or a totally differnt one. This is because they could care less about the emote. It is a bank of random actions, so they pass data across to the players that player A had an action of emote and the code then says, fine lets play an emote from emote pool.

(I am predicting this will be one of your next questions)
Getting into battle system will be a totally different animal. All battle systems for MMO handle the actual fight serverside. All players do is announce to the server the battle action, in turn the computer broadcasts to everyone what that action from you is so they see your ghost on their machine perform that action. The damage itself is delt on the server so that no player computers are involved with the physical battle.

It is rather amusing to see something die on everyones comptuer if you have a few in the room. The creature will die at slightly different times but all within a few seconds of each other, some sooner some later, but end result is the same. Who got the killing blow, how much damage everyone does, etc, all determined on the server through custom extensions.

Just wanted to pop in and say what a valuable thread this has become. :smile:

Haha yeah thanks to everyone whose replied with advice etc! It’s helped me tremendously and no doubt has helped others who have similar ideas!

Subscribed to this one out of curiosity a while now, so I second that (or third??) :smile:

If I understood correctly, what you are looking for is WWWForm.

(edit) something like:

var loginServer= "http://your.site.org/your/loginhandler";

// Create a Web Form
var form = new WWWForm();
form.AddField("username", userName);
form.AddField("password", password);

// Upload to a cgi script
var w = WWW(loginServer, form);
yield w;
// handle errors and show message to user

Hope it helps.