• 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
 
CO, please, add null checks before accessing fields etc. of BuildingInfo in BuildingManager class. Most players' saves get corrupted when players unsubscribe custom assets and some of Building.Info field values of BuildingInfo type become null after loading a save game. It won't affect performance but will save many save games from corruption (and thus players' nerve cells).

Well, if you have any save + asset combinations where this happens, please send them to us and we'll fix any problems we can replicate. As you probably know, it's much easier if we can actually understand what's happening than blindly adding null checks everywhere to fix a problem we haven't seen.
 
Well, if you have any save + asset combinations where this happens, please send them to us and we'll fix any problems we can replicate. As you probably know, it's much easier if we can actually understand what's happening than blindly adding null checks everywhere to fix a problem we haven't seen.
Sure :) This is my save game: https://drive.google.com/open?id=0Bz_u46Kl8EVnRkZCVmJvbXVUMnc
You may also want to see this GitHub discussion of me (earalov) and @SamsamTS: https://github.com/earalov/Skylines-IsolatedFailures/issues/1
which is related to our mod project with which we attempt to fix corrupted save games: https://github.com/earalov/Skylines...ollbarFix/IsolatedFailures/BrokenAssetsFix.cs
I've already fixed with this mod the save game from this reddit post: https://www.reddit.com/r/CitiesSkylines/comments/3in7hf/my_first_and_only_city_officially_died/
Would be really great if you could incorporate such code into C:S. My save is also mostly fixed by the aformentioned mod. Still have some simulations errors though.

EDIT: This community guide (http://steamcommunity.com/sharedfiles/filedetails/?id=463645931) sums up most of NullReferenceException's happening when players unsubscribe custom assets.
My point is that any save game should be possible to load without custom assets installed. Ideally, without any mods installed (ex: at this point any save game with Traffic++ activated becomes corrupted if Traffic++ is deactivated)
 
Last edited:
@CO_Dae Here is another issue that can be resolved easily: The building color variation system does not work in some cases.

Here is a link to the discussion: http://community.simtropolis.com/forums/topic/68839-is-the-color-variation-system-really-broken/

The problem is that the upgrade system and the color variation system use the same randomizer seed (the building ID).

If you have a certain number of assets with a specific area index, upgraded buildings will always have the same color.
  • For example, this happens when you have a list of 4 possible upgrade buildings. A random number between 0 and 3 is generated to select the building (e.g. 2).
  • Then, the same random number generator is instantiated again and another random number between 0 and 3 is generated to select one of the 4 color variations (will also return 2 because the seed is the same)
  • Result: Building 0 will always spawn in color 0, Building 1 will always spawn in color 1, Building 2 will always spawn in color 2, Building 3 will always spawn in color 3

This can be easily fixed by using a different seed for the color variation system (you could also generate 2 numbers and use the second value).

9427382015083100001.jpg
 
  • 2
  • 2
Reactions:
@CO_Dae Here is another issue that can be resolved easily: The building color variation system does not work in some cases.

Here is a link to the discussion: http://community.simtropolis.com/forums/topic/68839-is-the-color-variation-system-really-broken/

The problem is that the upgrade system and the color variation system use the same randomizer seed (the building ID).

If you have a certain number of assets with a specific area index, upgraded buildings will always have the same color.
  • For example, this happens when you have a list of 4 possible upgrade buildings. A random number between 0 and 3 is generated to select the building (e.g. 2).
  • Then, the same random number generator is instantiated again and another random number between 0 and 3 is generated to select one of the 4 color variations (will also return 2 because the seed is the same)
  • Result: Building 0 will always spawn in color 0, Building 1 will always spawn in color 1, Building 2 will always spawn in color 2, Building 3 will always spawn in color 3

This can be easily fixed by using a different seed for the color variation system (you could also generate 2 numbers and use the second value).

9427382015083100001.jpg

Thanks Boformer, I was about to post something here.

If it's finally solved I'll be VERY happy, I've been asking for a fix for monhts, actually from the day I uploaded my first building. :eek:

:D
 
I feel like most buildings, mainly the growable ones are allowed two color variation. It's #0 and #1 according to the default Hotel commercial building. Hopefully, the expansion will have a resolution to this.

About the illumination (i), at the current version, it is used for the diffuse emits in day time or just normal time. But after the expansion, if one sets the value to make the diffuse emits (0-120) at night. Would it retain the emission in the day time?

Nonetheless, the workshop updating is inevitable, am I right?
 
Last edited:
Sure :) This is my save game

