• 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 ?

Hi,

Sorry everyone for the misunderstanding! Let me try to clear this up.
When I say we squeezed the 0 to 255 range that is in the current build of the game to 0 to 120 in the upcoming patch, this is done so that it preserves the function the game already provides. What that means is if you want to use the diffuse color as emissive, you would need to set your map color between 0 and 120.
However, if your emissive is above 128 (the 8 shades between 120-128 are just a safety gap and are not used), it will not use the diffuse color at all but use varying tones of white (these are the randomized ones which cause a light to look on/off and of different intensity between buildings).
192 is the neutral color because it is mid-range between 128 and 255 and the implementation is so we sample both ways, hence a window in the illumination map will be between 192 and 128 or between 192 and 255.
Sof if your window diffuse texture is red and its illumination map is 140 for example, the window will be red at day time and have a random white-ish/yellow-ish color and intensity at night time. However if its illumination map was 120, it would emit red at night.

Also, to confirm Zed68 statement earlier, we chose to use sub-ranges in the illumination texture to avoid increasing the memory requirements of each buildings. This obviously set a major limitation to what we can do but tried to give as much freedom as possible nevertheless :)
I hope this clears things out a little bit and I am very sorry if the explanation was not clear in the original post.
If this is still unclear, I will try to provide a better explanation when I am back at the office tomorrow !

Cheers
 
  • 7
  • 5
Reactions:
So is there going to be a way to deploy a whole style through the workshop, or will we be stuck having to download a set of related but, nevertheless individual, assets and manually setting them to a style?
Also can a style be set citywide like policies?

Unfortunately, the Steam API does not enable us tat this time o integrate this system alongside with the Steam workshop collections nor programmatically tag required child items. We looked into integrating this feature tightly with Steam collection but it was not possible.
When deploying a style, I would suggest a convenient way to do so is to create of Steam collection of all the building in the style, share the style and link the steam collection in the description of the style item.

Styles are district only and it is not currently possible to set those city wide.
 
  • 2
Reactions:
Thanks for the diary! :)
Heck, I imagine sleepless nights fixing my mods after 'Afer Dark' comes out :( Looks like many of them will be affected by these changes. Still it's unclear to me will european buildings load for all biomes (and vise versa) or not ? Is 'Default' style what I call 'International' theme in my mods?

The buildings associated to a style will load for any biome as long as the style is enabled in the Content Manager. If no style is enabled then only the stock buildings and workshop items individually enabled will be available to the game.
 
However, if your emissive is above 128 (the 8 shades between 120-128 are just a safety gap and are not used), it will not use the diffuse color at all but use varying tones of white (these are the randomized ones which cause a light to look on/off and of different intensity between buildings).
192 is the neutral color because it is mid-range between 128 and 255 and the implementation is so we sample both ways, hence a window in the illumination map will be between 192 and 128 or between 192 and 255.
Sof if your window diffuse texture is red and its illumination map is 140 for example, the window will be red at day time and have a random white-ish/yellow-ish color and intensity at night time. However if its illumination map was 120, it would emit red at night.

Ooookaaaaay, so the values around 192 will serve as a colorwheel, still some things not 100% clear but I feel better now. :D
 
Will the Building Styles be a feature just of the expansion?

The District styles goes hand in hand with the modding additions (creation of custom styles) which we really want available to everybody. So the feature will be available in the base game, it will just arrive at the same time than the expansion.
However, there are plenty of other cool stuff which comes with the expansion only, so you should still buy it ! ;))
 
  • 1
  • 1
Reactions:
Yay more information!

I'm a bit confused. The current buildings on the workshop have a specular map with 100% white windows already, will the game grab this information for the illumination map or do we have to re-import and update every asset with a separate illumination map (and lower the specular map values)? and what will this do with cars? their windows should not light up o_O

Great to see the District themes, my 30 Dutch houses need this!
Will we also be able to give a style to an asset before uploading it? And update the current assets with this information?

I'm curious to the next Dev Diaries already, I'm dying to know if we will be able to import custom animations and Cim skins with this expansion!

