• 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

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
Drunken Wrestlers 2

Drunken Wrestlers 2

Fighting

Drunken Wrestlers 2 is a funny physics-based multiplayer fighting game. Features include character customization and a powerful mod editor integrated...

The Amazing Crackpots Club!

The Amazing Crackpots Club!

Fighting

Face off against your classmates in a duel in the (secret) Amazing Crackpots Club! Use spells, potions and magical artifacts to destroy your opponents...

Fraymakers

Fraymakers

Fighting

Fraymakers is a fully modular, full-featured platform fighter featuring a crossover main cast from indie classics including BIT.TRIP, Downwell, Rivals...

Super Powered Battle Friends

Super Powered Battle Friends

Fighting

Super Powered Battle Friends is a platform fighter. Featuring incredible Local Multiplayer and Online Multiplayer modes and the gameplay depth for intense...

Grow Fighter

Grow Fighter

Fighting

Grow Fighter is a brawl game, it also includes a story campaign which will include lots of characters.

Drunkn Bar Fight

Drunkn Bar Fight

Fighting

The more you drink, the stronger you feel. And you are going to need it because you will need to fight everyone at the bar.

X