Where Shadows Slumber: Testing

This week marks the deployment of our first batch of test levels, assuming I haven’t totally screwed up and delayed them. Throughout the past few months, we’ve been building a list of testers, and it is finally time to put it to good use!

If you’re on the list and you have an iOS device, you should have received an invitation to our TestFlight over the weekend. If you’re on Android, you can expect a similar email later this week. If you’re not on the list (or don’t know if you are), just let us know! We haven’t hit the limit on testers yet, and every pair of eyes helps us make a better game.

Frank already wrote about our testing, and why we’re doing it. This post touches on a lot of the same things, but I want to delve a little bit more into the benefits of testing.


Mommy, look what I made!

A child returns home, an exuberant look on her face. “Mommy, look what I made!” she exclaims, holding up a piece of construction paper covered in marker lines and dried macaroni. Her mother reaches down and takes the paper. “Isn’t it great?”

“Why, yes, darling, it’s the most beautiful piece of art I’ve ever seen!”


The original concept art Frank made for Where Shadows Slumber

Now, you and I know that the mother in this story is not telling the truth. Obviously, Where Shadows Slumber is the most beautiful piece of art she’s ever seen. But her daughter doesn’t know that – her daughter planned out the art, decided exactly how she would approach the task, and executed flawlessly.

Frank and I are the daughter in this metaphor, and Where Shadows Slumber is the macaroni masterpiece. We look at our game and we see something beautiful – but who knows what it actually looks like?

You do! You, our adoring public, are our mother. However, we need you to tell us the truth! We will never grow up to be a wonderful artist if you tell us that our macaroni levels are beautifully designed when they’re not.

This is the concept behind a lot of what we have been doing over the past year. We created a demo for the sole purpose of showing it to people and getting feedback about the game. We’re sending out test levels to get feedback about our level design. We even write this blog, in part, to get feedback about our process!

We use all of this feedback to help make Where Shadows Slumber a better game. That is the benefit of testing.


The Power of the POC

If you’re a game developer, and your friends and family know you’re a game developer, then there is a phenomenon I’m sure you’re quite familiar with. If not, allow me to explain.

Most people don’t understand the amount of time and effort that goes into the development of a game. Therefore, if someone thinks of a half-decent game idea, they come to you with it. If I had a dollar for every time someone has said “Jack, listen to this idea for a game – you’ll be a millionaire!”, I actually would be a millionaire.

So, you end with a lot more game ideas then you can possibly make. Some of them might actually be pretty good, but you’re just one person – how can you tell if an idea will end up working out? Do you have to just pick a concept, make the whole game, and then just hope that people like it?

This is exactly what proof of concept projects are for! Can you imagine if we had spent two years making the full game for Where Shadows Slumber, only to release it and find out that nobody enjoys shadow-based puzzles? What a waste! But spending two months working on a project that could become something big is totally worth it, even if people don’t like it.


A shot from one of our earliest POCs

That’s exactly how Where Shadows Slumber started. I came up with the idea, and I immediately spent two months or so developing a POC, a very, very basic version of the game, that would just be used to tell if the game had any merit. I showed it to Frank and a few other friends, and they liked it, so we decided to make the full game. If they hadn’t liked it, then we would have scrapped the project. I would have wasted two months, but I would have known that it was a project not worth pursuing, without wasting even more time.


Testing Design

In my opinion, the hardest part of game development is design. Programming is easy enough, once you know what you want to program. Art, on the other hand, would be the hardest part if it weren’t for Frank, but that’s just because I’m bad at art.

Once you know what you want to make, programming and art are mostly execution on that vision. Coming up with that vision is the hard part. What is your game mechanic? How does it work? How do you explain how it works to the player? What does your difficulty curve look like? On and on, there are thousands of questions like this that you can apply to game design, and they’re all important.

This is one of the main reasons we try to get as many people as possible to play our game. There are certain realizations about design that you can only get by showing it to a lot of people and getting feedback. We never would have discovered how much people dislike ‘randomness’, which is something that could have played a major part in our game, if we hadn’t shown it to a bunch of people.

But even once you’ve made all of the decisions regarding your game’s mechanics, you still need that feedback on the last giant piece of the game design puzzle: level design. If you have an awesome mechanic, but your levels are boring and easy, or way too hard, nobody’s gonna want to play.

In order to prevent this, we’re doing some alpha testing! We have all of the levels designed, and we have all of the mechanics half-implemented, so we’re sending out test levels!


This is what it would look like if I were in charge of the art…

These levels are ugly – but we’re not testing the art! These levels are buggy – but we’re not testing the code! These levels just might be poorly-designed, and that’s what we want to know. Our testers will tell us what they like and don’t like about these levels, and we will update them accordingly.

The important part of this process is that it’s happening as early as possible. If we sent out fully-complete levels, and then we had to change one, we would end up either scrapping the art, which is a huge waste, or trying to change the level without changing the art, which just makes it look weird. That’s why these levels look all dull – it’s all part of the plan!


Testing Philosophy

The last thing you want is to work hard for two years on a project, only to release it and find that it’s not as great as you thought it was. In particular, no matter how great you think it is, your audience might not enjoy it. While there will always be people that don’t like your game, it’s important to make sure that your target audience does like it. And how do you ensure that will happen? Testing!

It’s not a great experience to hear someone say they don’t like your game, and it’s perfectly natural to shy away from that. However, hearing that from a dozen people and still having time to make changes is a whole lot better than hearing it from a thousand people after you’ve already released the game.

Whether it be unit tests (small tests to make sure that one part of your code works) or beta testing (sending an almost-complete game out to fans to look for small bugs and last-minute fixes), testing is an important part of development. Don’t get caught up in your own little game-dev world; make sure you find out what the people want!

As always, let us know if you have any questions or comments about testing (or anything else)! You can always find out more about our game at WhereShadowsSlumber.com, find us on Twitter (@GameRevenant), Facebook, itch.io, or Twitch, and feel free to email us directly with any questions or feedback at contact@GameRevenant.com.


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

Jack Kelly is the head developer and designer for Where Shadows Slumber.

Where Shadows Slumber: Staying Motivated

One of the most difficult parts of game development is staying motivated. I can’t tell you how many projects I’ve started, a great idea and achievable goal in mind, only to have those projects fall by the wayside, almost but not quite finished. Last time I talked about dealing with adversity; this week, I’m going to talk about how to stay motivated when working on a game development project.

As game developers, we love games, and we love developing games. When you first come up with a great concept for a game, you’re excited about it. You have so many great ideas, and you just can’t wait to implement them. You have an image of what your game will look like in 2 years, and with that pristine goal in mind, you simply feel driven to work on it.

As you work on your game, however, that drive begins to falter. Where you once looked forward to sitting down for an hour or two of coding, you find yourself shying away from your computer. You look at your game and all the effort you’ve put into it, and you realize how far away you are from the perfect game you had imagined. Rather than tackling cool, big-picture things like core mechanics, you find yourself slogging through your levels, double-checking initialization values.

Basically, there comes a time in the development of a game where the fun parts are over. Your motivation is at its lowest, the work is the least interesting it’s been so far, and your noticeable progress has slowed to a crawl. You find yourself with a solid, but definitely half-finished game, and it feels like it will never be any more than that.

Depressing, huh? Let’s find out how to avoid letting your game succumb to this fate!



“The first 90 percent of the code accounts for the first 90 percent of the development time. The remaining 10 percent of the code accounts for the other 90 percent of the development time.” – Tom Cargill, Bell Labs

The Ninety-Ninety Rule


The ninety-ninety rule is a saying that describes a lot of the difficulties associated with software development. It works on two levels, both of which are relevant here.

First, the shrewd reader will notice that the total development time in the quote adds up to 180%. This, of course, cannot be true in a literal sense; rather, this is a reference to the fact that estimates of development time for a project are almost always woefully low. If this is to be believed, then these projects take almost twice as long as estimated! In my experience, this is very accurate.

Secondly, we can look at the values used above. We see that the last ten percent of the code accounts for just as much time as the first ninety percent! While this seems nonsensical, it is perfectly true. Anyone who has made it 90% of the way through a software project can attest that the last 10% always drags on and on. When developing Where Shadows Slumber, for instance, I found myself with a game in which every core game mechanic was completely developed within 10 months of starting! And yet here we are, nearly two years into development, and the game is still not complete (and not just because I’ve been slacking off this whole time).

The ninety-ninety rules helps explain why we start to feel so depressed as we reach what appears to be the 90% mark of our game. We feel like our game is almost done, and it’s taken just as much time as expected – awesome, we should be done in a few more weeks! What we don’t realize is that we’re really only halfway done. Since we don’t realize that fact, we don’t understand why our expected release date has came and gone. We missed our deadline, our project is dragging on, we aren’t really enjoying the work anymore, and we still don’t understand why the last 10% of the work is taking forever. With all of these things weighing down on us, it’s understandable when we start to lose faith in our game.