And p.s: Thumbs up for the "Last updated: 45 years ago" European style, I giggled :p
 
  • 1
Reactions:
Yay more information!

I'm a bit confused. The current buildings on the workshop have a specular map with 100% white windows already, will the game grab this information for the illumination map or do we have to re-import and update every asset with a separate illumination map (and lower the specular map values)? and what will this do with cars? their windows should not light up o_O
The illumination maps are different than the specular maps so no worries there. The illumination map function been in the game all along. Those end with "_i" So you don't have to touch the spec maps at all. What you can do to save time is do a "save_as" with your spec maps putting _i instead of _s and tweak from there.
 
Hi,

Sorry everyone for the misunderstanding! Let me try to clear this up.
When I say we squeezed the 0 to 255 range that is in the current build of the game to 0 to 120 in the upcoming patch, this is done so that it preserves the function the game already provides. What that means is if you want to use the diffuse color as emissive, you would need to set your map color between 0 and 120.
However, if your emissive is above 128 (the 8 shades between 120-128 are just a safety gap and are not used), it will not use the diffuse color at all but use varying tones of white (these are the randomized ones which cause a light to look on/off and of different intensity between buildings).
192 is the neutral color because it is mid-range between 128 and 255 and the implementation is so we sample both ways, hence a window in the illumination map will be between 192 and 128 or between 192 and 255.
Sof if your window diffuse texture is red and its illumination map is 140 for example, the window will be red at day time and have a random white-ish/yellow-ish color and intensity at night time. However if its illumination map was 120, it would emit red at night.

Also, to confirm Zed68 statement earlier, we chose to use sub-ranges in the illumination texture to avoid increasing the memory requirements of each buildings. This obviously set a major limitation to what we can do but tried to give as much freedom as possible nevertheless :)
I hope this clears things out a little bit and I am very sorry if the explanation was not clear in the original post.
If this is still unclear, I will try to provide a better explanation when I am back at the office tomorrow !

Cheers

I added these explanations in my French translations. :)

District styles are coming free with the day/night cycle ...Am I reading right ?
 
J'espère que tu as ajouté mes protestations... histoire que ça reste bien français (râleur quoi). ;)

Sorry guys, french affairs.. Omelette du fromage!
lol
 
@boformer you should be super happy - looks like they really liked your implementation and thought everyone should have it! congrats! ',:)
That's indeed very nice. The only problem is that our mod also provides some extra options and improvements.

Problems I see so far:
  • it does not allow cloning
  • no vanilla buildings in themes
  • you can only select one theme per district
I guess that a lot of referenced game code will be changed by the patch, and the mod will be broken. While this is not a serious problem because the mod does not break the save files, we have to decide what to do next.

I would suggest that we disable the cloning feature in our mod (only remove the option to create new clones in the theme manager) and warn users with clones in their themes that the feature will not be supported by the official theme system.

Many users also reported problems with the cloning feature, so disabling it is probably good to improve the stability of the mod.

I would also suggest that we include a version switch in our mod, so that it disables itself when the new update is installed (with option to bypass in the options menu).

Ideas for post-update time:
  • Make the Theme Manager GUI work with the official theme system (ingame creation of themes with 3d preview = awesome)
  • Create a mod that allows you to select multiple themes per district (if possible)
  • Create a mod that improves the footprint selection and upgrade system:
    • support for small 1x2 buildings (if not included in the update)
    • splitting and merging on update
    • intelligent calculation of footprints: for example a 4x10 road block would be filled with building with a depth of 2, to have buildings spawning on both sides.
  • Find a better way to create building duplicates for different levels (meshes and textures shared between models, so asset creators can publish multiple assets which do not increase memory usage)
 
J'espère que tu as ajouté mes protestations... histoire que ça reste bien français (râleur quoi). ;)

Sorry guys, french affairs.. Omelette du fromage!


Is it true that the French only have 1 egg for breakfast, because 1 egg is
un oeuf





I'll get my coat :oops:
 
  • 2
Reactions: