Jump to content

Photo

Enemy AI (Ghost.zh)


  • Please log in to reply
3 replies to this topic

#1 OmegaX

OmegaX

    Leader of Omega GamingHunters101

  • Members
  • Real Name:Matthew
  • Location:Rochester, NY

Posted 21 May 2018 - 10:16 AM

Basically I'm asking on how to program AI into Enemies mainly with attack patterns and programming attacks themselves. Essential having the enemy do a certain attack on certain conditions like having cast healing spells the less hp they have, or summoning monsters depending on how much magic link has, just to name a few.


Edited by MegaX, 22 May 2018 - 06:52 PM.


#2 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 24 May 2018 - 04:26 AM

I made some AI stuff once upon a time. I never finished the pathing stuff needed to make some of it viable. In general, you start by giving an npc an IQ, and some skills. Make checks against IQ every frame to see how smart of a decision they will make, then make skill checks as appropriate.

From there, you have conditional action trees. (This is once place where function pointers would be quite helpful.)

You can keep an array of conditional actions as constants, and have the npc folow down a path based on whether he's making smart, stupid, or neutral decisions. Once you resolve the action to take, you return that constant value to a function to perform the action.

Ultimately, this means fully scripting npcs if you want them to be fully aware and under your control.
  • Evan20000 and OmegaX like this

#3 OmegaX

OmegaX

    Leader of Omega GamingHunters101

  • Members
  • Real Name:Matthew
  • Location:Rochester, NY

Posted 24 May 2018 - 06:20 AM

Now it's starting to make a lot more sense. Do you think you could give me an example or two?

#4 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 27 May 2018 - 08:00 AM

https://github.com/Z...PG_EnemyAI.zlib

https://github.com/Z...RPG_EnemyAI.txt

There's some stuff that might give you ideas. :shrug:


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users