Page 1 of 1

Best network design methodologies

Posted: 07 Mar 2011, 23:20
by Questionairre
I am working in Unity and I was looking at the Island Demo that works with SFS.

So in the demo everything is tracked and moved "manually", as opposed to the network.instantiate system in Unity. Is this the best way to move around networked objects and players? Is this the most bandwidth efficient or processing efficient way to do this? What about games with many projectiles(think cannon balls, not bullets)?

What other features, that are present in Unity, become superseded with SmartFox?

Also, how can network efficiency be improved? What macro and micro level things should I do or take into consideration so that I can scale large amounts of users?

What kind of things can I add to make this a better networked experience, I, for example, plan to add extrapolation for the players.

Thanks for the assistance.

Posted: 08 Mar 2011, 09:18
by ThomasLund
First off - if you are starting out - then you should take a look at SFS2X and the FPS example instead. More recent/modern and a better example too as it has an semi-authoritative server. Its still not a "best practice" example with all bells and whistles - but a starting point.

It also has some basic extrapolation in it (being a FPS).


Posted: 31 Mar 2011, 01:34
by Questionairre
So here is a question, in a game where there a several players moving around in real time, is it better to send the position update of a player only when they have moved or is it better to send out an update at a set interval?

To explain this better, I see a choice of two options.

When a player moves he sends that input to the server and the server calculates his new position and then sends it out to all clients. I can see being problematic with many players leading to bandwidth issues due to clogging.

The other options is to have the users send input and have the server, again, calculate the new position. The server sends out an update to all clients at a set interval with all of the new positions for each player. Or maybe just those that have moved.

Both have, pros and cons but I am not sure which approach to take. I am leaning towards the sending of position at a set interval. Assuming I am developing a real time MMO(how trite, eh?), which method would be best to use. In my case the server still needs to keep track of all positions for various purposes, I plan on doing this with MongoDB.

The real issue is that both options are fairly viable, but I have no idea how they function at scale or to how far they can scale.

Posted: 31 Mar 2011, 07:56
by ThomasLund
Personally I would go for the "server tick" approach. This is really the best for several reasons (and yes - I know the FPS example does use it).

You can bundle things into a single update message being sent to clients. You can also put in NPC updates that the server calculated. You can still server side decide if you prune any transforms that didnt change since last update etc.

It just feels better and more robust in many ways.

The main problem with the other approach is, that you end up sending many more individual messages - which grows hefty with number of players in your room.


Networked Ball Object

Posted: 21 Jul 2011, 19:58
by jimbobway
I've been digging through the forums and I haven't figured this one out yet. I basically want a networked ball that players can move and kick around. But, the answer seems hard to do in SmartFox.

First, to let you know I have successfully integrated the FPS code into our game. Players spawn and can see other players move.

In the SFS demo there are items that are networked that don't really move. If a player gets close to a networked item it will detect it and will inform other clients. However, there is no networked object in the SFS demo that actually moves around (like a soccer ball). How do I implement this?

From reading the forums it seems like I want an authoritive server to control the ball while having players give input to the server and have the server recalculate the ball position. Then smartfox relays this position to the clients. One of the main issues is that we have terrain and buildings, and it seems like SFS will need the collision data of the buildings and terrain to do calculations. There really isn't an example for this and it seems difficult to do with smartfox. Thoughts?