Bps , bps peak & latency

Posted By: EpsiloN

Bps , bps peak & latency - 11/02/07 18:24

I'm asking here,because the manual is too confusing on this part of networking
First , is bps(bps peak,latency,bps reliable/unreliable) for sent (transfer from Client to Server) or received (From server to client) when displayed on the clients. When displayed on server , is it for the last client (all of the vars) or for all clients at the same time. If it is 'received' is there a var for sent (vice versa). Is it actualy per second , or it shows at the given moment. Is peak measured for one second , or the maximum peak data for a given moment.
As you can see I dont know anything about those vars,and I'm constantly looking at them and trying to figure them out Please , explain to me what is what , so I could continue (eventualy) my project efficiently (without 'unknowns' and suggestions)...
Posted By: fastlane69

Re: Bps , bps peak & latency - 11/02/07 19:50

I'm pretty sure this is right:

CLIENT
BPS-- how much you send
UNR/REL -- how many unreliable or reliable packets you receive.
BPS PEAK -- should be for duration of client uptime.


SERVER
BPS -- how much you send
UNR/REL -- last client connected... pretty useless in my book.
BPS PEAK -- should be for duration of server uptime.
Posted By: FBL

Re: Bps , bps peak & latency - 11/03/07 11:21

Hm...

What are your average values for these?
I'm asking because I have some stranke peaks > 1KB and I don't know where they come from. Some synching after level loading.

I want to compare where I am at
Posted By: EpsiloN

Re: Bps , bps peak & latency - 11/03/07 20:42

Quote:

CLIENT
BPS-- how much you send
UNR/REL -- how many unreliable or reliable packets you receive.
BPS PEAK -- should be for duration of client uptime.




Ok , its now a little more clear but still not enough...Bps , is it realy for one second , or a momentary value multiplyed by a factor to come up with the per second value...I think I should get some sort of a program to see how much my network card is sending/receiving atleast 16 times/sec.
Is reliable/unreliable per second or at a given moment?
And finaly , is Peak realy per second or again(as bps) measured for a moment and multiplyed (for example by dplay_entrate) to get the per second value?
Currently I have :
Client
Bps average 80
Bps peak maximum I've seen is around 450
Rel/Unrel is around 80 I think , ~75...But this depends. 75 is with a Client & a server. If I have two clients , this becomes ~140/150 on each client. 75 on one client if he's not moving,if he is jumps to 150.

Server
Bps average (Dunno,I forgot)
Bps peak I think I've seen maximum 2400 (Caused by a 1 second update of 3 entities to each one of 3 clients,update of pos,frame,flags,alpha...I should try something else,if I want more clients,this Peak could produce serious lags if I have more clients)
Rel / Unrel is diff. each time I test , last time it was around 80 with more frequent updating of a clients input(pan angle mostly). When I started (only movement,no rotation) it was less than 20.Max I've got it to 65 with constantly pushing each one of the movement buttons to 'simulate' maximum input for a client
So , if we look at those numbers , it means that anyone can create a MMO with 3DGS. But somehow it doesnt work how it should. Its still laging. If I increase the update rate,theese numbers jump to higher values,so this isnt a solution. To prove that the people who say its impossible are wrong , I have only 2 words for them. Dead Reckoning. But for this 'prediction' I need to know what those numbers represent , in order to determine what are the limits for frequency in updating , and based on that , to construct this Dead reckoning function...
Sorry if this post got too long , but I wanned to give my opinion on that matter , and to point out that I realy needed an in-depth explanation of the numbers.
Posted By: FBL

Re: Bps , bps peak & latency - 11/03/07 22:59

Ah then you are at the point where I gave up after 2 days of fiddling around. On LAN it's perfect, because latency basically does not exist, but when simulating an online conenction... forget it.

Easiest solution would be if the client syncs his player with the server and not vice versa. But it allows cheating and would require some sort of validation on the server.

Syncing however would become a LOT easier, because on each machine the lag is the same for each value and I don't have to sync with some value which is 300ms or so old.
I tried to do that and simply failed.
Posted By: FBL

Re: Bps , bps peak & latency - 11/04/07 00:22

I just implemented my idea above - it's running GREAT.
I did an online simulation for 33.6K modem (just to see the limits) and it remained playable, although the other players started becoming a bit jerky.
But I'm really satisfied. The more challenging thing will be event handling - lag will be a lot more noticable here when I handle it entirely on the server (which makes sense).
Posted By: EpsiloN

Re: Bps , bps peak & latency - 11/04/07 05:05

We're getting a little off topic,but I'll answer anyway
I'm not thinking about cheating,because I dont even have a game yet. After I have a game,I'll start thinking about preventing cheats I tought about moving the clients localy,but this will require (like in World of Warcraft) using only local collision (players are passable,houses arent). I decided to go with server movement. I have an idea how to get around the 'build-in' lag of the periodic updates. I'm not talking about latency,lets imagine its low To get around the build-in lag I'm going to try to send a 'forced' update,wich will be sent to all nearby clients when that certain client starts moving. The other clients will move the entity localy until a 'normal' update comes. From that point on,the entity will move only from the server updates. I tryed something like it,and it worked great,the clients moved the entity right after the other client sent input,but failed after that because I have to organise my script better (it send almost 10 forced updates,until the normal update arrived)
I'm not thinking about normal latency because in a RPG its not required everything to be precise , you might get the anim flag a second later noone will notice.And , after all , I havent seen modems recently everyone I know has better connections.
Posted By: FBL

Re: Bps , bps peak & latency - 11/04/07 10:03

I'm living in an area where modems still are common. We got DSL last year - with reduced speed

I've done your way with server updates (I think I did it a bit differently, but the basic idea is the same) and it works great for a low latency system.
The problem I encountered with ltency was, that the data send by the server was 100ms-300ms old when it arrives at the client. So this gives a noticeable jerk and all my methods to reduce this jerk failed. I tried to calculate the position when taking latency into account, so I have a fitting old position on the client to vccompare it with the one sent by the server - it simply was not accurate enough. The result was a bouncing player - very ugly and unplayable.

This was not acceptable.
With my current way I'll have an open door for cheaters, and about the collision you're right as well.
But we're lucky that A7 does colission for us even on the client, so the client doesn't notice that the server lags behind. For issues like falling of from a platform on one of both I do a regularly distance check - I only allow a certain distance, if it is to high I assume the system is out of sync and I force an immediate update. No smooting or anythign else. A fixed position update.

But this is ok. As player you only see the others lagging, which is way better than seeing the control taken away from your own player model.

I'll see if everything works with events and the like as my test project progresses. But for now I'm happy with the results and the setup for more entities is really easy.
Posted By: fastlane69

Re: Bps , bps peak & latency - 11/04/07 17:01

We should probably move this to the MP forum since it went beyond "Ask Conitec" a while back.


Quote:

The problem I encountered with ltency was, that the data send by the server was 100ms-300ms old




That's pretty high latency. Note that latency has nothing to do with the speed of you connection. It has everything to do with the number of "hops" you packet takes (ie: network topology) and to a lesser degree the speed of the server computer.

Lag, as I define it in my classes, is the human experience of time synchronization. One factor is the latency and the other is the clients computer (slow client computer = high lag).

I just wanted to say this so that we have a clear understanding that you can have high latency and low lag (by hiding the lag).

Now then...

Allowing the client to handle it's own updates is bad for several reasons. Cheating is one but actually not the most critical one. The worst reason is that your simulation will fall out of sync incredible fast. Consider one client and one server. If the client handles their own updates, no problem... it's no differnet than having the server do it. But now let's up that number by four. With five players, each INDEPENDENTELY handling their updates, you will have five people giving you five versions of where they are. Or in another implementation, you have to wait two hops to find out where someone is: one hop for the client to update the server and then another hop for the server to update other clients. In other words you introduce even MORE latency this way. As well, allowing collisions on the client suffers from he same problem: collision on one client is not guaranteed on every other client and thus your simulation is out of sync again.

Trust me, in a Client/Server architecture, the only way you SHOULD do it it is to have the server be the ONLY one in charge of the simulations and updates. This will actually reduce latency and perserve the uniqueness of your simulation. It makes things easier I assure you.