So, now that we understand some of the reasons behind this phenomenon, lets look at some ways to deal with it.




Set Realistic Expectations

A big part of the problem is feeling like you’re falling short of what you should be doing. The problem, however, isn’t with your work – it’s with your expectations. While you may be falling behind the schedule you set for yourself, you’re actually right on track – with the actual schedule for the game.

I’ve worked on a lot of software projects, and I would estimate that only around one in a hundred are actually completed by the original deadline. These types of projects are simply hard to estimate, and often take much longer than you would think. That’s why, whenever I have to estimate the time for a task, I always take my best, most realistic guess. And then I double it. Even after all this time, my best guess falls far short of reality, and the doubled timeline is far more accurate.

In addition to schedule expectations, this tip also applies to your game itself. If you start your one-man project, aiming to create the best MMORPG the world has ever seen, of course you’re going to fall short! You have to decide what you can reasonably accomplish, and at what level of quality, and then aim for that. If your game is starting to look like your goal, you’ll be much more motivated than if your goal is a perfect game that you’ll never be able to make.


Avoid Distractions


Credit: xkcd.com

I’ve spent a lot of time doing a lot of fun activities – game jams, NaNoWriMo, Ludum Dares, etc. But, since we started the development of Where Shadows Slumber, I have refrained from participating in any of them. It’s not that I no longer enjoy these things, it’s simply that I want to avoid distractions.

As you work on your game, you feel less and less excited about it – it’s only natural. This loss of excitement can be very dangerous to your game. Other projects are still out there, and they probably still seem very exciting to you. But it’s a slippery slope; it’s all too easy to take a few days off for a game jam, then you take a week off for something else, and before you know it, you’ve put your game on hold so that you can spend a few months working on a prototype for a new game. Betrayal!

I find the best way to avoid letting other things take over is to avoid those other things altogether. Perhaps some of you with stronger willpower or more time might be able to risk it a bit more, but be careful – it really is a slippery slope.

On the other hand, you don’t want to take this too far. Getting burnt out is very easy to do, especially when you’re spending a lot of time on a game. Sometimes I’ll sit down at my computer with the intention to work on Where Shadows Slumber, stare dejectedly at the screen for a few seconds, and then boot up StarCraft instead. If other game jams are your StarCraft, then go for it. As long as you’re continuing to work on your real game, and you don’t spend too much time on other things, it’s healthy to give yourself the night (or the weekend) off every once in a while.


Calendar with pushpins



This tip is something that I simply stumbled upon, but it has proven very helpful in forcing myself to work on Where Shadows Slumber. A year or so ago, I got a new job. My body still wakes me up by 8 am, but I don’t have to leave for work until 9:30 am! Woe is me!

This was actually an awesome development. Previously, I would work on my game whenever I could find the time – an hour here, twenty minutes there, etc. Now, I have an hour and a half every morning with nothing else to do. That time has become game-time; now I work on Where Shadows Slumber every morning for an hour or so.

One of the hardest parts of game development when you have a ‘day job’ is getting consistent time to work on it. I’m pretty fortunate in that the time I need was basically forced on me, but the principle holds. Find a schedule that works for you, and set that time aside as game-time. Don’t let anything else cut into that scheduled time – after all, it’s already booked! Whether it’s thirty minutes every Saturday morning, or two hours every night, blocking off a chunk of time for game development work will help you make consistent progress on your game.


Buckle Down

My last tip is less of an actionable item, and more of a mindset. There will be times when you sit down to work on your game, and you find that you simply do not want to. This happens, is perfectly normal, and is nothing to be worried about. As I mentioned earlier, when this happens to you, it’s absolutely fine for you to just take the night off and do something relaxing.

However… If you take a night off every once in a while, it’s fine. If you find yourself taking off multiple nights every week, you might be in a bit more trouble. Sometimes you don’t want to work on your game, but you have to anyways. You have to sit down, open up your game, and force yourself to work on it. If you never push your game forward, you’ll never get it into a spot where you want to work on it, and it will stagnate. This is an opportunity for your game to die, and you don’t want that to happen.



There you have it! These are my four biggest tips for staying motivated and continuing your game’s development. There’s obviously a lot more to keep in mind, and a lot of stuff I mentioned that’s hard to do, but I hope you’re able to put some of this to good use, and I wish you all successful, completed games!


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

As always, let us know if you have any questions or feedback! You can find out more about our game at WhereShadowsSlumber.com, find us on Twitter (@GameRevenant), Facebook, itch.io, or Twitch, and feel free to email us directly with any questions or feedback at contact@GameRevenant.com.

