In regards to rts's, unit counts, and game engines

So maybe you are not an rts fan, but I am a really big one. I love commanding lots of units to their deaths, or maybe their victory. So I sit back and marvel sometimes at the number of units games like the Total War series and Supreme Commander are able to pull off. I believe Supreme Commander 2 was capped somewhere around 500 units originally. And Total War…who knows what numbers they have.

My question, and perhaps it’s somewhat un-answerable, is how do these games pull off these numbers of units/characters/agents…whatever you want to call them, and is Unity capable of competing with the engines that pull these games off? I think of Blizzard and Starcraft2 as well. Very high quality game – although the unit limit in that game is 200 - which is really good considering the quality of that game.

Is it simply the game engine’s capabilities? Is it the developers somehow cutting back on the AI to allow for more cpu capacity in other areas? Is it that AAA companies have enough manpower to optimize the game with a fine-tooth comb, like squeezing the last drop of juice from a lemon? What is it? I really am wondering.

Obviously I am asking in the Unity forums, so I’m sure to get postivies in affirmation of how great Unity is…but I really would like some sober judgement in what types of things in a game engine relate to pulling off games like these.

OK, this is something that seems obvious to ask, but it actually doesn’t work that way.

The engine might be written from the ground up to be for an RTS, but that doesn’t change the amount of variables that need to be stored or that you have to set things up in a way that will allow hardware to go through the numbers.

Basically each unit has some variables, each unit has to navigate and make decisions. In unity these aren’t ready for you, you have to set everything up and decide how to handle things as the coders for starcraft did.

You will have access to tools that will allow you to optimize performance (batching stuff together), you will be able to code your path-finding to be spread over a number of frames and more, but doing so is up to you. Finding the most efficient way to do this is your task, unless you just want mod a game in which case simply use their editor and tools if they provide you with any.

There is no real “trick”, you first set it up so it works and it’s simple, then you simply improve it, until it is as fast as you want it. You learn along the way and you find the balance that delivers what you need. Do you think that the Starcraft programmers just clicked on a ready made engine and everything was ready? No they built that engine doing exactly this: first working and simple, then improve, until ‘it’s done’.

Of course you might face some issues with the engine, that’s true though for any engine. The key difference is that you won’t have source code access (most likely), but then again you aren’t paying millions to develop an engine (unless you think the Starcraft engine was made by slave gnomes).

Unity is more a framework, than a game engine. What you do with that framework is up to you, it’s focused on games though.

There is no hard coded limit for unit numbers if that is what you think will be the problem. The problem is how do you handle all these units.

Depends on how you handle the units, and in a 200 unit game, most of the processing power will more than likely go to pathfinding.

To simplify your answer, yes Unity should be able to theoretically support the same amount of units, but you will have to program the ways to do it yourself.

Also, with the The Total War series sprites are used at certain LOD levels, allowing more units on-screen. :wink:

Well that is good to hear, actually. I’d much rather have the end goal be hard, but possible, than to have it not be possible at all. From what I’m reading from those who posted, it’s possible, but will just take a lot of research, knowledge, and a lot of “elbow grease”.

Probably the main technical barrier in Unity will be threading (Unity is not Multithreaded), as most platforms have multiple core cpus now and to take advantage of those cores you will need to maximize your games use of those cores. Unfortunately Unity is not a multi-threaded platform so you will need to research this aspect further.

I would imagine that you will probably have to write a multi-threaded RTS game engine that uses Unity as a display system.

Total war series would be hard one. Their engine is handling those little humans on very optimised way considering that you can put gigantic number of units on screen which could easily pass 2 milion triangles and quite high detailed characters.That would be hard task to achieve in Unity i guess. If you think about it that those units are shadow casters, it becomes wonder from start on how do they get such good performance considering that each unit is shadowcaster (drawcall).

Supreme commander or Starcraft should be possible.

@janpec and instancing allows high unit volumes on the GPU DX10+ and OpenGL with ATI extension.

https://www.youtube.com/watch?v=JB2kkWkfJtw

http://www.youtube.com/watch?v=JB2kkWkfJtw

It would be cool if DX11 builds of Unity could take advantage of this technique.