Jump to content

  • Log In with Google      Sign In   
  • Create Account


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 nullie   Members   -  Reputation: 189

Like
0Likes
Like

Posted 21 January 2013 - 11:14 PM

I am working on a potentially multiplayer game which heavily relies on physics and rigid bodies. doing a little research before hand im wondering how many rigidbodies/bones should i set a max limit for simulating. assuming that there are 2-16 players on a network. as well as npc's.

EDIT: i am currently using unity as an engine for convenience in making a prototype. i.may end up porting the game eventually. Using javascript. Any HELPFUL advice would be appreciated.
~Nullie

Sponsor:

#2 Bacterius   Crossbones+   -  Reputation: 8856

Like
1Likes
Like

Posted 22 January 2013 - 04:31 PM

I don't know, how long is a piece of string? Your question can't be answered exactly, it depends on how exactly you're processing them, your level of detail, etc.. why don't you try and measure? Try with, say, 64 bones, if it's too much, halve if, if it's too little, double it, and zoom in on the optimal amount (on average) this way?


The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#3 L. Spiro   Crossbones+   -  Reputation: 13576

Like
0Likes
Like

Posted 22 January 2013 - 07:05 PM

Not only should you measure it for yourself as suggested by Bacterius, but you are also asking about 2 completely unrelated things.

It would be the same as me saying I wanted to make an egg sandwich and asking how many socks I need.

I will be wearing socks while I make the sandwich, but that has nothing to do with the process of making the sandwich.

 

Your objects will have bones, but that has nothing to do with network connections.  You don’t send bones over networks.

Impulses, collisions, and error-checking gets sent over the network.  1 bone or 1,000,000 bones, if there is only one collision only one small packet of data gets sent over the network.

Each client simulates the result of that collision for themselves and the server does periodic checks to make sure they are closely synchronized.

 

And all of this heavy lifting is done for you by Unity 3D so I won’t go into details (there is too much to explain anyway).

 

Bottom line: Number of bones is completely unrelated to network connections, unless you put socks on your sandwiches (and who doesn’t, right?), so profile based on how much of a load you expect to put onto the CPU’s of each player.

 

 

L. Spiro


It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums

#4 nullie   Members   -  Reputation: 189

Like
0Likes
Like

Posted 22 January 2013 - 08:16 PM

in this specific situation the number of bones and the network are related, as i plan to send packets of the position and angle of each of the bones as well. So if there are 64 bones, it will send quite a bit of information about the position and rotation of each bone.

I dont really want to be measuring it all out as that would require me to test with multiple connected clients, as well as needing me to do a bunch of stuff to them to see how much it takes to max out and get laggy, i was just looking for a generalised answer from where i can start at and work from.


~Nullie

#5 L. Spiro   Crossbones+   -  Reputation: 13576

Like
0Likes
Like

Posted 22 January 2013 - 11:13 PM

Why do you want to send that information across networks?

More information means better-informed answers means maybe better ways of doing it means better…you…doing.  It.  More better.

 

 

L. Spiro


It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums

#6 nullie   Members   -  Reputation: 189

Like
0Likes
Like

Posted 23 January 2013 - 10:28 AM

the game involves a lot of physics in the combat system, and the angle+direction can affect how an attack will hit. 
and for a hard boss guy or something, you'll need to find and attack weak points in its armor to kill it, which may be just a tiny slit between metal plates.

i dont know how better to explain it...


~Nullie

#7 nullie   Members   -  Reputation: 189

Like
0Likes
Like

Posted 23 January 2013 - 10:29 AM

you will be able to control the direction and angle of your attack/defense in real time.


~Nullie

#8 L. Spiro   Crossbones+   -  Reputation: 13576

Like
0Likes
Like

Posted 23 January 2013 - 09:50 PM

Sending bones is not the way to go, and in fact will likely just make the experience jittery and laggy for players.

It will also give them much less smooth play (like, jittery, or…laggy).

 

Again, standard networking rules are your best bet.  Send the collision information when collisions happen, verify each player is reasonably sync’ed periodically, and put some faith into the clients.

 

If I swing my Double-Edged Automatic Tail Stomper Blade into the kneecap of the giant enemy, the client only sends the fact that it hit the knee with this angle and this force.

The server sends this to the other clients and they all run the simulation from there.

 

 

L. Spiro


It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums

#9 Hodgman   Moderators   -  Reputation: 30378

Like
1Likes
Like

Posted 23 January 2013 - 10:38 PM

I dont really want to be measuring it all out as that would require me to test with multiple connected clients, as well as needing me to do a bunch of stuff to them to see how much it takes to max out and get laggy, i was just looking for a generalised answer from where i can start at and work from.

You can do it in theory instead of testing in practice.

e.g. let's say you've got a client-server game where:

* a bone is represented with a quaternion rotation and a 3d vector position, which is 7 floats (28-bytes)

* a character has 64 bones (1792 bytes)

* a character state packet has 1 32-bit character-ID, and 64 bone states (1796 bytes).

* there's 32 characters (57472 bytes)

* the physics is updated at 30Hz (1724160 bytes / second == 1.6MiB/s download per client).

* the server is sending this to 32 clients (55173120 B/s == 52.6MiB/s upload at the server).

 

You can tweak those numbers until they fall within typical DSL speeds (maybe 100KiB/s download per client, 3-10KiB if you want to be friendly).

 

Also, your choice of networking architecture makes a big difference. The above is based around the typical "FPS model" of networking, where you've got an authoritative server that updates the state of all clients (and also assuming that the state of the bones needs to be synced explicitly, which L.Spiro is trying to tell you isn't usually the case). If you were instead using the typical "RTS model" of peer-to-peer lock-stepping, things would be completely different (you could have unlimited moving bones at a fixed cost, because the state of the objects is never sent over the wire, only the inputs to the sim)...

What kind of game are you making?


Edited by Hodgman, 23 January 2013 - 10:42 PM.


#10 nullie   Members   -  Reputation: 189

Like
0Likes
Like

Posted 23 January 2013 - 11:32 PM

A fun game. ;D (hopefully) with a combat system similar to that of overgrowth. But with more emphasis on fighting with weapons. I plan to use an authoratative server but im thinking of sending the clients action to peers rather than the synchronised outcome
~Nullie

#11 Selenaut   Members   -  Reputation: 102

Like
0Likes
Like

Posted 28 January 2013 - 07:54 PM

Have you ever heard of toribash? If you use a bone system similar to their model, you can vastly reduce the number of bones you have to keep track of. And honestly, you can just subdivide the more flexible pieces until you're satisfied, but still, you shouldn't need anywhere near 64 bones to satisfactorily represent a person.

 

Using hodgman's calculations, you could (in theory) cut the packet sizes to a third of what they were, so.... 0.5M per client and 17-18M for the server?

 

Also, it may just be me being silly, but can't you somehow not have your server send all of the packets to every individual person? I thought there was a way to save bandwidth or something, because that seems slightly unreasonable... I'm lucky if I get 4-5M down, seriously. smile.png

 

Good luck,

 

Selenaut






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS