Monday, October 11, 2010

Flowgraph Node Mastery

Flowgraph Node 1 - AIFollowSpeedStance
With some help from our tutor Jules, I was able to create a simple AI movement flowgraph for AI characters in Crysis by setting AI path points then linking them to the AI and a AISpeedStance node. Further research into the node allowed me to figure out what different numbers and stances used in the dialogue caused the AI character to perform.

Using the list of numbers found in the dialogue, I found they did the following:

0=Slow Walk
1=Walk
2=Jog
3=Sprint

Stances:
CombatAlerted
Combat
Relaxed
Prone
Stealth



I added in an AIIgnore node to the flowgraph and linked it to LocalPlayer so it was possible to use on characters that were naturally hostile to the player. Once I had mastered this node, I was able to create a multitude of characters in my level moving and reacting in different ways.

Using multiple AI paths, I have laid them out all throughout my structure in loops for each AI character present within the structure. All paths have been strategically laid out so that every section of the structure is passed through by the AI characters, triggering the panels overhead to appear. Each moving speed and stance of AI characters have been individually modified so that each characters movements are unique and all walk/run at different speeds.




Flowgraph Node 2 - ProximityTriggerOpacityChange

Further research into flowgraph nodes that affect the opacity of certain objects, I was able to use features taken from Jule's flowgraph on changing opacity of an object shown on http://benv2423-2010jc.blogspot.com/ along with the help of nodes taken from changing material glow using the ProximityTriggerChangeGlow flowgraph also shown on Jule's blog and alter it using changing values within opacity instead of glow.

With the use of proximity triggers, I was able to setup sections of my sketch installation in which the AI characters would enter and trigger the opacity of overhead panels. Using values ranging from 0-20 in the panel's opacity, I was able to link the panels to the flowgraph and proximity trigger causing them to appear whenever an AI character was present within the proximity triggers place below their section.

By using the values found within the proximity trigger properties, I have the options 'OnlyAI' ticked true while 'OnlyPlayer' ticked false. This made it so that only AI controlled characters present within the trigger area would cause the panels to appear in that section. As long as an AI character is present within that section, the panel would be visible.



Flowgraph Node 3 - AIExecute
I initially created an AIExecute flowgraph taken from http://wiki.crymod.com/index.php/Entity_Always_Facing_Player and tweaked it so, when attached to an AI character they would follow me like a squad mate. Then with the help of Jules, I was able to create my own flowgraph using the same properties but instead, added a AIExecute node which allowed me to customize the certain actions the AI characters would perform with a key press.

Adding an AIIgnore function linked to LocalPlayer entity was used for the flowgraph because it allowed me to attach the script to different models such as hostiles instead of friendlies to prevent them from attacking my player. Using the actions field within the AI:Execute node, this allowed me to customize many different actions for the AI character using a key press.



Video demonstration shows multiple actions being performed by AI using multiple sets of the same flowgraph nodes taken from my AI:Execute script. With the different sets, only key input and action within the ActionExecute node were modified which allowed different key presses to perform different actions.

In this case the keys listed did the following:

O = Yawn
L = Sitdown & Rest
K = Smoke

No comments:

Post a Comment