Jack Kelly is the head developer and designer for Where Shadows Slumber.

Where Shadows Slumber: Adversity

FRIEND. Hey Jack, what’s up? You’re usually up to something interesting – are you working on anything right now?

JACK. Hey man – yeah, we just started working on a mobile puzzle game based on shadows! Basically-

FRIEND. Mobile? People are still doing that? I thought that mobile gaming was over [and anyone who decides to make a mobile game is a complete idiot!]”



I don’t think I quoted the above conversation exactly right, but I will say that it is exactly what you do hear as a game developer when these types of conversations occur. Deciding to go into indie game development can be a big risk, and while these conversations are important, they really aren’t that much fun.

In this post I’m going to delve into the concept of adversity and how to deal with it. This will be the first in a three-part series of blogs, all about staying focused and productive.


Dealing With Criticism

Criticism is one of the most important aspects of game development, especially for indies. You need to know what people don’t like about your game, so that you can fix it. As such, people tend to be very forthcoming with their criticisms.

However, after endless hours of hard work, it’s easy for a developer to have trouble dealing with criticism. And it’s easy for a friend, intending to offer constructive criticism, to end up simply insulting or demotivating a developer.

Throughout the development of a game, us developers put a lot of thought and work into creating something we can be proud of. When someone else picks apart our creation, we often wonder – why does everyone make sure that us developers find out everything they dislike about our game?

Game development is a field that lives and dies by the opinions of players. The best way to find out what you need to change about your game is to ask your audience. And the best way for a gamer to ensure that a game ends up being good is to tell the developers what they don’t like. This relationship is a very good one, so don’t take it for granted.


Types of Adversity

How can game developers prepare to deal with adversity? By knowing what to expect.

Handling Detractors



This was an early review of the Where Shadows Slumber demo for Android.

This is the most obvious type of adversity, and the type we have come to expect. No matter how awesome your game is, there will always be people who simply do not like it, and you will always hear from them. Something about your game is not good enough for them, whether it’s too short, or the graphics aren’t good enough, or the gameplay is too simple.

“You game is a big ol’ stupid!”

– Some dude who hates your game

The best way to deal with this type of adversity is to learn what you can from it, and then to let it go. Unfortunately, it’s impossible to please everyone. You game may be made for many different people to enjoy, but you still have a target audience, and a lot of people will fall outside of that audience. If you focus too much on trying to please every person who says something bad about your game, you’ll just drive yourself crazy. Just accept that this person will probably never love your game, and continue trying to make it the best it can be for those people who will enjoy playing it.


Handling Constructive Criticism


(Above) The  incorrect way to respond to constructive criticism.

Constructive criticism is the lifeblood of the indie gaming community, and any developer who really wants to do well is always on the lookout for it. Constructive criticism tells you what parts of your game need improvement, and it comes directly from the mouth of your target audience.

This is a very important point – I can’t tell you how many times we implemented a feature that we thought would be cool, only to find that our fans didn’t like it. Sometimes you make the wrong decision (especially when working in a small team), and constructive criticism helps you find out what things you need to change before it’s too late.

“Tell us what you hate about our game. We have thick skin, we can take it!”

– Frank, at every convention we go to

This is the easiest type of adversity to deal with, since we are constantly seeking it. This person likes your game, and they’re just trying to make it better, so they can enjoy it even more! The most important thing about constructive criticism is to always be ready for it, and to always listen to and learn from it. The player told you exactly what they want – try to give it to them!


Handling Friends Who Are Trying To Help

“You can do this, but to be more accurate, you probably can’t.”         – Barney Stinson

The third type of adversity I’ll talk about today is one that I wouldn’t really have expected, when I first went into game development, and is the main reason that I decided to write about this topic. That is the adversity that you receive from your friends.

“But wait, didn’t we just talk about that? Your friends are giving you constructive criticism, right?”

Yes, your friends are often a good source of constructive criticism. Maybe my friends are just the worst, but I’ve also noticed another, more sinister type of criticism.

“I’m only saying this because I care about you – you are literally the worst.”

– Your ‘friends’

Your friends love you, and having them in your life is awesome. However, they don’t always share your passions, specifically about game development. Many of them might think that you’re getting your hopes up and stressing yourself out for no reason. Maybe you don’t spend as much time with them as you used to. Maybe they’re just jealous of how awesome your game is. Whatever the reason, they’ll probably let you know.

