Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Unity vs Unreal

Turjan

Arcane
Joined
Mar 31, 2008
Messages
5,047
Also, I doubt you even need LODs for those. I am not sure there is really any point to LOD any more for most circumstances. Maybe for an RTS game with lots and lots of animated characters.
No, you definitely need LODs. This game has lots of animated characters, thousands actually.
 

Turjan

Arcane
Joined
Mar 31, 2008
Messages
5,047
From a certain distance it normally it is enough to render buildings as a simple boundary, even just a cube. There is a lot more detail in those geometries that you dont really need to render all the time.
I know that you should do a simplified model for your LOD model, not just cut your original model down. That's actually done this way by the more prudent makers of custom content.
 

Burning Bridges

Enviado de meu SM-G3502T usando Tapatalk
Joined
Apr 21, 2006
Messages
27,562
Location
Tampon Bay
CityGML uses 4 levels of detail. From a simple boundary representation that is enough from high above the city, down to full CAD quality, and you could only see the highest level if you are directly at or inside the building.
 
Unwanted
Shitposter
Joined
Oct 5, 2014
Messages
3,390
Location
Nazi death cult center of jew medicine avoidance
From a certain distance it normally it is enough to render buildings as a simple boundary, even just a cube. There is a lot more detail in those geometries that you dont really need to render all the time.

If scene management is decent you should just be drawing what's visible, which is not much in that picture. Those should be low poly anyway but if not then to make a LOD you'd have to make a low poly model anyway.

In OpenGL today you also have instancing which makes it very cheap to draw 600303 versions of some model for very little extra cost compared to doing just one and many of those are clearly duplicates even from what's visible on the screen.

Of course I won't be surprised if I learn that Unity does not take advantages of instancing.
 

Turjan

Arcane
Joined
Mar 31, 2008
Messages
5,047
CityGML uses 4 levels of detail. From a simple boundary representation that is enough from high above the city, down to full CAD quality, and you could only see the highest level if you are directly at or inside the building.
A good building model here uses about 1.5 MB for something small and about 2.5 to 6 MB for something bigger growable. Good uinique buildings try to stay under 10 MB. There are jokers who use 25 MB and up. The main memory usage is in the different sets of textures you need (with the lighting map etc.) and how big you choose to make the texture map. Game killers use too many tris.

Edit: Anyway, there is no memory creep. The game stays solidly at 3.65 GB with this city which is at the building limit and close to the agent limit.
 

Burning Bridges

Enviado de meu SM-G3502T usando Tapatalk
Joined
Apr 21, 2006
Messages
27,562
Location
Tampon Bay
Are you talking about real buildings? They usually are unique and cannot be copies of another building of the same type. Most of the buildings in the game are copies and also, there is really no detail in the screenshots that warrants more than a few hundred, maybe thousand bytes. That is for the geometry. Textures will eat up a lot more, but really, you need not make new textures for every building.
 

Burning Bridges

Enviado de meu SM-G3502T usando Tapatalk
Joined
Apr 21, 2006
Messages
27,562
Location
Tampon Bay
Of course I won't be surprised if I learn that Unity does not take advantages of instancing.

I doubt that Unity has any merits for a game like a city builder. They probably just chose it because they never looked at any other tools, or something equally stupid. No real city applications I have seen uses a game engine, although the idea is not new.
 

Turjan

Arcane
Joined
Mar 31, 2008
Messages
5,047
Are you talking about real buildings?
No, I'm talking about buildings this game uses. The main memory use is in the textures, so bigger buildings use a lot more. This is why I said that high memory use comes with the use of lots of custom buildings, as every custom building obviously needs its own texture map.

Edit: I was looking at your example, CityGML. Really? All those buildings have simple geometries and very basic textures. No wonder it needs much less memory.
 

Turjan

Arcane
Joined
Mar 31, 2008
Messages
5,047
Well, that's fine. It was not meant in any way as a jab against CityGML btw. However, I think it somehow gets lost what a specific game wants to achieve. CSL is mostly a city simulation (with emphasis on traffic simulation) with lots of moving vehicles and pedestrians, and it wants to look good at the same time. Modelers coming from other games have really a hard time getting their models down in line with what the game wants. Those coming from SC4 don't like the cuts and workarounds they have to do on details. Honestly, I do not see a single game that you could actually use for a proper comparison. There simply isn't any that achieves the same set of parameters.

Which makes this whole discussion quite academic. I would love to see a game that does this better than this. However, where is it?
 

Hirato

Purse-Owner
Patron
Joined
Oct 16, 2010
Messages
3,954
Location
Australia
Codex 2012 Codex USB, 2014 Shadorwun: Hong Kong
You definitely forgot Kerbal Space Program in your shitlist. The only game I know where once the world is loaded you have to wait another 5 seconds until it registers mouseclicks and keystrokes

Arguably a realistic simulation of controlling spacecraft remotely. :M

