Flocking and schooling

Forums: Flocking and schooling
Forum for OctaneRender Lua scripting examples, discussion and support.

Flocking and schooling

Postby haze » Fri Dec 04, 2015 12:30 pm

haze Fri Dec 04, 2015 12:30 pm
In my off time I've written a script to simulate flocking in Octane. It does this by scattering a number of meshes and rotating them to face a certain direction, and applying the Boids rules to them repeatedly. The result is a realistic looking (and very configurable) school of fish, or flock of birds. You can generate the exact same sequence of movements over and over again without storing the translations/rotations - just by keeping the random seed value that you started with. In other words, for a convincing flock/school irrespective of size, it only takes around 32 bytes of storage.

You can make these fish do anything - you could tell them to collectively move over to a certain location, avoid a certain area, etc etc with minimal effort.

I've made a short movie clip of one such animation. I'd like to gauge interest - being a personal project, if there was enough interest I would spend more of my own time developing this into a configurable GUI and make it easier to use, then release it.
Attachments

[ Play Quicktime file ] out.mp4 [ 542.03 KiB | Viewed 9095 times ]

nodes.png
User avatar
haze
OctaneRender Team
OctaneRender Team
 
Posts: 795
Joined: Sun Feb 08, 2015 8:57 pm

Re: Flocking and schooling

Postby bepeg4d » Fri Dec 04, 2015 2:25 pm

bepeg4d Fri Dec 04, 2015 2:25 pm
Wow, very powerful :o
Count me in :)
ciao beppe
User avatar
bepeg4d
Octane Guru
Octane Guru
 
Posts: 6586
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Re: Flocking and schooling

Postby pegot » Sat Dec 05, 2015 2:14 am

pegot Sat Dec 05, 2015 2:14 am
This is really neat! I'm interested. Would this only be available in Standalone or could the script also work in the Blender plugin?
Windows 10
4.2Ghz i7 7700k / 64 GB
AsRock SuperCarrier
GTX 1080 ti SC Black (wc)
GTX 1080 ti SC2 Hybrid
GTX 780 6 GB
------
Hackintosh OS X 10.14.3 - NOT able to use with Octane :(
3.5 Ghz Intel i7-3770K / 32 GB
Gigabyte GA-Z77X-UP5
GTX 770 4 GB
pegot
Licensed Customer
Licensed Customer
 
Posts: 585
Joined: Mon Nov 07, 2011 3:44 am

Re: Flocking and schooling

Postby prehabitat » Sat Dec 05, 2015 2:15 am

prehabitat Sat Dec 05, 2015 2:15 am
This looks great!
Win10/3770/16gb/K600(display)/GTX780(Octane)/GTX590/372.70
Octane 3.x: GH Lands VARQ Rhino5 -Rhino.io- C4D R16 / Revit17
prehabitat
Licensed Customer
Licensed Customer
 
Posts: 495
Joined: Fri Aug 16, 2013 10:30 am
Location: Victoria, Australia

Re: Flocking and schooling

Postby haze » Sun Dec 06, 2015 11:36 pm

haze Sun Dec 06, 2015 11:36 pm
pegot wrote:This is really neat! I'm interested. Would this only be available in Standalone or could the script also work in the Blender plugin?


Theoretically it can, but I'm not sure that the plugin allows you to load a lua script for Octane itself to execute
User avatar
haze
OctaneRender Team
OctaneRender Team
 
Posts: 795
Joined: Sun Feb 08, 2015 8:57 pm

Re: Flocking and schooling

Postby prehabitat » Mon Dec 07, 2015 2:04 am

prehabitat Mon Dec 07, 2015 2:04 am
Actually reminds me of leaves/seed pods falling on a slight uplifting wind,

Can it be used with similar random movement but a plane (below) being the anchor? (Ie gravity)?

Or even better could chose two influencers; gravity and wind...
Win10/3770/16gb/K600(display)/GTX780(Octane)/GTX590/372.70
Octane 3.x: GH Lands VARQ Rhino5 -Rhino.io- C4D R16 / Revit17
prehabitat
Licensed Customer
Licensed Customer
 
Posts: 495
Joined: Fri Aug 16, 2013 10:30 am
Location: Victoria, Australia

Re: Flocking and schooling

Postby haze » Mon Dec 07, 2015 8:41 am

haze Mon Dec 07, 2015 8:41 am
Yes - it is very easy to do so. In fact, if I developed it further I would probably have a list of points or perhaps geometry to fly or swim around/away-from/towards etc.
User avatar
haze
OctaneRender Team
OctaneRender Team
 
Posts: 795
Joined: Sun Feb 08, 2015 8:57 pm

Re: Flocking and schooling

Postby Inverse404 » Tue May 31, 2016 2:56 pm

Inverse404 Tue May 31, 2016 2:56 pm
Such a function would be super awesome, can we try out your dev script node ?
Inverse404
Licensed Customer
Licensed Customer
 
Posts: 14
Joined: Wed Sep 10, 2014 4:05 pm

Re: Flocking and schooling

Postby haze » Wed Aug 24, 2016 12:13 am

haze Wed Aug 24, 2016 12:13 am
Here it is. Please remember it is really not a finished product.. You can currently only go forwards in time with the sim.
Attachments
boids.orbx
(1.65 MiB) Downloaded 314 times
User avatar
haze
OctaneRender Team
OctaneRender Team
 
Posts: 795
Joined: Sun Feb 08, 2015 8:57 pm

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 1 guest

Thu Sep 19, 2019 10:56 pm [ UTC ]