Saturday, September 26, 2015

Do NPCs In Video Games Really Die?

Mortal Kombat

Since the early 90's, old people who had no idea what video games are and Florida lawyers who are willing to spin the grief of parents who have lost their children to violent crimes to make a quick buck have tried to question the issue of violence in video games.  I mean, it's undeniable that video games depict a lot of simulated death.

Now, those disrespectful politicians and opportunists who I mentioned above have tried to rattle our ears with the concept that our brains can't understand the differences between reality and video games; that these video games will rot our minds and turn us into killers.


Half-Life 2

Those crusty old farts are full of it.  We know that now.

But, what if we actually are all killers?  What if those virtual characters, packed with "AI", are actually living things that we're killing?




What if we're wrong about video games?  What if the characters inside of our games who we kill on a regular basis are sentient beings who can not only feel and fear what we do to them but also suffer the ultimate consequences: death.

"We just want to liiiiiiiiiiive!"

It may seem far-fetched, but let me set you up with a thinking exercise.

Imagine that there is a computer that is so complex that it can run a simulation as massive and as complicated as the entire universe that we live in.

Put those away.  I'm not finished.

Now assume that, just like our universe, there is a planet inside of the simulation just like Earth.  And, just like Earth, inside of the simulation there are people just like us.

Juuuuuust like us.

These people, within the simulation, have lived entire lives.  They have bloodlines.  They have families.  They have relationships.  They have dreams.  They have aspirations.  They get tired.  They are flawed and occasionally make bad decisions.  They forget to turn in their taxes in time and get fined through the ass.  They remember eating waffles yesterday, remember eating crepes two months ago, and look forward to scrambled eggs today.  They grow old.  They write wills.  Their families grieve their deaths.

But, all of this is just a perfect simulation of what's going on.  All of it, just as complex as the universe itself, down to the planck level, is housed in the computer's processor and RAM.

Perfect.

Now let's say you open up the code and make somebody (who otherwise wouldn't have) get a massive heart attack and die.  Maybe you save them the suffering and you just make them disappear; delete their future.


Is this murder?  Did you just murder a person?  A person who maybe dreamed of owning their own company, or liked the smell of lavender, or who was afraid of heights, or who had a beautiful singing voice but they were too shy to show anybody.  They may be part of a simulation, but do you consider removing this person, who acts like and is every bit as detailed and complex as a real person, to be an act of murder?

Is their digital blood on your hands?

Now, I've given this thought exercise to a lot of people.  I might just be really convincing or biased in the way that I present this, but I've yet to have a person respond that this isn't murder.  Everybody seems to agree that if a simulation is as intelligent, complex, and full of relations with other similarly complex and intelligent simulations, then that simulation might as well be considered alive.  Therefore, ending that life would be murder.

Maybe destroying the computer is one of the most monstrous things anybody could do.  Mass extinction- the destruction of an entire universe.

The single most violent, death-filled image that you've ever seen.

So now let me ask a question:

If we're willing to accept a simulation as life, where do we draw the line?



There are 1223 Imps in Doom 2.  On a conservation status, they would be critically endangered.


An Imp is able to respond to your entering its field of vision, able to change states to move from pursuit to deciding to attack from afar, to determining that you are close enough to melee attack, to having a set variable that determines how much pain would make it flinch.  Of course, it also has durability before it-


Oh my God!  Why?!  Why would you do that?!  This beautiful, majestic creature!  There are so few of them yet you have opted toward violence instead!


You make me sick!

Is there any level of complexity that we can remove from the massive simulation and allow it to retain the label of life?

To determine this, we will first have to define what life, sentience, and death are.

All three in one GIF

Let's start with life.  The first definition of life when searching on Google is: "the condition that distinguishes animals and plants from inorganic matter, including the capacity for growth, reproduction, functional activity, and continual change preceding death."

Alright, I find that to be a sufficient definition.  There is only one hitch in the comparison between life and the simulation based on this definition: the need to be organic (as the definition requires that the condition of life separates the subject from inorganic matter).  This is easily sidestepped, however, as the definitions here become circular and "organic" simply means to be, or related to, something that is living.  In this case, the simulation (if we deem it to be alive) would inherently be considered organic.

Checkmate.

With that, it is easy to accept that the complex simulation in the presented hypothetical meets the requirements set forth by this definition to be life: it can grow, reproduce, function, and change continually.

Second, we should probably define death.  Death, however, is a pretty easy concept to wrap your head around: the end of, or  what comes after, life.  If simulations live, then once that stops then they have died.

Now we don't care that much about killing things most of the time, right?  We commit genocide regularly in regards to our bodies fighting newly mutated forms of bacteria and viruses.  We step on plants all the time, squash bugs, and some people even go hunting.  What we really care about is complex sentience.  That's when it's considered murder.

Sentience is described as the ability to feel, perceive, or experience subjectively.  This includes the ability to react to your surroundings and interpret them based on input.  

"I can only feel pain"

In that case, we can only assume that the simulation can be said to have sentience, or at least something greatly resembling sentience.  We really couldn't know without seeing it through their robo eyes.

Kano always sees something through a robo eye.

