Afraid of the dark! Devstream 272 Allie and Angelo

Greetings @Allie and @ayazar (i hope i got the right tags :jubilant:)

So in the stream you guys was talking about lights and darkness. The work that is underway looks awesome!
But near the end you talked about the fear of the dark trait, if it will be a trait?
Then the suggestion with handheld lamps came up while you spoke about dumb circles and how the hearthlings could be afraid when stepping outside the zone.
I got to thinking about that problem and what if the afraid of the darkness ran on a timer and not directly on the zone?
So as long as the hearthling is in a lighted zone the timer dont come in to play, but the moment the hearthling steps out of the zone it starts to count.
Depending on what level of angst the indiviual hearthling have towards the darkness, this timer could be shorter or longer?
Might even be countered with a potion? (made by fernjuice? hahaha :jubilant: or maybe even more obvious, the lightbells?)

I guess some hearthlings thrive in the dark aswell? their timer could be the same as the whole nighttime maybe?
Well just a view on the issue and thank you for a very nice stream.


That’s a really interesting thought @Fornjotr but would that require the hearthling to check to see if it’s in that lighted zone with every tick or would it use a zone engine similar to how it now checks only for changes like the height engine does now?


i dont have the knowledge to suggest how the technical aspect of the thought would be made most efficiently, but i am sure that the developers do. :merry:

Another option is to use the buff/debuff system – at the start of the night, an “it’s getting dark out” debuff is applied, which keeps applying the “afraid of the dark” debuff (some combination of negatives to courage, diligence, speed and strength/combat ability) on a timer, lasting the whole night. At the same time, light sources apply a “well lit” buff which grants immunity to the “afraid of the dark” debuff – so if the hearthlings are near light sources, the fear debuffs are never applied.

This already has a “timer” mechanic built in, but I would personally do it so that there’s an extra step: “it’s getting dark out” applies “who turned out the lights?”, which does nothing but runs for a set time and then applies “What was that? Who’s there?!”, which is the actual debuff which gives stat penalties. The buff from well-lit areas would make the hearthlings immune to “who turned out the lights?”, so they never have to worry about the third effect triggering. That way, the timing is more consistent; and it allows for enemies to cast blinding/darkening spells (seems fitting for high-end Necromancer enemies.)

Then, hearthlings who aren’t afraid of the dark at all can simply be immune to the second effect in the chain, meaning they never have to worry about nightfall (the third effect can still target them though if it’s the result of dark sorcery… no pun intended.) Hearthlings who are very afraid of the dark can get their own separate stack of “who turned out the lights?” which kicks in a little later at night; so they’ve got more chances to become afraid of the dark and there’s the potential for a double/stacked effect!

This is a rather “voodoo” method – i.e. it’s complicated and has a lot of parts running invisibly/behind-the-scenes. However, it’s an idea of how the system could work within the game’s current structure and systems. There are probably much better options if the team are prepared to make engine changes to support them; this is just an idea of how it could work right now for either testing purposes or to limit the required dev time.


Fun fact, it is already in-game, just not in use or ready.

It even has an icon:

(Which does not fit much the style of the game, so I guess it is just a place holder)


I wanted to add a idea too hope you dont mind tagging on to your. I was thinking to show that its night time they could use like a fog of war that would creep over at night so discovered areas become undiscovered unless a light source is near. this will give us a visual that it is night time. not sure if it would get annoying if you had to re explore each day or if it just goes back each day to how it was. hope that made sense. im thinking more of the fog of war from old games like 7 kingdoms or age of empires that had 2 sets of FOW . one was solid black next showed you the land scape but didnt update anything like enemy tropps etc. unless you had a item , building near it. this could work with light source and keep FPS low as it would run on one layer. but not sure about the retrospect to building shadowing and lighting.

im not a modder or anything just an older gamer :smiley:


I love this idea! I’m familiar with what you’re talking about from Age of Empires, and yeah I think it works brilliantly as a way to keep the landscape mysterious and to lower the processing cost as a nice side-benefit.

Actually, I believe a similar idea has been brought up before; but I think this is a great time to bring it up again. I’ll have to dig around and see if any previous conversations have something to add on the subject of “spreading” FoW; but I really think it would add a great narrative element. Even if the “solid black” fog wasn’t present, but the shadowy one was the default and had to be peeled back by exploration (growing back if you don’t visit an area in a certain time), I think that would have a really nice effect of hiding enemy camps and encounters, and possibly some other things like small treasures or lost traders or stranded settlers…

I think it could be a very versatile tool for the dev team to use, not just for gameplay purposes but for storytelling too. And again, the potential to cut down on rendering costs (even if it’s only by a small amount) should never be overlooked!

