Skip to content
Shop

CommunityJoin Our PatreonDonate

Sponsored Ads

Sponsored Ads

Mission 13

Your mission, should you choose to accept:

Mission #13 - Live Game Character

Live Game Character

Make a 3D video game character that has all 5 senses and two others.

Problem Statement:

AI is taking over, but to make it really useful, we have to bring it into the real world. We need an AI that has all of the senses and can react to users in real time.

Your Mission, should you choose to accept:

  • Build a real character
python
from character import Senses

class See():
    pass
class Hear():
    pass
class Smell():
    pass
class Touch():
    pass
class Taste():
    pass

Senses System

think the best AI system is one that simulates our own intelligence in real life. All humans have 5 senses. Sight, Hearing, Smell, Taste, and Touch.

If you build a SENSES SYSTEM, then you can give whatever object you want a sense of Artificial Intelligence. You basically create some SENSE OBJECTS. I will give a brief demo:

TOUCH:

Touch is basically simulated using COLLISION detection. Giving an entity the ability to sense when it is colliding with something is simulating the sense of TOUCH.

SIGHT:

Sight also uses collision detection. Attach a CONE to the front of an object. This will be the FIELD OF VIEW. Anything that collides with the cone is SEEN! (The cone must not have physics. In other words, it shouldn't react to the collision). The width of the cone simulates how wide the object can SEE. The transparency of the cone would simulate how WELL the object can see (more transparent means worse sight). The LENGTH of the cone would simulate near or farsightedness.

HEARING:

Hearing uses a PROXIMITY system. The closer you get to an object that makes sound, the HIGHER THE VOLUME and PITCH of an object gets (Doppler effect). The Hearing() function basically turns up the volume of an object the closer you get. You could also use a SPHERE as your FIELD OF HEARING and make a proximity system based on how far an object is from the center of the sphere.

SMELL:

Smell uses a PARTICLE SYSTEM. Odors act more like particles. The smell system is just a sphere that can detect when a particle has entered it. If a particle has entered the sphere that particle system is SMELLED!

TASTE:

Taste is just a collision detection also. Works like the TOUCH system. But the taste object is just located near a mouth.

All these senses are FUNCTIONS:

Touch()
See()
Hear()
Smell()
Taste()

And all the things they can sense are entities/objects:

box
man
radio
particleSystemGas
meat

And when these senses get triggered, things happen:

Fall()
Wave()
Dance()
Frown()
RubTummy()

Take Care!

need some feedback on something I call a Senses System. Someone said that the way I am doing it is wrong, so I need some suggestions on how to do it right. This is how it works:

The senses system is a physics based system. Each sense is made up of basically one sensing object, one function, and two variables. All senses will eventually be part of a Senses Class.

SIGHT

Sight is just a collision test between a cone primitive that represents eyes. If there is a collision between the cone and an object, it makes a Boolean named seen equal to true. An arguent is used so that you can easily make something see whatever object you type in the parenthesis. The transparency of the cone represents the quality of sight. The wideness of the cone represents the field of view. The height scale of the cone represents nearsightedness or far farsightedness. The eyes variable is the cone primitive.

Here is some a pseudocode skeleton of sight.

function See(object)
{
seen = true;seeing = true;
if isCollisionBetween(eyes,object){}
if (seen){}
while (seeing){}
}

SMELL

Smell is a collision test also, represented by a sphere primitive, but instead of detecting collision with an object, it is a collision with a particle system. The amount of particles that go inside of the sphere represent the strength of the smell. The type name of the particle system determines the type of smell. The nose variable is the sphere primitive.

function Smell(object)
{
smelled = true;smelling = true;
if isCollisionBetween(nose,object){}
if (smelled){}
while (smelling){}
}

TOUCH

Touch is a collision test also. It requires no primitive shapes. The character or object itself detects the collision. It can be used for multiple game objects:

function Touch(object1,object2,object3)
{
touched = true;touching = true;
if isCollisionBetween(toucher,object1){}
if (touched){}
while (touching){}
}

HEARING I decided to make hearing work a little differently. Hearing is just a volume and distance test. It checks if the distance between the hearing object and the sound object. It also checks if the volume is above or bellow a certain value.

function Hear(object){
heard = true;
hearing = true;
if (heard && volume >= 30 && distance <= 3)
{}while (hearing){}
}

TASTE

Taste works just like touch, except it has a primitive shape that does the collision witih another game object.

function Taste(object)
{
tasted = true;tasting = true;
if isCollisionBetween(tongue,object){}
if (tasted){}
while (tasting){}
}

This systems is easy to implement in any language or game engine that has particle systems, collisions, and sounds. I was even able to implement it in the Little Big Planet game using their tag system. When there was a collision, it would display a speech bubble that said either "Seen, Heard, Touched" etc.

Update:

Okay, so this was so easy to implement. Only took about 3 lines of code:

if isCollisionBetween(eyes,box) then
setText(text, "I see a ".. readout)
else setText(text,"I see nothing")


function See(object)
	if isCollisionBetween(eyes,object) then
		readout = getName(object)
		setText(text, "I see a ".. readout)
	else setText(text,"I see nothing")
	end	
end

The above code is how the final function looks. And the way you use it is simple:

See(box)

Resources