I’ve heard a lot of different comments, but most of them begin with some form of “I’m saying this because I care about you…” This is the ultimate way a friend will disguise a negative comment. A lot of times you’ll hear something like “You know your game isn’t going to take off, right? I just don’t want you to get your hopes up,” or “Why are you wasting so much time on that – I mean, it’s just a hobby, right?”

Perhaps they are saying it because they care about you, and perhaps they mean well. Game development requires a lot of motivation and momentum, and hearing these things from the people who most care about you can be very disheartening. Sometimes you need to hear these things, but if you’re simply committed to creating something you can be proud of, you don’t need that kind of demotivation.

So how do we best deal with this type of adversity? To be honest, I wish I knew. The easier strategy is to simply nod along with them – “yeah, I know my game isn’t that great, but it’s a fun hobby.” This doesn’t seem fair to you, as you’ve put a lot of work into your game, but it’ll get them off your back. The other strategy is to explain to them that you’re doing everything you can to make this game a success. You’re putting a lot of work into it, and you would appreciate their support. If they have any constructive feedback, you would love to hear it.

Honestly, I think the second strategy is probably better, but as an introverted developer, I find myself utilizing the first more often. This is something I’m working on, but I think this is the type of adversity that is the most difficult to overcome. If you have any tips or thoughts about this one, we would love to hear from you!


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

Hopefully this post gives you a little bit of insight into some of the types of adversity you will most likely see as a game developer, and how to deal with them. Next time I’m going to discuss another topic that I find plagues me and many other game developers: staying motivated.

Until then, let us know if you have any questions or feedback! As always, you can find out more about the game at WhereShadowsSlumber.com, find us on Twitter (@GameRevenant), Facebook, itch.io, or Twitch, and feel free to email us directly with any questions or feedback at contact@GameRevenant.com.

Jack Kelly is the head developer and designer for Where Shadows Slumber.

Mechanic Spotlight: Shadows, Part 2

Where were we before we were so rudely interrupted by my extreme laziness? In my last post, we went over the basics of how shadows operate in Where Shadows Slumber. This week, we’ll pick up where we left off, and I’ll describe the way I actually implemented shadows, and the reasons for doing so.

Last time, I described two different ways to think about objects changing in shadow. Unfortunately, I did so in a sentence that, in retrospect, looks simply confusing:

[Things] can always change when put into shadow, or they can only change when you move around the object casting the shadow, so you’re on the other side of the casting object, relative to the changing object.

Yeah, that’s no good. So let’s figure out what this means, in a way that’s a little longer, but easier to grasp. We’ll use the classic pillar / bridge problem, where the pillar is casting shadow, and the bridge is changing with that shadow.

If I walk past the pillar, the shadow will overcome the bridge. If I continue walking, the shadow will move, the bridge will be revealed, and at this point, it should have changed. This is exactly what we want.


Not only is the pillar / bridge problem less violent than the trolley problem, it’s more relevant!

Now consider the scenario where I start to walk past the pillar again. The shadow overcomes the bridge again, but this time, I stop walking, leaving the bridge in shadow. Instead of continuing forward, I turn around and go back. The shadow moves, so we can see the bridge again, but we’re on the same side of the pillar as we started. Now the question arises – should the bridge have changed?

This is a very important question when considering this mechanic. Thinking about it from a ‘pure’ standpoint, of course the bridge should have changed – it was in shadow. After all, that’s the rule, right?

This was exactly my thought process, and is why I implemented the mechanic in the way I shared in my last post. The early prototype we made behaves in exactly this way. However, as I got further into level design, I realized that this is not what we want. In order for many of our level designs to work, the above scenario would need to result in the bridge not changing.

When designing levels for a game like this, there are a number of considerations to make, but one of the most important is to remember that the player will not always do what you want. I may want the player to walk around the pillar, but the player may instead decide to walk behind the pillar, and then turn around. If I need the player to end up on the far side of the pillar (for a story event, part of the puzzle, etc.), that becomes hard to accomplish with the current version of the shadow mechanic.

So, it seems that we need to update the implementation of our mechanic. The way we want it to work has more to do with what side of a shadow-casting object we’re on – the bridge can only change when we move around the pillar.

Fortunately, this is actually an easier problem than the previous one. When we think about it this way, we don’t even need to use shadows – what we’re really checking is when we pass the object. When the light (player), the blocking object (pillar), and the shadow object (bridge) are all in a row (collinear), we can simply know that the object is in shadow rather than checking. This is true when we make a few assumptions:

  • Both the pillar and the bridge are about the same size. This means that we may have to break the bridge up into a number of 1×1 ‘shadow objects’.
  • Each light involved originates from a single point (so point/spot lights, not directional lights).
  • The bridge is further away from the player than the pillar.

When all of these conditions are met, we can ignore the shadow itself, and just change the bridge when the player passes the pillar. It’s a little hard to conceptualize, but a picture is worth a thousand words!


Alright, maybe like 500…

At the moment the player passes this ‘collinear point’, we trigger the shadow object to change (note that at that moment, the shadow object will be entirely in shadow). But the shadow is just there for cosmetic purposes, like a magician’s illusion – it’s so you don’t see the trick!

As I said before, this problem is much easier to solve – every frame, we simply compare the angle from the player to the blocking object with the angle from the player to the shadow object. When those angles switch, it means that the shadow object is in shadow and should change.

In this way, we can easily keep track of when a shadow object should change. There are a few ways in which this situation can become more complicated – if there are multiple lights or blockers that should affect a single shadow object, if there are multiple shadow objects that should use a different set of lights or blockers, etc. These are all very important things, but they’re all things that can be implemented by carefully extending the system we laid out above. As such, implementing them is left as an exercise to the reader : )

There are still ways we can use the previous implementation to help out with the shadow system. There are a few cases where we might need to actually know if an object is in shadow, rather than just making the assumption that it is. Thus, our shadow system includes a sort of ‘back-up’ shadow-detection – in certain cases, we fall back on the more accurate, more expensive shadow detection we worked on in my last post.

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

That finishes up our high-level overview of our implementation of the shadow mechanic – I hope you enjoyed it. Let us know if you have any questions or feedback! As always, you can find out more about the game at WhereShadowsSlumber.com, find us on Twitter (@GameRevenant), Facebook, itch.io, or Twitch, and feel free to email us directly with any questions or feedback at contact@GameRevenant.com.

Jack Kelly is the head developer and designer for Where Shadows Slumber.

Mechanic Spotlight: Shadows, Part 1

Throughout this blog, I’m planning on doing a number of posts which outline the mechanics of Where Shadows Slumber, and how they work. Now, there are plenty of very interesting mechanics that I can (and probably will) go over. However, there are probably a lot of blog posts and tutorials out there describing path finding, object pooling, shaders, and everything else. So, the mechanic I’m going to start with is the one that is the most unique to Where Shadows Slumber – the mechanic behind the shadows.

A quick disclaimer on the nature of this post – please note that this is not an in-depth description of the exact code we used for the shadows, nor is it an attempt to tell you the correct way to think about or implement such things. I’m sure a seasoned veteran of coding and game design will be able to point out a few inconsistencies or inefficiencies in our shadow system. Rather, this is meant to be a high-level overview of my thought process while I created this system, and how those thoughts changed throughout the process. Also, since we have been working in Unity for the production of this game, I will probably be mentioning how Unity does stuff pretty often.

When playing Where Shadows Slumber, you may have noticed that sometimes, things change when they’re in shadow. In fact, you shouldn’t have been able to beat the game without figuring that out.


I think I’m just gonna use this GIF in every post…

Things change when they’re hidden by shadow and then revealed, but there are two (basic) ways to think about it – they can always change when put into shadow, or they can only change when you move around the object casting the shadow, so you’re on the other side of the casting object, relative to the changing object. One of these methods ended up making more sense to use in the game, but I implemented both of them on the way there, so I think it only makes sense to go over them both (even if it means stretching this post into two parts).

Now, these are both pretty simple problems at their cores, but there are a few interesting lessons. Let’s start with the first type of shadow, using the naive approach, which is exactly where I started a year or so ago.

So when an object is covered in shadow, the next time you see it, it should be different. The steps involved should look something like:

  • Detect if the object is in shadow now
  • Check if it was in shadow before (last frame)
  • If it wasn’t, change it!

Using these steps, the object will change every time it’s put into shadow and then revealed. So, clearly, the most important thing to be able to do is detect when an object is in shadow.

Since the light in the game comes from the player’s lantern, everything that’s in shadow is essentially ‘blocked’ from the player’s view by some obstacle. Thinking about shadows in this way leads to the first pass at detecting when an object is in shadow – basically, just draw a line from the player (or the lantern) to the object. If it hits anything along the way, that means that the light isn’t going to reach the object, which means it’s in shadow.

Image result for unity raycasting

Looks like Unity’s ray casting…


This process is pretty much the description of Unity’s ray casting: draw a ray from a point until it hits a Collider. So we just add a Collider to any object that might get in the way, and we have a simple ‘IsObjectInShadow’ function!

