Procedural maps in Spy DNA

Procedural map generation isn’t just terrain, it’s also placing all the things that go on top of the terrain. This includes vegetation (got that one covered) but also roads, buildings, and locations for NPCs and objectives (more about them in a second).

At this point, our game can generate a terrain up to 2x2k meters, and more or less cover it with trees,bushes, and grasses. We’re talking literal thousands of them per square kilometer, with wind animation, and for trees also collision, so they can be used for cover.

But we thought our players would like to do a bit more than just run around in the woods each mission, so we added buildings.

That in turn means, taking another pass at the terrain and smoothing it under buildings, and removing vegetation on each plot designated for a building, because having a Douglas fir in the middle of your living room isn’t everyone’s taste. Also, having to go through literal bushes on the way to the bathroom may be a bit much to ask, even of an NPC.

Additionally, we have to make sure that the locations defined in the mission are all placed on the map in a way that makes the mission flow better for the player. The “location” in this context means anything from a building where the objectives are (item to be retrieved, hostage to be saved, etc.), to a place on the map where the player starts, or an item for the player to pick up.

Over the past weeks, Jason’s been working on improving the code that interprets the mission description from our Editor tool, and generates a level from that. Now we have the ability to place locations within a certain distance from another location, to make sure that things that need to be close together stay that way, such as office buildings on a campus for example.

Another thing we can do now is group buildings by type, so that if we’ve got some residential houses and some industrial buildings, they will be placed on different blocks of the map, like one would expect. Jason implemented a sort of “zoning code” for the map generation, so that a block can be zoned residential, commercial, etc. and only the buildings suited for that zone can be placed there.

Locations that are most important for the mission must be placed on the map, while filler buildings can be optional. This is why we spawn our locations in order, according to what Alex has set in the Editor. This way we can be sure that locations such as the building where the objective is hidden, or the extraction vehicle you need to reach to escape the enemies, are placed on the map before a filler building that’s only there to make the map look good.

Here’s an example sequence of a map being generated. The code creates a bitmap after each location is created, to help us debug it if something doesn’t look right. So we thought we’d share these images with you to illustrate the process.

Here the most important location is placed on the map right at the start. This is the parking garage where an illegal deal is happening. The area around it is zoned commercial, shown in blue.

Now we’re placing a restaurant on the same block with the parking garage, where some NPCs will be spawned after the map is all done.

Next, a residential block across the street is created, and the first house placed there. It’s a small house, so it gets a small lot.

Skipping a few steps ahead, you’ll see another couple commercial buildings placed in the commercial block, and another house in the residential. And so it goes, you get the idea.

As Jason continues working on this code, we’ll be adding more decoration to the maps, things such as road signs and street lights and so on, to add visual interest to our levels, so stay tuned!

The future has rounded corners

by Alex Maier, a literal rounded rectangle

As Early Access release draws closer, we’re beginning to think of generating some exciting visuals to help get people interested in our game.

We’re proud of how far we’ve come with our simulation and visualization of what your characters can perceive and do in the world around them. At the same time, we’re aware that the game needs some visual polish before it’s ready to be shared with an external audience.

So Alex went to town to sci-fi up the look of Spy DNA world.

Some of the things that were “futurized” include:

  • Rounded sci-fi looking windows

  • Glowing details on furniture and equipment

  • Futuristic doors and wall materials

  • Futuristic (or at least very modern-looking) furniture

Additionally, materials on interior decorations have been modified to have a similar color palette, to give each level a unified look.

Here’s a gallery of screenshots taken today to show you some of these improvements. Let us know what you think!

Spotting and senses

by Jason Sams, Lead Developer

Let’s talk about spotting and senses in Spy DNA.

In any game where stealth is a factor, you also need to consider detection. We just finished some improvements for a mission. I don’t want to spoil the mission, but I can talk about the improvements to the spotting system.

In Spy DNA we have three senses, visual, sound, and smell. Each of these has their own set of rules. A character has attributes for each, so it’s possible for them to be very good at one, while poor at others. We also have a skill for observation, I’ll go over how they work together in a bit.

Let’s start with vision because you will need a visual detection of a target before you can evaluate or attack it. Vision controls whether we render an NPC, so if no member of your party has visual contact with an NPC, you will not see it in game.

Here is a list of some of the things that factor into visual detection of an NPC.

  • Distance to the target: farther things are harder to spot.

  • Senses: eye attribute of the spotting character.

  • Lighting conditions: bright light will make something easier to spot, darkness makes it harder.

  • Movement of the target: moving objects are easier to spot. We also factor in movement speed.

  • Movement of the spotter: if the spotting character is moving it will make spotting things more difficult. We use a different curve here vs the target speed because movement affects both differently.

  • The clothing of the target being spotted: camouflage makes one harder to spot. Ex wired.com/2014/03/hidden-snipers

  • Genetic enhancements of the spotter will make detection easier. The “Eye Resolution” enhancement will make it easier to spot objects at longer ranges, while the IR enhancement will reduce the effectiveness of darkness, camo, or the stealth skill.

  • Stealth: knowing how to blend in with the environment is a skill

  • Observation skill

You might ask what the difference is between a characters eyesight attribute and their observation skill.

When we calculate the chance to spot, we do two separate calculations. First we calculate the strength of the signal. That is the physical question of can the character actually see target. This is basically an eye-chart test. Then we factor in the difficulty due to the environment such as lighting, movement, stealth skill, and we combine this with the spotters skill. So we have two numbers, can the character see the target, and how hard is it to pick it out of the noise. We combine those into one number representing the percentage chance to detect the character and run the check.

I should also note that spotting is continuous. Failing the first check does not mean you will never spot something. Your character will continue to try to spot a target as long as they remain in their field of view.

We treat sound in a similar way to vision. There are a few important distinctions. Detecting a sound will not tell you where the source of that sound was, only the direction it came from. We also have different enhancements to improve a character’s hearing. Sounds will also tend to be impulses. Meaning the detection isn’t continuous but done each time the target makes a sound (footstep, uses an object, fires a weapon, etc.).

Smell is different than the other two. In general it won’t be used to detect an NPC, but rather environmental hazards. Another difference is, it will need time to propagate. So if a bad guy cuts the gas line, it will need some time before it’s detectable at a distance.

We are proud of the results of our detection systems. While not every single one of the genetic modifications and senses will be fully implemented in the Early Access, you should get a pretty good idea of how detailed and realistic our simulation is.

Character creation in Spy DNA

by Jason Sams, Lead Developer

When you download and start to play Spy DNA, one of the first experiences you will have is creating your character. We want to make a good first impression, so we’ve spent some time making the new game experience look and feel more like the rest of the game.

Here is a screenshot from the updated “New Game” screen.

You can compare this to the old “New Game” screen.

We have split the new game options across multiple pages to allow for us to describe what effects on your game experience each of the choices will have. It will also gives us more room to put in more options for gameplay customization and difficulty options.

As you make your choices, the next page becomes available.

Here you can see the gameplay effects that will occur based on changing how a character looks. The choices here are merged with the choices you later make going though the character personality questionnaire. We don’t show raw +/- value at this stage, because the values are not simply added. We tried this, but found we needed an additional step to combine the values that would produce more human-like results.

We combine the choices in a way that preserves your ranking. So whatever values you prioritized will continue to be your strongest attributes. What we add is a rounding of the character. So for example if you made a character that focused on strength, you will also get smaller buffs to other strength related attributes such as stamina and quickness.

We will have screenshots of the gameplay and difficulty options in future update. Right now they are still undergoing some changes.

Please let us know what your think of the new UI look for the new game screen.

Xmas at Spy DNA

‘Twas the night before Xmas at Spy DNA
All missions completed, all agents home safe.

The spies getting sleepy, and ready for bed
When roaring of rotors came from helipad.

The agents ran up to the window and saw
A FLEA helicopter had landed below.

What could be the reason for a visit so late?
What was so important that it couldn’t wait?

FLEA agent in charge saluted our spies
“Lieutenant St-Nicols, support and supplies.”

“I need you to sign,” lieutenant continued,
“For receipt of the goods contained in this shipment.”

“Five gallons of vodka, five gallons of rum.
Deluxe set of dumbbells, two-point-oh-three tons.

“Assortment of fireworks and incendiary rounds
With fuses and det-cord. Makes three hundred pounds.

“A new Gauss rifle with wind compensation
Steel-toed velvet pumps with heel stabilization.

“A DIY kit for a race airplane
And access credentials for quantum mainframe.

“A gift set of knives, shuriken, and nunchucks.
VR gamer system with goggles and gloves.

“Here, sign on this line, so we can go on.
“We have a few stops still left before dawn.”

With that the Lieutenant gave sign to the pilot
And the chopper took off leaving agents behind.

Karsten and Zoe, Ivan, Ronda and Shin
Tank, Nuri, and Ros rushed to open their gifts.

Though gifts were so many, there was no confusion.
Each knew which was theirs. What would be your conclusion?

Run! It's the cops!

Stealth missions usually revolve around you not being noticed or identified as trespasser by the civilian NPCs around you, but what happens if they do?

He’s ready.

A regular civilian NPC such as a researcher, office worker, or even a building night guard would pose absolutely no challenge to a Spy DNA agent, which would make missions boring. To help up the ante a bit, we’ve added the police.

The “police” NPCs will have a non-zero “combat tactics” skill, and depending on their experience level they’ll have other relevant skills, such as Pistols or Observation, to name a couple. This will make them more formidable opponents than your typical night guard. They will also arrive at the scene expecting trouble and will definitely carry weapons.

“You’re under arrest!”

