Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Question about DF coding  (Read 1977 times)

Zulgaines

  • Escaped Lunatic
    • View Profile
Question about DF coding
« on: August 06, 2008, 10:41:10 am »

So I was talking to someone about DF today, and we have a bit of a disagreement. From what I'v seen of the game I feel that most of the game feels procedurally generated. It feels like the game world builds and evolves itself depending on what's going on in and around it.

However he says DF, from what he can tell, is about as procedural as Diable 2 was. The world is randomized each time, but this is simply the random placing of certain pre-built elements. But once those elements are in place, they are more or less permanent for that iteration of the game, and that the occupants of the world are just running some basic what if coding.
Logged

TheSpaceMan

  • Bay Watcher
    • View Profile
    • http://www.digital-lifeform.com
Re: Question about DF coding
« Reply #1 on: August 06, 2008, 11:00:07 am »

It's WAY more advanced then Diablo. Yes both are precedural designs but DF work on way way way more parameters.

It's like comparing, pac-man with a flight simulator. Yes both have controls used to controll an object. But it's done in very very very different ways. Where one is much much much much more advanced. Specialy since DF have very few premade tiles.

See it like makeing a picture from a couple of jars of paints or make a picture with a pussel. Both produce pictures one takes more work and is much more flexible.
Logged
Poking around with a DFParser.
Bodypart names, creatures names in one easily overviewable place.

Oh my new (old) picture?

Lazer Bomb

  • Bay Watcher
  • Sine! Cosine! TANGENT!
    • View Profile
    • Homepage 60☼
Re: Question about DF coding
« Reply #2 on: August 06, 2008, 11:18:07 am »

from what he can tell

Theres his problem.

From what I can tell, he doesn't know much about DF. I never actually played Diablo 1 or 2, but do they have rain shadows next to mountains?
Logged
Kagus: "Still, demonic spelunking is always a promising idea."

RedWick

  • Bay Watcher
    • View Profile
Re: Question about DF coding
« Reply #3 on: August 06, 2008, 05:39:02 pm »

Your friend would be right, just so long as he's talking about the world generation process.  Using the same world and history seeds will always generate the same world, with the same people fighting the same wars.

