Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: Polyominoes  (Read 2009 times)

Benitosimies

  • Bay Watcher
    • View Profile
Re: Polyominoes
« Reply #15 on: October 22, 2008, 06:49:05 pm »

The uh, implications that happened in my brain were that you can describe possible Dwarf Rooms as a function of x polyominoes that are given enumerated arrangements.

The arrangement enumeration could describe the type of symmetry you expect, or alternatively you could come up with asymmetrical arrangements and call them "Arrangement 1", "Arrangement 2", or give the arrangements descriptive names like "Starfish", "Octopus", "PaintedOars_Throne_Room", depending on what the room looks like.

And similarly you could map an n-omino to the natural number n, for all natural numbers.
(So a domino would be considered a 2, triomino would be considered a 3, tetromino would count as a 4...)
You also would number each type of k-omino from 0 to however many. Like this picture of Hexominoes: The stick piece would be Hexomino 0, that sticky r-looking piece would be Hexomino 1... and that last staircase-looking thing would be Hexomino 34.

So you could work out a theoretical parameterized function PolyominoRoom( PolyominoType, k-ominoNumber, ArrangementType )

And for example you could invoke (not in any particular programming language, but you would do it in real life using math)

PolyominoRoom ( Hexomino, 8, HorizontalSymmetry)

And that would come up with

Code: [Select]
[ ]......[ ]
[ ][ ][ ][ ]
[ ][ ][ ][ ]
[ ]......[ ]
where [ ] is a square designated to be dug.

So I'm having fun with some math that describes rooms as functions that deal with types.

What's more is that these pre-defined rooms can, with some fiddling, be put into functions that designate floors on an undug floor, which we can consider a 2D matrix if we're going to be doing math on it.

Too bad I don't have the linear algebra background to putz around with this more, but the basic idea is that you would have a FloorMake function.

FloorMake (PolyominoRoom, FloorArrangement)

And instead of arranging POLYOMINO into ROOM
It arranges ROOM into FLOOR

You might have to apply it twice or change things in the Floormake function if you want rooms *and* corridors. Whatever, play with the idea.

So if this sort of pseudocode is imported into Dwarf Fortress you could designate an entire floor with one button to be dug in a way that takes friggin hours if you do it by moving the cursor around with the arrow keys & arrows, and it is all dug the same way.

Most DF players seem to want their rooms lookin all crazy though so all of the above is irrelevant.
« Last Edit: October 22, 2008, 06:53:06 pm by Benitosimies »
Logged
Quote
Something really needs to be done about ice. At the moment it's like some kind of Pitch Black threat where everyone dies at sunset. Feel free to substitute that film reference with one without Vin Diesel.
--Skizelo

forsaken1111

  • Bay Watcher
    • View Profile
    • TTB Twitch
Re: Polyominoes
« Reply #16 on: October 23, 2008, 01:29:22 am »

Complicated stuff I didn't understand

-stare- ...Huh?
Logged

Frelock

  • Bay Watcher
  • Dabbling Philosopher
    • View Profile
Re: Polyominoes
« Reply #17 on: October 23, 2008, 02:03:55 am »

I think you've had a little too much math for one day...

But I sort of get what you're saying.  Still, while that would be interesting, it would be much easier to build a macro that digs tiles in a set pattern that the user defines, likely by designating the desired formation and then just having the comp repeat it over a set number of squares.  Mind you, you couldn't get all the fun stuff you could with Polyominos, but you could save your work.
Logged
All generalizations are false....including this one.
Pages: 1 [2]