Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Megaproject help.  (Read 1482 times)

Urist Imiknorris

  • Bay Watcher
  • In the flesh, on the phone and in your account...
    • View Profile
Megaproject help.
« on: January 05, 2011, 05:42:29 pm »

I am attempting something ambitious. Something I've tried before, but gave up almost immediately. I m going to build a fully-playable chess game in DF. I haven't worked out much of the mechanical workings yet, and I'm mostly doing this because I have little understanding of large-scale mechanics and computing, so this will be very fun to say the least.

Currently I am planning to use two grids of pumps to store the contents of each tile on the board. The first will be 8x8x7 pumps, and will control which piece is on each stack's respective square (0=nothing, 1=pawn, 2=rook, etc.). The second grid will be 8x8x3, and will control the color of the respective piece (nothing/white/black). I will also have a record of each captured piece.

The board will be a grid of 24x24 floors on the highest z-level of my map. Pieces will be represented by 20x10 grids of retracting bridges, one for white, one for black. From the board to the ground 100 z-levels below is what I have to work with. I will build a tower to support the board and contain the mechanical components. This tower will be as large as I can make it, 182x182x99 tiles in size. This is possibly the single largest structure anyone has built in the .31 version. Z-levels +1 and +2 will contain no mechanics, only lava.  Z-levels +3 and +4 will be taken up entirely by a massive water reactor, as will +6 and +7 if needed.

When the game is completed, one of two things will happen. If black wins, the map is flooded with lava. If white wins, my fort is flooded in lava. As far as I can tell, I will only be able to determine victory by the actual capture of a king, so this should be easy.

My issue is that I have no way of determining valid and invalid moves, or limiting movement selection (which will be done by a grid of levers) to only valid moves. Any help on this would be greatly appreciated, otherwise I'll spend all semester trying to find a way and neglect my classes (which is very bad).

