Starting from:

$35

ASSIGNMENT – 1 FSM (Simple FSM + Factory Design with Randomness)

COMP 396 – GAME PROGRAMMING 2

ASSIGNMENT – 1 FSM (Simple FSM + Factory Design with Randomness) STATE TYPES • SOCIAL • NON-SOCIAL STATES (With Actions) • PATROL o Patrols the waypoints in a loop • SUSPICIOUS o Time Taken to confirm there is a threat (To mimic the real world) • INTERACT WITH NPC o Any social interaction with other NPCs o Can be predefined o Checks in predefined if not found in vicinity • INSPECT EQUIPMENT o Checks equipment for maintenance • REST o To mimic rest behaviour of human • HOWL o To alert other NPCs of threat of Point of Interest in vicinity (Like shout) • ALERT o Know that there is threat • SEARCH o Looks for last known position of player • ESCAPE o Runs away from player if weaker • WAIT o Waits for some time after running away from player • CHASE o Chases the player when in sight and out of attack range if stronger • ATTACK o Attacks the player when in sight and in attack range if stronger COMP 396 – GAME PROGRAMMING 2 PLABAN BISWAS 2 PATROL ATTACK CHASE SEARCH ESCAPE WAIT ALERT SUSPICIOUS Player in FOV? Player in FOV? Attributes better than Player? Random X Chance Player confirmed after Delay Ran away enough distance Return to patrol after waiting Within attack range and in FOV Outside attack range and in FOV Outside FOV Outside FOV Yes Yes Yes No No No HOWL Proceed after notifying other NPCs in range Notify other NPCs Receive notification from other NPCs INTERACT WITH NPC REST INSPECT EQUIPMENT Receive Social Interaction Invitation Send Social Interaction Invitation Player in FOV Player in FOV Player in FOV Random Z Chance Random Y Chance Fig - 1.1: Diagram depicting the States in State Machine COMP 396 – GAME PROGRAMMING 2 PLABAN BISWAS 3 FROM (CURRENT STATE) (UNDER) CONDITION TO STATE PATROL Random X Chance REST PATROL Random Y Chance INTERACT WITH NPC PATROL Random Z Chance INSPECT EQUIPMENT PATROL In FOV before Confirmation SUSPICIOUS REST Rest Timer PATROL REST In FOV before Confirmation SUSPICIOUS INTERACT WITH NPC Interaction Timer PATROL INTERACT WITH NPC In FOV before Confirmation SUSPICIOUS INTERACT WITH NPC On Notify INTERACT WITH NPC INSPECT EQUIPMENT Inspect Timer PATROL INSPECT EQUIPMENT In FOV before Confirmation SUSPICIOUS SUSPICIOUS In FOV and Confirmed HOWL HOWL In FOV and Confirmed ALERT ALERT In FOV and Confirmed and Vanished SEARCH ATTACK In FOV and Confirmed CHASE CHASE Not in FOV and Confirmed and Vanished SEARCH CHASE In FOV and Confirmed and in Attack Range ATTACK ATTACK In FOV and Confirmed and not in Attack Range CHASE ESCAPE Not in FOV and Confirmed and out in range WAIT WAIT In FOV and Confirmed ALERT Fig - 2.1: Table depicting the States in State Machine and transitions COMP 396 – GAME PROGRAMMING 2 PLABAN BISWAS 4 GIZMOS in Scene (Draw Spheres): • YELLOW: View Distance • RED: Attack Radius • GREEN: Escape Distance • CYAN: Howl Radius for Coward Enemy • MAGENTA: Howl Radius for Aggressive Enemy

More products