Framerate hit, number of visible units
by Guy Allard · in RTS Starter Kit · 09/27/2006 (6:03 am) · 15 replies
OK, I wanted to see if the RTSKit can cope with the number of units we need in our project.
My system is a 2month old laptop,
3.2GHz Turion 64
1GB ram
256MB ATI radeon X1600 graphics card
The engine was compiled as a release build, and I chose the 'optimize for speed' option in VC2005.
If I have 400 units in the viewport, I get a massive (sarcasm) - 14 FPS !!!!
If I move so that the units are out of view, I get 120 FPS
If I disable all of the rendering code for the units, and simply draw a point at their location, I manage to get around 40fps for 400 invisible units. Now, this is before there's any AI, no environmental effects, no combat, no sounds.
This is awful - how can you could make a commercial RTS with those sort of figures that would be playable on anything less than a top end system. 200 units per side is not a large number for a modern RTS. What's going on?
My system is a 2month old laptop,
3.2GHz Turion 64
1GB ram
256MB ATI radeon X1600 graphics card
The engine was compiled as a release build, and I chose the 'optimize for speed' option in VC2005.
If I have 400 units in the viewport, I get a massive (sarcasm) - 14 FPS !!!!
If I move so that the units are out of view, I get 120 FPS
If I disable all of the rendering code for the units, and simply draw a point at their location, I manage to get around 40fps for 400 invisible units. Now, this is before there's any AI, no environmental effects, no combat, no sounds.
This is awful - how can you could make a commercial RTS with those sort of figures that would be playable on anything less than a top end system. 200 units per side is not a large number for a modern RTS. What's going on?
About the author
Recent Threads
#2
09/27/2006 (7:20 am)
Sounds like you need some sort of instance rendering, like found in TSE. But, I don't know if the RTS pack can be implemented within TSE?
#3
This is for a multiplayer game, and 200 units per player doesn't seem that many compared to some games I've played. I guess the issue is how likely will it be that all units will be on screen at once, and I suppose that's not very likely at all.
09/27/2006 (7:46 am)
Right, I see what you're saying.This is for a multiplayer game, and 200 units per player doesn't seem that many compared to some games I've played. I guess the issue is how likely will it be that all units will be on screen at once, and I suppose that's not very likely at all.
#4
--totally independent objects that can each act on their own, not "4 squads of 100 men each". Each one is networked individually, and each one is independent. As an aside, it's a pet peeve of mine with the Total War and other games that advertise "tens of thousands of units!!!1!". It's complete marketing speak--a "unit" in many people's eyes is an atomic "thing" that stands alone, and the one version I had you could have 10 squads, not 100 squads, and each squad could only act as an entire squad, not individually.
--Zero level of detail. Each of the stock RTS units are roughly 800 polys, so 400x800 is a whopping 320, 000 polys on screen at once, not counting even your terrain polys or anythign else in the scene. To get that many models into the screen at once, I'm betting you had to zoom back some, which would indicate that many of the models would be using much lower poly levels of detail, if they had them.
--Zero batch rendering. An RTS game especially would benefit from batched rendering since so many of the units look exactly the same.
The RTS-SK is a starter kit, not a "here's every single thing you'll ever need in an RTS already done for you". It's designed to give you a basis to build the game you want by demonstrating some relatively non-trivial networking, input, and managing techniques and source code, but not be the top of the line next generation RTS with a big red button.
09/27/2006 (8:45 am)
Aye, you need to take a half step back and see what those 400 units are:--totally independent objects that can each act on their own, not "4 squads of 100 men each". Each one is networked individually, and each one is independent. As an aside, it's a pet peeve of mine with the Total War and other games that advertise "tens of thousands of units!!!1!". It's complete marketing speak--a "unit" in many people's eyes is an atomic "thing" that stands alone, and the one version I had you could have 10 squads, not 100 squads, and each squad could only act as an entire squad, not individually.
--Zero level of detail. Each of the stock RTS units are roughly 800 polys, so 400x800 is a whopping 320, 000 polys on screen at once, not counting even your terrain polys or anythign else in the scene. To get that many models into the screen at once, I'm betting you had to zoom back some, which would indicate that many of the models would be using much lower poly levels of detail, if they had them.
--Zero batch rendering. An RTS game especially would benefit from batched rendering since so many of the units look exactly the same.
The RTS-SK is a starter kit, not a "here's every single thing you'll ever need in an RTS already done for you". It's designed to give you a basis to build the game you want by demonstrating some relatively non-trivial networking, input, and managing techniques and source code, but not be the top of the line next generation RTS with a big red button.
#5
09/27/2006 (9:12 am)
Yep, thanks for that reply. Puts it into perspective.
#6
Even if the units are invisible, they slow things down. That makes no sense at all.
If the units were just boxes, a simple low quality square, then how many could you efficiently manage?
09/27/2006 (10:21 am)
Http://www.garagegames.com/products/54Quote:False advertising?
The specialized RTSUnit class have a highly optimized networking scheme so that efficiently managing large numbers of units is easy. The RTSUnit's simplified physics help make it easier to process large numbers of units. You can also customize what features RTSUnits have turned on - disable shadows, look animations, or water interaction to save resources. The RTSUnit also uses a customizable Datablock and Modifier system, which make it simple and quick to define new types of units without sacrificing the ability for individual units to have buffs, debuffs, and special abilities.
Even if the units are invisible, they slow things down. That makes no sense at all.
If the units were just boxes, a simple low quality square, then how many could you efficiently manage?
#7
Wolf, your comments continue to get further out of hand. If you feel cheated contact GG for a refund.
09/27/2006 (11:34 am)
Guy, where did you comment out the rendering code? It sounds like some state changes or setup may still be going on. Also try running Torque's profiler it should show you where the bottleneck is and give you an idea how to avoid it.Quote:False advertising?
Wolf, your comments continue to get further out of hand. If you feel cheated contact GG for a refund.
#8
Otherwise, the only thing out of hand, in my opinion, is your claims.
Even games made back in the late 1990's such as Total Annilihation, Starcraft, and Age of Empires 2, could handle plenty of units on the screen at a time. Most of these games had it where each player had a maximum of 200 units they could have at a time, and they didn't lag at all.
If you can't handle the same number of units as games from 1997, 9 years ago, then yes, we have all been cheated and deserve a refund. You can not promise something on your website and then not deliver.
Tell me, what is your definition of a large numbers of units? And can we efficiently manage those easily?
09/27/2006 (11:57 am)
I'm waiting for the update, to see if it can deliver what it promises or not. Otherwise, the only thing out of hand, in my opinion, is your claims.
Even games made back in the late 1990's such as Total Annilihation, Starcraft, and Age of Empires 2, could handle plenty of units on the screen at a time. Most of these games had it where each player had a maximum of 200 units they could have at a time, and they didn't lag at all.
If you can't handle the same number of units as games from 1997, 9 years ago, then yes, we have all been cheated and deserve a refund. You can not promise something on your website and then not deliver.
Tell me, what is your definition of a large numbers of units? And can we efficiently manage those easily?
#9
I have a Pentium 4, 1.9mgz, with 256mb RAM, and Windows XP.
I'm curious what everyone's speed is.
09/27/2006 (12:06 pm)
With just the RTS Starter Kit demo, no alterations at all, and their 16 units on the screen, nothing moving at all, I get FPS: 22.8 mspf: 43.8597.I have a Pentium 4, 1.9mgz, with 256mb RAM, and Windows XP.
I'm curious what everyone's speed is.
#10
Wolf, once again John is correct, and you are making accusations without even bothering to do your research, or put any effort into actually working on a game. No one ever said you should expect superb performance from starter kit models that were only included to demonstrate features, not be a fully optimized game. As I mentioned before, not a single bit of optimization (lod specifically) was done on those models, because we don't in any way expect anyone to use the models in a production quality game.
As John mentioned, we will gladly refund your licenses, simply contact purchasing@garagegames.com and we'll remove you of any concerns at all.
09/27/2006 (12:19 pm)
With just the RTS Starter Kit demo, no alterations at all, and more complex models, I can easily put 100 units on screen at once running from a dedicated server (which means fully networked) at 50+ frames per second, with no optimizations.Wolf, once again John is correct, and you are making accusations without even bothering to do your research, or put any effort into actually working on a game. No one ever said you should expect superb performance from starter kit models that were only included to demonstrate features, not be a fully optimized game. As I mentioned before, not a single bit of optimization (lod specifically) was done on those models, because we don't in any way expect anyone to use the models in a production quality game.
As John mentioned, we will gladly refund your licenses, simply contact purchasing@garagegames.com and we'll remove you of any concerns at all.
#11
I'm quite surprised by this. Does this mean that the actual rendering of the units (all 320,000 polys) is only costing 26fps (and therefore, by implication, using LOD meshes will save me no more than 26fps), whereas all the stuff that happens to decide if and how they get rendered is costing 80+fps?
On a different note - with the stock RTSKit as shipped, is a 2 player networked game with 200 units per side across the internet (assuming DSL connections or better, and assuming no more than say 50 units on screen at one time) feasible without further modifications to the pack/unpack functions?
09/27/2006 (1:16 pm)
John K - I simply put a return; at the start of RTSUnit::renderImage to get the 26fps increase. Interestingly, if I return false from the beginning of RTSUnit::prepRenderImage, I get the framerate back up to over 110fps.I'm quite surprised by this. Does this mean that the actual rendering of the units (all 320,000 polys) is only costing 26fps (and therefore, by implication, using LOD meshes will save me no more than 26fps), whereas all the stuff that happens to decide if and how they get rendered is costing 80+fps?
On a different note - with the stock RTSKit as shipped, is a 2 player networked game with 200 units per side across the internet (assuming DSL connections or better, and assuming no more than say 50 units on screen at one time) feasible without further modifications to the pack/unpack functions?
#12
Pro: Anyone can afford it.
Con: A anyone can afford it.
However, it would be very interesting if someone could come up with a solution on this. :)
09/27/2006 (1:27 pm)
There are pros and cons to making an engine so cheap anyone can afford it.Pro: Anyone can afford it.
Con: A anyone can afford it.
However, it would be very interesting if someone could come up with a solution on this. :)
#13
It sounds like the main overhead could be in renderObject, but to make sure thats the case and not the scenegraph traversal you can put a return at the beginning of renderObject to see if the fps jumps back up.
09/27/2006 (1:27 pm)
RTSUnit is a descendant of ShapeBase (through the player class). ShapeBase descendants use renderImage to customize their rendering while letting ShapeBase do a lot of the heavy lifting in ShapeBase::renderObject.It sounds like the main overhead could be in renderObject, but to make sure thats the case and not the scenegraph traversal you can put a return at the beginning of renderObject to see if the fps jumps back up.
#14
And why not answer Guy Allard's question?
09/30/2006 (2:17 am)
Quote:If it was optimized, then how many units would it be possible to manage with the current code offered in the RTS Starter Kit?
Stephen Zepp
As I mentioned before, not a single bit of optimization (lod specifically) was done on those models, because we don't in any way expect anyone to use the models in a production quality game.
And why not answer Guy Allard's question?
Quote:I need an answer to this.
with the stock RTSKit as shipped, is a 2 player networked game with 200 units per side across the internet (assuming DSL connections or better, and assuming no more than say 50 units on screen at one time) feasible without further modifications to the pack/unpack functions?
#15
Each and every one of which is game specific, so you would have to tell us the numbers for your game.
09/30/2006 (8:01 am)
Wolf, there is no answer to your question. If you "need an answer", then go and do your research, design your game, build your models, implement your game specific optimizations, and let us know what you come up with for your game--because there are dozens and dozens of contributing factors to how fast a game runs, or how many units you can have at once.Each and every one of which is game specific, so you would have to tell us the numbers for your game.
Torque 3D Owner Jacopo De Luca
Default Studio Name
AFAIK there are no commercial titles that managed to get that number of independent units on screen at the same time, but I could be wrong.
The games I know, that have a lot of elements (soldiers, for example) on screen, like the "total war" series, usually joins them in squads (you can't give orders to a single soldier). This means that you only have a handful of units on screen and you can optimize network traffic and CPU calculations, since the position and behaviour of the single elements (soldiers) will be strictly tied to their "father" unit.