Boid boogie is a flocking simulation that uses Spotify's API and Spotify's Web Playback SDK to match the animations to your current playback.
Largly inspired by Kaleidosync by Zachary Winter. If you like this, you'll love his application.
Each point, or boid, has a limited perception by which it can see other boids.
It then adjusts its acceleration based on three steering behaviors.
- Separation: Push away from other boids.
- Cohesion: Pull towards the average position of all nearby boids.
- Alignment: Steer towards the average direction neighbors are traveling.
It's that easy!
To make things a little easier to process, a quad tree was used to store and query boids for neighbors.
Allows you to push the number of boids much higher.
As learned from Kaleidosync, querying Spotify's API for user's current playback to account for seeking, pausing, switching tracks can quickly reach rate limits.
A great way to fix this, implemented in Kaleidosync 2 was to utilize Spotify's Web Playback SDK, essentially turning your site into a device by which user's can play from.
This provides instant access to playback changes.
Here are two great endpoints used for this project.