1 / 10

Mutant Monster Vortigaunt

Mutant Monster Vortigaunt. Ming Yang. Outline. Goal: Crazy monster: vortigaunt Custom NPC Sub-system of AI NPC vortigaunt Damage system Demo. Goal. To implement a crazy monster that attacks the player violently. To implement a custom NPC based on custom modeling. Challenges.

caden
Download Presentation

Mutant Monster Vortigaunt

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Mutant Monster Vortigaunt Ming Yang

  2. Outline • Goal: • Crazy monster: vortigaunt • Custom NPC • Sub-system of AI • NPC vortigaunt • Damage system • Demo

  3. Goal • To implement a crazy monster that attacks the player violently. • To implement a custom NPC based on custom modeling.

  4. Challenges • The AI and NPC systems are huge. • The functionalities are distributed in the class hierarchy tree. Some latent constraints are hard to find.

  5. Results • Convert the friendly ally monster vortigaunt into a crazy killer. • Create a custom NPC npc_cube based on Zach’s modeling (why it cannot think?)

  6. NPC vortigaunt • Capable of range attack and melee attack, a loyal friend of the player that attacks the player’s enemy and heal the player. • Set the player to be the enemy of vortigaunt is forbidden. • The damage of vortigaunt’s attack to the player will be filtered.

  7. Custom schedule • Detect the player and trigger the attack • Add modules in SelectSchedule(). • Implement 2 kinds of custom schedules: • SCHED_VORTIGAUNT_MELEE_ATTACK_PLAYER • SCHED_VORTIGAUNT_RANGE_DODGE

  8. Damage System • Class CTakeDamageInfo wraps the damage info including the attacker, damage, damage force, damage position et al. • Attacker generates CTakeDamageInfo objects and calls the victim’s TakeDamage() to send the damage and the victim responses it in OnTakeDamage().

  9. Damage filter • The damage sent to the player will be filtered in • CBasePlayer::TraceAttack • CBasePlayer::OnTakeDamage • CHL2_Player::PassesDamageFilter • CTeamplayRules will test if the attacker is teammate or ally. • g_pGameRules->FPlayerCanTakeDamage • CTeamplayRules::FPlayerCanTakeDamage

  10. Demo • Run run_mod.bat • Test the npc with console commands: • Npc_create npc_vortigaunt • Npc_create npc_cube

More Related