News Forums RAIN Sample Projects, How To, and Code Example XML Files OR A Tutorial For Wander, Eat, Attack, and Reset.

This topic contains 55 replies, has 4 voices, and was last updated by  Sigil 4 months, 4 weeks ago.

Viewing 11 posts - 46 through 56 (of 56 total)
  • Author
    Posts
  • #39268

    Sigil
    Keymaster

    No, you are fine, feel free to add more game logic. The only reason I had us revert the code and step back, is because you had anomalies that you were trying to account for, but the anomalies shouldn’t have been there at all. Accounting for problems that shouldn’t be there just leads to more problems later on.

    You have two prime places to add game logic, the custom action for eating (maybe this heals the zombies, or empowers them, or …), and the custom action for attacking (obvious one). I’ll leave the game logic to you though.

    Let’s fix the double attack, my guess is that the facing call is causing problems. To figure it out though, get the game into the state where he stops chasing you after an attack. Before you move out of distance open up the behavior tree editor, select the zombie, and make sure the drop down is on “Current AI”. It should be color coded and indicate where the AI currently is stuck (yellow indicates running). Send a screen shot along.

    After you send that, what other behavior would you like to see? I’ll work with you to put that together.

    #39269

    Sigil
    Keymaster

    I may go through here and clean house in a moment, so only relevant posts are here, since the conversation is long.

    #39274

    Mad_Mark
    Participant

    Yeah, there’s a lot of jabber in the thread.
    So what would be the best method, code or BT node, for selecting from 4 attack animations?
    - Attack1 = Swiping hands
    - Attack2 = Double hand slapping
    - Attack3 = Grab & Scratch
    - Attack4 = Grab & Bite
    All are melee (zombies don’t use guns) and require close proximity to the player to not look silly.

    Mark

    #39287

    Sigil
    Keymaster

    Sorry, coming back around to this.

    I usually try to keep my behavior trees simple, so I would recommend putting this all in the AttackTarget custom action. You could merge the trigger into the custom action, and add the logic to either choose a random attack, or something similar.

    I’ll come back around with a custom action with this modification. Just a bit busy right now.

    #39312

    Mad_Mark
    Participant

    Still busy?

    Cheers!
    Mark

    #39319

    Sigil
    Keymaster

    Yes unfortunately. I think I need to let this one go actually, it’s gotten fairly large and at some point I need to move on.

    I am planning on taking everything in here and adding it to the starter kit though, I just need to go find a model and some animations that match. I will attempt to add more of the behavior we talked about before as well.

    We’ve been needing a good example of mecanim anyhow.

    Give it a go on your own for awhile, and come back with questions.

    #39545

    VRDevGirl1984
    Participant

    This was cool! Anyway you could upload the XML file???? I could use this for my zombie game i’m making.

    #39566

    Sigil
    Keymaster

    I never actually put together the tree for this, the pseudocode is pretty straightforward though so you can probably create the tree without too many issues (there are a lot of variables as this thread shows, so your mileage may vary).

    I may take some of this and rig up a character for our starter kit though, we’ve been needing a good mecanim example and this may be the one.

    #39796

    Mad_Mark
    Participant

    Hey Sigil or others,

    So progress is slow, I’m tackling one detection and reaction at a time in individual BT’s.
    I am stuck on the ConsumeFood function. I can now get the tEntityRig.Entity.IsActive = false, but Can’t seem to re-enable it after 30 seconds.

    I have tried setting up an AI on the cube I am using to be the food item, and have:

    SEQ (root) (repeat: forever)
       CON (repeat: never, Constraint: Entity.IsActive != true)
          SEQ (repeat: never)
             TIMER (Seconds: 30)
             EXPRESSION (Entity.IsActive == true, Returns: Success)

    Is this not right?
    Mark

    • This reply was modified 5 months, 3 weeks ago by  Mad_Mark.
    #39913

    EDarkness
    Participant

    This is a great thread. I’m curious, how to get wandering to work when using Unity’s NavMesh?

    #39914

    Sigil
    Keymaster

    That involves using a custom motor, there is one over here, and there will be one included in the starter kit when the next RAIN is released.

Viewing 11 posts - 46 through 56 (of 56 total)

You must be logged in to reply to this topic.