News Forums Sample Projects, How To’s, and Code Samples Wander, seek, move to and STAY there until condition

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

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #12687


    I need some help, please…

    My AI has two visual sensors, both looking for an aspect named ‘aspect': one long range, other close range. ‘aspect’ is an aspect of an entity, child of a random spawned object. This object don’t move and has a life time of a few seconds. Then another object is spawned somewhere near.

    Default behaviour of AI is wandering around a waypoint network until he detects an ‘aspect’ (this random spawned object just represents a meeting point. Could be a litle sphere or just invisible).

    When ‘aspect’ is detected by the long range sensor, AI runs to it and stops when close range sensor detects the ‘aspect’.

    AI stay there doing some animation facing the spawned object until it’s destroyed. Then the AI goes back to the waypoint routine until he spots another ‘aspect’…

    So, the desire of AI is to detect an ‘aspect’, get close, stop near, and stay there while aspect is within the close range sensor. If there’s no ‘aspect’ in range, he goes back to the waypoint route.

    That’s all I want to get my project on the trails. And I just can’t make it work :\

    I’ve read every single line of the documentation, watch every video, every post, it seems my BT logic is correct but when I press Play things just don’t work as I expect and I can’t debug it because it doesn’t seem logic. I’m very confused. I think it’s maybe I don’t understand the terminology… for example when you say, on the wiki “Aspect Variable - The name of a variable to put the detected Aspect into” - what’s the detected Aspect? What kind of variable is this, which type, what is ‘detected aspect’? Is it a boolean? a transform? an object?…

    Meanwhile I’ve implemented another AI solution and I get things working but I continue to believe RAIN is The Thing. I just want to get the click on my mind and be able to understand why AI behave so different from my own logic :\

    So, I’ll keep seeking for clues and if you feel this can be an useful example for someone else maybe you can make an example with a similar behaviour. That would be great!

    • This topic was modified 5 months, 3 weeks ago by  TRoNDaNeflin.


    Ok. I got thinks working, finally!

    Problems were:

    If we upgrade RAIN via menu, we can’t have any scene with RAIN components loaded or it will state ‘Updated’ but those components remain untouched. Create an empty scene, upgrade, then load your scene and everything should be ok.

    The entity mount point. If entity is ‘hidden’ inside or on the backside of the carrier object, AI will not see it. Entity should be literally visible to the AI.



    Great job working through this! Glad you got it figured out. That’s very interesting about “upgrading with an open scene”. I hope Jester and Sigil see this.

    The entity mount point can be seen by the AI if you have “requires Line of site” turned off. Correct?



    This was posted a while ago, but I have a question since I’m having trouble with the same thing (although it’s not an update issue here). I have practically the same setup as the OP here, except my issue is that once the inner sensor triggers, it never turns off, even when the object moves away out of the sensor’s range. I thought it might have something to do with two sensors looking for the same object, but it’s really weird. Even when the player (which the sensor is looking for) is way out of the range of both sensors, it still says that the aspect is not null.



    Are both sensors sharing the same form variable (or other)?

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.