Sign in to follow this  
StratBoy61

Theory - 3D Crowd Simulation

Recommended Posts

Hello all, This is a very general question, and I thought that this forum was the best place to ask it... So here I go : I was wondering what was the typical limitation for displaying 3D characters on the screen in a game like Quake for example, or any MMORPGs. I have an idea about a game that would require the displaying of a crowd of a thousand of NPCs in the same shot, and I was wondering if : 1) That was technically possible ? Is there already one/several game(s) doing so ? 2) It existed tricks to simulate a big number of characters on the screen --I mean moving 3D characters, not just billboards. Regarding the second bullet, I was thinking of creating a special object that would simulate a dynamic crowd by getting rid of polygons that cannot be visible in a crowd --like mainly the legs... My two cents indeed ;) Please let me know of your experience and/or ideas. Thank you in advance StratBoy61

Share this post


Link to post
Share on other sites
I did something similar a while ago using keyframed animation md2 models, and around one hundred of them, immediate mode, and I still got descent framerates :)

So, yes - it's possible.

But then I didn't do polygon-to-polyon collision checks or AI or something, but if you stick to using simple flocking or wandering modes you'd be fine.
Try doing it simple first, getting simple quads to move around... once you got that, the rest is just cosmetics. :)
using a shader to blend animation and a VBO, and your all set. ;D

Share this post


Link to post
Share on other sites
First I have to say that my old geforce 3 was able to run Age of empires 3 where some dozens of 3d characters were involved at the same time, so I can imagine that todays hw should not have problems with, let's say, 200 meshes. Of course, I suppose that the high amount of characters will lead to very small creatures in the background, so those can be rendered as billiboard (when a character is 10x10 pixels, I suppose it wont be a great difference), or as a very low-poly low-textured mesh, avoiding shadows and other subtle effects.
Ati made a demo for the x800 using some hundred of characters, all soft shadowed and textured, if you're interested.

Share this post


Link to post
Share on other sites
Thank you Rasmadrak and cignox1 for your answers.

Well, first of all, I do not want to display a hundred of characters, but more like a thousand, or more... Let's say a maximum of 3 thousands.
I would obviously disable a polygon-to-polygon collision detection, but still leave a simple bounding sphere check, so that characters do not get inside others. As for AI, one or two thousands extra entities should not give a dramatic performance loss.

Regarding billboarding, I thought that it did not really make sense when you want your characters to be animated. Also, I do not know whether it is possible/feasible to render a 3D character on a billboard, as many times as you want different animations...

Regarding the ATI demo, sure, I would like to know where to find it. I will search for it on Google anyways.
Cheers
StratBoy61

Share this post


Link to post
Share on other sites
rendering 3 000 animated modells should be quite hard. How many polys per modell are you thinking of? if you'd go for 300 polys(a grunt/footman of warcraft 3) average(LOD) you still have 900 000 poyls. Are all the modells the same? If they are, maybe you could do software skinning and use instancing to render all modells which are standing in a similare position(i think that would occur quite often with 3000 characters). I agree with the other posters that billboarding could definitely help to reduce the polycount extremly. No one will notices if a character standing 200metres away is a 5x5 pixel character or a 5x5pixel billboard. Also the billboards that are further away can be static and the billboard that are nearerer to you could be rerenderd every 10,30 or 50 frames(depending on the distance to the viewer).

I don't know if it's possible to render thousands of characters with that, but it's the best system i can think of.

regards,
m4gnus

Share this post


Link to post
Share on other sites
Thank you m4gnus for your answer, it does make sense.
I understand the billboarding thing. I guess I could dynamically create billboards of some characters in certain positions and display them for the farthest characters, instead of the real 3D model. And true, you do not need to see the details if the character is very far away.

I think I have a good idea of what can be done now.

However, if one knows what is the limitation in a game like warcraft or quake, it would help. For instance, have you ever seen over a hundrer players in a quake arena, without FPS loss ? And what about the dead players that stay on the floor. Are they the original models, or have they been "lightened" in terms of poly count ? Could the quake engine display, say, over 200 dead models piled up in the same view (if the engine does not get rid of them)?

Cheers
StratBoy61

Share this post


