User Tag List

Results 1 to 9 of 9

Thread: Flocking (no extensions) - opensource

  1. #1
    Clicker Fusion 2.5iOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    889
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Flocking (no extensions) - opensource

    Hi all,

    I was inspired by Andos' wonderful Flocking Extension (http://community.clickteam.com/showthread.php?t=66009&highlight=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 04:03 PM.

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

  3. #3
    Clicker Fusion 2.5iOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    889
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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,556
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The old flocking bird examples are on my website.

    Thanks for sharing SolarB.

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

  5. #5
    Clicker Fusion 2.5iOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    889
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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
    Clicker Fusion 2.5iOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    889
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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 05:10 PM.

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,035
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    PixelatedPict's Avatar
    Join Date
    Jul 2006
    Location
    Portland, OR
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  9. #9
    Clicker Fusion 2.5iOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    889
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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, 02:42 PM
  2. Flocking Example
    By ClickerGuy in forum File Archive
    Replies: 3
    Last Post: 24th August 2011, 02:28 PM
  3. Flocking example w/ eyesight
    By ClickerGuy in forum File Archive
    Replies: 0
    Last Post: 23rd August 2011, 11:28 PM
  4. Flocking Extension
    By Jeff in forum News
    Replies: 0
    Last Post: 23rd August 2011, 09:40 PM
  5. Flocking
    By Anders in forum Released Extensions
    Replies: 0
    Last Post: 23rd August 2011, 08: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
  •