Context Free Animator

If you have a design you're proud of, share the cfdg file here. It's also a good place to ask for feedback and collaborate.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
flembobs
Posts: 47
Joined: Tue Oct 09, 2012 3:00 pm

Context Free Animator

Post by flembobs »

I have made a program using Python 3 that creates animations from Context Free Art drawings.

http://www.goshdarngames.com/context-free-animator/

The repository can be found here - it includes some documentation:

https://github.com/flembobs/Context-Free-Animator

A gallery of animations I've made can be found here:

http://www.goshdarngames.com/context-fr ... r-gallery/

The program works by parsing a CFDA file that has some special mark-up and converting it into a CFDG file and then passing that to Context Free.

The output is a series of PNGs straight from Context Free. I combined them into animations using http://www.gifmaker.me/ and then converted those to HTML videos using http://www.gfycat.com/

You can combine the images using any animation software (e.g. GIMP) - I found it handy to use the online tools I mentioned.

I have tested it on Windows but it should (fingers crossed) work on linux/unix as well.

If you create an animation I'd be happy to include it in my gallery if you wish. Just reply here.

Any feedback is appreciated!

nik282000
Posts: 6
Joined: Sun Nov 10, 2013 8:35 pm

Re: Context Free Animator

Post by nik282000 »

Cool work, I took on a similar project today but went at it a completely different way.

After writing a CFGD that I liked I used Processing to generate the same code over and over while incrementing some of the variables.
Each iteration was saved to a new, numbered, CFDG file and a batch file was generated to render each of the CFDGs with the Context
Free Art command line interface. Once all the images were rendered I put them together with VirtualDub and Sony Vegas. It's really
ugly but lets me adjust any variable in the CFDG in any way (going to try some trig functions). I'll have to experiment with making
super high res videos, I tried to do an 8000x4500 animation but Sony Vegas kept running out of memory before it could fully render.

1080 Video: https://youtu.be/Eed1LVd5HXQ

flembobs
Posts: 47
Joined: Tue Oct 09, 2012 3:00 pm

Re: Context Free Animator

Post by flembobs »

Nice animation!

The technique you described isn't too different from how I did it. I just generated a temporary file for each frame and called Context Free using a python script instead of a batch file.

I've been wanting to put together a GUI for making the animations as well as implementing some more interesting rules for replacing text in the CFDGs. Maybe some day I'll have the time and determination!

Good luck with your project!

User avatar
MtnViewJohn
Site Admin
Posts: 875
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: Context Free Animator

Post by MtnViewJohn »

Two things:

1) If you can express your frame-to-frame changes using the frame() or ftime() functions then you can get Context Free to output all of the frames in one operation.

2) You can pipe a generated cfdg file directly into cfdg on standard input if you specify '-' as the input file.

nik282000
Posts: 6
Joined: Sun Nov 10, 2013 8:35 pm

Re: Context Free Animator

Post by nik282000 »

I'll have to mess around with piping directly into CFDG and save my self a step (and 7,000 files in the recycle bin).

Some more reasonable results form my tinkering, Thanks, John, for the tip about randomization, it let me make those curling up trees.
https://www.youtube.com/watch?v=dg9KisUu744

flembobs
Posts: 47
Joined: Tue Oct 09, 2012 3:00 pm

Re: Context Free Animator

Post by flembobs »

Hey I gave the FFmeg stuff another try. Put together this little animation:

https://twitter.com/GoshDarnGames/statu ... 6457335809

Here's the .cfdg for reference:

startshape WAVES[ h ( ftime()*360 ) ]//sat 1 b 1]

CF::Time = [time 0 1]

shape WAVES
{
loop i=480 [y -1]
{
ALPHA_WAVE ( i ) []
}
}


shape ALPHA_WAVE(natural n)
{
loop i=640 [x 1]
{
SQUARE[
h ((sine ( i ,1 , 0.25, 0 ) * 100) + ( sine ( n ,50 , 0.25, 0 ) ))
sat 1
b 1

]
}
}


sine(t,amp,freq,phase) = amp*sin((2*(22/7)*freq*t)+phase)

Post Reply