City building game - need advice

Hi everyone,

I would like to start working on a city building game similar to the Caesar/Pharaoh/Zeus series, but I have a few concerns about performance.

What I am worried about is the number of objects that have to exist in the scene because for this type of game it can really easily approach thousands. I assume Unity does lots of stuff for each game object that exists in the scene (per frame updates needed by the engine I suppose) and probably most of this stuff just won’t be needed in my game.

So my question is would Unity be suitable to build this type of game or should I just build my own engine specifically tailored for my own purposes.

If my question sounds vague :slight_smile: I think I could provide more details although I haven’t even started working on the game so I do not really know exactly what will go in it. But as I said in the beginning it will be quite similar to some of the most well known city building games.

Best Regards,
Andrew

City skylines was built in unity. If object doesn’t have Start/Update method, as far as I know, it has very little overhead and unity pretty much does not touch it.

1 Like

You can easily use unity to update thousands of behaviours, it all depends on how you do it.
Also, if you do not count static objects the performance will even be better because as said before, start (on instantioations) and update methods are the most expensive ones.

Checking unity’s keynote in los angeles you can even see that in action.

check at 30:45.

Also, I seriously doubt you would see thousands in a game similar to those you mentioned, you would lose all readability of the game. a hundred or two, sure, more than that will probably only happen if you zoom out too much and in that case you can start reducing other aspects such as quality of the sprites which will make you gain performance.

anyway, a simple answer to you, yes unity is suitable.

1 Like

The key thing I’ve figured out is to try not to use Update or anything as much as possible. You can have scripts on the buildings that have some logic behind them. But only call them when you absolutely need too by accessing the Method of the script to run it once to do some form of logic too it.

It’s really just breaking down bigger pieces of a puzzle into smaller pieces and only connecting them to the proper pieces when they need to be.

1 Like

That is great news guys! Thanks for all your answers!

1 Like