game dev

Complexity in games

By Jason Sams, Lead Developer

I want to talk about complexity in games. I think complexity is a very misunderstood subject. Game developers are sometimes seeking to “simplify” where there’s no need, while at the same time adding complexity without realizing it.

What is “complexity?”

When I say “complexity,” I mean specifically “perceived complexity.” In other words: Is the action considered easy or hard for a human to accomplish?

Here’s a practical example: If I asked you to throw a ball at a target, would you consider that a complex or difficult task? Probably not. However, hitting a target with a projectile is a task complex enough that solving the math behind it drove the creation of the first computers.

When video games were created, lobbing projectiles at things was a rich enough subject that entire games were built around the idea, such as Artillery Duel and Scorched Earth.

Let’s look at a more recent example. Is driving a car complex? Most people consider it so easy that they do all sorts of other things while driving. Yet teams of engineers are still struggling to teach a computer to do the same thing. Analyzing visual data is so challenging, that they have to use additional sensors (Lidar) that humans don’t have, or need. Objectively, driving is very complex and yet it’s still easy for humans.

And again many games are built around the idea of driving (or flying). Most of those games are considered very easy to pick up and start playing. Perfecting your technique and winning is the real challenge.

What about an opposite example? Multiplying large numbers is so simple even a phone can do it a few billion times per second, yet ask a human to do it and many would rather drive to buy a calculator. No one would make a game like this outside of education.

In context of game design, we’re interested in complexity as perceived by a human player. In our case we are specifically interested in making the mechanics of the game easy to grasp. This idea has been a driving factor in the design of Spy DNA and is also the reason for us calling the game a Simulation RPG. (Side note: it’s also led to way more UI iteration than we ever envisioned.)

Our combat system is designed to be the best simulation we can make of combat. We chose simulation and not the traditional turn-based approach to solve the problem of perceived complexity vs. actual complexity.

I’m a big fan of realism in games. Nothing will frustrate me more than when something happens in a game that makes no sense in the real world. Some examples:

1: You move a character one step forward, you trigger an enemy group, that now all get to activate, move several times farther than your one step, and possibly attack and kill your character. All this before you can even react.

2: You find a new item in game, yet you can't use it because of some attribute or skill check. The worst ones are the cases where you lack “strength” to wear an item, yet, toss it in the backpack and you can be lugging several of them around despite them being harder to carry that way.

3: You sneak up behind a target and make a surprise attack. You stealthy weapon fails to penetrate the armor despite hitting a spot where there was none (visually). The enemy then turns around and kills you.

What all these things have in common is they are results of artificial rules imposed by a game system that don’t exist in the real world.

Human brain is very good at understanding natural things such as physics (throwing something), or processing an image, but dealing with large numbers of artificial rules is not something that comes to us naturally. Therefore games that go down this path are perceived as complex for the player.

Not all complexity is necessarily bad. There are many popular games built around artificial rules, chess being the first that comes to mind. Add a little random input and you have pretty much every card game ever. In these cases managing and exploiting the rules becomes the focus of the game.

In Spy DNA, we want you to feel like an agent in a believable world, where things that should work actually do work in-game. Or put another way, we wanted the combat system to be intuitive and realistic. We wanted the game to be about Spy DNA world and not about the combat mechanics.

When you play Spy DNA, one of the things you will notice is that we have a lot of attributes compared to most RPGs. I’ve heard people give talks saying that six attributes is too many for an RPG, and I consider that silly. I mean, if a console sports game can have 38 attributes (MLB the show), I don’t see why a serious PC RPG shouldn’t have more than 6.

Yes, this is a scroll bar in the attributes screen!

Yes, this is a scroll bar in the attributes screen!

This is where we clearly see the difference between perceived vs. real complexity. By all accounts the simulation in the MLB game is more complex, but because each attribute is clear and easy to understand and relate to in real-life terms, it never feels difficult to understand or play.

By comparison, when you have too few attributes, the attributes have to stand for things that are not obvious from the name, such as using dexterity for speed, strength for hit points, or intelligence for spellcasting. Each game has a slightly different system, making it necessary for the player to learn a new set of artificial rules with each game. Learning abstract rule sets is a thing that humans aren’t very good at, and therefore perceive it as complex.

How could having more attributes actually make a game seem simpler? The primary way is to map the attributes to “things a human intuitively understands.”