Plus, how cool would it be to see lights far off through the fog at night… ?!?


The only problem I see with fog of war that hides enemies, is that we would lose all those interesting battles between goblins, undead and forest faction. I think a fog of war that actually hides enemies is only useful for competitive games, where you should not know about your enemies. I’m ok if they implement a fog that hides them from us, but I would prefer not.


@Fornjotr So yes! We are planning on having a ‘scared of the dark’ trait which changes how a hearthling reacts to darkness. Hearthlings without that trait would get a ‘Darkness’ thought.

@YetiChow I think we’re going to use thought system to apply the changes to the hearthling - as for how we know a hearthling is currently in darkness, Justin is currently working through a more general way of tracking what hearthlings interact with.

I also like @Jeffrey_Bomford 's idea! It would mean that placing lights ‘saves the state’ of areas you like and the other areas could change at night. We’re still thinking about how we’re going to treat FoW in the future and how it will interact with the visibly lit regions.


you should use candle that is lit or not… :confused:

oooh, that’s interesting to know – if the hearthlings are able to look at the world around them (whether it’s them doing the sensing or being told by the game that it’s now day/dusk/night or similar), think about/analyse their situation, and then change their mood (or other things) accordingly, that’s going to really bring them to life!

I know you guys are trying to avoid voodoo solutions, so I’m not surprised to hear there was a more robust plan for the how hearthlings would detect/deal with night and day (and I expect various other environmental and weather effects), but it’s exciting to think of the possibilities of what you describe. Here’s hoping Justin gets it working smoothly and quickly :merry:

If you allow me some offtopic, the I’d like to add to the fog discussion.

This can be somewhat fixed by:

  • Making visibility range for hearthlings (and maybe buildings) high enough, and
  • Introducing something similar to “Sentry ward” from Warcraft 3.
    For those who didn’t play War3, a Sentry Ward is a magic spell casted by the Horde’s troll witch doctor. It summons a temporary “ward” (a stick with an eye on top) that provides visibility around itself until it despawns. Other factions sometimes have similar mechanics (Undead Scourge has spying units called Shades - these are invisible but cannot attack; Night Elven Sentinel army has two spells: Priestess of the Moon’s “Scout” summoning a temporary flying owl ally, and Huntresses’ “Sentinel” that allows each Huntress to summon a permanent immovable owl scout bound to any tree once per game).

In SH this can be implemented in several ways, including, but not limited to:

  • Magic devices. A magic class can summon spying units (similar to Warcraft2’s Eye of Kilrogg) or stationary “scrying” wards.
  • Trapper’s pets. Trappers can be given some means to scout, like “sending pets on patrol”. That can lead to pets being attacked though.
  • Engineer’s mechanics. For example, a stationary turret-like “Spying glass” that reveals a selected area of the map as long as any Hearthling is near it. Engineer’s limit on the number of devices guarantees that this mechanic is not abused. (although that makes using engineers even more complex)
1 Like

I have three reactions to the stream:

1 . There was one set of settings that Angelo explored which looked like a spooky forest fog. It would be cool to have that be able to be achieved by modding (even better if a mod can trigger it to happen temporarily).

“Suddenly, a heavy fog rolled over the town. The ominousity can only mean one thing…”

2 . Hearthlings carrying candles in the dark. That would be so cool. :jubilant:

3 . Angelo and Allie explored diifferent shapes for the “logically lit area”, from squares to circles. May I suggest another type of shape for consideration?
The shapes would be supercircles (and superellipses when rectangles would be involved, and also, yes, that is what they are actually called). These are shapes that hold the midddle ground between a circle and a square.

[details=Mathematical stuffs and picture]So your normal circle has the mathematical formula:
x^2 + y^2 = r^2 where

  • x and y are the coordinates of the point
  • r is the (maximum) distance a point in the shape can have to the center
  • 2 is the exponent

However, the exponent doesn’t have to be 2.
If you use an exponent of 1, your circle will be transformed to a diamond, if you use* the exponent infinity, you get* a square.

If you choose a bigger exponent than 2, you get shapes that look more and more like a square, the higher the exponent is. Like this picture:


(* means it is more commplicated)

(with some exponents, you might need to take the abolute values of x and y before you use the exponent, or else it will not even form a loop)


About the discussion of how to apply ‘afraid in the dark’ debuffs:
Will hearthlings only be afraid when they are in an unlit place, when they have been in an unlit place for a long time, or also at the prospect of having to step into the dark. Will hearthlings with too low of an courage score also run back into the light?