Pär wrote:I have made a working ammo-system now and I'm about to script an AI system. Is there any good ways to go about this?
I will also script some kind of a hitbox, I'm not sure how to do this as well.
/P
Hey Par! I have been waiting to share some ideas about the way my idea of a game engine would work, and I have thought of an AI system (at least how it would work).
I 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!
-TD