In today's post we'd like to go just a tiny bit more technical than usually. Let's peek a bit behind the scenes and let's have a look at a few features we're particularly happy with how they turned out. And we'll of course also mention why they're interesting when you actually play the game! :) [h3]The Day-night cycle[/h3] Matching a day-night cycle to the cycle that controls when the units get replenished at your bases works so well! Especially the bases themselves can look quite beautiful at night. [img]https://clan.cloudflare.steamstatic.com/images//43007216/496f7dc8d572c34860bfcb248215516687da61c3.png[/img] But we're not only talking about visual spice that adds to the atmosphere. We've already started enabling some gameplay features built on top of this, like monsters changing between day and night. [img]https://clan.cloudflare.steamstatic.com/images//43007216/8453a62e46360a81fa9e2a0f2bd2ceba651fa9d3.png[/img] Different days (cycles) will also often trigger different global effects. Some of these will give you a bonus, some will impede your production or limit your visibility range on the map. [img]https://clan.cloudflare.steamstatic.com/images//43007216/9dc60958994783a6bec6d4d44bc3e2e56b2c78cc.png[/img] [h3]Lights[/h3] In realtime graphics (unless you use the so-called deferred rendering, which is not suitable for our graphics style with a lot of transparency and hand-drawn sprites) there's usually a limit to how many dynamic lights the engine allows you to use - in Unity it's 4. We use these for the main light that casts shadows and for an ambient light, but we needed much more. The solution? A custom 2D light map. [img]https://clan.cloudflare.steamstatic.com/images//43007216/ca83a15e7f34546311d5dcae7fc87e94db1e266a.gif[/img] [img]https://clan.cloudflare.steamstatic.com/images//43007216/5c2d24aae58a9af9086bb5cbce457609d571b694.gif[/img] We render sprites that represent lights of different shapes to a texture, which is then accessed by shaders that draw all the different types of objects, monsters and terrain. And what are these lights actually used for? [list] [*]There are colored lights to subtly highlight which player owns which structure. [*]There are directional lights from your commander's 'torchlights'. [*]And a lot of custom pointlights placed by the map designers to highlight objects or locations. [/list] [h3]Fog of war[/h3] The Fog of War system has been one of the most complicated features to implement, as it affects almost everything else in the game. There are three levels of the starry 'fog' as you explore the map: undiscovered, 'remembered' and of course areas currently visible to your commanders and structures. As you leave an area, the game must remember the state of everything when you've seen it last and this is for example used when a path is planned for your commanders. The game will also give you a [!] notification and sometimes pause your commander's movement if you return to a discovered area and something has changed, like when the treasure you're going to pick up has been already taken or a monster already defeated. [img]https://clan.cloudflare.steamstatic.com/images//43007216/fced2ef4a46bded66a79cec25a912187f9fed0f4.gif[/img] Now, let's have a quick look at the graphical side. A starry sky with some light nebulosity works well for the sci-fi settings. To make things more complicated for ourselves, we also added a little paradox: Notice that the Fog of War texture looks like it is above the terrain (this is quite subtle, but look at some stars on the left or on the right next to the discovered area)! [img]https://clan.cloudflare.steamstatic.com/images//43007216/20af0032867ceff7481b786852e7eb774e84a856.gif[/img] One more little detail is that objects right at the edge of the undiscovered territory don't just pop up, but they get rendered as their silhouettes first, so they can nicely fade-in! [img]https://clan.cloudflare.steamstatic.com/images//43007216/b716cb1372f8252a3c40026762ecf7b4b0134216.png[/img] Let us know if you enjoyed this kind of a technical post! We might do one about scripting the campaign, if you're interested. The next post though should be a proper introduction of the Sovereign Fleet, the third playable faction included in the Early Access build coming in September! https://store.steampowered.com/app/2147380/Silence_of_the_Siren/