• Register

Reaction AI is an artificial intelligence engine to be used for game developers that have non-player characters governed by AI or other game components that rely on artificial intelligence for reactions based on actions by the avatar.

It can also be used for other systems that require learning systems and provides an intelligent output based on input. Reaction AI models the human brain and neural networks in its design. It learns over time and uses past events in a memory system to determine the next best reaction. However, it is pseudo-dynamic in the resulting output based on how well the “brain” is functioning at that time based on stimuli.

The “brain” is divided into four components, each sized proportionally to the human mind. This includes the Frontal Lobe which performs reasoning and emotion, the Parietal Lobe for movement, the Occipital Lobe for visuals, and the Temporal Lobe for memory. When the “brain” is created, the number of total neurons must be specified. This will generate an n-ary tree. At each time a new “brain” is created (i.e. for different NPCs), a different brain structure is created dynamically and pseudo-randomly. When stimuli is applied (i.e. an avatar action), Reaction AI will send a random set (within a range) of electrons to each component of the brain (also proportional to the size of the respective lobe) to activate a subset of the neurons.

The algorithm uses the active neurons to total neurons to determine the performance of the “brain” in each of the lobes for their respective purpose. Thus, a better functioning “brain” will yield more “intelligent” results. Each time stimuli is applied, the “brain” will function slightly better or worse due to the difference in the number of active neurons. This is done by ranking the results and using data based on whether it can map the avatar action with a calculated emotion and prior reaction data for what the NPC “thinks” is the best next action. If certain data fails to map, fallback mechanisms are performed which still are “intelligent”.

There is a memory system where historical data is stored. When a new memory is created, the successfulness of the most recent reaction is also mapped to that memory cell. The data includes what the avatar action was, what was the AI’s output for that action, and how successful it was. This data grows over time and the “search” starts from most recent memory to earlier in time memories. However, the “search” also goes as far back in memory as the number of active neurons at that time. The maximum size of the memory is the total number of neurons in the temporal lobe. When a new memory is created, and the maximum size is reached, the oldest memory is removed. When the “brain” is created, the memory is initialized with a user defined input (one time) for the NPC’s “personality”, which defines the allowed reactions, sub-reactions, and emotions.

The final output of the system is a reaction category, sub-reaction, emotion, visual rank (ranging from 1 -5 where 1 is the lowest rank and 5 is the highest), and a speed value (ranging from 1 – 4 where 1 is the slowest and 4 is the fastest). You can decide how to handle (how the NPC behaves) based on the output, and can cause a different reaction as well based on the values returned for emotion, visuals, and speed. The neural networks involve the structure of the “brain”, the stimuli that activate neurons, the memory, and the personality, being passed to different functions in different parts of the “brain” and results in final outputs. The fact that the system is varying each time a “brain” is created, the performance of the “brain” per stimulus, and what the allowed output values can be, allow Reaction AI to be reused any number of times with varying results. Thus, the same engine can be used for any number of different NPCs or AI based elements. The user defined “size” of the “brain” also introduces dynamics.

Finally, for extremely large “brain” sizes, and longer periods of learning, Reaction AI can be as complex accordingly.

Also, for NPC attacks (proactive actions instead of reaction to avatar action), use Avatar action states as idle=1, blocking=2, starting attack=3, etc)

Unity Asset Store

Assetstore.unity3d.com


Youtube demo video:


  • View media
  • View media
  • View media
  • View media
  • View media
  • View media
Post article Articles

No articles were found matching the criteria specified. We suggest you try the article list with no filter applied, to browse all available. Post article and help us achieve our mission of showcasing the best content from all developers. Join now to share your own content, we welcome creators and consumers alike and look forward to your comments.

Post comment Comments
fizzq Creator
fizzq - - 2 comments

There is also the playable demo included (which is shown in the video) with sample implementation.

The video is a demo of one sample type. The SDK is versatile enough to be used in many ways and types of combat, even with multiple bots. The included code is an example of implementation, but you are free to use it many ways and the AI will also still "React" for various scenarios.

Reply Good karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account:

You may also like
Child Arms

Child Arms

Fighting

A 2D arcade sword-fighting game, inspired by the likes of Punch-Out! and Crossed Swords, Child Arms puts you into a world where the majority are youth...

Zeq2 Xenoverse

Zeq2 Xenoverse

Fighting

This is first mod i going to update on....., Never get defeated by strongest player ever in whole unverise!, New information: This is Standalone new game...

Party Animals

Party Animals

Fighting

Fight your friends as puppies, kittens and other fuzzy creatures in PARTY ANIMALS! Paw it out with your friends remotely, or huddle together for chaotic...

Brutes.io

Brutes.io

Fighting

Welcome to the world of BRUTES.IO ~ The online multiplayer game of chaotic physics-based combat, brute evolution, crazy powerups and unlockable costumes...

Super Smash Flash 2

Super Smash Flash 2

Fighting

Super Smash Flash 2 Beta is an action-packed 2D rendition of the Super Smash Bros. series built by a team of passionate Nintendo fans. Duke it out with...

Fight Arena

Fight Arena

Fighting

Third-person multiplayer fighting game. Different types of Fights. Many types of melee weapons. Special abilities. Different types of fighting arenas...

X