One final note: I'm using the free-raw-material reactions in Shaostoul's guide on the wiki (because there's no way I could get enough white stone without them), and my dwarves will have [SPEED:0] until the goblins come around with their traditional greetings of "An ambush! Curse them!" or "Snatcher! Protect the children!" I figure these are acceptable, as they are not related to the main task of actually programming the game to play another game.
Logged
Quote from: LordSlowpoke
I don't know how it works. It does.
Quote from: Jim Groovester
YOU CANT NOT HAVE SUSPECTS IN A GAME OF MAFIA

ITS THE WHOLE POINT OF THE GAME
Quote from: Cheeetar
If Tiruin redirected the lynch, then this means that, and... the Illuminati! Of course!

FearfulJesuit

  • Bay Watcher
  • True neoliberalism has never been tried
    • View Profile
Re: Megaproject help.
« Reply #1 on: January 05, 2011, 05:49:53 pm »

Fricking awesome...unfortunately, I don't know how you'd do it.

Perhaps you should start with checkers. That'd probably be simpler.
Logged


@Footjob, you can microwave most grains I've tried pretty easily through the microwave, even if they aren't packaged for it.

Levi

  • Bay Watcher
  • Is a fish.
    • View Profile
Re: Megaproject help.
« Reply #2 on: January 05, 2011, 05:51:49 pm »

If completed, this might be the single most complex machine made in DF yet.

I wouldn't even know where to start, but it might be worth going though some chess programs source code to find out if there is a relatively easy way to test valid moves, and then figure out if you can extrapolate that to DF.
Logged
Avid Gamer | Goldfish Enthusiast | Canadian | Professional Layabout

Xenos

  • Bay Watcher
  • [DWARFINEER]
    • View Profile
Re: Megaproject help.
« Reply #3 on: January 05, 2011, 06:03:13 pm »

I am posting this idea here because it seems like this is the place that it would most likely be adopted.  Ahem. Build a graphing calculator in dwarf fortress.
Logged
This is a useful feature..and this is DF.. so im gonna assume its bugged
That's what cages and minecart shotguns are for!  We don't need to control them.  We just need to aim them.
[DWARFINEERING]

Makigall

  • Bay Watcher
    • View Profile
Re: Megaproject help.
« Reply #4 on: January 05, 2011, 06:49:09 pm »

Probably an easier chess problem to program is a Knight's Tour, its challenging to write a chess program that protects against illegal moves and tests for checkmate.  But a knight's tour you could probably program and have it run off of a single lever pull.  The other option is to assume that the players know what they're doing and follow the rules.

http://en.wikipedia.org/wiki/Knight%27s_tour
Logged

Zrk2

  • Bay Watcher
  • Emperor of the Damned
    • View Profile
Re: Megaproject help.
« Reply #5 on: January 05, 2011, 07:40:20 pm »

You sir, are a true dwarf. Your beard must be sooo long...
Logged
He's just keeping up with the Cardassians.

Urist Imiknorris

  • Bay Watcher
  • In the flesh, on the phone and in your account...
    • View Profile
Re: Megaproject help.
« Reply #6 on: January 05, 2011, 09:19:03 pm »

If completed, this might be the single most complex machine made in DF yet.

I wouldn't even know where to start, but it might be worth going though some chess programs source code to find out if there is a relatively easy way to test valid moves, and then figure out if you can extrapolate that to DF.

This is good news for me - I get to write a chess program this semester.

EDIT:
its challenging to write a chess program that protects against illegal moves and tests for checkmate.

I will weaponize that bridge when I come to it.

For the illegal moves part, I was thinking of setting up a system wherein a player chooses a piece from a grid of levers (it should be easy to control this, just seal each lever with a door which will open if that square has a piece of the active player's color*) and then a destination in another grid, sealed by doors that only open if the piece can move there. Actually linking this up will be a huge bitch, but I can deal with that.

*Two AND gates (piece is white && white's turn, piece is black && black's turn), the outputs of which are hooked up to an OR gate controlling the door. Repeat 63 more times.
« Last Edit: January 05, 2011, 09:51:00 pm by Urist Imiknorris »
Logged
Quote from: LordSlowpoke
I don't know how it works. It does.
Quote from: Jim Groovester
YOU CANT NOT HAVE SUSPECTS IN A GAME OF MAFIA

ITS THE WHOLE POINT OF THE GAME
Quote from: Cheeetar
If Tiruin redirected the lynch, then this means that, and... the Illuminati! Of course!

GuudeSpelur

  • Bay Watcher
    • View Profile
Re: Megaproject help.
« Reply #7 on: January 05, 2011, 11:56:38 pm »

One final note: I'm using the free-raw-material reactions in Shaostoul's guide on the wiki (because there's no way I could get enough white stone without them), and my dwarves will have [SPEED:0] until the goblins come around with their traditional greetings of "An ambush! Curse them!" or "Snatcher! Protect the children!" I figure these are acceptable, as they are not related to the main task of actually programming the game to play another game.

I'm assuming fighting off goblins in the shadow of a massive chessboard chessboard is part of the funtm, because if I were to try anything like this I'd turn invasions off.

Also:  :o
Logged
This fortress is turning into some kind of supervillain lair or something.
You do remember that you've been farming gigantic wingless dragon-fish for profit and Fun, right?

Urist Imiknorris

  • Bay Watcher
  • In the flesh, on the phone and in your account...
    • View Profile
Re: Megaproject help.
« Reply #8 on: January 06, 2011, 04:14:39 pm »

The first thing I did was dig out and furnish two barracks, a danger room, and 40 military bedrooms. Then the dining room in the magnetite cluster.

EDIT: Forgot to mention, all dwarves have natural adequate armor smithing. Not high enough to be useful, but it saves me time, copper, and potential useless crafting moods. This is a thing that I've had since finding out about the natural skill tags because it seems dwarven:

Urist McManager: "Welcome to the fort, what can you do?"
Urist McIdiot: "Well, I know my way around a forge a little..."
Urist McManager: "We're dwarves, dumbass. We all know our way around a forge. Welcome to the Masonic Army!"
« Last Edit: January 06, 2011, 04:26:29 pm by Urist Imiknorris »
Logged
Quote from: LordSlowpoke
I don't know how it works. It does.
Quote from: Jim Groovester
YOU CANT NOT HAVE SUSPECTS IN A GAME OF MAFIA

ITS THE WHOLE POINT OF THE GAME
Quote from: Cheeetar
If Tiruin redirected the lynch, then this means that, and... the Illuminati! Of course!

Musashi

  • Bay Watcher
  • cancels Work: distracted by Dwarf Fortress.
    • View Profile
Re: Megaproject help.
« Reply #9 on: January 06, 2011, 04:21:17 pm »

That sounds impossible to do in a reasonable time. By "reasonable", I mean that you might still be busy with it in a year, assuming you have some sort of social life.
But I command you for trying. Good luck. Godspeed, you dwarfy... dwarf... person.
Logged
I don't mean to alarm you, but it appears that your Dwarves are all in fact elephants.

Scaraban

  • Bay Watcher
  • One Crazy Ass Giant
    • View Profile
Re: Megaproject help.
« Reply #10 on: January 06, 2011, 09:19:39 pm »

Urist I always knew you would go off the DF-end, but a Working Chess Game in DF?!?!?!?!?
Logged
It's a long way to the top if you want dank memes.

Zrk2

  • Bay Watcher
  • Emperor of the Damned
    • View Profile
Re: Megaproject help.
« Reply #11 on: January 06, 2011, 09:27:17 pm »

Yes. This is batch fucking crazy. If you pull it off i will be so jel.
Logged
He's just keeping up with the Cardassians.

Urist Imiknorris

  • Bay Watcher
  • In the flesh, on the phone and in your account...
    • View Profile
Re: Megaproject help.
« Reply #12 on: January 06, 2011, 09:29:10 pm »

Give me a couple weeks to plot out the logic required, then I'll start building. Ideally I'll start by the end of the month, but it'll more likely be the end of next month.
Logged
Quote from: LordSlowpoke
I don't know how it works. It does.
Quote from: Jim Groovester
YOU CANT NOT HAVE SUSPECTS IN A GAME OF MAFIA

ITS THE WHOLE POINT OF THE GAME
Quote from: Cheeetar
If Tiruin redirected the lynch, then this means that, and... the Illuminati! Of course!