Once the player is able to interact with the world though, the game starts to react and change to what's going on.  I once ran an adventurer who went into an elvish retreat and killed everybody within it's borders (well, I defended against their attacks, as they were at war with my home civ).  When I left, the place showed up as a ruin on the travel map.  Later, I wandered back on by and saw that the place was populated again (I wasn't able to de-populate it a second time, alas).

Likewise, with the upcoming releases and the ability to set up other settlements outside of your primary fortress, you should be able to have a drastic effect on the landscape, as well as the economics and politics of any given world.
Logged

Tormy

  • Bay Watcher
  • I shall not pass?
    • View Profile
Re: Question about DF coding
« Reply #4 on: August 06, 2008, 05:54:08 pm »

I dont know anything about coding, but I can see that DF is much more complicated already than Diablo.  ;D
Logged

dreiche2

  • Bay Watcher
    • View Profile
Re: Question about DF coding
« Reply #5 on: August 06, 2008, 06:37:57 pm »

Your friend would be right, just so long as he's talking about the world generation process.  Using the same world and history seeds will always generate the same world, with the same people fighting the same wars.

Well, but that is hardly the point, because using the same random numbers in *any* program will lead to the same outcome (without user interaction). I don't think you would call content procedurally generated depending on whether the user can access the random seed or not, or whether there is interactivity in the process. I guess the point is whether the program stores the actual data it presents you with, or whether it just stores certain algorithms from which the data is generated.

I guess you would indeed call the world generation process procedural to a large extent, because it's simulated. With Diablo it's much less so, all the map components just get shuffled. So maybe the old 2D dwarf fortress was more like, but now...
Logged

Snoman

  • Bay Watcher
    • View Profile
Re: Question about DF coding
« Reply #6 on: August 06, 2008, 07:38:47 pm »

Procedural and randomised are not mutually exclusive.

In world gen, a pseudorandom seed is used to kick of the world generation procedure.

Procedural generation of stuff just means that Toady doesn't hand craft every world that is generated, he writes procedures that do it for him.
 He also happened to make the parameters adjustable, and able to take random inputs, giving different "randomised" worlds every time.

EDIT:
Reading the original post again, you're both right. Its just that during play after world gen, the 'basic what if' stuff by all the NPCs, that your friend refers to, are (as far as I can tell) much the same factors that shaped the world in world gen. Its just that in world gen everything ran way faster, and that after world gen, there is player interaction as well.

It would be nice to hear from Toady on this, (if he hasn't already commented on the issue somewhere). As the world generation part of DF is a masterful idea in my opinion, and it would be cool to have a better understanding of the forces that shape a DF world.
« Last Edit: August 06, 2008, 07:43:35 pm by Snoman »
Logged

Fieari

  • Bay Watcher
    • View Profile
Re: Question about DF coding
« Reply #7 on: August 06, 2008, 07:58:59 pm »

The terrain is 100% procedural.  You can read about how it works on the wiki, or at this interview.

On the other hand, the towns and fortresses and towers and such are all pre-made and plopped down on the map.  The location of these places are procedurally generated, and are dynamically taken over by different races, dynamically populated, and dynamically ruined.  Towns will have a temple sometimes, and there are a couple different temple models, but these are also put down wholesale.

So the landscape is far, far, FAR more procedural than Diablo II EVER was.  But yes, there are SOME premade aspects... those exclusively being towns.
Logged

Snoman

  • Bay Watcher
    • View Profile
Re: Question about DF coding
« Reply #8 on: August 06, 2008, 08:04:21 pm »

The terrain is 100% procedural.  You can read about how it works on the wiki, or at this interview.

On the other hand, the towns and fortresses and towers and such are all pre-made and plopped down on the map.  The location of these places are procedurally generated, and are dynamically taken over by different races, dynamically populated, and dynamically ruined.  Towns will have a temple sometimes, and there are a couple different temple models, but these are also put down wholesale.

So the landscape is far, far, FAR more procedural than Diablo II EVER was.  But yes, there are SOME premade aspects... those exclusively being towns.

Thanks for the references. So you mean the layout of the buildings etc for the towns etc right?
Logged

Fieari

  • Bay Watcher
    • View Profile
Re: Question about DF coding
« Reply #9 on: August 06, 2008, 08:30:13 pm »

Yeah.  Toady has said he'll eventually want to make the town layouts and buildings procedural too, but for now are just templates.

Edit: Oh, by the way, to clarify, I'm almost positive that caves are randomly generated, and not set pieces either.  These aren't exactly -procedurally- generated, like the terrain which runs rivers and calculates rain shadow, but aren't premade either.  It's more like nethack, or other roguelikes in this respect, except in 3d chunks instead of purely 2d slices, so that it weaves between the zlevels.  These caves may or may not be placed procedurally or randomly, I don't know.  They are then populated procedurally, via history generation.
« Last Edit: August 06, 2008, 08:44:37 pm by Fieari »
Logged

dreiche2

  • Bay Watcher
    • View Profile
Re: Question about DF coding
« Reply #10 on: August 07, 2008, 04:05:40 am »

Hm, I also have to clarify myself, because I'm not sure whether you would necessarily call something that is simulated "procedural". E.g. in DF, the interaction in between the races in generation is simulated, and all the legend data for example procedurally generated from that...

Well, it doesn't really matter how it's called, but yeah content in DF is definitely more "evolved" etc. than Diablo. Actually, when speaking only about the civilizations and not the terrain, your friend is right, I think, if he's still playing DF from before the last (bigger) release, and you're right with the current version. Because making the world history being dynamically generated from the interaction of its inhabitants, that's basically what the last release was about...
« Last Edit: August 07, 2008, 04:37:56 am by dreiche2 »
Logged

valcon

  • Bay Watcher
  • Experience rivers.
    • View Profile
    • My YouTube Channel
Re: Question about DF coding
« Reply #11 on: August 07, 2008, 04:28:01 am »

I've played DF for a while now and I'd just like to say I have absolutely no f-ing idea how it works.
Logged
Still doing Let's Plays, still got a gold toof. 

Adventure Mode:  The Movie!

Capntastic

  • Bay Watcher
  • Greetings, mortals!
    • View Profile
    • A review and literature weblog I never update
Re: Question about DF coding
« Reply #12 on: August 07, 2008, 04:45:53 am »

The towns are procedural but right now very basic; there's roads and around them, buildings- some will be on top of hills and stuff.   They're placed atop the existing geography, and change during world gen.

Furthermore, since all of the terrain is mutable (can be modified during the course of the game) it is far more complex than DF.

Meanwhile, DF is being made more and more complex with each passing arc- and more and more tasks are being proceduralized.

So, the bottom line is thus:  Your friend made some false assumptions.  DF is several times more complex than Diablo 2.
Logged