Slick Forums

Discuss the Slick 2D Library
It is currently Wed Jun 19, 2013 8:45 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Feb 14, 2012 10:17 pm 
Offline

Joined: Sun Jun 03, 2007 2:51 am
Posts: 80
I'm looking to do a Milkdrop Style effect for the background of my game. It wouldn't need to be as complex or flashy as the video here, but this is the general idea.

I'd like for it to have swirling colors that are synched to: the music, the user's input, and the game events.

I can imagine how to tie all of those things into the engine once it's running, but I have absolutely no idea how to generate those sorts of effects. I don't need the crazy stuff, just pulsing colors that overlap and merge would be amazing.

Any suggestions? I'm glad to read whatever, pick up a book, etc. I just need to get pointed in the right direction.


Top
 Profile  
 
PostPosted: Tue Feb 14, 2012 10:52 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1477
An audio visualizer is no small task, and it would probably take longer to create than your entire game. You need to:
  • Analyze the incoming audio data. You can't use Slick's sound engine for this; so you'd need to extend or re-write it to handle the incoming audio data (would likely require a solid understanding of OpenAL and audio decoding). The least painful thing to do would be to analyze only a single streaming source (i.e. background music).
  • You would then use something like a FFT (fast Fourier transform) to analyze the incoming audio data
  • You would then transform shapes/images based on various mathematical functions that you describe

The flashy/pulsing effect would likely be created with 3D shapes, a lot of complicated mathematics, and various materials/lights/etc. Basically... Out of the question for Slick.

A simpler solution would be to use Slick's particle system to create some moving shapes, and change the way they are emitted based on the game's events and such. For syncing to music, you could simply store a text file describing the timings of various "key moments" in your streamed music (e.g. climax, breakdown). Then, you simply trigger a change in your particles/shapes/etc. if the music playback time passes one of these "key moments".

Making a particle system "flashy" will be up to you. You can try Slick's particle editor tool, or you could write some systems yourself that use some fancy physics (Processing has some tutorials that might help).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group