The reason you are having problems Firo is most likely a bad Dead Reckoning algorythem (either your's or Conitecs). A good one will allow you to effective hide latency and reduce lag. The worst that will happen with a DR algorytem is that you will have occasional "warps" and "snap backs" when the latency gets so high, the simulation is way out of synch and the client has gone beyond the limits of the DR routine. There are several techniques you can us and I recommend you either search programming books (no matter what the languge, the routines are the same) or see what google pulls up.

A7's dead reckoning works great for few players. For large number of players (say 10 or more), the fact that it sends updates to all players all the time eats up bandwidth and that is not a good thing. So dont' give up on server updates; you'll be thankfull you didn't in the long run!
Posted By: EpsiloN

Re: Bps , bps peak & latency - 11/04/07 18:19

I already sent a PM to Firoball to discuss dead reckoning in depth because we got offtopic too fast.
In my opinion there are two possible solutions. One is to move the players client-side all the time. (It is diffrent from 'moved by the server' because you...you still have two hops , but only when sending the input wich is also only one time , when you move the ent localy , you'll update it frequently to the server and again to the other clients.) The other is to move the ents localy only until a regular update comes (thru a forced update) , wich will remove the 'build-in' lag of the frequency of updating.
Also , for the latency , it could be a 'many servers' system , managing one world and when registering a player assigning him to the lowest latency server.(The servers will communicate with a .dll file for sync). The other solution to the latency problem is to have again a .dll file , but this time with a peer-to-peer connection. When an ent moves , the client that owns the ent sends to all other nearby clients the input , and it will be ignored after a regular update comes. Until then , the ent will be moved localy according to the input given directly by the interracting client. If the latency between the two clients is lower than thru the server , it'll lower the time needed for the packets
It sounds not only complicated,hard,but in my opinion possible.
Posted By: fastlane69

Re: Bps , bps peak & latency - 11/04/07 19:02

Quote:

One is to move the players client-side all the time.




You don't want that.

Quote:

The other is to move the ents localy only until a regular update comes (thru a forced update) , wich will remove the 'build-in' lag of the frequency of updating.





This is where dead reckoning comes into play. Without DR, this routine will lead to very noticible (and unplayable) warping.

Quote:

Also , for the latency , it could be a 'many servers'




Unless you have to money to host a server on each continent, this is not a vible solution. If you have two servers in the same city (or even country), their latencies will be off by at most ms and thus you dont' gain anything here.

Quote:

When an ent moves , the client that owns the ent sends to all other nearby clients the input , and it will be ignored after a regular update comes




Here is an example problem here: Player A and Player B want to move to Spot A. Who gets to go there? What if Player C gets both updates? What does he see?

Here is another example problem: Suppose you have ten players and one server. One player moves and has to update the other 9 players as well as the server. However the server finds tht the movement was illegal and sends an update to all 10 players rejecting the move. However before you get the server update, you keep moving and giving the other 9 players updates. In short, one bad move could result in 10's or 100's of unnecessary updates which could lead to a flooding failure on the part of the client or server.

Peer to Peer is only good for 4 players or so without A LOT of overhead and completely impractical for 10 players or more.

Quote:

If the latency between the two clients is lower than thru the server , it'll lower the time needed for the packets




True, which is why so many MP FPS games use p2p... the latency is very low and not subject to a central server. However, as I've stated below, maintaining server sync and simulation integrety becomes, as you said, hard if not impossible!
Posted By: EpsiloN

Re: Bps , bps peak & latency - 11/04/07 19:47

Quote:

This is where dead reckoning comes into play. Without DR, this routine will lead to very noticible (and unplayable) warping.
...
Unless you have to money to host a server on each continent, this is not a vible solution. If you have two servers in the same city (or even country), their latencies will be off by at most ms and thus you dont' gain anything here.
...
Here is an example problem here: Player A and Player B want to move to Spot A. Who gets to go there? What if Player C gets both updates? What does he see?

Here is another example problem: Suppose you have ten players and one server. One player moves and has to update the other 9 players as well as the server. However the server finds tht the movement was illegal and sends an update to all 10 players rejecting the move. However before you get the server update, you keep moving and giving the other 9 players updates. In short, one bad move could result in 10's or 100's of unnecessary updates which could lead to a flooding failure on the part of the client or server.




I'm not talking about dead reckoning here,I'm saying that it needs only a simple move forward until the update comes. After the regular update (if the pos is offsetted) the ent will float(same speed as movement speed) to the new possition smoothly(with dead reckoning it could even be curved,for further smoothing). For a FPS it'll look not only slow but also wrong (I mean moving in another direction while facing the opposite for example) but for RPG its fine,imho
About the servers...you wont gain much,but even 50ms is enough if you reduce it below 100ms,dont you agree? Btw , lets first create the MMOs then we'll think about the money for the servers
As for the collision...player A sends an input to player B and C...player B sends also input to player A and player C...player A receives input and collides localy ents A and B , player B receives input at the same time player A received player Bs input,and collides too localy ents A and B...player C receives the same inputs,possibly at diffrent times,and collides with just a little offset ent A and ent B because he got the inputs at diffrent times,and than they collide for 200ms , wich is just a little movement , until the regular update comes.
How does that sound? And for the second problem ... if you move your clients localy it'll be a problem , but if you move them localy only until a regular update comes , the server will correct the possition (that the ent collided with another ent) and move that same ent on the clients a little back,where it actualy collided. It wont look good,but why do you suppose WoW doesnt have player-player collision only player-env? It's interesting to discuss this , but we should try (each one of us) to make some solutions to this problem,so we could all benefit from it (and it could possibly take all of us one step further in the process of making MMOs with 3DGS,wich I would love to see done,even if its by a person that I dont like just the idea having a MMO made with it is great...)
Posted By: fastlane69

Re: Bps , bps peak & latency - 11/04/07 20:51

Quote:

I'm not talking about dead reckoning here,I'm saying that it needs only a simple move forward until the update comes. After the regular update (if the pos is offsetted) the ent will float(same speed as movement speed) to the new possition smoothly(with dead reckoning it could even be curved,for further smoothing). For a FPS it'll look not only slow but also wrong (I mean moving in another direction while facing the opposite for example) but for RPG its fine,imho




But that is the essense of DR. Ultimitely, you will be using a c_move on the client to move players on it. If you do teleportation (setting my.x directly), then you are at teh mercy of the server update speed and generally will just look bad. With c_move, you move based on previous physics data (position, velocity, and if you want, acceleration) and then adjust based on server updates. This means that as long as the player is moving predictably (no collision), you will be close to 100% accurate all teh time. If you have collisions (which are unpredictable), then the DR corrects.

Doesn't matter if FPS or RPG... this problem is stil a problem. Consider that a collision can be a Mob attacking you. Your players will SCREAM "foul" if they moved out of range on their computer consistently but the server sends updates that they are in range and taking damage.

Quote:

About the servers...you wont gain much,but even 50ms is enough if you reduce it below 100ms,dont you agree? Btw , lets first create the MMOs then we'll think about the money for the servers




I agree completely on both points, which is why I point out that this is a solution that requires money and the need and is not a "real" solution in terms of developing your game.

Quote:

player C receives the same inputs,possibly at diffrent times,and collides with just a little offset ent A and ent B because he got the inputs at diffrent times,and than they collide for 200ms , wich is just a little movement , until the regular update comes.




So the clients will be out of sync for 200ms and even then the server update may tell them that they were wrong all along! And you are forgetting a critica part of my example, that two people are trying to enter the same space on a client. Consider how complicated you have already made your system as opposed to the standard model: Player A and Player B send an update to the server, the server makes a decision on what happens and then updates all players on the "truth". Can you see how doing this makes developing and maintaining the simulation so much easier?

There is a saying that goes "too many cooks in the kitchen ruin the soup". This is what is going on here. By making each client a "cook" and able to affect their own simulation (the "soup"), you allow for way too many inputs, way too many voices saying "I was here first", "No I was here"... and ultimitely, it's STILL the server that has the ultimite say!

So what I'm saying is don't try to reduce latency... it's a losing game. Instead, work on mechanisims within your serve and client to hide the lag and process data effectively.

Quote:

but if you move them localy only until a regular update comes , the server will correct the possition (that the ent collided with another ent) and move that same ent on the clients a little back,where it actualy collided. It wont look good,but why do you suppose WoW doesnt have player-player collision




It's become clear that what you are proposing isn't very different from what is actually done. The only difference is that I somewhere got the idea that the clien woudl be transmitting back to teh server, would be actively modifing the simulation, and that is a no-no. As long as the server is the only one that can modify the simulation, then what you do on the client to hide the lag doesn't matter.

Quote:

It's interesting to discuss this , but we should try (each one of us) to make some solutions to this problem,so we could all benefit from it




What I talk is what I've done. All the techniques I've described are what we have going on with our MMOG. We haven't been able to do public demo due to our inability to create a stable published version, but we are actively working towards that. At that point, you will see how our solutions make our players move just as good (IMO) as any MMOG out there.
Posted By: EpsiloN

Re: Bps , bps peak & latency - 11/04/07 21:17

I am refering to dead reckoning as a very complex mechanism to predict possitions thats why I said its not a dead reckoning (to move the ent simply forward and to possibly rotate it with a defined speed in a given direction) Dead reckoning is every (simple and complex) solution for prediction,but I'm saying it for the more complex solutions.
My system does have collision detection right now , and I havent tested how it works with 2 clients moving (localy I can only move one only if I had a second keyboard ) and I'm thinking of removing it(only player with player) and reworking the 'fight concept' to be the same as other MMOs. Currently my fighting concept will require instant updates (wich is not an option with more than 100ms latency) and constantly synching the clients. I think the current solution in many MMOs will be better , to have a 'cycle' where your character attacks at a certain rate eighter until you cancel it , or until the other(or you) player is dead.
By the way , the only thing that I did to 'predict' client movement was this 'forced' updating , but for some reason it updated more than once,so I'm still fixing it but from the feedback I got (when I tested with a server & two clients) I'm very satisfied by the numbers. I'm still new to MP,yet I'm managing to keep my data transfer to a minimum,I hope my project continues to develop this way

PS.: All the techniques we're talking about , you say you did it in your MMO...what exactly you did because (not only here,but in my post in MP section) we've talked about many thinkgs,and peer-to-peer , server/client & local movement together wouldnt look good and btw , how are you managing with the numbers ? bps , peak & rel/unrel ? I'd like to know for comparing how much 'spare' traffic I have for interraction (currently I have movement only & anim states)
Posted By: FBL

Re: Bps , bps peak & latency - 11/04/07 21:30

I failed to get some proper DR working.
Since there are soo many other awful things to take care of, I started working on some other things closely related to player movement.

Anything which is not a player currently is created on the server, moved on both client and server and synced by the server. My simple smoothing algrorithm works fine for that as I don't have to care about latency.

The players however are far more difficult to handle.

Next step are adding events like getting hit. Then I can test a bit more
Posted By: fastlane69

Re: Bps , bps peak & latency - 11/04/07 22:50

Quote:

All the techniques we're talking about , you say you did it in your MMO...what exactly you did




-Traditional Client/Server Multiple backend server applications supporting the frontend clients
-No pure p2p, although the server backend is p2p-ish (all server applications communicate with each other).
-Each client has DR active
-Each client only gets updates about it's surroundings
-Each client only makes requests of the server; the server is the ultimate authority on whether to grant these requests.
-Current "requests" include movement, chat, inventory, trading, kicking, throwing, picking objects up, dropping them.
-Current non-players include Merchants, Quest Givers, physics engine based columns and balls. Currently working on a goal post and score board on the way to making a series of sport-like games!

Quote:

how are you managing with the numbers ? bps , peak & rel/unrel ? I'd




I don't know what these numbers are. I don't use these numbers as a guide yet. At this stage in development it's easier to have a design philosophy to minimize traffic. For example, since we are still in A6, we only have vars and strings. As such, we pack as much infomation into a single var and string.

I'll look them up on monday and post them for reference.
Posted By: EpsiloN

Re: Bps , bps peak & latency - 11/06/07 15:43

I tryed two ways for moving clients smoothly , only one looks good , but its not the actual possition the player is at. It lags 250ms behind the actual possition.
I tryed a simple script for predicting the players possition and failed the collision detection + gliding gives unpredictable results with diffrent speeds. For example , moving an ent for 1 frame with a speed of 150 quants and moving an ent for 10 frames with a speed of 15 quants. It gives diffrent results from gliding , so I cant predict even a straight line movement...
No obstacles :

With obstacles :

In case someone misunderstood something : the red lines show the path of the models and how far they got...
How did you do dead reckoning with collision detection (I'm talking about using 'glide') when it gives diffrent possitions for diffrent speeds? Or there is another way that I dont know about,yet...

PS.: You do have collision detection with glide,right ?
Btw , Firoball , how are you going to make the events for attacking? I already have something in mind for that but I'll first take care of the DR,otherwise it'll be waste of time if I cant get the DR working...
Posted By: fastlane69

Re: Bps , bps peak & latency - 11/06/07 17:08

I don't think we use glide at all and I'm not familiar with it at all.

We have a single application that handles the physics simulation and then sends the updates to all clients. This application is using the 3DGS physics engine for all movement and collision detection.

This means that any fps or speed differences in the physics application would affect all the physical entities at the same time and the same way and thus all the clients are in sync in terms of the physical simulation. We then have a DR routine running on all clients to handle the time between packets to acheive smooth movement.

We thought about using the 3DGS physics engine on the client as a form of DR, in effect turning it on when the update time between packets got too large. But we found it easier to just write a simple DR routine... we might still do it in the future and it should work; after all, a DR routine is really nothing more than a physics engine!
Posted By: EpsiloN

Re: Bps , bps peak & latency - 11/06/07 17:45

It sounds great , but I dont think I can ever make anything like that I guess I'll have to satisfy with my current 'lag behind' method So far I'm the only one working on that,and I tought about asking for help in a local forum (I mean Bulgarian) for a C++ coder , but I'm not shure I want another 'teammate' at this time.(Not shure if I'll give up after a few days)
I've added a simple log function to my project , and after the next test (with 3 clients) , I'll have the 'almost final' numbers on bps & rel/unrel.
Posted By: FBL

Re: Bps , bps peak & latency - 11/06/07 18:06

Quote:



PS.: You do have collision detection with glide,right ?
Btw , Firoball , how are you going to make the events for attacking? I already have something in mind for that but I'll first take care of the DR,otherwise it'll be waste of time if I cant get the DR working...




I wanted to handle the event itself by the server (logically) and then set some variable according to which event occured. Upon change, this variable is sent back (reliable!) to the clients, so they can react on the event (For moving and animation). Anything about health, score and the like will be done by the server and then transmitted. So far the idea...

This still is very vague as I haven't yet found the time to play around with it, but it's the first raw idea that I came up with since this is more or less the way I'd do it in singleplayer mode.

I'll let you know if this has any future once I tested it
Posted By: EpsiloN

Re: Bps , bps peak & latency - 11/06/07 18:42

I'm going to add 'interraction' with objects tommorow for a start , creating objects by request from the client...
I'm giving up on the idea for Dead reckoning , because I do not know of another way to move objects without c_move or ent_move (except for non-collision my.x += ) but maby I'll remove gliding,so that it can send & update the same pos as predicted. I'm not shure yet.
fastlane , how many people are on your team? sounds like a very big project
Posted By: fastlane69

Re: Bps , bps peak & latency - 11/06/07 19:44

Quote:

fastlane , how many people are on your team? sounds like a very big project




For 4 years, it used to be just me. After 3 years, alone and in about 3 months of doing nothing else, I managed to create a viable MMO prototype that laid the groundwork for what we have today.

Then last year I got outside funding and an office and hired two programmers part time from local universities. For about two months this year I had 3, then dropped to 2, and right now I'm technically at 2 though 1 is in grad school and hasn't done much. These programmers revamped what we had and created the version we use today. So on average, I've had two programmers at any one time.

Since art and music is a low priority compared to actually creating the tecnical side of the MMO, I have always outsourced both. Here, I usually freelance people to handle these tasks. On average, I have about 5 people to help me with art and music.

I'm no storyteller, so I have used some of my funding to hire story consultants. This is a two woman team (The Writers Cabal) whom I've known for a while and they are currently helping me create a viable story for my educational game.

Finally, I have a game consultant (Dr. Richard Bartle) and a business consultant. The former is the grand-daddy of all virtual worlds and helps me with gameplay and virtual world design issues. The latter is helping me make a business case for my game so I can get more investment.

So in the last year, my team has been, on average:

CEO: 1
Prog: 2
Art and Music: 5
Story: 2
Consultants: 2

or about 12 people as part of my team though only the programmers work on this constantly.
Posted By: Damocles

Re: Bps , bps peak & latency - 11/06/07 22:33

A "lagging behind" method, as mentioned is suited the best for most
projects, as the displayed paths of the entites are correct.
Just the time-offset is the negative point.

Using a DR System can handle the time-offset, so beeing in "sync" with the actual
serverworld, but will always create nasty jumps on the client, when the entity
is moving on a non-predictable path. (not in a straight line)

I see DR only important for very fast gametype, that require a high precision
(Shooter, racer).
All others can use a more precise "lag behind" method. (RTS, tactical games)
Posted By: fastlane69

Re: Bps , bps peak & latency - 11/06/07 23:24

Just to be clear, the "lagging behind" method means that that you send to your clients an update that is X number of timesteps behind so that the clients are always "lagging behind" the simulation, right?

If that's the case, there is a better explanation than "precision" for your correct choices.

In an RTS, you aren't aiming and the time response is not "real time". That is when you send 10 tanks against 10 hummers, each vehicle will fire on it's own and the path it takes is set by the controlling algorythem and thus both are completely predictable. As well, when both units engage in combat, you won't be doing any "fine tuning" and if you do, a difference of 200 ms won't amount to anything.

But in any game that has human interaction (FPS, RPG), then the movement and aiming is set by the player and thus unpredictable. Under this circumstance, the computer has no idea what you intend to do and thus it has to DR to "best guess".

So human control is one factor. As well, if your game has high inertia (very large mass or very fast), then it become easier to predict where it will be and thus you can adopt a lagg behind method more easily. Therefore a racing game could in principle be well served by a lag behind method because there is little change to the simulation in each frame. In counterdistinction, a game that has low inertia (low mass or slow speeds) would require the DR since it is likely to violently change direction based on collisions and interaction to the point where the lag behind method would fail to capture the correct simulation state.

I just wanted to clarify that "lagging behind" is only a valid technique when there is little human interaction with units and/or high inertia while DR is valid when there is a lot of unpredictable interaction and/or low inertia. It doesn't have to do with the precision but note that a RTS has high inertia and no direct human control while a FPS has low inertia and human control... I think this is a better way of seeing and deciding which routine is better for your game.
Posted By: EpsiloN

Re: Bps , bps peak & latency - 11/07/07 16:02

Quote:

Just to be clear, the "lagging behind" method means that that you send to your clients an update that is X number of timesteps behind so that the clients are always "lagging behind" the simulation, right?




The 'lagging behind' method I'm talking about is , when a client hits the forward key , the server receives the input , but for example the client sent the input right after a regular update has been sent. So , the client has to wait for example 250ms , until the next regular update wich will give the current x/y/z of the ent. This is great for my 'lag behind' method it looks smooth , but if the client hits the key right before a regular update , the ent starts moving to the received x/y/z , than stops and waits 250ms for another update to see the next possition so , sometimes it looks 'walk,stop,walk,stop' kind of way strange...
So , we discussed only RPG so far , and an RPG using WSAD for movement...Damocles wrote about RTS. RTS and RPG using mouse for movement , and any other game wich uses mouse movement + pathfinding is very easy to predict. You have to send only the 'goal' coordinates and to generate the path to see how long it takes to get there , and the clients (the same pathfinding) will generate the same path,and move the ents for that given time , for example , you send a var from the server on every 'join' event that states how many frames have passed since the server was started (you can even zero that from time to time) and according to prediction on wich frame the ent will arrive at the goal point. So , the clients see for how long the ent should be moving there , and I bet , no mather what latency you have (I mean < 250ms) the clients will have the same ent possitions all the time.
But this doesnt bring 'action' to a game. If you want action than , you cannot have a good DR , unless you have 300 people working on it or you're a genius
I'm going to use a diffrent method , I'll send 'goal' possitions from the server instead of actual possitions , and always in a straight line forward. If a client changes the pan of the ent , the server will force no more than 3 updates between regular updating for synching of server & clients. Dunno if I can do that but I'll try tommorow.
Btw , I tested without 'glide' , and the results from a c_move or ent_move again are diffrent depending on speed. With no gliding the entities get stuck on walls or corners. But when I moved them to the right of the walls (no object in the way) the 'instant move' ent got stuck for no reason just next to that wall while the other entity (same distance from wall and path and wall pos.) wich was moving smoothly went further without touching the wall. I guess if you move an ent very fast/slow the bounding box orientation or size differs. But with some tweaks I'll use this way to make my 'stupid' DR

PS.: I started from scratch again today (for 14-th time for 30 days,each time I get further and my script becomes more complex and better written from mechanics point of view) and I decided to try another method for ent management. I'll have only 'real' entities for the clients , everything else is handled local (server local & client local) and server will synch clients & clients will synch server (with input). It'll be easyer to handle , because currently I used a function to check every entity if its a 'player' entity and assign a local function (ent_next(you);func(you);) and it got kind of messy It'll be a lot more organised this way , but I'm not shure how synchronised the server and clients will be. We'll see What do you think about the new method?
Posted By: FBL

Re: Bps , bps peak & latency - 11/11/07 19:21

Quote:


I'll let you know if this has any future once I tested it




I finally had some time to test this.
It's working pretty good, although delay is noticeable. When playing via DSL, everthing works pretty nifty (if DP8SIM does not lie...), 56K modem is palyable but due to high latency you sometimes miss the enemy.

But since I'm not doing direct traces, but instead I use a scan and do back-traces, the whole thing is pretty tolerant.

Currently I'm only synching once a second - maybe I'll increase this to two times a second later. I'll have to see what traffic looks like when I've added more dynamic objects.
Posted By: EpsiloN

Re: Bps , bps peak & latency - 11/12/07 15:53

I'm updating 4 times per second and the traffic stays pretty low so far.
I dont think you should aim for 56K modems , because when you finish your game they might be out of use...all my friends have better connections for lower prices.
Quote:

...you sometimes miss the enemy...
...But since I'm not doing direct traces, but instead I use a scan and do back-traces, the whole thing is pretty tolerant.




You scan from one player for hit and then scan again from the other player to see if they're close enough ?
And , what does sometimes miss the enemy That sounds like you're doing FPS...

PS.: I've slowed down my mp development for a few days , because I needed some definitions of my concept. I now have the full list of features (What the player can do in the game) for my game , but I'll probably add more options later. I'm currently thinking how to manage the players. So far I have a skill to identify the ent as a 'player ent',but still testing to get some client ID's. Any ideas ? Oh, and btw , the MySQL dll is for older versions of MySQL , so dont count on that for registering/logging already tested and failed.
Posted By: FBL

Re: Bps , bps peak & latency - 11/12/07 18:07

Luckily I have an old concept which I'm now partly porting to Lite-C and multiplayer, so I don't have to sketch everything out again. Nonetheless I'm basically rewriting evreything - the A5 WDL code is an ugly bastard from hell

I'm not doing a FPS, but indeed there are realtime short ranged weapon realtime battle sequences. I do a scan, because I can scan whoel segments - which allows multiple attacks at the same time without doing several dozens of traces.

Unfortunately scan goes through walls, so each scanned entity checks back using a trace whether the hit counts (no pbstacle inbetween).

Sometimes update is not fast enough and therefore the server shows a too much different situation than the client which owns the attacking player.

To overcome this I've hacked some sort of fast update (comparable to ent_sendnow) which I can trigger sends at important moments, but it makes the multiplayer code more and more messy.

I already have a whole lot of functions and slowly its gettings difficult to debug...
I'll continue until I fail - don't think this will take much longer
Posted By: EpsiloN

Re: Bps , bps peak & latency - 11/14/07 15:32

I'm still using C-Script , but from what I understand 3DGS is limitless with lite-C in every aspect of programming
You're talking about what I called 'forced' update in some of my posts I'm wondering how did you do it? I did it regulary,like my usual updates,but called at an exact moment between 'regular' updating. The only difficult thing (wich wasnt very difficult) was to make it run no more than 3 times between regular updating at (like regular updating) certain intervals. (Eg. splitting the time between a regular update to 4 parts (the fourth being the regular update) and sending only on the other 3 exact moments if needed).
The only thing messy using this concept is a counter in my regular updating that counts the frames passed since the last regular update in order to synchronise the forced updates.
If you run into problems , I'll gladly help you with my (still very limited ) knowledge of MP programming (I mean for debugging).
And , if you fail and decide to abandon that project (I hope not), I'd like to offer you to team up on a 'learning' project for MP programming Turn-based concept for 2 or maby 8 players (not much of a diffrence).
Posted By: FBL

Re: Bps , bps peak & latency - 11/14/07 17:45

I have a coutner running which times the regular updates. If I need an update at once, I just reset the counter

(reseting the coutner means skills are sent)
Posted By: EpsiloN

Re: Bps , bps peak & latency - 11/14/07 19:15

Is your update cycle in a separate function or (as it looks from your last post worth giving some toughts) separate update cycle in every player action ?
If its separate function , there is one problem with your solution It might not be a problem for you personaly , but in more general form...When you reset the counter , an update is sent , but than your next update will come after x number of frames (as after a regular update). And forced updating is used to fill in the gaps between 2 regular updates...so , if you're normaly updating on each 4-th frame , the forced will always come on the second frame after a regular update. In your case , after sending a forced update , the regular update wont arrive 2 frames after , it'll arrive 4 frames after unless you set the 'update' as a forced , in order to send the next update after 2 frames as 'regular'.
But your post realy got me thinking I should experiment with updating cycles in each entity. Easyer to manage , I think...also gives some opportunities , to keep track of each entity thru local vars (wich are limitless number of skills in theory ) , to store movements and update only if an ent moved. The only disadvantage I can think of is , you cant use ent_next(ent) to cycle thru the other ents , to update each one to the 'my' entity,unless you could do 10000 ent_next instructions between 2 frames
Posted By: FBL

Re: Bps , bps peak & latency - 11/14/07 20:35

I have fast updates currently only for players which are controlled by clients.

All other entites are controlled by the server and those are updated with a task scheduler. If I need a fast update there, I'll ahve a problem. Thanks for reminding me on this

thsi separation makes only sense with my setup I guess, so it probably has quite some flaws. I'll find out once I tested around more.
Posted By: fastlane69

Re: Bps , bps peak & latency - 11/15/07 17:14

Here is a typical client readout:

fps 55, bps 20, bpk 68, rel 900, unr = 900, drp 0.


Here is a typical server readout (in non-ded. mode):

fps 110, bps 688, bpk 10368, rel 0, unr = 0, drp 0.


This for several (over 20) bots running around in the world and two players in the world. The important numbers to consider is that the client's maximum send was 68 B and averages about half as much. He is receivig about 1800 B from the server which is actually high for we have not optimized the server send much and we expect to be able to drop that eventually to around 1000 B.
Posted By: EpsiloN

Re: Bps , bps peak & latency - 11/15/07 21:03

Quote:

bps 20, bpk 68, rel 900, unr = 900, drp 0...
fps 110, bps 688, bpk 10368, rel 0, unr = 0, drp 0...
The important numbers to consider is that the client's maximum send was 68 B and averages about half as much. He is receivig about 1800 B from the server



This is confusing...You said in your first post that BPS is how much you send , for the server here its 688 bytes/sec. but the client says 1800(rel&unrel) , or is this at diffrent times ?
Also , strangely in your example , the server isnt receiving anything...
After adding some more functions to my script , the only thing left for updating frequently is the animation states , and my numbers for BPS(send) are around 60 for clients and the received is 115*players or/and NPCs^2.
(2 Players = 115 * (2 * 2),3 Players = 115 * (3 * 3) , for 100 clients its 1150000bps , and I should start thinking how to solve this problem because a client cant always receive 1MB/s,or I'm wrong again ? )
I'm currently updating always , and I'll reduce the received bps by 115 first thing tommorow by updating the client only when moved. For the others , I'm not shure how I'll reduce the numbers,because I'm already sending only X,Y coords...

PS.: I changed my concept , I went from my current project way back to an old concept I wrote about robots top-down shooter. Its easyer for me,because I have more experience in this type of gameplay,we'll see about the current concept after I get it working well in the futuristic concept. So far it looks almost like a regular MMO
Posted By: fastlane69

Re: Bps , bps peak & latency - 11/15/07 21:53

Quote:

You said in your first post that BPS is how much you send , for the server here its 688 bytes/sec. but the client says 1800(rel&unrel) , or is this at diffrent times ?





Quote:

Also , strangely in your example , the server isnt receiving anything...




An annoying quirk of the 3DGS network panel on the server is that it only displays the received data for the last client connected. So if you have 10 moving clients and the last one isn't moving, then unr/rel will read zero.

This is a main reason why I don't use the network panel and instead use third party network monitors (ETHEREAL is a good one for it can sniff the packets too). It's hard for me to understand what those number mean but when you have a sniffer on the network, you get a precise idea of what is coming in and out. I don't have it set up right now but (because we develop on one computer, it is harder to separate server from client traffic) but I should and will in the future.

Quote:

2 Players = 115 * (2 * 2),3 Players = 115 * (3 * 3) , for 100 clients its 1150000bps , and I should start thinking how to solve this problem because a client cant always receive 1MB/s,or I'm wrong again ?




That seems right. If each player has an NPC that needs updateing, then you would need over 1 MB to update every player of every other players information... which is why you don't do this!

Instead, you limit the updates to only the players that are nearest to you and exclude the others. This way if player 1 is 100 miles from player 2, either player need not know what the other is doing until they get closer.

Quote:

when moved. For the others , I'm not shure how I'll reduce the numbers,because I'm already sending only X,Y




If you are not sending velocities, then 3 coordinates would require 3 variables or 12 bytes (without header). With velocity, it jumps up to 24 bytes per update. Hence for 100 clients, it should be 200.4KB (without header) at full resolution "could" be doable on broadband. All the same, I would still optimize by restricting who gets updates adn throttling the update frequency to minimize bandwidth.
Posted By: EpsiloN

Re: Bps , bps peak & latency - 11/16/07 04:57

I'm already updating only in a certain area wich is btw in my futuristic concept very small,because you see only a small part of the level... So , I'm talking about 100 players or NPCs on the screen at the same time wich would pretty much fill your whole screen
Right now I'm sending one var to indicate that an update came , one for entity ID that needs to be updated (I'll have to include entity type also in the future) 2 for X and Y coords , one for pan angle , one for firing/not firing and one for health , and today I'll include animation states. 7 vars packed in an array total 4 times/sec. for each entity visible on screen.
I'll have other updates but 'one time only' type of. For creating weapons on the ground or removing them...
Btw , I'm also testing on one PC. I suppose I cant find out what app is sending what to another app ?
Posted By: fastlane69

Re: Bps , bps peak & latency - 11/16/07 07:12

Quote:

one for pan angle , one for firing/not firing and one for health , and today I'll include animation states.




Here's a common bandwidth saving routine: Packing as much data into a data type as possible.
Observe:

Pan can go from 0-360... or three digits max.
Firing/Not Firing is one bit... but aince you are using A6, the least we can do is one digit.
And I don't know how much health you have, but let's assume you have a max health of 9999.... or 4 digits.

So all together you have pan (3 digits), firing (1 digit), and health (4 digits).

A var has a total of 9 digits.

Hence, you can store ALL this informaiton into one var...

...and if you only have 10 animations states, you an store that in there too!!

You've just reduced 3 vars (12 bytes) into 1 var (4 bytes)!!!!
Or if you put in 10 animations, you've reduced 4 vars (16 bytes) into one var (4bytes)!!!!
Posted By: FBL

Re: Bps , bps peak & latency - 11/16/07 13:07

Hm why shouldn't it be possible to use single bits in A6?
Mixing up digits and bits might be dangerous, but apart from that it's nothing more than some bitwise AND/OR. One digit can take up to 3 bits.

I'm using this for all button presses.

However I need a lock state for PAN, so you just reminded me of a good way to implement this
Posted By: fastlane69

Re: Bps , bps peak & latency - 11/16/07 15:45

Quote:

Hm why shouldn't it be possible to use single bits in A6? Mixing up digits and bits might be dangerous,




It can but I don't recommend it not because it's dangerous, but inefficient. If you use one bit for firing, you still lose that one digit resolution since the two remaing bits can only represent a number from 0-3. So unless you have two other bitwise variables or a command that takes a value from 0-3, you are going to be doing unnecessary transformations for nothing.

The main point of the post above is that you should use every bit in a variable when sending it. A7 BTW, with it's native bool and structs, makes it MUCH easier to design network traffic. Also, IMO, it's better to clump all the bitwise operations in one var (for example movement... that is a great candidate for bitwise network compression) and all the numbers into another.
Posted By: EpsiloN

Re: Bps , bps peak & latency - 11/16/07 17:17

I'm not much into bits and bitwise operations so I'll stick with vars and btw , what you posted is a great idea for packing numbers. I tought of that , but using strings...sending player name,pos & other stuff and than when a client receives a string he can 'strip' off (Is this the correct word? ) the player name , the pos , all the data he needs. But , I dont know how much bytes a char in a string is and I havent tought of the actual 'mechanical' part of that concept. It'll be easyer to manage all clients with a string because this way you could always link an ent to a 'player name' in your project. Right now , my player names are nothing more than local strings and plus I dont know yet how to limit an inkey instruction to only numbers and "_[]{}=." for example. I also cant prevent clients from setting already existing player names , because I need an ent created to send to that ent back a response and my ents arent created until the client has set his player name But thats a separate wdl code , I can modify it later,when I optimise the current code.
Btw , I tested with 4 times/sec. updating and I think the clients will be satisfied with 2 times/sec. It'll decrease the bps received and still look like a regular MMO , because right now its more kind of a online shooter
I added animation , but local only (when the player ent is moving,animate) but I guess I'll need anim states updated because I'm planning for bones anim.

PS.: I'm currently testing with the default (3DGS's) MP code for entity management , but I might start over again to make the ent creation/updating handled by the custom server updates. Not only because of the BPS Peaks and a lot of traffic at the same time for all clients , but also because I might have greater control over the entities.
And , a little off topic from MP , how can I resize terrains that have a shader applied to them ? I tryed scale in WED , I tryed scale in the function , I even tryed in the console , nothing works when a multi-tex is applied. I think in the end I'll make my own script for terrain management , possibly with an editor if I have the nerves to get involved in image and mesh manipulations
Posted By: FBL

Re: Bps , bps peak & latency - 11/16/07 18:13

Lite-C offers bool datatype???

Each letter in a string is one byte. You can easily see this when taking a look at atypes.h. A sTRING is some information stuff for the engine and internal linking plus a plainand simple pointer for a char array. A char is 1Byte in size.
Posted By: fastlane69

Re: Bps , bps peak & latency - 11/16/07 19:15

Quote:


Lite-C offers bool datatype???





I could have sworn it did, but I'm not seeing it.
Maybe I'm confusing it with the Char datatype and confusing it's 1 byte for 1 bit.
Still, it'd be nice to have a bool, don't you think? For flags and such?
Posted By: FBL

Re: Bps , bps peak & latency - 11/16/07 20:38

Depends on what the compiler itnernally does with it. May programming language which offer bool datatype in fact reserver at least one byte of memory for a bool.

So what I do is using a var to store my flags and then turn single bits on and of by or/and-ing. Just as Lite-C does it for native flags.
I'm fine with that.
Posted By: EpsiloN

Re: Bps , bps peak & latency - 11/16/07 20:50

So , 1 var = 4 bytes (I guess size doesnt matter) = 1 string with 4 letters/numbers? If thats the case , than it wont be that much practical
Btw , I'm with A6 , so I dont understand much about any C (lite,#,++) I dont want to get involved in that because I often forget when I learn something new so I might forget all about C-Script...(Thats 7 years of playing arroud).
And , I didnt understood that part :
Quote:

So what I do is using a var to store my flags and then turn single bits on and of by or/and-ing.



Is this something like in the weapon templates , where you have firing modes for example 2,4,8,16...etc. and by setting + mode + mode you get a result to compare ? I'm not shure how exactly does it divide them , but I havent tought on that much. Maby I should , its another way to pack variables
So , fastlane , there is no software for 'local' traffic scanning ? (On one PC)
Posted By: FBL

Re: Bps , bps peak & latency - 11/16/07 21:13

Yep that's the way this is done

by and-ing with 1 you get bit0, and-ing with 2 delviers bit 2, 4 for bit 3, 8 for bit 4 and so on.

About strings...

do a printf("%d", sizeof(STRING)) and then add 1 more byte for each single letter and when you're done add one byte more for the NULL termination of the string.

Then you'll know the exact size of your STRING.
I don't know if Acknex sends everything of a string or just the char array... you'll have to ask JCL about this.
© 2024 lite-C Forums