Metal Gear Solid Detection Code

Started by
2 comments, last by mhawkins 20 years ago
Would anyone have any idea how to do a metal Gear solid Style Detection Code. I know that the gaurds in that game scan an are and if there is something deemed threat worthy they will go towards it. Should i Flag items deemed threat worthy? And how would I get them to detect sound? If you know of any articles or know how to do this that would be helpful.....
Advertisement
The search patterns were scripted for each area (scripted in this case means that they always follow the same pattern/path, or script). If they saw you, they would attack (obviously).

I don''t know how they did sound, but I can guess that they don''t actually detect sound. They detect movement on flagged surfaces and they detect gunshots.

--------------------------------------
I am the master of stories.....
If only I could just write them down...
I am the master of ideas.....If only I could write them down...
For instance, in MGS: Twin Snakes, when you''re at the helipad if you get caught but run into the truck at the right time the guards will start a *very* scripted search. Four enemies will surround the truck and one will be say "move" and one other enemy will move forward and check under the truck, in the back of the truck, around the corner etc. with each check being followed by the point man saying "move." This is all shown by different camera angles and was completely scripted, no AI involved really. The effect was cool though

As far as hearing things I would imagine a sound being made sends out a "signal" or flag from it''s point in the map with a radius of "can you hear this from where you are" space. So if one of the guards is within the radius of hearing it just moves the guard into inspection mode. AFAIK the guards would follow the path that you make with footprints as well.

MindEngine Development
http://medev.sourceforge.net
This can be very complex or too simple, and there are many ways to do it.

Lets make a variable "visibility" with ranges 0.0-1.0

Aproximate enemy eyes with a view cone attached with his head.

the visibility is modified by sound and vision. So there are two visibilities.

For each frame
Empty visibilityV
Add these values in visibility var
PlayerMoving 0.6 + speed*K (this isnt correct, you have to work on it your self. It is only here to give idea)
Sneeking 0.3+ speed*K
Crouched 0.2
or others

Empty visibilityS
for sound add it
Surface matrial.K
Movement Speed.k
or others

Normailize visibiltyX ???
----------------
----------------
Evert frame
For viewing
If enemy is in range
If he is in my view cone
If ..cast ray from my eyes to his body == true
if (visibilityV is > thresholdV)
RunAction A

For hearing
If enemy is in hearing range
If sound is suspecius
if (visibilityS is > thresholdS)
RunAction A

Action A() = Set of investigation states
Investigate by facing in that direction.
Change state on what you see.
If you can see nothing move to that location.
Still nothing investigate by looking around that location.
Still Nothing? Go to (patrol/gaurd or other state)
Or if it is player change to aggrassive state

I never implemented such thing so it can be wrong. I made above algorithm after playing commandos game. Im not sure comandos works that way but it can achive almost same functionality.

[edited by - DirectxXx on April 14, 2004 11:48:41 AM]
3D Side-Scroller game demo Project-X2 "playable"Lashkar: A 3D Game & Simulation Project demo @ lashkar.berlios.de

This topic is closed to new replies.

Advertisement