sendtransform lag

Post here all your questions related with SmartFoxServer .Net/Unity3D API

Moderators: Lapo, Bax

zoultrex
Posts: 2
Joined: 05 Jul 2010, 13:11

sendtransform lag

Postby zoultrex » 05 Jul 2010, 13:25

HI all,
I have recently downloaded smartfox pro and first thin i did was to install the server in my machine and run the Unity Island Demo.
When I opened 2 clients in my machine I noted that the performance was really poor, i say that because I thought that running it on my machine it would be real time as server and clients were running locally. But that didnt happen and the lerpz mesh took a considerable ammout of time to translate from one point to the other in the receiver client.

Further testing showed me that this only happens when moving around.
What I did was take the scripts of the Island Demo and use it on my game where my mesh moves around and has walk, run, idle animations.

The movement is really badly affected by a ~1 second lag and also is the rotation.
But the interesting thing is that whenever I play an animation in 1 client, the other client receiving the animation plays it practically instantly.

I am a complete newbie on server programming and to be honest I dont know what needs to be done to optimize it, but the first idea that I had in mind was to stop sending objects as data and send strings with the XYZ location and rotation of my game objects.

Maybe this Island Demo that comes with SmartfoxServer is really just a demo showing that It is possible to make a MMO in unity and it was not designed to have real-time results as it is. Is that so?

Any advice appreciated :wink:
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 17 Jul 2010, 12:19

Hi

The island MMO is by no means meant as a real time FPS plug and play example. So it does not feature any kind of extrapolation/prediction. Only backwards interpolation. Thus any movement will always be delayed.

It doesnt even have a server side component - only uses the SFS server to route messages.

This is not an issue in a 3d chat world - but is one for FPS or other where its important to have "exact" and up to date positions.

The new FPS demo (unfortunately slightly low on the priority list at the moment) will feature extrapolation/prediction - so you can use that to build your game with.

That being said - there is a huuuuge amount of knowledge you need to have to make a true MMO. Especially real time. So time to start learning and reading :-D

/Thomas
zoultrex
Posts: 2
Joined: 05 Jul 2010, 13:11

Postby zoultrex » 17 Jul 2010, 14:07

Hey Thomas, thanks for your response.

I have realized recently that there is much more to network programming then just connecting and sending position and other data.
As you said, prediction and interpolation have to be there in order to make the game feel realtime.

Unfortunately there is few information about these details on the internet, rather people often post general ideas of the concept and not an actual example in most cases. The only few examples I was able to find were extremely outdated, most of them dating back to the AoE 1 and Quake =(

If you have any advice on a recommended reading please do, I will happily check it :P

Oh and one thing im in particular trying to understand and that wasnt able to find it yet, is how to make the server logic programming, I mean, where am I going to code my npcs that will be controlled by the server?
Is it correct to say that I will have to create that in unity and run a kind of "unity server controller application" that will be running alongside with the server in the same machine and that unity-server-controller is the one that will spawn the npcs and deal with their autonomous behaviour?
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 17 Jul 2010, 15:34

Hey,

I am working on a FPS example which runs as autoritative server with prediction and interpolation + various other things.

So "soon" you will have the sources to build upon. Poke me with an PM and I can send you the code as-is.

The "magic words" you are looking for in terms of coding server side is "extensions" in the SFS world. Lots of examples in the documentation, so take a look. Its a pro feature only though.

/Thomas

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 28 guests