• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Greetings everyone,

Today, let's have a look at the two biggest changes/new stuff happening on the Modding side of Cities: Skylines.
Let's get started on how the day/night cycle affects the Asset editor and user-created models:
After we decided to add this feature alongside the After Dark expansion, our first reaction was to ponder what would that mean for the ton of assets already created on the Steam Workshop. We knew it would be impossible to completely automate the process to lit those assets during night time, but we wanted to minimize and ease the amount of manual work required by content creators.
Our first step was to turn all prop assets which are expected to emit light into assets emitting light. Street lamps/poles (see below) and so forth are heavily used in custom assets, therefore it made sense to take that road, as it would provide a base lighting for all assets already using them.

ul9359B.png
To allow more granularity to the lighting process of a building, we also added various light props such as wall-mounted and floors lights. Heck we even added a sub-category to the Common Props toolbar. Below is an example of how to properly mess up the night look of a residential building using wall-mounted lights, also features the new Light props toolbar.

rSdD1qL.jpg
In order to visualize the asset both at day and night time in the Asset Editor, we replaced the previously existing slider Light rotation to control the time of the day. The lights toggling/animation logic are simulated in Editor just as they would be in-game, so the preview of the building for a given day time is accurate.

kCkyywE.png

The dynamic lighting was the first aspect to consider, but we also needed a way to get the windows to lit up therefore we added support for texture-based illumination using illumination maps.
Conveniently, we have had illumination maps all along (the _i suffixed images used when importing asset) but they have obviously been heavily underused as our themes only features day time until now.
It used to be the illumination map acts as a mask where a value of 0 (black) means no illumination and a value of 255 (white) means full illumination using the diffuse texture information.
We preserved this behaviour but squeezed the color value to range between 0 and 120 instead, where 0 still mean no illumination contribution from the diffuse texture and 120 means full contribution. We hereby freed the range 128 to 255 to allow windows to be lit randomly. A value of 192 means neutral, so if you want a building to be unlit at all times, the illumination map needs to be solid 192. The likelihood of a window to be lit at a given time and its intensity are randomized for values within 128 and 255, the closer the value is to a boundary the more likely it is to be lit and stronger.

As an example below is a residential house with its windows lit and diffuse, specular and illumination map composited next to each other.

UUDTQfL.jpg
In this case, the UV mapping is such that the windows use very little texture space but you can see them clearly at the bottom right of each texture. Notice the illumination map value of unlit areas is 192.
Also, the specular map, while irrelevant to the lighting is shown in the picture as it is worth noticing in most cases, if you have already created a specular map for your asset, you already have a base windows mask to derive from when creating the illumination since windows are usually reflective and you have already cranked up the specular mask color.


Next, let's talk about a brand new feature which affects both content creators and players: District styles.
After shipping the free patch introducing the European theme and buildings, a rather high demand for these buildings to be made available in all themes rose from the forums. It was not done as such because of both technical and visual motives:
- memory usage would have gotten very tight for our user with minimum system requirements and we did not want to break the game for them.
- Buildings have specific requirements to tie-in with corner buildings and we would have needed to redo the entire stock buildings set to scale with the wall-to-wall and corner buildings feature. That obviously was not a viable option.
Coincidentally, another pretty highly requested visual feature was the ability to set a policy which would define the look of a district.
While we did not feel comfortable making this feature a policy as policies should have an impact on gameplay and not purely on visuals, we did add an option to select what we call "Styles" from a new Dropdown component in the District info panel.
We added a default building set with the European buildings and when enabled in the Content Manager, it will be available in the game dropdown.

yFHlWqy.jpg

Once a style is set to a building, it will start using/replacing buildings from that style matching the level and density requirements for spawning hereby you can have a European style district in your city.
The screenshot below shows European buildings in the good old Los Santos map which is built on a tropical theme.

H6UNbcu.jpg

This is pretty cool but here is the good(er) news: content creators can also create and share their own styles on the Steam workshop.
In the Content Manager, there is a new section called Styles and you can create a style to which you can add any building uploaded to the Steam Workshop.

otrq9jO.png

xcocjku.png

Provided you include buildings which covers all levels and densities used in the game, you will have a fully customized look for a given district \o/
We can't wait to see what new amazing combinations you are going to come up with!

That's it for today.
Thanks for your time reading this diary, it's back to coding for me, there is still some work to be done :)

/damsku
Technical Director @ Colossal Order
 
I hope I'm not misunderstanding this, but I totally have to agree with zed68 here. If the color of the night lights is actually derived from the diffuse map, I would also have to make the diffuse white, which looks a lot worse than a nice dark-blue color. And if I want the buildings to have differently tinted lights, will it affect the daylight reflection and look horrible ?

Maybe having the ranges between 128-255 very between different white-tones would be a better solution ?
 
Or an optional interior map :D

After reading the specs for a second time I don't seem to get it.
A value of 120 means a window will be lit at all times.
A value of 255 also means a window will be lit at all times.
What's the difference. In the first example the diffuse color will be used for lighting. But how will a window be lit in the second case? Just a uniform lighting?

And how about the neutral 192 value? Does that mean the 128-192 range will behave different compared to the 192-255 range?
 
Or an optional interior map :D

After reading the specs for a second time I don't seem to get it.
A value of 120 means a window will be lit at all times.
A value of 255 also means a window will be lit at all times.
What's the difference. In the first example the diffuse color will be used for lighting. But how will a window be lit in the second case? Just a uniform lighting?

And how about the neutral 192 value? Does that mean the 128-192 range will behave different compared to the 192-255 range?

No, the 0-120 is the intensity, the values above serve as a "trigger" to light some parts but not others at different times
 
I understand pretty well what the problem is for the devs. They came with a solution that didn't add weight to the buildings.

Adding another map would have been very heavy. Even turning the _i map into rgb would have added a lot...

I'm searching for ideas... I'll find one, I'll find one.
 
Yeah... But let's now say the value is 80. Then what?

I don't get how the 0-120 range - which controls how much of the diffuse map adds to lighting - is combined with the 128-255 range values - which control random behaviour.
 
Wait a minute... Perhaps substract 120 from 150, and the intensity will be 30 (?)

Strike that...mdoesn't make sense either.

Must be something like the sum of two parameters adding up to the total value in the i map
 
Last edited:
I've got a suggestion to make... it would allow us to still be able to have some choice in our windows colors (although limited) without having to destroy our diffuse maps.

Why not keep the illumination as greyscale but chose the color of the illumination with a 0-255 value at import instead of using the diffuse ?
It would force us to have only one color for all the windows of a building but I would prefer it a thousand times over the diffuse map option.