When civilian NPCs see something that we’ve defined as crime (picking a lock, using specific items, being in restricted areas, etc.) or if they see something that would hint at criminal activity (an unconscious body for example), they won’t go after the perpetrators or investigate the crime themselves, they’ll call the cops instead.

When the NPC “calls the cops” we start a countdown until the police units are spawned on the map. How soon they arrive depends on how remote an area is, among other things.

We’re playing super-spies, so when the Police Dispatcher activates the response units, your character will pick that up on their police scanner. The dispatcher will state how far out the response units are at regular intervals, to give you an idea of how urgently you need to get your character out of the area.

On stealth missions, getting arrested by the police will result in mission failure, as will shooting any civilians, so our heroes should ideally clear out before the law enforcement officers show up.

Combat hesitations

by Jason Sams, Lead Developer

In Spy DNA we have talked about how you can queue actions for your characters. When we were discussing the difference in behaviors of well trained troops or agents, vs thugs, vs civilians, one of the things that came up is how quickly a character can evaluate the situation and choose their action.

One of the concepts we have introduced to represent this in-game is the idea of a character being indecisive. To model this we introduced a skill called “Combat Tactics”. It’s a passive skill.

We used to key a character’s combat response off of their highest combat skill, but after thinking this through, we concluded this was not an accurate portrayal of how people respond in a tactical situation.

Let’s say we’ve got someone who’s a very skilled marksman while shooting at the range, but has no actual combat experience. Such a person would do worse in combat than a basic soldier who may have a significantly worse shooting skill, but has been trained specifically for a combat situation.

The new “Combat Tactics” skill will use mental quickness as its primary attribute, and mental memory as its secondary attribute. When an NPC decides to change their course of action in response to something it sees, this skill will be used to generate hesitation before starting the next action. This means some civilians and green troops may freeze for a bit once things go loud.

So how does this impact PCs?

When a PC is carrying out their queued actions this will not affect them at all. However, should you cancel your action queue, we will generate a hesitation for the character to represent this changing of their mind. Some PCs will be able to do this almost for free, either due to extreme mental quickness (Margo), or lots of training (Ivan). On the other end of the spectrum, avoid changing things up on Karsten, who’ll need some time to figure out the next steps. In effect it will be important for some characters to stick to the plan, whatever plan you made.

The “Combat Tactics” skill will improve with use, but the governing attributes will still have a large impact on how fast a character can respond to the change of orders.

Spy DNA background brief: Character bios

by Alex Maier, character profiler

As we work on the missions and figure out the best ways to make each team member useful for the team, we get to know our characters better. As a result, we were able to add quite a bit more detail to each of their bios. Additionally, we’ve changed a few callsigns to better match their owners’ personalities.

As we become more familiar with the characters, we can begin to flesh out inter-team relationships. Who would befriend who? Would there be any conflicts? (The answer is always yes!)

By looking at their alignment chart, you can imagine that our two ex-mil “paladins” Zoe and Ivan wouldn’t get along super-well with Nuri, but will have an easier time working with Shin or Ros.

Our two chaotic good folks, Margo and Tank, are both firmly in the “making things go boom is fun” camp. Tank prefers working with explosives, and Margo is more of a mad-scientist type who likes unorthodox solutions. They are both fairly easy-going and get along with most folks, but given their intelligence levels, they prefer to hang out with the smarter members of the team. Conversations with Margo often leave poor Karsten in a state of bewilderment.

Speaking of Karsten, both he and Ronda are true neutral, and place great value on mission success rather than on philosophical questions of whether their actions are truly “good.” For Karsten, whatever helps his friends and teammates, is the right thing to do. Ronda values hard work and a neutral, more scientific approach. They both have no issues working with anyone who’s not chaotic.

As a side note, Ronda with her perfect memory, is a walking encyclopedia of mixology, and has become the squad bartender. She rarely enjoys her creations, being busy making cocktails for her team.

Oh, and Karsten has a giant crush on Nuri, who’s only too happy to tease him for amusement.

Shin is the living embodiment of the “dura lex, sed lex” principle. For him, the highest priority is upholding the law, and given his experience investigating organized crime, he’s come to believe that in some cases, enforcing the law won’t look pretty. He’s made his peace with that a long time ago.

Our two entertainment industry buddies, Nuri and Ros, go a long way back, and through the years, Ros had to be Nuri’s moral compass. They share love of martial arts, along with a passion for dressing sharp. Nuri is most at home hanging out with Margo and Tank, with a drink in hand. Margo knows how to party, and that means a lot in Nuri’s book.

Ros is an extremely compassionate person, especially when it comes to animals. When he says he could just kill wildlife poachers with his bare hands, he actually means it. Over the years he’s rescued multiple animals, including his hawk Razor (who sadly had to stay in Israel with a friend).

Which characters do you like best? Which ones do you think will come in most useful on your missions? We’d love to see your comments!