Results 1 to 9 of 9

Thread: Flocking (no extensions) - opensource

  1. #1

    Flocking (no extensions) - opensource

    Hi all,

    I was inspired by Andos' wonderful Flocking Extension (http://community.clickteam.com/showt...light=flocking) and as an experiment I made a very basic flocking project to see if this could be done from within MMF itself, without the extension. It is pretty much entirely based on the pseudocode found here:

    http://www.vergenet.net/~conrad/boids/pseudocode.html


    Download it: Attachment 6635


    Features:

    - Separation
    - Alignment
    - Cohesion
    - Velocity Limit
    - Move to Target
    - Set Angle

    - ForEach version
    - Normal FastLoop version


    Basically it runs a bunch of nested loops:

    1. Set up positions for distance checks, set velocities
    --------2. Check each boid's distance away from every other boid (using positions stored in 1st loop)
    ----------------3. Add positions and velocities of neighboring boids in range to be averaged and set by Loop 1.


    Bugs:

    - Separation is wrong, boids bounce off each other rather than incrementally move away (stumped on this one!)
    - Sometimes one boid thinks it belongs between 0,0 and the center of the rest of the flock

    To do:

    - Ability to set:
    + Speed (min, max, idle)
    + Acceleration
    + Deceleration
    + All weights
    + More stuff


    Any contributions and bugfixes are most welcome! If I have gone about this entirely inefficiently (or have totally screwed something up) please let me know, it's my first time doing something like this. The ForEach version only gives me 5 more objects before the framerate drops drastically so any solutions to this would be fantastic.

    Hope this is useful/informative to someone and looking forward to any feedback.

    Thanks!
    Last edited by SolarB; 31st May 2012 at 03:03 PM.

  2. #2
    A long long time ago ( maybe during the MMF1.5 days i think ), i did see and download an impressive Flocking .mfa.
    There was basically a flock of birds moving along i think, and they were also able to avoid obstacles!

    Maybe the example is still around somewhere?
    How can i change username and display name?
    Cannon Ball Jack the game

  3. #3
    King_Cool, I would be really interested to see this. Any idea where it could be? Extensive searching on this site, TDC and google turned up nothing. Do you still have a copy?

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,465
    Blog Entries
    8
    The old flocking bird examples are on my website.

    Thanks for sharing SolarB.

    Marv
    ​432 MMF2 & CTF 2.5 Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  5. #5
    Ah, I see - the old example uses Andos's extension. The point here was to see if it was possible without it. Cheers

  6. #6
    UPDATE:

    v.0.0.2 - flockopensource2.mfa


    Additions and fixes:

    - Optimised (up to 70 boids possible before framerate drop)
    - Weighting
    - No more fastloop version, ForEach is out on pretty much every platform so yey!
    - limit velocity condition (max speed)

    Bugs:

    - Separation is wrong, boids bounce off each other rather than incrementally move away (better than last version but still not perfect)

    To Do:

    - currently averages are calculated for the whole flock rather than for members within a certain radius
    - Ability to set:
    + Speed (min, idle)
    + Acceleration
    + Deceleration
    Last edited by SolarB; 3rd June 2012 at 04:10 PM.

  7. #7
    Quote Originally Posted by SolarB View Post
    UPDATE:

    v.0.0.2 - flockopensource2.mfa


    Additions and fixes:

    - Optimised (up to 70 boids possible before framerate drop)
    - Weighting
    - No more fastloop version, ForEach is out on pretty much every platform so yey!
    - limit velocity condition (max speed)

    Bugs:

    - Separation is wrong, boids bounce off each other rather than incrementally move away (better than last version but still not perfect)

    To Do:

    - currently averages are calculated for the whole flock rather than for members within a certain radius
    - Ability to set:
    + Speed (min, idle)
    + Acceleration
    + Deceleration
    Really nice! it would be even better if you could specify the speed value!

  8. #8
    Very cool! Thanks for attempting this, and especially sharing it with everyone. I will check it out soon!


    PS - I (briefly) checked out the paper on boids, interesting read. Thanks.
    3DCoat|Modo|Colors!
    Need art for your game? I'm currently available for work.
    3D Modeler, Rigging TD, Animator for hire - Javis Jones
    Follow me on twitter!

  9. #9
    Thanks for the comments!


    UPDATE:

    v.0.0.25 - flockopensource2.mfa


    Additions and fixes:

    - Speed control


    NOTES:

    I probably won't do any more on this until I can work out a good way to put in acceleration and deceleration. Also if anyone has a good idea about how to implement average calculation for only neighbouring boids I would be glad to hear it! Currently all my experiments with this have either failed or are too CPU heavy...

Similar Threads

  1. Flocking (no extensions)
    By SolarB in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 31st May 2012, 01:42 PM
  2. Flocking Example
    By ClickerGuy in forum File Archive
    Replies: 3
    Last Post: 24th August 2011, 01:28 PM
  3. Flocking example w/ eyesight
    By ClickerGuy in forum File Archive
    Replies: 0
    Last Post: 23rd August 2011, 10:28 PM
  4. Flocking Extension
    By Jeff in forum News
    Replies: 0
    Last Post: 23rd August 2011, 08:40 PM
  5. Flocking
    By Anders in forum Released Extensions
    Replies: 0
    Last Post: 23rd August 2011, 07:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •