Friday, October 16, 2015

Game Design Analysis - Delivering Dread 2/2

As a continuation from last week's post this week we'll be discussing the delivery of dread through subtle scenes and audio, my preferred style of horror. Unlike jump scares, creepy environments leave a much more lasting impression on players. Down the line a keyword or image can invoke a chain reaction in the mind to bring that scary scenario back to the players. Jump Scares leave players with: "A thing jumped out at me. I flinched." While carefully crafted scenes leave players with: "So there was this creepy [location]. In it was [monster] who [did nasty things]. It was awesome. I had chills." The difference clearly being that scenarios and environment leave the players with a story to accompany those scares. I'm not saying that jump scare games can't have stories, it's just that jump scares games have to rely on a different mechanic or story telling style to get across the same effect.
The notable examples being: Slenderman vs FNaF. Slendy has no story. He's just a monster and you're some guy in a bad area. Pure jump scare game. Meanwhile FNaF has an underlying story that was carefully crafted to be hidden, making players want to search it out to try and uncover it all.

I can't say one way of doing scares is better than the other, it all comes down to what type of game is being designed. But it is a simple truth that if one relies on sound and the environment to set the tone then those scenes that creeped a player out will stick with them for much longer.

---

So how does one make a scenario scary? The two different paths one can take are: visceral environments or visceral experiences. The difference between the two is that in environments players are lead through the scares, while experiences are discovered naturally by the player. These two different paths are also not exclusive so the experiences can be combined with the environment; in fact, experiences are usually enhanced by a quality environment.
Spooky vs Not Quite as Spooky
Visceral Environments are any type of scene that is disturbing or spooky to the players. Instead of having a monster right off the bat this type of horror relies on the fear of the unknown. In this desolate decrepit castle is there vampires, a bundle of corpses sewn together or vengeful ghosts? We're literally in Hell, what will we find here; demons, sinners, a racist grandma?! The player will only know if they progress through the environment. Games that focus on a slow drawn-out environment and storyline usually take forever to actually show the monster to the players. It's always just a passing shadow or ominous rumor, only truly being revealed at the apex of the story when the tension is at its highest and the player has learned all they need to regarding the lore.
A good example of this style is the Amnesia games. The character wakes up in a castle with no memory, then must progress ever downward to find the truth, and the monster doesn't even appear until a decent way into the game. The entire time before the monster even shows up is littered with some exposition flashbacks topped with the occasional jumpscare to keep the player nervous.

Visceral Experiences are quite similar to environments except that it is more on the player to discover the horror. What that means is that there has to be aspects in the environment that keen eyed players can notice without it being directly revealed to them in a "ta-da, here's this thing" moment. The proper way to do this is with subtlety and having faith that your players will find what you want them to find. It could be as simple as corpses but something is off with them, just odd enough that the player knows that something weird happened. The player should always feel that there's something else going on underneath the surface.
The example I use for this one is from SOMA (another Frictional Games game, huh... I promise this isn't sponsored) and it is also one of my favorites. So you're walking along all alone through this strange facility, you've seen a couple spooky monsters and had your fair share of this environment, then you start coming across headless corpses. Odd, right? Well time to explore and find out why there is some headless corpses. After a bit you come back and... One of the corpses has been moved. Not far, but it has definitely been moved. The problem is that you were gone from this room for maybe thirty seconds and there was no way a monster got past you to do that. Were you hallucinating, was it actually always there? Did the headless corpse move on its own? Or even worse, is there actually a monster that somehow did this and are they still nearby?

Happy Spookin' Gamers!

Friday, October 9, 2015

Game Design Analysis - Delivering Dread 1/2

Before we begin; yes, this is a obligatory spooky post for October.
Oooooh, so spooky!
This will be part one of a two part analysis on the sense of fear and dread in video games. This post will focus on delivering dread through frightening visages and 'jump scares'; with the following post focusing more on the dread caused by subtle scenarios and audio.
Both posts will talk about scares that happen in popular video games, so [Scare Spoilers Ahead]? However no story will be discussed, so you're safe there.

---

So the first thing that comes to most people's minds when you begin discussing scary games is horrifying sights, usually accompanied by sudden loud noises. These are affectionately(?) referred to as 'Jump Scares".
Jump Scare Simulator... Now please flinch.
The most notable games that use jump scares is the Slenderman Games and the Five Nights at Freddy's franchise; both of which are games that all gamers probably know about, willingly or not, and both of which are/were pretty popular. The main draw of these jump scare type games is the sudden shock each player experiences (usually when they die...). Every time those monsters jumps out of the darkness the players experience a rush, that shock and brief moment of panic. Those moments are what most players want to feel, and what most player want to overcome to succeed. It is akin to a right of passage. You came, you saw, you flinched and you finally succeeded in overcoming the shock to win the game. To be a successful mechanic jump scares have to be spread out or unpredictable enough that the player can never expect when the next one will come. In Five Nights at Freddy's this is the moment when players check on the doors and peer out into the darkness. While staring out into the darkness the players have to pause and make a sudden decision that will decide if they live or die and the wrong choice ends with a, sometimes adorable, animatronic ripping you to pieces.

While the shock tactics of jump scares are common place and most known by gamers they are also leave little impact overall. After the initial flinch and a second or two to collect oneself there isn't a lasting feeling of dread. One spike in adrenaline and then that's it. If jump scares are too common place in a game then they also become a nuisance more than a frightening mechanic. So there is a fine line that one must ride when crafting a shocking experience.

Friday, October 2, 2015

State Machine AI

State machines are the easiest of all AI's to program. They are simple but that also makes their 'intelligence' simple. In a sense they are just glorified switch statements that get told what type of responses they have and then check versus whatever input they receive.

Now lets talk about state machines in a much less abstract form!
What you need to begin is a variable that keeps track of what state the AI is currently in. I prefer an Enum since you can name each state with a unique title, but you could also simply use an Int so long as you can keep track of which state is which number.
Next you have to set up a hierarchy or tree that your AI will check against to tell it what state it should be in. This hierarchy is one way to help define how 'smart' your AI is and how complex its actions are. For ease of an example lets say we're building an AI for capture the flag.
Something like this. Or something much, much bigger. Your choice.
Finally you need to simply set up a switch statement in the AI's update that checks against whichever state it is in and then provide the adequate response.
And that's it. State machine AI's are pretty simple and fun to make (at least I think so).
---
Now for some example code!

void AIUpdate()
{
    CurrentAIState = CheckDemStates();
    
    switch(CurrentAIState)
    {
        case AIState.Attacker:
            //Seek out the flag
            break;
        case AIState.Defender:
            //Cover our flag
            break;
        case AIState.Rescuer:
            //ZOMG, get our flag back!
            break;
    }
}
 
AIState CheckDemStates()
{
    if(//they got the flag)
    {
        if(//Rescuers > X)
        {
            return AIState.Attacker;
        }
        else
        {
            if(//Other teammates are closer)
            {
                return AIState.Attacker;
            }
            else
            {
                return AIState.Rescuer;
            }
        }
    }
    else
    {
        if(//Defenders > X)
        {
            return AIState.Attacker;
        }
        else
        {
            return AIState.Defender;
        }
    }
}