View unanswered posts | View active topics It is currently Thu Dec 26, 2024 4:20 pm



Reply to topic  [ 15 posts ] 
 Context Free Art 
Author Message
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Context Free Art
I know some of you like coding.
I know some of you like art.
I've just rediscovered this gem of a program and thought I'd share.

http://www.contextfreeart.org/

Basically, you code pictures with some simple rules, like the ones at the bottom of this post and make pictures that way. Recently some cool stuff has been added like the ability to code primitives and grids and whatnot, but whatever. The cool thing is that it's all based on chance, so one set of rules can produce a huge number of variations (which you can also share w/ the alphanumeric seed)

Here's an example output (ALI variation of below, I think):
Image

Reading through the code should be self explanatory to anyone who's done programming before, otherwise see http://www.contextfreeart.org/mediawiki ... CFDG_HOWTO

Code:
startshape C
background {b -0.9}
rule C { A {b 0.2}}
rule A {//base
   Z {}
   A {y 1 hue 1} //spin the hue for coloured lights
}
rule A {
   Z {}
   A {y 1 hue -1}
}
rule A { //LIGHT
   SQUARE {s 0.5 b 1 hue 40 sat 1 z 0.1}
   Z {}
   A {y 1}
}
rule A 0.1 {//levels
   A {z -2 b -0.2}
}
rule A 0.1 {
   A {z 2 b 0.2}
}
rule A 0.5 {//rotation
   A {r 90}
}
rule A 0.5 {
   A {r -90}
}
rule A 0.01 {//fork
   A {r -90}
   A {r 90}
}
rule A 0.5 { //medium "room"
   B {x -2 z -0.1}
   B {x -1 z -0.1}
   B {x 1 z -0.1}
   B {x 2 z -0.1}
   A {}
}
rule A { //small "room"
   B {x -1 z -0.1}
   B {x 1 z -0.1}
   A {}
}
rule B {
   Z {}
   B {y 1}
}
rule B 0.5 {}
rule A 0.01 {}
rule Z {
   SQUARE {}
   SQUARE {s 1.1 z -0.5 b 0.1}
   SQUARE {s 1.3 z -1 b -0.4}
   SQUARE {s 1.5 z -100 b -1}
}


It'd be cool to see what you guys do with this. I used to use them for inspiration for drawings.


Mon Sep 20, 2010 11:07 am
Profile WWW
Moderator Hero

Joined: Sun Dec 24, 2006 11:28 pm
Posts: 868
Location: London Server
Reply with quote
Post Re: Context Free Art
Really off topic, but if someone could use that to make a base in CC I would buy them a pint. (All legal restrictions apply)


Mon Sep 20, 2010 11:36 am
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Re: Context Free Art
That's very likely what I was getting around to. Problem is you'd have to use the algorithm to spit out bunkermodule code, not squares. If someone wants to write a converter, though, I can write a mapgen (maybe)


Mon Sep 20, 2010 9:11 pm
Profile WWW
User avatar

Joined: Mon Jun 15, 2009 4:02 pm
Posts: 905
Reply with quote
Post Re: Context Free Art
Rather than writing a converter, I would have thought it'd be easier to make your own tile-based random walk map gen and then use a bitwise tile map to get the bunker modules to place.


Last edited by Petethegoat on Mon Sep 20, 2010 9:23 pm, edited 1 time in total.



Mon Sep 20, 2010 9:18 pm
Profile WWW
Data Realms Elite
Data Realms Elite
User avatar

Joined: Sun Nov 01, 2009 3:00 pm
Posts: 4144
Location: Hell.
Reply with quote
Post Re: Context Free Art
I don't recognize that coding type, the one im used to is sort a like this
Code:
tile
      grass
             icon

Probably on my side though.


Mon Sep 20, 2010 9:20 pm
Profile WWW
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Re: Context Free Art
caekdaemon wrote:
I don't recognize that coding type
The language is native to the program.

Petethegoat wrote:
Rather than writing a converter, I would have thought it'd be easier to make your own tile-based random walk map gen and then use a bitwise tile map to get the bunker modules to place.
Indeed, but considering how flexible CF is it'd be easy to write different rules for different layouts, and even get terrain generation happening at the same time.


Mon Sep 20, 2010 9:30 pm
Profile WWW
User avatar

Joined: Mon Jun 15, 2009 4:02 pm
Posts: 905
Reply with quote
Post Re: Context Free Art
That is true. You mentioned in the OP that you can have it do grids?
Time to do some experimentation with this, I think.


Mon Sep 20, 2010 9:38 pm
Profile WWW
User avatar

Joined: Fri Oct 17, 2008 9:46 pm
Posts: 5212
Location: The Grills Locker.
Reply with quote
Post Re: Context Free Art
Well I have to say this is awesome. I never though I would be so happily spending hours of my life creating images with mathematical formulae. Plus, this program is almost criminously easy to learn to use.

On a sidenote, I think I've discovered the mathematical equivalent of creepy:
Image


Tue Sep 21, 2010 2:12 am
Profile WWW
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Reply with quote
Post Re: Context Free Art
How do you do that?



I am quite thoroughly impressed.


Tue Sep 21, 2010 2:17 am
Profile WWW
User avatar

Joined: Fri Oct 17, 2008 9:46 pm
Posts: 5212
Location: The Grills Locker.
Reply with quote
Post Re: Context Free Art
Basically, reducing cartoony faces to simple shapes (almost everything is a circle) and telling the program to place them in a semi-random disposition over an offset.
The cool part is that it's purely vectorial, so I can get it in any size I want.






Image
See?



EDIT: Oh, and I can post the code if you want. Made it this afternoon.


Tue Sep 21, 2010 2:22 am
Profile WWW
User avatar

Joined: Thu Feb 12, 2009 1:47 am
Posts: 1182
Reply with quote
Post Re: Context Free Art
Please do.


Tue Sep 21, 2010 3:07 am
Profile
User avatar

Joined: Fri Oct 17, 2008 9:46 pm
Posts: 5212
Location: The Grills Locker.
Reply with quote
Post Re: Context Free Art
Here it is. Just copypaste it into the console. But you probably already know that.


Attachments:
FacesOfEvil.txt [12.52 KiB]
Downloaded 231 times
Tue Sep 21, 2010 3:15 am
Profile WWW
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Context Free Art
Wow, for whatever reason I am spectacularly failing to accomplish anything worthwhile with this program

the online documentation (or lack thereof) doesn't help much


Tue Sep 21, 2010 4:22 am
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Re: Context Free Art
The Gallery is the best place to find examples of code, paul.

Areku, that's cool. Something about a million creepy faces is fun.


Tue Sep 21, 2010 5:38 am
Profile WWW
User avatar

Joined: Fri Oct 17, 2008 9:46 pm
Posts: 5212
Location: The Grills Locker.
Reply with quote
Post Re: Context Free Art
Grif wrote:
the online documentation (or lack thereof) doesn't help much


Just check the Shape Adjustments page. Quick reference without all that clutter from the rest of the site.


Tue Sep 21, 2010 2:41 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 15 posts ] 

Who is online

Users browsing this forum: No registered users


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 © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.039s | 16 Queries | GZIP : Off ]