Announcement

Collapse
No announcement yet.

Monster AI freezes

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Monster AI freezes

    Hello, I really hate doing AI but I always get sucked into it. I've created a custom monster, using skeletel mesh instead of vertex (pretty sure this contributes to the issue). I've written a new controller that basically restricts attacks to melee only. Everything seemed to work fine until I changed over to the custom skeletal meshes. Now the monsters freeze up, usually when they are about to change an enemy. I've done a lot of state scouring and noticed they often bounce back between -roaming-ranged attack- and tactical move whilst stuck. But sometimes I have also seen them stuck in waitforanim.

    I think the vertex animations are interfering but I'm not exaclty sure how to stop the monster from attempting to play those. I've set an animation sequence for all of the animations that are in xpawn. Also when I imported my animations, the movement sequences played REEEALY slow, so their frame rate had to be adjusted (to 300) to play naturally. The attacks and idles did not require this. Not sure if that contributes.. If anyone has any thoughts I'd love to hear it. I can post my code if you need to see that too.

    thanks so much.

    #2
    I don't suppose youve rewritten to melee code and added animNotifies to your melee animations yet have you? I had a similar problems using a skeletal mesh and a custom pawn extended from monster. bShotAnim and bWaitForAnim were the variables I had to specifically set in my code to make the monster "work" (I modified the animend event and SetAnimAction. Also, keep in mind the animnotifies (functions) called in the monster class at certain points in the vertex model's animation.

    Comment


      #3
      Adding an anim notify for the melee attack would be useful only to get the damage to be dealt at the end of the hit animation right? Whats important for not getting stuck is knowing when the animation is over and that is automaticly sent?(even tho i tried calling animend at the frame before the last, but boy did that blow up the game).

      I disabled play victory this morning and now my AI is behaving pretty well. They do freeze up ocassionally and not move, but so far I haven't found them to totally freeze into a zero physics state (i was setting a timer before and moving them up in z, and well, they just kept going).

      I wasnt sure bShotAnim was necessary so i've just avoided having to call it, and I am leaving waitforanim true for now. I guess the key is to just not let it call any of those vertex sequences. I didn't realize it was calling play victory after every kill.

      thanks a lot for your help, MeowCat. I appreciate it.

      Comment


        #4
        Don't call animend from a animnotify, it will already be called automatically in your pawn class (provided it is not overirdden in your controller class), also animnotifies placed too close to the sequence end (or to each other) will definitely screw things up as you saw.

        Since it sounds like you have your own pawn class as well as controller, you may be able to avoid having to set bShotAnim true or false, but The WaitForAnim state in the base monster controller expects bShotAnim to be false in order to decide what to do next. So if you simply extended monster controller, that could be where the problem is.

        Comment


          #5
          Also, always look at the log, in ths case it would of said things like "unable to play anim victory" etc... then you go find where that is being called and overwrite it.

          Comment

          Working...
          X