Flocking and schooling

Forum for OctaneRender Lua scripting examples, discussion and support.
Post Reply
User avatar
haze
OctaneRender Team
Posts: 1003
Joined: Sun Feb 08, 2015 8:57 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
out.mp4
(542.03 KiB) Downloaded 13904 times
nodes.png
pegot
Licensed Customer
Posts: 934
Joined: Mon Nov 07, 2011 3:44 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?
Win 10
3.7Ghz i9 10900k / 64GB
ASUS STRIX Z490-E
PSU: PowerSpec 850Wd
RTX 3090 Asus Tuff

Network rendering:
Win 10
4.2Ghz i7 7700k / 64GB
AsRock SuperCarrier
PSU: EVGA 1200w
RTX 3080 Ti EVGA Hybrid
RTX 3080 ASUS Tuff
GTX 1080ti SC Black (wc)
prehabitat
Licensed Customer
Posts: 495
Joined: Fri Aug 16, 2013 10:30 am
Location: Victoria, Australia

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
User avatar
haze
OctaneRender Team
Posts: 1003
Joined: Sun Feb 08, 2015 8:57 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
prehabitat
Licensed Customer
Posts: 495
Joined: Fri Aug 16, 2013 10:30 am
Location: Victoria, Australia

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
User avatar
haze
OctaneRender Team
Posts: 1003
Joined: Sun Feb 08, 2015 8:57 pm

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.
Inverse404
Licensed Customer
Posts: 14
Joined: Wed Sep 10, 2014 4:05 pm

Such a function would be super awesome, can we try out your dev script node ?
User avatar
haze
OctaneRender Team
Posts: 1003
Joined: Sun Feb 08, 2015 8:57 pm

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 932 times
Post Reply

Return to “Lua Scripting”