Game Development Community

More units equal dramatic slowdown plus map editor crashes.HELP

by Wolf Dreamer · in RTS Starter Kit · 01/30/2008 (9:32 am) · 4 replies

Just using TorqueScript, and no coding in C++, can someone get it to handle a reasonable number of units? Or do I have to do some coding in C++ to get any reasonable speed out of this thing?

Also, whenever I switch to the map editor, and start placing things around, it crashes on me. Every single time.

Anyone else have that problem?

Are there any free map editors I can find out there to use instead of the official Torque world editor? I want to be able to drop something from the camera, to the ground, and have it stop whenever it contacts anything.

I remember before it being mentioned that the speed program was because the models weren't optimized or something. Any other way to increase speed?

I would like to have 400 units at a time, but will settle for half that if I must. Not able to have at least a hundred units each for a two player game would be rather horrible for any real time strategy game.

#1
01/30/2008 (10:07 am)
Wolf, I did some tests with 100 units.
Indeed there is a huge performance drop, but that without a context, means nothing.

At the first look, we can see that the drop cames when the camera sees all the houndred units at the same time. As soon, as you zoom in, or divide your units, the drop will diminish, and even disapear.

That lead us to a fair point: the units on the rts-sk are low poly but had no LOD (levels of detail), so the results are expectable: the engine is rendering 100 units at full detail, even when the distance from the camera dont whorth it, loosing one of the jewels of TGE, the LOD management.

There are also other things involved, but in this case that is the major point, I believe.

I would recommend you to learn how the engine works, because it can be a pain to work against it, but wonderful when you found the path to go with it. That is the point when you begin lo love TGE, and when the things began to be easier.

Just remember that there is no magic here, Torque is not a Game-o-matic system, is an SDK. You cannot throw in 400 units and expect to work like that. There is a context, there are many complex things to take into account- just dont dispair! read, investigate, and in the end, leave the more complex parts for future iterations of the project, give yourself time to get use to whole thing ;)
#2
01/30/2008 (11:00 am)
Novak is correct--the models included in the RTS-SDK are medium poly (650-800ish if I remember correctly), but have no LoD. For multiple hundreds of units on screen (in view) at once, you will require LoD, and even that isn't going to solve every problem--you still have to network all 400, you still need to process all 400, and each of those, while already tweaked down in performance load, will need to be carefully watched.
#3
01/30/2008 (11:43 am)
Okay, this begs the question (at least from me) "Why would you want 400 units on the screen at one time anyway?"

When I used to play table top games, having to move 50 units was enough to process without doubling it. In fact, to ease the strain, each unit would usually represent at least 2-5 "real" units. So I guess my question REALLY is, is the requirement for such a large number of units for the visual presentation or for game play?

If the former, I think you're best to re-think your visualization a bit - 50 units really does look like a lot!. And if the latter... REALLY!?

But this is all academic, creating LODs will go a long way to easing the "problem".

Some quick math (which I suck at):
40,000 polys/ 800 polys (taken from Stephen's estimate above for the included units) = 50 units
40,000/400 = 100 units
40,000/250 = 160 units
40,000/100 = 400 units

Don't mind me, just curious :)
#4
01/30/2008 (1:26 pm)
I still play Total Annihilation: Kingdoms. You have large numbers of units on the screen swarming against each other all the time. Wonderful game, despite being more than a decade old. I didn't mean all 400 units would be on the screen at a time, just in the game.

So, when things lag up, I just move the camera down. Good. I'll do that.

One can not look for information until they know what they are looking for. The LOD thing is something I'll search for now. That makes sense. I'll need to lock the camera so it can not zoom out by any great distance, or if I allow zooming out, turn everything into simple shapes such as circles, squares, X's, or whatever.

As for the online thing, I don't think it'll be a problem at all. Computers are faster these days, as is the internet connection. Visualize it as numbers to be kept track of. Each unit has its own ID number, an X, Y, and Z location, its health, and its type class. There isn't a whole lot of information to be sent at a time. I haven't looked up any information about it recently, so I don't remember, but I don't think it'll be a problem. The amount of data channeled through constantly shouldn't be more than Torque can handle. And there are some free data management programs out there like that one version of MySQL to use if necessary.