Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Dwarf Circle Making guide  (Read 5761 times)

Crossroads Inc.

  • Bay Watcher
  • Joined in the great Migration of 2009
    • View Profile
Dwarf Circle Making guide
« on: November 11, 2010, 11:33:39 pm »

OK I've spent the last thirty minutes looking for ONE picture in the past threads.... Months ago someone posted a "how to" pic of making circles in DF. everything from circles 5 across to 30 across and I had used it but simply can't find it anywhere! Anyone else remember this?
Logged
Ask not what the Dwarfs can do for you...
But ask.... why are they drunk all the time?

Toastergargletop

  • Bay Watcher
    • View Profile
Re: Dwarf Circle Making guide
« Reply #1 on: November 11, 2010, 11:46:41 pm »

just design your stuff in paint.  turn on the grid and zoom right in.
Logged

NecroRebel

  • Bay Watcher
    • View Profile
Re: Dwarf Circle Making guide
« Reply #2 on: November 11, 2010, 11:58:42 pm »

I also happened to find the actual picture in another thread, though not the original.

The pic is copied in the spoiler.

Spoiler (click to show/hide)
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

languard

  • Bay Watcher
  • Meep
    • View Profile
Re: Dwarf Circle Making guide
« Reply #3 on: November 12, 2010, 12:33:40 am »

compass + graph paper works as well.
Logged
He's now moping around, doing Armok knows what. As far as I can tell he's just going to stay there, in the party room. Forever.
Given our relationship thus far, I can genuinely say the party has just begun for me. - Captain Mayday,

Lawec

  • Bay Watcher
  • Dabbling Goblinslayer
    • View Profile
Re: Dwarf Circle Making guide
« Reply #4 on: November 12, 2010, 02:26:13 am »

just design your stuff in paint.  turn on the grid and zoom right in.

This.

Also, colour code for furniture and stuff and you can easily design a fort in paint.
Logged
In order to improve the universe's frame rate, we must all throw rocks into volcanoes and then do absolutely nothing, worldwide, for a week, to take pressure off pathfinding.

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: Dwarf Circle Making guide
« Reply #5 on: November 12, 2010, 01:41:05 pm »

I wrote a quick Perl program to designate my spherical dome correctly. It has radius 20, for a different radius change $r. Non-integer values of $r may look better for circles, but I use whole numbers for spheres.

Code: [Select]
#!/usr/bin/perl


use Tk;

$Z = 0;

################### EDIT RADIUS HERE ##########################
$r = 20;
###############################################################

$R = int(2*$r) - int(int(2*$r)-$r);
$mw = tkinit();
$cv = $mw->Canvas(-width => (2*$R+1)*16, -height => (2*$R+1)*16)->pack();
for my $y (0..2*$R) {
for my $x (0..2*$R) {
$cv->create("rectangle",
$x*16, $y*16,
($x+1)*16, ($y+1)*16,
-fill => "white",
-tags => ["t $y $x"]);
}
}
$cv->create("text", 0, 0,
-anchor => "nw",
-text => "Level 0",
-font => "Helvetica 24",
-fill => "yellow",
-tags => ["text"]);

$mw->bind("<less>", sub {$Z++; upd()});
$mw->bind("<greater>", sub {$Z--; upd()});
$mw->bind("<space>", \&upd);
$mw->bind("<Escape>", sub {exit});
upd();
MainLoop;

sub upd {
$cv->itemconfigure("text", -text => "Level $Z");
for my $y (0..2*$R) {
for my $x (0..2*$R) {
$col = (($x-$R)**2 + ($y-$R)**2 + $Z*$Z < $r*$r) ? "white" :
(($x-$R)**2 + ($y-$R)**2 + ($Z-1)*($Z-1) < $r*$r) ? "#5f5f5f" : "black";
$cv->itemconfigure("t $y $x", -fill => $col);
}
}
}
Logged

Crossroads Inc.

  • Bay Watcher
  • Joined in the great Migration of 2009
    • View Profile
Re: Dwarf Circle Making guide
« Reply #6 on: November 12, 2010, 03:11:00 pm »

Any way to get that program to work for a Mac?
I don't know the first things about Pearl.
Logged
Ask not what the Dwarfs can do for you...
But ask.... why are they drunk all the time?

Huggles

  • Escaped Lunatic
    • View Profile
Re: Dwarf Circle Making guide
« Reply #7 on: November 13, 2010, 08:02:57 am »

You can throw in a bit of maths to calculate the position of the edge of the circle in-situ (with a little bit of patience and understanding of how you describe a graph). Apologies for anyone allergic to algebra.

The following equation describes a circle in the x-y plane of radius 'r' around the origin:

x^2 + y^2 = r^2

If you want a circle that's (say) 25 squares in diameter (so r = 25/2 = 12.5 rounded down to 12; this gives you 1 square in the middle of the diameter and 12 squares in a line either side, giving 25 in total), start by defining the square at the centre of your circle; this is the point 'x=0, y=0' or '(0,0)'

Rearranging the equation:

y = SQRT(r^2 - x^2)


Follow me through this:

At the point x=0, y = SQRT((12)^2 - 0) = 12

So the edge of the circle is 12 squares up and 12 squares down from (0,0)

At the point x=1 or x=(-1), y = SQRT((12)^2 - (1)^2) = +/-11.9582... -> round up to 12

So the edge of the circle is also 12 squares up and 12 squares down from both (-1,0) and (1,0)

At x=+/-2, y = SQRT((12)^2 - (2)^2) = +/-11.8322... -> round up to 12.

So the edge of the circle is again 12 squares up and 12 squares down from both (-2,0) and (2,0)

At x=+/-3, y = SQRT((12)^2 - (3)^2) = +/-11.6190... -> round up to 12

So the edge of the circle is yet again 12 squares up and 12 squares down from both (-3,0) and (3,0)

At x=+/-4, y = SQRT((12)^2 - (4)^2) = +/-11.3137... -> round down to 11

So the edge of the circle is 11 squares up and 11 squares down from both (-4,0) and (4,0)

etc, up to x=+/-12 where y=0


Essentially you're calculating the length of one of the sides of a right-angled triangle from knowing the length of the hypotenuse and one of the other sides.  You might find using paint or other similar programs faster if you're not so confident with the maths but it might be useful otherwise, especially if you have a scientific calculator to hand  :P
Logged

Crossroads Inc.

  • Bay Watcher
  • Joined in the great Migration of 2009
    • View Profile
Re: Dwarf Circle Making guide
« Reply #8 on: November 13, 2010, 02:22:04 pm »

<brain melts> Math MATH! <runs screaming>

I guess I'll have to do it out the slow way, lots of counting and trial and error.  The city I am planning will have LOTS of circles, bot it shouldn't be too bad as I just have redo on variety several times.

I am planning on 4 large circles connected by circular paths in a sort of wheel shape with living areas lining the corridors and workshops in the middle.
Logged
Ask not what the Dwarfs can do for you...
But ask.... why are they drunk all the time?

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: Dwarf Circle Making guide
« Reply #9 on: November 14, 2010, 06:34:37 am »

Any way to get that program to work for a Mac?
I don't know the first things about Perl.

Save this thing as a plain-text .pl file with a no-format text file editor (TextEdit on Mac, disable RTF) and run it on a terminal (Applications -> Utilities):
Code: [Select]
$ perl sphere.plPerl should be installed by default on all systems other than Windows.
BTW: The $ is the command prompt, don't type it.
Logged