In Spy DNA we have 21 attributes in 7 common groups. We use groups, so that players used to traditional RPG systems would immediately be comfortable. The groups simply provide the average of the sub-attributes for quick reference and ease of picking up the game for those familiar with other systems. Within each group we provide the details, so it’s intuitively clear what’s really going on.

Screen capture of Spy DNA character attribute screen

Screen capture of Spy DNA character attribute screen

Let’s looks at dexterity, using the party sniper, Zoe, as an example. At a glance you can see at 81, dexterity is a strength for the character, as you would expect for someone specialized in ranged attacks. However, with our focus on being realistic, we break down dexterity into Dexterity, (could also be called manipulation), reaction, and flexibility. In this example the character has a clear specialization. You can also see from the description she has a “+40 enhancement”. This comes from the genetic enhancements which put the “super” in “Super Spy”. As a result of these you can end up with values in excess of the natural human limit of 100.

Reaction is simply reaction time and impacts reactive movements (duh). In-game it will make you harder to hit in a melee fight, and help with any other action that depends on quick reflexes.

Flexibility is important to martial artists or characters that want to sneak past alarms or hide in places you wouldn’t assume someone normally fits. 

By being explicit about the common traits that a character may have, it should be actually easier to parse what the attributes actually mean for gameplay. We feel that this is better than a giant array of perks because it’s clear and straightforward.

When it comes to combat, we try to simulate the world as it is, and not require people to learn a unique set of made up rules just to play Spy DNA. Let’s take cover as an example.

In some games cover is measured in increments (high, low, none), or as a percentage. In these examples the cover makes it proportionally harder to hit the target. So far so good. Now you need a mechanism for attacking a target in cover. So these games introduce the idea of “flanking”, or moving to a position where the cover doesn’t apply. Typically these are done on an all or nothing basis, leading to frustration as your character can clearly see and hit the target, but because you have not triggered the arbitrary rule that says you’ve “flanked” your target, you still miss.

In Spy DNA we deal with this in a straightforward way: if you can see it, you can shoot it. Humans understand intuitively that the more of a target is exposed, the easier it is to hit. How much easier? We solve that problem visually. We present the player with a picture of their character’s viewpoint. You see what is exposed, what the area your shot might land in is, and you make the call based on that. Visual and intuitive.

Screen capture of the gun sight cam, showing circular error probable values

Screen capture of the gun sight cam, showing circular error probable values

I also want to talk about cover vs concealment in Spy DNA. A real-world consideration is: “Will this thing I am using for cover actually stop the bullets?” If the answer is no, it’s not really cover, but just concealment. You might use a couch or a thin door as cover, but those will only slightly reduce the energy of the shots. So if the enemy gets lucky or guesses where you are on the other side, you’ll still have a problem. The flip side of this is, that if you have a weapon with a high rate of fire and have a general idea where the target is hiding, you may be able to get them through their concealment. Just like in the movies.

This leads to the next bit, damage. In most games once you hit a target, there is a random roll for damage, and possibly a separate random roll for a “critical.” So back to that early example on math, most humans don’t have an intuitive feel for complex equations that don’t mirror something in the real world. So instead of having a good grasp of the actual probability of hitting and damaging a target, players have to develop a feel for a weapon’s effectiveness based on trial and error.

In Spy DNA we invert this equation. Damage is 100% deterministic once you hit a target. How much damage you do is based on three things.
1: What hit the target? Ex:type of bullet, fragment, knife, fist.
2: Where did it hit the target? Ex: head, arm, leg
3: How much energy did it have when it hit? More is better (for the attacker)

Those concepts should be very easy to understand, nothing feels complex about it. However, the actual simulation is very complex. It only takes a few lines of code to implement hitpoints. To simulate injuries, we have thousands of lines of code in Spy DNA. 

Spy DNA uses per-polygon collisions to model wounds on a character

Spy DNA uses per-polygon collisions to model wounds on a character

Our models have multiple colliders so we can not only figure out if you hit your target (which we resolve per-polygon against the mesh), but also what part of the target you hit. Then our damage code takes over and models a wound based on the results. 

This creates interesting situations in-game. Looking over cover is still dangerous, even though you’re 90% covered. Why? Because if the enemy lands a shot, it’s the exposed part that gets hit, which in this case is your head. Sticking an arm out would be much safer.