However, you may have noticed that there are a couple of reasons this won’t work, the most important being that it doesn’t behave correctly. Since casting a ray will only target one point, the shadow detection will only work for the exact position of the object. Anything with any amount of width or depth (so, anything) will say it’s in shadow when the center is in shadow, but the edges are not. This happens when the object is at the edge of the shadow, when it’s only partially shadowed. This is a pretty big problem if we’re going to be changing the object at that time, since the whole point is that the player won’t see the object when the change happens.

So we can detect when a point is in shadow, but just checking the exact position of an object isn’t enough. The easy solution is to simply check more points! By casting two rays, one toward the leftmost side of the object, one toward the rightmost, we can check if both of them are in shadow. If they are, then the whole object is in shadow. This version of our theoretical ‘IsObjectInShadow’ function works much better – as we move a character around a pillar, the object will more accurately determine whether or not it’s in shadow.

We can get the object’s leftmost/rightmost positions (relative to the player/light) by getting the objects dimensions, which we can either get from the Renderer component on the object (Unity will measure the visible object), or simply by placing some restriction on the size of the objects. Since Where Shadows Slumber uses a grid system, everything that changes with shadows is restricted to a 1 x 1 x 1 unit cube, in order to make shadow calculations easier.

Now comes the question – why is this version not good enough? We have to do a little math up front to get the left/right bounds, but after that, we simply have to cast a few rays, and we know whether or not our object is in shadow. Seems pretty good! And it is pretty good. It only works in two dimensions – if you move upward, above the object, the object will still think it’s in shadow – but that’s not too bad, and most level designs don’t involve a lot of vertical movement, so we can ignore it for now. The biggest problem with this version is that we have to add a Unity Collider component to every object that might cast a shadow. Then, every ray cast will test collision against every collider every frame (the reality is not quite this bad, but that’s the idea). This can become a problem in a scene with a lot of shadow objects and a lot of shadow casters, especially if you want different casters to affect different objects. We can improve upon this version with a little math and some clever thinking.

If we think about the way that shadows are cast, we can come up with a better way of determining if something is in shadow:


(There’s a reason Frank’s the artist, and I’m not.)


If we specify that every object is restricted to a 1 x 1 box (in the two non-height dimensions), then we can use some trigonometry to determine whether something is in shadow. I won’t get into the details of the actual math, just the overall conceptual parts. No matter the angle, the radius of the blocker will always be at least r (0.5). In the same way, no matter the angle, the radius of the shadow object will always be at most R (√2). Thus, by taking distance into account, we can always tell if the entirety of the shadow object (everything within the bigger circle) is put into shadow by the blocker (everything in the smaller circle).

By using this method, we can tell if a shadow object is in shadow without ray casts or Colliders, and we can do it for a specific object. In this way, we can specify which blockers affect which shadow objects, which gives us a lot more control over level design.

Now that we’re able to tell if an object is in shadow, the hard part is over. Every frame, we just follow the steps outlined above, for any shadow object. We check if it’s in shadow, then check if it was in shadow (meaning we have to keep track of whether or not it was in the previous frame). We change the object to the next state. The object will only change once, until the user sees it, when it’ll appear differently. Then, if it’s put in shadow again, it’ll change again. This allows us the flexibility and consistency of shadow objects.

As it turns out, this version of the shadow mechanic didn’t end up being the one that we needed for Where Shadows Slumber. The shadow mechanic that we actually did use will have to wait for Part 2. We already did a lot of the heavy lifting this time, so it shouldn’t be too hard to make some small adjustments to the work we did here.

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

I hope you enjoyed this first highlight of the shadow mechanic in Where Shadows Slumber. Hopefully it wasn’t too complex, and I was able to explain it well. Let us know if you have any feedback! As always, you can find out more about the game at WhereShadowsSlumber.com, find us on Twitter (@GameRevenant), Facebook, itch.io, or Twitch, and feel free to email us directly with any questions or feedback using contact@GameRevenant.com.

Jack Kelly is the head developer and designer for Where Shadows Slumber.

Where Shadows Slumber: Inception

Welcome to the Where Shadows Slumber blog! I know Frank posted something last week, but this is my first post, so I’m going to pretend like I’m important or something. In case I’m not important and you don’t know who I am, I’m Jack – the head designer and lead engineer for Where Shadows Slumber. We’ve decided to do a blog to keep in touch with the people that really matter in the production of our game – the users!