As someone who has extensively played this game, I just wanted to comment on this. I didn't experience any of these specific issues (and I use two monitors). That does not mean I did not experience other issues. You had to use the DX9c render for AMD cards at some point (a Unity update broke that). The game suffers from crashes during exit if you load too much custom content. It doesn't like repeated returns to the main menu. Otherwise it runs completely stable, and I haven't seen any savegame corruption yet that some people mention (probably an autosave bug).

Regarding your memory issue, this is, from my (and from other's who tested this) experience, completely false. The game runs a 400k person city with about 3.7 GB memory usage. This rises quickly with custom content you use. When I had 920 different custom assets (many of them poorly optimized) and two dozen mods, the game grasped all it could get on my system (12.7 GB RAM). This means, RAM usage depends purely on custom content use, and the limit how much you can use depends on your system. The base game without custom content stays strictly within the official minimum specs, which means below 4 GB. As with all simulations, the true limit is CPU power.

I had 0 mods and DLCs installed on version 1.1.something, and it was using well over 5.5GB when I reached 20K population.
i loaded up my old town which is currently at population 40K and the game is using 4.4GB of RAM, so I guess the 1.2 patch optimised things a bit.

IzeHK4n.jpg


Still a ridiculous amount of resources.
 

Turjan

Arcane
Joined
Mar 31, 2008
Messages
5,047
Still a ridiculous amount of resources.
No idea how you managed to do that. That much, much bigger city up there is still running as I type, and it stays put.
Can you try to load your city with the --disableMods --noWorkshop parameters?
 
Joined
Jul 4, 2014
Messages
1,563
IIRC CSL's asset loading/handling is rewritten (to some quite large extent) by Colossal Order's programmers, and is not off-the-shelf Unity. They did it to make modding easier, but got some significant performance boosts as a side effect. And it's why the game "runs pretty well for an Unity game".
 

Turjan

Arcane
Joined
Mar 31, 2008
Messages
5,047
IIRC CSL's asset loading/handling is rewritten (to some quite large extent) by Colossal Order's programmers, and is not off-the-shelf Unity. They did it to make modding easier, but got some significant performance boosts as a side effect. And it's why the game "runs pretty well for an Unity game".
That's true. I only talk about it, as it got on the "Unity shitlist" further above.

As an aside, while I obviously like the game, I'm fully aware of its many limitations (some of them as hard limits in the code). I'm sure the game I have running at the moment has toned the actual citizen simulation way down in order to be able to keep running.

Edit: Hmm, they are mostly on the metro. Anyway, they keep breeding like rabbits (at 536k now), and as I'm at the building limit, I can't place any water pumps anymore, which leads to rolling water outages. Memory usage is still 3.65 GB. Anyone with the game can try this for themselves (not my city btw, I just added some commercial and offices in my game to keep it growing):
http://steamcommunity.com/sharedfiles/filedetails/?id=407110916
 
Last edited:

Hirato

Purse-Owner
Patron
Joined
Oct 16, 2010
Messages
3,954
Location
Australia
Codex 2012 Codex USB, 2014 Shadorwun: Hong Kong
No idea how you managed to do that. That much, much bigger city up there is still running as I type, and it stays put.
Can you try to load your city with the --disableMods --noWorkshop parameters?

As launch options from steam? not noticing any difference.
 

Burning Bridges

Enviado de meu SM-G3502T usando Tapatalk
Joined
Apr 21, 2006
Messages
27,562
Location
Tampon Bay
Well, that's fine. It was not meant in any way as a jab against CityGML btw. However, I think it somehow gets lost what a specific game wants to achieve. CSL is mostly a city simulation (with emphasis on traffic simulation) with lots of moving vehicles and pedestrians, and it wants to look good at the same time. Modelers coming from other games have really a hard time getting their models down in line with what the game wants. Those coming from SC4 don't like the cuts and workarounds they have to do on details. Honestly, I do not see a single game that you could actually use for a proper comparison. There simply isn't any that achieves the same set of parameters.

Which makes this whole discussion quite academic. I would love to see a game that does this better than this. However, where is it?

The truth is only a fraction of programmers works on computer games, and hardly anyone in the geospatial world thinks of games.

Also, to be clear, I am not arguiing if CS is shit or KSP is shit. They both seem to be pretty good games. The question is how much better they would be if they had not used Unity. CS can model a city with a thousand buildings or so as on the screenshots and use "only" 4 gigabyte? If it had stuck to efficient storage it could have cities the size of Berlin on the same computer.
 

Immortal

Arcane
In My Safe Space
Joined
Sep 13, 2014
Messages
5,062
Location
Safe Space - Don't Bulli
This sums up the age old balancing act of Performance vs Compatibility.

Unity has a one shoe fits all methodology (to be platform agnostic) and that leads to most portable choice being made all the time. The gains you can make through optimization / native tailored code is lost.
This applies to game types as well. The same code that loads a single player map with barrels that you can fire is the same code used to load a city landscape with 30 000 buildings.

You have to make a choice, do you want it to be generalized or performant. This is a constant juggling act right down your lowest level languages. (INB4 LOLOLHAXOR)

The guys who worked on Cities made the right decision designing their own pipelines, the performance gains are clear. Imagine if they did a whole engine.
Of course it would cost more and take longer but the end result would be better.
 

Turjan

Arcane
Joined
Mar 31, 2008
Messages
5,047
The truth is only a fraction of programmers works on computer games, and hardly anyone in the geospatial world thinks of games.
That's a given. But does your geospatial simulation have to simulate game elements similar to this game at the same time? Does loading game assets in and out all the time use computing power, given there isn't anything left next to the traffic etc. simulation? I mean, I use the game to do things like this while the game shuffles agents around:



Which also means the highest zoom level isn't that hot (and only achieved by a mod; also ignore the sunken feet, it's someone's custom asset):

108AAE4CA8064740C54E0A42ECEB904DDBF9D321


All of this has to be done real-time and fast. All agents you see have to be calculated at all times, on the whole map.
It's not a rhetorical question btw, I just want to know.
 
Last edited:

Turjan

Arcane
Joined
Mar 31, 2008
Messages
5,047
This sums up the age old balancing act of Performance vs Compatibility....

The guys who worked on Cities made the right decision designing their own pipelines, the performance gains are clear. Imagine if they did a whole engine.
Of course it would cost more and take longer but the end result would be better.
Probably. I think they were 7 or 8 people during most of development, so I guess that was not an option.
 

Burning Bridges

Enviado de meu SM-G3502T usando Tapatalk
Joined
Apr 21, 2006
Messages
27,562
Location
Tampon Bay
That's a given. But does your geospatial simulation have to simulate game elements similar to this game at the same time?

Maybe no maybe yes. But the data structures are so that you only need to plug in algorithms to do a lot of things. (Oh of course there are traffic simulation in CityGML, there is one complete module dedicated to traffic)

Does loading game assets in and out all the time use computing power, given there isn't anything left next to the traffic etc. simulation?

Of course it does cost computing time. But if you can save gigabytes its worth it.

All of this has to be done real-time and fast. All agents you see have to be calculated at all times, on the whole map.
It's not a rhetorical question btw, I just want to know.[/QUOTE]

Oh I think I understand. Imo normally no one would try to simulate a whole city in real time, in full resolution. There could be a requirement to do that, but it's clear that it brings a normal system to its knees. So you need some sort of supercomputer.
If the game really simulates every commuter on its work, its no wonder the game bogs down so early.

What file size are the savegames by the way?
 

Burning Bridges

Enviado de meu SM-G3502T usando Tapatalk
Joined
Apr 21, 2006
Messages
27,562
Location
Tampon Bay

Ah that's what I mean.

I see very little variety here. Perhaps 10-20 different pedestrian models on the screenshots. So in fact every pedestrian needs only to store the ID of the model and a coordinate, plus some state info.
There is so little vatiation you could easily store millions of pedestrians. Plus some kilobyte for each model, but only once. In fact there is no way this scene would be more than 10-20 megabyte.
 

Turjan

Arcane
Joined
Mar 31, 2008
Messages
5,047
Oh I think I understand. Imo normally no one would try to simulate a whole city in real time, in full resolution. There could be a requirement to do that, but it's clear that it brings a normal system to its knees. So you need some sort of supercomputer.
I think they only use two resolutions, full resolution and one LOD step.
If the game really simulates every commuter on its work, its no wonder the game bogs down so early.
It does (well, I guess it's a fraction of them). It takes some shortcuts once in a while, but it generally does. You can follow each of these people to work, to their favorite store, to their home. They won't despawn when they arrive there.
What file size are the savegames by the way?
Between 35 and 42 MB, but it depends on the city size. The game is officially only good for 9 tiles, but nearly everyone uses 25.
 
Last edited:
Unwanted
Shitposter
Joined
Oct 5, 2014
Messages
3,390
Location
Nazi death cult center of jew medicine avoidance
Ah that's what I mean.

I see very little variety here. Perhaps 10-20 different pedestrian models on the screenshots. So in fact every pedestrian needs only to store the ID of the model and a coordinate, plus some state info.
There is so little vatiation you could easily store millions of pedestrians. Plus some kilobyte for each model, but only once. In fact there is no way this scene would be more than 10-20 megabyte.

Well, you have to skin them too and that will take up memory. I think it takes a bit even if you do hardware skinning.
 

Turjan

Arcane
Joined
Mar 31, 2008
Messages
5,047
I see very little variety here. Perhaps 10-20 different pedestrian models on the screenshots. So in fact every pedestrian needs only to store the ID of the model and a coordinate, plus some state info.
There is so little vatiation you could easily store millions of pedestrians. Plus some kilobyte for each model, but only once. In fact there is no way this scene would be more than 10-20 megabyte.
With "state info" you probably mean the route calculation? Most of those models probably walked from their home or their workplace/school/shop/leisure spot to a bus stop, drove to the station and are waiting for the train now. There will be more way segments later. They may also have used a car or a bike or walked directly. No idea how much memory such a way calculation takes. It cannot be too much given how many of them are out there.
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom