[behavior] rex_boids

  • Also, it would be great to use this plugin just as collision avoidance behavior only, without flocking.

  • lennaert

    Instances which would affect this boids behavior is picked by line of sight in my default plan. So the range and the radius could be assigned at runtime.

  • Sounds promising Rex

  • xoros

    In my understand, the logic of sprite would be separated into 2 levels.

    Bottom level is the moving behavior or other appearance behaviors, to set the position/angle/opacity/... of this sprite. This level would export some commands like turn left/turn right/accelerate/brake for top level.

    Top level is the controller, it would fire these commands by human input, or fire by logic (NPC/AI). This AI logic might be

    if ( some_conditions )
        fire_command[/code:29ox0whs]
    Boids and LJ potential would provide some values for condition checking, They would not set properties (position/angle) of this sprite directly.
    
    Back to "collision avoidance behavior", it might be another kind of moving behavior since it needs set the position directly to become "collision avoidance". So it would be another behavior.
    In above boids demo, sprite would try not too closed to the obstacles by some logic, but it might not "collision avoidance" for all cases without adjust any term of the controller logic.
  • lennaert

    Here is a snapshot of demo capx

    F.Call( "SetLOS", F.Param(0) , 100, 180)[/code:350a2r01] would set the range and cone of view to 100 pixels and 180 degrees. Then pick instances by LOS behavior. Do cohesion/alignment/separation in actions.
  • Interesting

    I am thinking this is for a single flock per object type, right ?

    If so, perhaps an idea to add some form of grouping per object/family ?

    for instance, 10 instances of object bird, 5 of them belong to flock group A, the other 5 in flock group B etc

    btw the demo requires touch wrap and drag vetctor

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • lennaert

    It might be grouped by additional picking conditions.

    I would add another more basic sample capx while released.

  • If grouping is applied, then this could work really well for strategy games troops movements.

    I would imagine in game:

    Selection rectangle selecting a set of units, click destination x,y, and off the group goes.

    Expanding on that idea, single line, delta, block etc ^_^

  • lennaert

    I am not sure how to combine pathfinding with boids behavior. I might think about that later.

  • xoros

    Uh, I understood. I would add action to apply steer force directly toward position or direction.

  • Great!

  • lennaert

    I am not sure how to combine pathfinding with boids behavior. I might think about that later.

    Cool.

    Perhaps they can play "follow the leader" Like, the closest to destination leads, and the rest flocks behind it.

  • Update

    Update demo.

    • Click to put feed (green box). Bird which found feed would try to eat it. ( action: Apply force toward position )
    • Bird would avoid purple box. ( action: Separation )
    • Bird would do flocking if it had not found any feed. ( action: Cohesion, action: Alignment, action; Separation )

    This behavior had almost done. I would write document later.

  • Slick there Rex

  • rexrainbow

    I am so glaad to se your work!!!!

    I am not sure how to combine pathfinding with boids behavior. I might think about that later.

    I was thinking this way:

    on selected (like in rts games, by bounding box) create invisible dummy sprite that boids follow and that dummy sprite moves by pathfinding... when he reaches the destination it gets destroyed and boids are on their own again.

    When i have boids in mind i usualy think of them as squad of soldiers in RTS

    One thing iw noticed is that if i click several times and boids bunch up they behave strange... like jittery movement and jumping positions from time to time.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)