Link to post
Share on other sites
Look at the crowd demo at ATI's site to get some inspiration.

On a more techinal note, I'd suggest that you forget about skinning when trying to do that many characters.
Use heavily packed vertex buffers containing your frames and just interpolate for animation.
This way it's almost as fast to render an animated object as a static one.
Also make sure to LOD properly.

Edit: Another game that handles alot of animated characters is Dead Rising on the X-box 360 (look under movies or screenshots).

Share this post


Link to post
Share on other sites
hehe, if you don't mind me asking - but why on earth do you have to display 3000 characters simultaniously? would they even fit on the screen?

Anyway, LOD is the way to go, like several above me already suggested :)

Share this post


Link to post
Share on other sites
It's quite possible to display a crowd of 1000 people, animated and all.

Here's a screenshot of one of my early tests with hardware skinning.

I only had 900 characters on screen, but 1000 should be no problem...



All the skinning is done in vertex shaders. I got 60+ FPS @ 1280x1024. The models are 1100 triangles each, with a 512x512 texture. No LOD was used in that test.

I have a video of this around here somewhere...it's pretty funny [grin]

In my game 'Gang War' there can be 100s of civilians/gangsters/characters on screen at once.

- Dan

Share this post


Link to post
Share on other sites
I think that the Quake (I) engine is heavily limited about the polygons count. Don't know about the Quake (III) engine. You may try to download some free 3d engine and use a simple model.
@dgreen02: wich graphic card do you use? 1000 polys per mesh, 1000 meshes and 60fps means 60.000.000 polys/sec. The product copmparison utility on the ati site shows 325M for the 9800 and 712.5M for the x800 pro, so you are way under the limits of the hw. I suppose that a highly optimized engine one should obtain at least 200M on a decently new card.

BY THE WAY: someone knows why the products comparison tool says: "*Not applicable for Radeon® X1000 series and higher."? For me, that's because the x1000 didn't improve the geometric side too much, but only the v.s. and p.s. :-)

Share this post


Link to post
Share on other sites
Good point...now that I think about it I was probably getting a lot more than 60 FPS heh. I don't really remember, it was a little test app. I'm using a ATI X700.

But yeaaaa, displaying a crowd of 1000 people in realtime isn't very hard considering the power of today's cards. And if you use LOD, I'm sure you could have a LOT more than that.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by cignox1
I think that the Quake (I) engine is heavily limited about the polygons count. Don't know about the Quake (III) engine. You may try to download some free 3d engine and use a simple model.
@dgreen02: wich graphic card do you use? 1000 polys per mesh, 1000 meshes and 60fps means 60.000.000 polys/sec. The product copmparison utility on the ati site shows 325M for the 9800 and 712.5M for the x800 pro, so you are way under the limits of the hw. I suppose that a highly optimized engine one should obtain at least 200M on a decently new card.

BY THE WAY: someone knows why the products comparison tool says: "*Not applicable for Radeon® X1000 series and higher."? For me, that's because the x1000 didn't improve the geometric side too much, but only the v.s. and p.s. :-)


It's not all about triangle rasterization you know, those tests are performed on static vertex data, in dgreen02
's demo every vertex has skinned, thus the transformation cost is much higher than that. Most hardware also performs alot better when drawing as many triangles in one DP call as possible.
I guess that dgreen02 draws each character with a single dp, so 1000 dp's.
It is possible (on newer card) to use hardware instacing and get better performance, but a skinned vertex is probably 4x as expensive as a static vertex (not counting the added amount of memory needed to be processed by the GPU, think bone transforms).

Share this post


Link to post
Share on other sites
Thank you guys for your answers.
I am sooooo disapointed because I did not know about Dead Rising the X-box 360 as eq mentioned, and my project was *exactly* the same concept. Mmm, I guess it was not that original then... So to answer Rasmadrak, this is the reason why I wanted to make sure that a thousand of animated characters could be displayed on the screen. The Dead Rising screenshots are impressive.
Dead Rising Screenshot
dgreen02's demo looks very encouraging too. Thank you for your answer !

Well, thank you all, I am going to look for a rope now that I know that my little project's concept is being developped by an army of professionals at Capcom's ;)
StratBoy61

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this