Koch's snowflake

Designed a level that creates new, exciting, and challenging Armagetron game play? Or maybe just something funky. Put it right here.
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Koch's snowflake

Post by wrtlprnft »

I made some maps (using a script) in the form of Koch snowflakes (if you can read german you wanna read the German article, which is much more detailed).

I just made them for fun and because they look nice, but don't have any real use for them, so feel free to turn them into fortress maps or shooting or whatever. These maps are pretty wallhugging-safe, too. Oh, and the 6th iteration even beats my tronsector map in size (and is probably unusuable for all practical purposes).
Last edited by wrtlprnft on Fri Sep 29, 2006 8:43 am, edited 1 time in total.
There's no place like ::1
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

Fun. What does the 6th iteration do to your framerate?
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

This. The 5th is better, but still kinda low, I figure the 4th might be the most useful one.
There's no place like ::1
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6711
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

I remember investigating this thing for a math project last year :D.

Visually, that's some funky looking stuff :D.
Image
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

Ouch.

I'm now also trying to do something with Koch snowflakes. We'll see whether I'll actually finish it. It's in concept stage at the moment.
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6711
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

We had to come up with formulas to calculate the number of sides, length of each side, etc. I wrote a php for it in the end :).
Image
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

Note the “stats” comments in the maps, though i'm not 100% sure they're all correct (especially the area).
There's no place like ::1
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6711
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

Here are the phps I came up with after having some of the formulas.

http://electricpotential.net/koch/

3 is the final version. Add ?stage=x where 0 <= x <= 6. Going much higher than that eats too much cpu as it starts getting super complicated. It was hard enough to get it to draw that. I essentially made a class representing a side and... I don't even remember now, but it wasn't easy.
Image
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

Looks nice :)
Anyways, modified my script a bit to create SVGs and uploaded them to the Wikimedia Commons (only the last 8 are mine) :)
There's no place like ::1
User avatar
kyle
Reverse Outside Corner Grinder
Posts: 1876
Joined: Thu Jun 08, 2006 3:33 pm
Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
Contact:

Post by kyle »

Smowflake 1 i made a while ago
but all of them past snowflake 0 look great
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

Tank Program wrote:Here are the phps I came up with after having some of the formulas.

http://electricpotential.net/koch/

3 is the final version. Add ?stage=x where 0 <= x <= 6. Going much higher than that eats too much cpu as it starts getting super complicated. It was hard enough to get it to draw that. I essentially made a class representing a side and... I don't even remember now, but it wasn't easy.
Classes representing sides? Seems like you're making it harder than it is. I have my own working generator in C using only integer math (easy to transform in the callback), and there's hardly 10 lines of actual code per type (guaranteed inside or guaranteed outside polygon). Still more redundant than it could be.
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6711
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

It's because I had trouble getting it to do the angles right... It looked very impressive handing in 3 pages of syntax highlighted source with my math report though :).
Image
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

Mine draws on a grid like this:

Code: Select all

• • • • • • •
     / \
•---• • •---•
 \         /
• • • • • • •
 /         \
•---• • •---•
     \ /
• • • • • • •
I have a direction table (to 'turn' I just change the index) and a bit of recursive code working on a single point (shared by passing a pointer). There's nearly identical code that calculates the outside. Again, it's easy to fix the aspect ratio afterwards. It should be made √3 times as high.

It doesn't calculate the perimeter or anything, but you don't need plotting code for that. Maybe I'll add it sometime. First I'll be working on a little experiment.

I did it without syntax coloring. :P
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

Anyways, getting bored of koch and made some maps representing Sierpiński curves. 1 to 3 might be used for 4 or 12 team fortress (or 44 team, though that would be weird), all above eat way too much framerate to be useful, and 0 is rather boring.
As a waste product there's some random crap that resulted of a programming error but looked cool and something similar to the koch curve, but with squares instead of triangles.
Hope some fortress guy turns them into maps for CTWF :)
There's no place like ::1
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

We're overloading the server that draws all those maps. :)

The Sierpiński curves could make for some interesting mass-team games. Just make sure teams are spread evenly.

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
...
This is a Sierpiński curve
Post Reply