My point is that any save game should be possible to load without custom assets installed. Ideally, without any mods installed (ex: at this point any save game with Traffic++ activated becomes corrupted if Traffic++ is deactivated)

Thanks, we'll have a look. I agree, any save game should be possible to load without custom assets installed. With code mods, it's more difficult, though, since we really don't have time to see what the mods do to break the saves.

@CO_Dae Here is another issue that can be resolved easily: The building color variation system does not work in some cases.

Your explanation of the issue totally makes sense, thanks. We will take a look at that, too.
 
Well, if you have any save + asset combinations where this happens, please send them to us and we'll fix any problems we can replicate. As you probably know, it's much easier if we can actually understand what's happening than blindly adding null checks everywhere to fix a problem we haven't seen.

My save file crashes upon loading: http://steamcommunity.com/sharedfiles/filedetails/?id=510663194. I used the cloud save feature, so I do not have a copy on my PC. I put-in ~ 100 hours on it, before it stopped working.
 
@CO_Dae : (and other devs...)

I've got a request, and I think I'll make this request in the name of all or at least a huge part of the builders.

As I already said I truly understand your choice of making the illuminaiton system use the _i map and keeping this map greyscale so that the assets weight won't jump through the roof.

But... I think (and I hope you understand that) that we should be given the possibility to use an rgb I map for our custom buildings in some cases. Yes there's a weight cost, but we should at least be given the choice.

I was chatting with Shroomblaze a few minutes ago and he told me he started work on an art deco building. And then I started googling art deco building pics. And I realized that the monochrome _i map will have huge limitations in certain situations.

Here's an easy example :

Day picture...
27487731.jpg


Night picture...
avalon-hotel-south-beach-miami_38659_600x450.jpg


Two different neon colors. (and some have more).
This, using the monochrome _i map, just can't be made, or can't be made correctly.

We can have the neons the color we want, but we will be unable to have the light on the walls be the color we want. (unless we make the building look weird by day).


The mono _i system might be "ok" for most occasions (although it's still pretty restrictive)... but there are things that could look magnificent and that we just won't be allowed to do.

Please, consider adding an option for us builders to use an rgb _i map instead of a monochrome one, give us the choice, give us the possibility to make more with the game.


Thanks for your time, guys.
 
  • 4
Reactions:
Hello @CO_Dae
I have to agree with Zed68 here, We really do need a color illumination map if at all possible. Having our buildings have color spot lights during the day will look weird as most building turn them off during the day and at night they come to life. I too have some examples of what I mean. For Instance, It will be impossible to have our tall buildings have lights on them unless we want them looking neon during the day or rainbow during the day which will just look stupid. I really hope you consider this request. As tony pointed out, we think you may have not gone this route because of possible memory increases but I don't think people would be using the full advantage of a color illumination map all the time, and at least give the modders the option to use them if they want.

Suggestion would be to make the greyscale illumination always be considered on and anything with the color illumination would only come on during the night and use that color of the illumination map to cast onto the building including gradient lighting such as a dark red to light red to cast a fading red light on the side of the building. Thanks!

dTe0FjJ.jpg
 
Last edited:
  • 4
Reactions:
Hello @CO_DaeSuggestion would be to make the greyscale illumination always be considered on and anything with the color illumination spec would only come on during the night and use that color of the illumination map to cast onto the building including gradient lighting such as a dark red to light red to cast a fading red light on the side of the building. Thanks!

I've got a suggestion concerning this.

A specific rgb intensity on the _i map could be used to determine what's still illuminated during the day. Let's say it would be 255 255 255 (full white).
So if you want to have neon during the day, you set its color (and intensity... with great chances that it's full on but still you can have "fading lights there too) using the diffuse and you set it to full white in the _i map

This could be useful for the greyscale _i too. You could use a value from the 120-128 range for the same use. (Or was it supposed to work another way ? Did I miss something ?).
 
You might want to just make a separate thread for this Zed.

Anyways, I totally agree.
Having an actual glow map rather than trying to use the specular for color would be much more effective and look better
 
  • 2
Reactions:
You might want to just make a separate thread for this Zed.

Anyways, I totally agree.
Having an actual glow map rather than trying to use the specular for color would be much more effective and look better

I'll make a separate thread if we don't get any replies for any dev... we hope that we'll be heard.
 
I also support RGB illumination map options. My reason is so we can have the ability to make proper interior lighting as windows are reflective and more solid during the day but at night interiors are revealed when lights are on. I just don't want to be stuck with solid lit windows at night. And the colors of windows change accordingly at night so it would look bad to see night time interior textures during the day.
 
Last edited:
  • 1
Reactions: