Showing posts with label Dwarf Fortress. Show all posts
Showing posts with label Dwarf Fortress. Show all posts

Wednesday, April 22, 2009

Nothing Up My Sleeve...

As I'm sure is the case with a lot of you, the idea of procedural generation of content has also fascinated me ever since the release of Spore last year, which allowed players to design truly bizarre creatures and then puzzled out precisely how they moved just on the basis of the creature's form (among other things).  While I have yet to actually play Spore (as I have a relatively low-end computer), I am still duly impressed by reports of how it manages this sort of thing.

For those of you who have never heard of Spore and consider the Wikipedia article I linked to about procedural generation a tl;dr situation, let me see if I can sum it up for you: procedural generation is the creation, by way of an algorithm in a computer program (in this case, a game), of content that did not exist at the moment the program was run.  In the Spore example, the procedurally-generated content is your creature's walking animation.  There's no way that the programmers could account for all possible permutations of the various bits and pieces of the game's creatures, so they wrote a chunk of code that allows the game to create the animation on the fly.

The most impressive example of procedurally-generated content I have found thus far is a game called .kkrieger.  Here is the gameplay screenshot that is featured in its Wikipedia article.  Click on it for a larger size.


A traditionally-created game--one that has independent files for models, textures, and animations that are referenced by a core program--that looks like this one would probably occupy a few hundred megabytes of disk space at least.  Plenty of games out there run into multi-gigabyte territory (Halo and World of Warcraft are just a couple that spring to mind--my gaming is a bit dated, admittedly).  But .kkrieger occupies only 96k.  That's it.  I've seen Word files that are bigger!  All those pretty things in that screenshot?  The models, textures, animations, and even music are all generated during the game's hella long loading time.  None of it is hard-coded or included in separate files.  It builds itself from the ground up every time it's run.

Given, it takes a PC with some pretty hefty processing power to play the thing, but the fact that it works at all is fascinating to me.

Other examples of games that use procedural generation can be found in the Wikipedia article about it.  Right off the top of my head, I know that Dwarf Fortress uses it to create entire worlds, including their histories and legends (pretty spiffy), and a lot of the games over at Java4k use it to keep their file sizes down at the 4k maximum size for the competition.

I'll warn you, though, those games at Java4k can be damned addictive.  Enter at your own risk.

Anyway, this was just something that I thought was awesome and consequently wanted to share.  You may all go about your lives now.

----
"The Tao did not wish for him to pass."

Wednesday, May 14, 2008

Review: Dwarf Fortress

So a few days ago I downloaded a freeware game called Dwarf Fortress. I had heard interesting things about it, so I decided to give it a shot, not expecting altogether much. What I discovered was an incredibly and strangely addictive game that is an ingenious exercise in real-time strategy and low-level artificial intelligence.

The game starts out by naming and fractally rendering a world. This isn't just the little swatch you're going to build your soon-to-be village, on, however. This is the entire. Bloody. World. It simulates corrosion by running water, raises a few mountains, busts out some greenery, and suddenly there's landscaping. Then it goes through and names each individual location (I believe in the world belonging to the screenshot above there is a Swamp of Despair or some such) and determines where the civilizations of this new world make their homes. It then (evidently) generates legends and folklore for the world. The whole process takes around ten minutes.

Now would be a good point to mention the graphics involved, or the lack thereof. As you can tell in the screenshot above, everything is rendered in colored ASCII characters. The whole business was baffling as hell to start out with--I could barely tell plants and trees from grass--but after a while you get used to it, and the interface begins to make more sense. And the time that would've been spent on graphics has apparently been rerouted into the gameplay itself.

After the world is generated, you choose a place to plop down your group of intrepid pioneers, and then you're off. You have a handful of dwarves (represented by smiley faces of various colors, depending on their profession) and some limited supplies, and the name of the game is civilization...that is, the forging thereof.

I set my first fortress by and in a sandstone mountain. This may not have been the brightest thing, but it certainly made digging by my miner (who has officially reached "legendary" as his mining skill) easier. Unfortunately, it also meant that there was almost no proper stone to build things with, so I had to make do with wood for a good long while as supplied by my woodcutter and shaped by my carpenter.

Here's the thing, though: each dwarf isn't defined merely by their profession and randomly-generated name. Each one has an array of skills (which may or may not be related to their profession) and a collection of likes, dislikes, and thoughts that can be accessed by selecting them. Their thoughts in particular can serve as a guide for improvements to the settlement. And it's always amusing to take someone as useless as a jeweler and turn them into the campus cook.

Speaking of such, each dwarf must be fed, clothed, and otherwise taken care of lest they become grumpy, fall ill, or even die. This is easier than it sounds, however. My hamlet (that's its official title) has a little over thirty dwarves, and there have been no complaints about hunger. Early on there were problems with food rotting in the stores, but that was taken care of by setting aside an area for trash outside the mountain.

After the first year of game-time, traders begin stopping by the village from other civilizations. Most of the traders that have come by Diamondcastles (that's the name of my hamlet translated from dwarfish--kind of poncy, I know, but what can you do?) have been elves, who are literally tree-hugging hippies. They refuse to take any goods manufactured from wood. Since I only recently struck upon a vein of workable stone, there hasn't been much actual trade, so I can't really speak to that aspect of the game.

Similarly, I can't speak to the combat/military aspect, as I only today set up a group of individuals whose collective profession was literally "peasant" as recruits, and they're a ridiculous little lot. There's four of them, and their job is (or would be, if the dwarves actually spoke) to stroll around outside the mountain and shout, "Four o'clock and all's well!" Also, the late game in which the village becomes a true bastion of short, bearded culture protected by siege engines, and the--well, intergame, for lack of a better word--in which a lone dwarf strikes out from the fallen ruins of said bastion of culture to set up another somewhere else in the world are equally mysterious to me.

To say the absolute least, there is a shit-tonne of content in this game, and the dwarves behave in surprising and sometimes very human ways. One threw a party yesterday around the statue in the main hall (represented by the white omega symbol above).

I have only two problems with this little gem: its interface, which is not the most intuitive thing in the world, and the complete micromanagement clusterfuck gameplay must become once the fortress becomes large enough. The interface is a series of menus accessed by keypresses (as seen above), which wouldn't be so bad if all the menus behaved more or less the same. Most of them seem to want to be off in the corner playing by themselves instead of joining the rest of the class, however, so it's a bit of a crapshoot as to whether any given menu will operate with ease. Unless there's some mechanic to take the "micro" out of "micromanagement", which happens to be a major part of the early game, the late game has to get indescribably complex. I have yet to get there, however, so it's hard to tell.

In any case, I would heartily recommend this game, as it is by and far worth the download. But only play it if you happen to have several hours to spare. You wouldn't think that watching smiley faces scooting around would be that engaging, but the second time I sat down to it I lost two and a half hours. After all, those smiley faces have gotta eat.

----
I'll build a well when I get to it, dammit!