So, since this is the very start of our blog, I figured that a good topic would have something to do with the very start of Where Shadows Slumber – the inception of the idea itself. If you haven’t played yet, you definitely should (and how did you end up here?). If you have, then you probably know that the core mechanic of the game is rather interesting, and isn’t something you see, or think of, every day. So how did I come up with it? I get this question a lot, and I never have a satisfying answer for it.


Watch the bridge – it appears and disappears!

I’ve always been a gamer, and thus a game designer, even if it’s usually just in the back of my mind. I’m always thinking about what might be a good game design. A kid walking down the street, avoiding cracks in the sidewalk? Maybe that could make a good game. The picture on that billboard? Looks like a cool puzzle to me – can I expand on it? These thoughts are always floating around my head, and, to be honest, 99% of them are completely worthless. Almost everything I think of has an inherent flaw, or has already been done, or just wouldn’t be fun.

However, it’s the other 1% (it’s probably far less, honestly) that matters. I find that these few half-decent ideas often come up when I’m thinking about the design of existing games, since they’re often far more in tune with what users might be looking for. And I think that’s an important point – no one wants to play Generic Shooter 257342, but a lot of people are willing to give a new, quirky platformer a shot.

Enter Monument Valley. Yeah, I said it, and I’m gonna pander commit a whole paragraph to it. Monument Valley is one of the greatest mobile games I have ever played. Monument Valley took a simple idea and a simple aesthetic, polished them both into a well-oiled game engine, and gave us an incredible experience based around an interesting, understandable mechanic. It wasn’t difficult, but it made you think. I love Monument Valley, and if you haven’t played it, you should go do that. If you have played it, you can probably tell that it was a pretty big inspiration for Where Shadows Slumber, and despite the many reasons for that, there’s one word (which I just learned) that I would use to describe why that is: frisson.

  1. a sudden strong feeling of excitement or fear; a thrill.
    “a frisson of excitement”

The way I think of it, frisson is that feeling you get when something really cool happens. When you figure something out, and it makes you realize that the universe fits together in a really awesome way (the math nerds out there know what I’m talking about). In short, it’s the feeling you get when you solve, understand, and appreciate a really cool puzzle. That feeling stood out so drastically when playing Monument Valley that it made me realize – this is why I play puzzle games, and this is the feeling that puzzle games should strive to inspire.

So Monument Valley came out, and I played it, and I loved it. This was right around the time of the lackluster culmination of our previous project, SkyRunner (go check it out!), and it made me want to try to create something just as unique, interesting, and beautiful. So I continued thinking about potential game ideas, but I started aiming for something new, something interesting, something that hadn’t really been done before. I never sat down and tried to think of a great idea, I just tried to let them come to me.


Left: Monument Valley, by ustwo games. Right: Where Shadows Slumber, by Game Revenant.

And then (and this is the unsatisfying answer that I have to give everyone), the idea came to me. I don’t remember how or when or where, but it just came to me – gradually. It didn’t start out as shadows – basically, it was the idea that anything that you can’t see might be different from the way you remember. You don’t know – you can’t see it! This eventually developed into the idea of shadows, because we decided on creating a third-person game, and shadows are a good way to show that something ‘can’t be seen’.

Now this idea is by no means new. Erwin Schrödinger stuck a cat in a box with the same general concept. If you look, you can find other instances (in fact, you don’t even have to look – just click here or here.) In fact, I remember watching a proof-of-concept demo for a video game based on this exact idea – anything you couldn’t see could change. So it wasn’t a brand new idea, but it was definitely something novel, something interesting, something that we hadn’t seen in the mobile gaming space, and something we thought we could design a lot of fun puzzles around. After a few conversations with Frank, we decided to put together a small initial demo for the first version of Where Shadows Slumber.

We ended up falling in love with both the concept and the aesthetic we had managed to cultivate. For probably the first time in my life, I can actually say that, 18 months or so after I had the idea, we have managed to create a game that actually looks every bit as good as what had first popped into my head. I’m really proud of the work we’ve done to get here (which you’ll hear about if you’re willing to continue reading my hackneyed posts), and I’m very excited for the upcoming phase of production.


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

Thanks for tuning in, I hope you enjoyed reading about the inception of the idea for our game, Where Shadows Slumber. As always, you can find out more about the game at WhereShadowsSlumber.com, find us on Twitter (@GameRevenant), Facebook, or Frank’s game development Twitch stream – and feel free to email us directly with any questions or feedback at contact@GameRevenant.comNext week, Frank will talk about our development process and how we manage our time.

Jack Kelly is the head developer and designer for Where Shadows Slumber.