How to make complicated movement patterns?

I’m currently trying to make a game where the random entities surrounding you will have different and complicated movement patterns, here are some of the examples.

avoid you
move around aimlessly
attack you when you get close but de-agro when you’re far away enough

I also want all of them to be able to stay in a general area unless you interfere.

another part of the game is that it’s in an ocean, so the movement also goes up and down.

I know it’s complicated, but if anyone could help I would appreciate it.

It’s barely started but here’s a link: https://flowlab.io/game/view/944959

Actually

You can use both RANDOM and FILTER tools,
just connect both of them.
(time)="new=(Random)=“in”=(Filter)= Then add whatever you want.
Example.
True = move 2 velocity
False = move -2 velocity.

Hope my comment helps you =3