So, let's go over our list:
-Life can grow
-Life can change continually
-Life can reproduce (given that it isn't sterile)
-Sentient life can observe and interpret surroundings through input

Is there any AI or simulation today that meets those requirements?


Well, I mean... kind of.

First of all, let's look at one of the simplest characters in a video game ever: the enemy in Pong.

Classic tale of good vs. evil

The paddle on the right, at least in single-player games of Pong, is the AI opponent.  When the ball moves to the right, the opponent aligns itself with the ball.  In pseudo-code, it'd look something like this:

If ball is moving right
{
If ball is above paddle
{
paddle move up
}
If ball is below paddle
{
paddle move down
}
}

The actual code for it isn't that much more complicated than that.  At most there are added conditions to ensure that the paddle does not move through the top and bottom of the screen.  That's it.

So, off the checklist, the paddle has: none of what we could consider life.  It simply reacts to the ball's position, the same way that a rock reacts to the surface of water and skips.  The ball, in turn, simply reacts to the paddle's imminence and deflects.

So how about something more substantial?  How about a guard from Wolfenstein 3D?


Now, the guards in Wolfenstein 3D are fairly impressive in terms of AI compared to the Pong paddle.  They patrol along set pathways, have directional vision, chase the player once they've spotted him, use path-finding algorithms to navigate, know how to open doors, know to attempt to dodge when in certain situations, flinch on damage, fire at long distances with varying accuracy, and can die when their durability is spent by gunfire.


Now, these guards definitely take into account their surroundings and assess them to determine whether or not the player is in their sight, how to path find, and where there is a door obstructing their forward motion.  These are thoroughly calculated and put into a arbitrary ratio counter to give them somewhat organic decision making.  An argument could be made that this is a sign of very simple sentience.

I think, therefore ACHTUNG!

Are they really living though?  Well, there's a couple issues with that idea.  One is that they do not grow in any way.  No matter what is happening, they never gain information; rather, they either change states or subtract from a variable that represents their health.  There is nothing in their A.I. that actually gains information.

They do, as I mentioned, continually change states and adapt their approach around the situation they are in.  This is one of the major hallmarks of life, so they're not so far off.  The issue is that something that reacts solely based on internal impulses is not alive in the same way that a severed hand that twitches when electrocuted isn't really alive.

"Meet my best friend.  He's a great guy."

So, moving on to more complex ideas, how about gaming's most famous growing and loving AI characters: The Sims.

The Goths have been waiting to welcome you to their neighborhood.

The Sims are a bit more complicated than I'm sure you'd have time to read, but let me summarize: the Sims are an AI that simulates "real life" by doing mundane tasks and requiring the same maintenance and socialization that most real folks need.  They hunger, tire, bore, and fall into depression.  All of this can be combated by eating, sleeping, playing the computer, and having sex.   In certain Sims games they can have babies, they can grow up, they can die, and they can even haunt the Earth in a spectral form.

And then said specters get pregnant because why not?

By the definitions we're working with from above, The Sims get really close to what we'd consider to be life.  Let's go into it:

1. Life can grow

This is a bit of a weird one, because "grow" is kind of vague.  Now, in terms of a computer simulation, the physical representation would be the data that such a character takes up within a computer.  In that case, Sims absolutely do grow.

And eventually you grow into a tiny grave or urn.  Just like real humans.

The life cycle above isn't what I'm talking about though.  That'd go more into the next section.  What I'm talking about is that Sims record life experiences in the data, specifically experiences that they have with other Sims.


While things like hunger, bladder control, and happiness are variables that simply change value based on algorithms and never really take up more space, interactions with other Sims have to create new space in the computer.  Even if it's just a little bit.  This can easily be deduced by one main characteristic of the game: you can add more Sims into the game.  When you add more Sims into your game and your Sim goes and talks with them, they have to create new data within their personal data that includes how they feel about and are willing to interact with the new Sim.  This is actual, physical growth, because they now take up more physical space on your computer.

2. Life continually changes

Let's look back up at number 1 for a second.  I mentioned that the Sims have to deal with all sorts of variables that are constantly shifting during their time in your computer's processor.

To name a few
All of these stats control the Sims' behavior.  What their short term goals are, how they interact with one another, the order in which they want to complete tasks, and their general disposition are all affected by these values.

And these values are constantly changing.  Therefore, the Sims are indeed constantly changing.

3. Life can reproduce

Technically, you can say that Sims do create new Sims given that certain expansion packs which allow for Sim sex are enabled.


Now, in the first Sims game the procreation was a bit sloppy and the Sim baby was little more than an additional decoration.  Later Sim games, however, allowed for the little Sim babies to grow up and develop their own personalities.  So I'm going to go ahead and say that yes, Sims can reproduce.

4. Sentient life can observe and interpret surroundings through input

This is kind of the important one.  This marks the distinction between killing a tree and killing a mammal.

And the answer is kind of a yes.  Now, you remember the meters above, right?  Well, when a Sim gets hungry from not eating virtual food, he'll take into account that there is a virtual refrigerator in his house, take into account the path he must take to get there, and then move along that path to that refrigerator because he wants to eat and stop being hungry.  Upon reaching the refrigerator, he opens it, grabs some food, and resolves his hunger meter.

Mmmm, sentience!

That's admittedly kind of a lame example.  Maybe we should go more into something else that can happen, then.

Sims can cheat on one another and break each others' digital hearts.

Somebody spent a lot of time programming the possibility for these interactions.

When one Sim is in a relationship with another Sim, they can start to find another Sim to be of interest to them romantically.  Another Sim has ways of observing this affair and reacting to it.  All parties involved internalize this and, based on how strong certain relationships are, different outcomes are possible.

Sims are complicated programs that really do spend the majority of their time internalizing their surroundings and inputting these variables into algorithms to create sophisticated reactions.

That sounds almost lifelike, even if it is extremely simple life.


So, are we all real murderers in games?

Nope.  When you kill an enemy in a game you don't actually kill it.


Let's go look at the Imp in Doom 2 again.

One dead Imp.

That Imp is actually just as alive as he was before that happened to him.  He still processes an image of himself, has physics simulations running within himself (so if an elevator were to move down while the body is on top, the body will move with it), it can change into yet another state where it becomes a crushed puddle of goo if a door closes on it, and it can still interact with another monster called the Arch-vile who can reverse the death animation and replenish the health, making the Imp combative again.

They're the worst

In that sense, the Imp isn't dead when he is gunned down.  He's just in a different state, just as different from his running state as the running state is different from the attack state.  He's playing dead because that's how his program reacts to being shot.

How about those Sims though?  Do they die?

Want to reap souls?  There's an app for that.

Well, remember how I earlier mentioned that they can even come back as ghosts?  Well, that's kind of the same thing as the "dead" Imp up above.  It's the same character, just in a different state.

He's just wearing a pretty shade of blue.

So does any character here actually blip out from your game when you kill them?

The slaughtered masses of the video game world.

Well, Goombas are certainly characters in games that lack most of the basic necessities to be considered life that we listed above.  But, for the sake of argument, if we were to say that they are... they are enemies that actually disappear from the game's current processing when they die.  They change into a squished guy and then they're gone.  The player gets points and moves on.

But...

They still exist within the code.  At any point you can boot up the level and they're going to be there once again.  They don't really go anywhere.  It's more like you put them in a coma and give them amnesia or something.

"This all feels oddly familiar..."
That kind of brings us to the next thing to consider.

The enemies in video games aren't actually alive

"THEN WHAT WAS THE POINT OF HALF OF THIS ARTICLE?!"

This was all kind of a fun thought exercise, but we're about to get into the really technical stuff.

So, in programming there's these things called "classes" and "instances".  It's going to pay to understand these moving forward, but I'm going to try to summarize them.



A class is the description in code of what something is.  How an enemy behaves, which variables they'll locally store, sometimes what they look like, how things interact with them, whatever.  It's the template.

An instance or object is when the computer manifests the class during execution of the program.  It is a set of processes using the class as a reference.

In a way, the instance is just reading a rule book for what a Goomba is and does.  But these characteristics don't actually belong to the instance at the very core of the code- they're all just indexed information of the computer, looking at the Goomba class for how to proceed.  An amorphous blob of binary that looks like a Goomba when viewed through graphical processing that is just a projection of what a computer says should be happening right now based on what it has been given to understand.

A computer says what a Goomba does in the same way that you imagine a Goomba doing things based on what you know about Goombas.

"Wait... that just makes me-"

The Goomba is nothing more than the computer's dreams.


Wait, what?


The Goomba, the Sims, the Imp, all of them: they are information floating around in the processors of a computer.  They are the imagination of a computer that is being told to you through a monitor and speakers.

Computers are often thought of as mechanical brains, and it's not too much of a stretch.  The major issue is that they can't really be considered to be alive.  They are brains which work with what we input in the form of keyboard inputs or software downloads.  Then those brains start thinking real hard about that information and show us some what what they're thinking about.  And then we kind of converse with them by pressing keys or clicking the mouse.

In other words, a video game is a bunch of information and rules you feed to your computer and when you play you're just talking to the computer about what's happening with the player character and the computer is telling you what the result of that would be based on the information it knows.

"And then Mario goes down the pipe!  What an interesting point you make, computer!"

So let's return to our thought experiment about the simulation of an entire universe within a impossible computer.  Is it real enough that deleting a digital person within it is murder?


You might want to consider that, if it is, then if a person were to imagine the entire universe at once, forgetting a person would also be murder.  Stopping their imagination process would also be murder.  Their death would be the end of an entire universe.

We trusted you with the universe, dude.

So what do I believe?  I need answers.  You're hurting my brain.


None of that can really say whether or not a perfect simulation of the universe would contain life important enough to distinguish as living.  My list about life above even only used dictionary definitions and hardly answered in a concrete way how to distinguish if anything is life.  For those you'd have to turn to philosophy, and that can say a lot but will never provide any concrete answers.


Thanks for nothing, Socrates.

Want to help me keep making free games?  Try checking out my art shop and buying some cool merchandise with my characters and designs on it.  It helps me stay alive long enough to make stuff!

No comments:

Post a Comment