The last bit I’ll talk about is the passage of time. Most similar games have made the decision to be turn-based. We are a simulation, which means every action you take, takes some amount of time. When in combat, time in Spy DNA only passes while you are doing something. The most similar game I can think of is SuperHot with their tagline “Time moves only when you move.” Time will pass for both you and the enemy when everyone in your party has something to do, even if that something is just wait.

Because you want to be able to react to the changing situation in-game while your character is performing their action, we allow characters to react to perceived threats. A character that spots a new threat will cause the time to immediately stop, so you can change your orders if you desire. This mechanic takes the place of the various “overwatch” systems that most turn-based games have.

The ability to stop time when new threats are discovered allows us to avoid the problem where you need to have characters on overwatch to protect a character that is moving, in case they trigger an enemy reaction. In Spy DNA, if an enemy becomes visible, you can just react to it if you choose. We completely bypass the complexity of having the player figure out which rule they can use to protect them against the AIs use of reaction rules. Instead, you just react to what you see when it happens.

When out of combat, you move the party around in real-time. You can manually enter combat mode if you want, and the game will automatically switch to combat mode when the first shot is fired. Exiting combat mode is always manual, unless the mission is finished.

We have put a lot of thought into how to create as realistic a game as possible, where the world feels natural and real to the player. We want you to enjoy the gameplay and story rather than having to learn and optimize for an arbitrary rule system. For many situations in Spy DNA there isn’t just one “optimal” solution, but multiple ways to accomplish your mission, which frees you up to just play the way you want.
 

Spy DNA development update 2018-02-23

By Jason Sams, Lead Developer

It’s been a while since my last update. I’ve had my head down in the game code making some fundamental changes. We have made major changes to the AI system, character customization, hit location and damage system, level designer, asset loading, modding support, and a few other things. 

Let’s start with character customization. We put a lot of effort in making the players character fully customizable. Now a few of you gave us a hard time for going overboard here. The reason we put so much effort into this is we unified it with NPC generation. This will let us generate much more unique NPCs for each mission and avoid repeating the same character models over and over.

New game screenshot

New game screenshot

During character creation you will be prompted to choose your commanders frame (skinny, average, or heavy), and condition (pro-fighter, fit, average, nerd). This choice determines which character model you will see in game and will also change your attributes. The condition choice biases your attributes towards physical or mental, while the frame choice is a speed/dexterity vs strength/toughness choice. 

Related to this we implemented our appearance reaction model. Each appearance item is rated on several metrics, such as Serious, Classy, Scary, and the ability to conceal weapons or armor. So while you may want to bring the heavy armor to the dinner party, doing so will make it much harder to get people talking, at least by verbal means. 

Wardrobe screenshot

Wardrobe screenshot

Speaking of armor, we added the armor options to the wardrobe screen. You can now equip your characters with a variety of armor and storage options. I’ll have some updated screenshots of the overhauled equipment screen soon. Armor in spy dna is now working as intended. Armor resists bullets and other weapons, but for it to work, the weapon needs to hit the armor. This makes your aim point really matter. Unless you have the heavy weapons out, you will want to try to avoid hitting the heavily armored points on a target.

Character status screen

Character status screen

We updated the status screen to show where the shots have hit a character. The length of the marker changes depending on the penetration of the incoming round. The diameter represents the damage level of the shot. The hits are colored based on result. 
Green = fully blocked by armor
Yellow = blocked by dermal armor, probably still really hurt though.
Red = call the doctor and make an appointment

Attributes screenshot

Attributes screenshot

We are scanning the shot against the polygon mesh of each piece the characters are wearing. We don’t want near hits/misses being mis-reported by the engine.

We have also been cleaning up the UI. We moved from using pre-drawn icons for the party to using render targets and snapping them in game. This means they will reflect the current state of the character. If you change into a delivery worker outfit to sneak into a building, the portrait will update on the fly.

Skills screenshot

Skills screenshot

And the final bit for the update is the changes to the inventory screen. We have moved a few things around and made room on the left, under the item image, for attachments or modifications. 

Inventory screenshot

Inventory screenshot

We have also put a lot of time and effort into performance work. To give you just one example: The time from a level loading until you can start moving has been reduced from a minute or more it could take in the past, down to about a second. The pathfinding will prepare in the background now, using multiple cpu cores to speed things up if available.

While we basically had Spy DNA up on jackstands with the engine out and all kinds of parts strewn all over the place, it was challenging to really show and explain all the things that we had in-flight. But now that we have put the thing back together, we’ll be sharing updates on a more regular basis.

Stay tuned.

Getting ready for Early Access

It’s been a heads-down month here getting ready for early access. I’ll talk about what we are doing to go from demo to a full game. The transition from demo to full game for us has been about adding progression and content. 

The first big change is the result of a mission now affects your game. You can now also train your team at the base. Wounded characters will need some time to heal at the base before they are available for future missions. We’ve implemented the save game system and made the full character roster available. It’s all pretty obvious stuff, but it still needed to get done. 

While on mission, a character can advance their skills by using them in the field. On the skills page you will now see a count of how many times that skill has been used. Each use will improve the skill. 

The amount of the improvement will depend on several factors. First, each skill has associated attributes which govern how well your character can learn the skill. These are separate, though possibly overlapping, from the attributes which bias the ability to use the skill. For example “mental motivation” is a factor in learning most skills, however, it is used in few skill checks. These determine the character’s learning rate modifier for that skill. 

In addition each skill has a base learn rate to adjust for skills that are used frequently vs rarely. For example we don’t want to penalize hacking and lockpicking progress just because there are fewer chances to use the skill. 

Back at the base, skill training is a passive activity. You can assign each character two skills (primary and secondary) to train. Then as each day passes, any characters at the base that are healthy, will train those skills. So characters that are not taken on missions will still be making progress. A character that is not healthy may still make some progress. For example, a broken leg will prevent training physical skills, but would allow the character to keep working on mental skills. 

Injury recovery is similar to training at the base. A character will survive a mission as long as they are alive at the point when the “end mission” screen is triggered. In theory we can simulate post-mission death due to injury, but that would be an opt-in for extreme difficulty. Because we track each injury a character suffers, we do healing per-injury. Different injuries can heal at different rates. As they recover, they will automatically resume training as their health allows.

In the case of non-fatal injury to the Commander, if one or more other characters are available, you will be able to designate an acting commanding officer to cover the Commander’s duties and lead the squad on missions until recovery. If no one is available, time will fast forward until the Commander recovers. 

For early access we also wanted to make the full character roster available. So in addition to Ivan, Karsten, Nuri, and Zoe from the demo, you will now have Alexey, Marguerite, Ronda, Shinichi, and Rustam. 

Saving and loading has been implemented. The game will now autosave after each mission at the base. For initial early access saving will be limited to while at base. We will implement saving while on mission later.

2017-05-01.png

We also have been hard at work on the UI. We received a lot of feedback about the look and feel of the UI and have responded with some improvements. Functionally the location of the controls is largely unchanged. What we have done is softened the appearance of the buttons, borders, and dialogs, and replaced some of the radio buttons with icon based sliders that make it easier to visualize how the controls work together.

We published a video for those wanting to see more of the new UI.

One final change for realism and game ballance we’ve made, was to implement the penalties for attacking moving targets. Simply put, it’s harder to hit something that is moving than something that is still. The mechanic implements this is two ways. One, there is a penalty to the circular error probable (CEP) for any given aim time. Two, the moving target limits the amount of time that can be spent aiming. The strength of the penalty is based on how fast the target is crossing the character’s field of view and how far away they are.

The first batches of character voices have started to arrive. Each playable character will have an unique voice and persona which they will use to acknowledge your commands and give you status updates.

The last area of getting ready was the implementation of settings screens. We have made a pass over all the sound effects and broke them into channels so each can have its own volume control (music, ambient sounds, combat sound effects, player character voices). We have also started implementing the settings for difficulty and new game options. These will be exposed soon.

With all these changes, the core engine of Spy DNA is pretty much ready for early access. What we are finishing up now is getting enough of the missions ready that the game has some content to go with the engine. 


 

Demo prep

We are getting ready for the demo. Today we made a new video from the latest build. This is the first time we’ve shown a play-though from character creation to combat. We’ve been focused on playability over the last few weeks, so we’re fixing lots and lots of smaller issues.

The big task was working through issues with load and save of games. Because the demo takes you through character creation before you can start taking sample missions, we wanted players to be able to save a character they generated. We also implemented a loading screen while working on load game. We hope these additions make the demo more enjoyable for players.

Another significant change from our previous videos is an updated camera system. While watching people play, we found players used three camera positions frequently. So we added direct support for the most common camera uses. 

  • A low camera which shows things from the view of the character
  • A high camera which shows the tactical situation
  • A target camera which flies the camera over to the active target
  • And we still have “free” camera so the player can move it around as they desire

For the low and high camera they save the player's view height and angle so if you switch away and come back you won’t have to reset the camera each time.

We also implemented a compass; it shows which way the character is facing. More interestingly, we also added contact ticks to the compass. So you can see which way contacts are relative to your active character. Also you can click them to fly the camera over to any contact.

The map generation has been heavily tested and we have recently implemented a number of performance enhancements. Currently the large maps can strain some mid-range systems so we put some effort into improving performance. There is more to be done, but we got a very nice performance bump for the demo.

For the playable characters we doubled the number of commander appearances available for the demo. There are two male and two female commanders to choose from, each with their three outfits depending on mission. There will be many more for the shipping game.

The demo will also include default genetic enhancements for all the playable characters. You will get to see a small example of the enhancements in action. In the shipping game you will be able to select and choose how your commander is enhanced to mirror your play style.

We implemented new shaders for the trees, firing range, roof of the base, and a few other items. This was done to make them more friendly to the camera so they cut or blur away so you can continue to see the most important parts of the map.

The status screen has been updated to show not only injuries, but also attacks which were stopped by armor or implants. You can mouse over any hit and see the force and type of attack along with how much of it any armor you may have stopped. 

Movement was reviewed. and walk, jog, and sprint speeds were double checked for the demo. We spent a bit of time graphing the various movement speeds vs attributes. These are the base speeds with zero encumbrance.

Walk speed graph

Walk speed graph

Jog speed graph

Jog speed graph

Sprint speed graph

Sprint speed graph

The jog (max sustained movement speed) graph is 3D because it’s based off both quickness and stamina. This was triggered when we picked up a few too many weapons at the firing range and unintentionally tested our encumbrance system.

Barring any unexpected problems we expect to have the demo out this month. Stay tuned!

Demo Complete!

We finished putting the final touches on the demo and are sending it out to a few testers tonight.  Once they have had a chance to play with it and we address any issues, we will send it to a wider list.

We have also decided to make the demo available to anyone that has backed our Kickstarter campaign at Beta or higher.  I.e. those that wanted an early look and were willing to put up with the limitations of early builds.  It’s around 1.4Gb for the two demo levels.  

One of the good side effects of working on the demo is it forced us to address some long standing bugs that we had been putting off.  

Examples:

  • Write a manual
  • Add objectives to the maps
  • Sort the dialog answers so “goodbye” was always at the bottom
  • Put the status indicator over the character portraits
  • Assign skills to the NPCs

We also added the end of mission screen which includes the status of the objectives, the party, and some statistics about the equipment used.

We also added an “event cam” to the game.  It’s purpose is to highlight important events to make sure the player is fully aware of what is happening in the game.  We will add settings for the final product so players can customize which events are highlighted.  

Changes of note:

  • Added check marks to objective list

  • Made movement modes available to AI waypaths

  • Maps can now specify if the characters start with a weapon equipped

  • Hide shooter weapon in gunsight cam to avoid possibility that weapon would block view

  • Fixed bullet trails and sounds for some weapons

  • Enabled event cam for kill shots

  • Fixed AI bug that cause NPCs to sometimes empty the clip into a already down character

  • Taught AI to reload

  • Added medium and heavy combat armor

  • Fixed icons for armor

  • Tweaked ROF for a few rifles

  • Added new pistol models

  • Added descriptions to armor

  • Fixed bugs applying armor to hits

  • Added keyboard shortcut for previous and next target visible to selected character

  • Replaced generic sounds with per-character sounds

  • Removed occlusion check for muzzle flashes.  Was causing flicker.

  • Greyed character portrait when stunned, unconscious, or dead

  • Set skills for all NPCs on demo maps

  • Replaced placeholder NPC models with correct models

  • Fixed bug causing turns for unconscious characters.

  • Reviewed max-texture sizes for small objects

  • Added post-mission summary and stats screen

  • Fixed bug with default aim point after a melee attack

  • Updated 3D queue overlay to fix bug with stuck targeting line

  • Fixed gun empty sound

  • Hide contact counts when character is unconscious or dead

  • Added sorting support to dialog answers

  • Changed default to show long answers rather than short summary

  • Fixed cursor hitbox for hud to resolve small dead-space area

  • Added skill check for spotting and rate limit spot checks