A common question with Blink 3D is how many people can be in a virtual world simultaneously. The answer is, it really depends on a number of factors, there is no hard and fast answer.
What's in front of the Camera?
When it comes to having people (avatars) in a virtual world there are 3 main types:
1. Those people that are in front of the camera.
2. Those people that are not in front of the camera.
3. Those people who are in front of the camera but are to far away to be rendered. Note that Blink 3D does not support occlusion culling, so even if there is a building in front of the avatar, the avatar still gets rendered. However, Blink 3D does support distance culling for avatars so if the avatar is more than x distance away from the camera it is hidden.
The first issue is how many people can you have in front of a camera. If the virtual world supported 5,000 people, can you have 5,000 people in front of the camera? The answer is no. Assuming that each persons avatar consisted of 2,000 triangles on average that would mean that there would be 10,000,000 triangles (2000 triangles x 5,000 avatars) in front of the camera to be rendered. All these triangles would have to be rendered plus the triangles used for the actual buildings in the virtual world its self. Even the fastest computers out there would have trouble rendering this number of triangles.
From this we realize that there are two issues here. How many people can be in the world at once and how many can be in front of the camera at any point in time.
Before we can use a rule of thumb here to come think about a few things What type of computer is the average user is going to be running on and what sort of responsiveness the user can reasonably expect in the virtual world. This question is not just about how powerful the CPU is in the users computer but also how powerful the GPU (Graphics Processing Unit) or Graphics Card is. Factor in that they could be running other software at the same time, also factor in the size of the window to the virtual world. The larger the window the sower the frame rate. Now also consider the complexity of the virtual world in general, how much animation is going on, how many timesteps are being used, is there music or video being streamed in to the world,, are there HTML pages being used as materials, in other words what is the general load on the environment. What is the average number of FPS (Frames Per Second) that the virtual world is able to sustain on the average computer without having a single avatar in the virtual world. If the answer to this question is lets say 50 FPS then you will not be able to support that many people in front of the camera before the FPS drops below 15 and makes the virtual world unusable.
We would recommend keeping the number of triangles that need to be rendered at any point in time to below 50,000. On an average machine the user will get around 40 FPS. Assuming that your average avatar has 2000 triangles you could afford to have 10 avatars in front of the camera and have 40,000 triangles left over for buildings, etc. Or 20 avatars and 30,000 triangles for buildings. Note that this does not mean you can only have 50,000 triangles in total in the virtual world, just that at any point in time 50,000 should be the average number of triangles in front of the camera. This also does not mean that the maximum number of avatars is 10. It is just how many should be in front of the camera on average. Do not forget that you can use avatar distance culling to help keep the numbers down. This is particularly useful in environments that have wide open areas where a lot of avatars can gather.
Virtual World Instancing
Blink 3D support instancing of Blink 3D environments. When you go to a restaurant, quite often on the wall you will see a message stating the maximum occupancy. This is the maximum number of people who can safely fit into the restaurant. But what happens once this number is reached. Well, you either have to wait for someone to leave or you go else where. Blink 3D works in a similar way, when you create the virtual world you state what the maximum occupancy is, lets say you set it to 40. Now lets say that you try to get into this virtual world and there are already 40 people in it. What Blink 3D does is create a new instance of the virtual world and you enter that. It's like making a copy of the restaurant, minus the people and putting it in the next door lot. Then as other people try to enter the virtual world they too will find it full and will be put in the second instance of it with you. When the second instance becomes full a third is created, etc. This all happens automatically, there is nothing the user needs to do.
Now while this sounds like a perfect solution there is a catch. If you arranged to have dinner with your friends it might seem a little strange for you to be in one restaurant and for them to be in another instance of it. The same is true with Blink 3D environments. You may be in one instance and your friends may be in another. We are working on a couple of ideas to solve or mitigate these limitations so stay tunned. Of course if you don't want to have Blink 3D automatically create a new instance for the virtual world you can tell it not to. But if someone tries to enter the virtual world and the world is full they will simply be denied access.
Avatarless
If you are creating an environment that is geared towards presentations you can disable the creation of users avatars completely. They can still chat to each other but you will not be able to see where they are in the environment.
XMPP Server
Blink 3D uses an XMPP server for chat, avatar positioning and shared objects. There are a number of commercial and open source XMPP servers on the market. In house at Pelican Crossing we use the OpenFire Java based server http://www.igniterealtime.org/projects/openfire/index.jsp. This server is capable of handling up to 5000 users. Note that these users would not all be in the same virtual world. For the hardware requirements for an XMPP server please contact the developer.
An XMPP server is used for in world chat. You can have a large number of people chatting in a large number of environments or instances of an environment before you start to see an impact on the server. If you are approaching this point consider using additional servers and breaking out the virtual worlds or instances of the virtual world to different XMPP servers. Some XMPP server developers have connection managers and clustering options that might help.
The real load that is placed on the XMPP server is when synchronizing the position of all the users. Essentially every 20 seconds by default, each users position is sent to all the other users. Note that the position information is only sent if it has changed from the last time it was sent. So if a user stands still there are no positioning messages sent.
Using the default value of 20 seconds between updates is normally fairly good. There is however one draw back. The information that is sent is the avatars current position. So when the avatar moves they go from the last know position to the new position in a straight line. Normally this is not a problem but if the user just walked around the corner of a building other users may see the avatar cut through the corner of the building. Note that remote avatars do not have any collision geometry. The update frequency is something you will probably have to experiment with to optimize performance.
Web Server
People also ask what the load will be on a the Web server. When a user visits a Web page with a virtual world embedded in it, Blink 3D will download the virtual world from the Web server if the virtual world has not previously been downloaded into the cache. This means that the virtual world is only downloaded the first time. If the world is updated then it will automatically be downloaded again.
The average virtual world or environment extension is between 5-10Mb. So when determining the capacity of the Web server required, factor in the size of your virtual world (the .env or .envx file) then determine how many new users will be visiting the virtual world each hour. Then multiple that number by the size of the virtual world. So lets say the virtual world is 8Mb and there are 10 new users per hour then your server and Internet connection should be capable of serving 80Mb per hour on average.
Summary
Here are some things you need to keep in mind when creating your virtual worlds.
1. Determine what you believe will be the average hardware configuration for your your users and then test your environment on that configuration, test often and while under the anticipated load.
2. If you control the avatars that people can use then you can also to a degree determine the number of triangles that each one will use and therefore the number of triangles that need to be rendered. If people use their own avatar, some may have 5,000 triangles and some may have 1,500 so it's going to be much harder to keep things consistent.
3. Decide if the virtual world instancing approach will work for you. If so what are you going to set the room occupancy to?
4. Decide if culling avatars based on proximity to the camera is an approach that will work for you. If so you may be able to increase the value specified for the room occupancy.
5. You may want to write some code to determine the number of triangles being rendered and the average FPS. With this information you could adjust the avatar culling distance in real time. This will help to maintain a consistent FPS regardless of the machine people are running on. Just be careful that you don't end up removing all avatars so maybe set add some minimum non cull distance logic.
6. Decide how often you want an avatars position to be updated. The longer the delay between updates the less traffic to and from the XMPP server. However, with long delays you may see remote avatars appear to walk through buildings rather than around them.
7. If you are likely to have a lot of avatars and a high update frequency for the avatars position, make sure that the XMPP server is able to handle the load. Check the spec for the XMPP server you plan to use.
8. Always think before adding a feature to your virtual world, what will be the impact on the FPS? Do you really need to use a particle system to make smoke come out of the cars exhaust?