Bay 12 Games Forum

Please login or register.

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

Author Topic: Dwarf Fortress source code  (Read 47214 times)

alegz

  • Escaped Lunatic
    • View Profile
Dwarf Fortress source code
« on: April 27, 2012, 11:52:55 pm »

Hi.
I am new here and probably asking some naive or already solved questions.

I started to play Dwarf Fortress aproximately 2 months ago, and faced some problems playing it.
For instance:
- Game uses only one CPU thread, but i have Core i5 with 2 physical cores with hyperthreading (4 virtual cores). And game uses only one of them, that makes it work slow when number of creatures starts to be big enough.
- I am using linux. Dwarf Fortress is available from my linux mirror, that's great, but I was surprised when I found out that I need root privileges to start the game.

I wanted to ask local forum users, is there any possibility to have access to the source code of the game, or ideal way is to have access to repository (svn, git, hg or any) to be able to make some changes, or be able to look why is it so and how it works.

P.S.
And sorry for mistakes in English. It's not my native, and i don't practice it often.
But please correct me, I'll learn.
« Last Edit: April 27, 2012, 11:57:45 pm by alegz »
Logged

Patchouli

  • Bay Watcher
  • Where very delicious cake shop?
    • View Profile
Re: Dwarf Fortress source code
« Reply #1 on: April 28, 2012, 12:16:15 am »

There's no access to the source code.
Logged

hermes

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress source code
« Reply #2 on: April 28, 2012, 12:22:47 am »

Hello, welcome!
Check out this FAQ thread, which probably provides detailed answers to your Qs.
Logged
We can only guess at the longing of the creator. Someone who would need to create one such as you. - A Computer
I've been working on this type of thing...

Starver

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress source code
« Reply #3 on: April 28, 2012, 12:42:00 am »

Ah, actually doubly-ninjaed.  That'll teach me to spend a long time editing.  No... actually, I don't think it will.  Anyway, here's what I did write, you can check to see if it's anywhere near correct by looking at the suggested FAQ thread, if you wish. ;)

We'll have some better answers along in a moment, I'm sure, but I think the immediate reply is:

The game was never been designed for multi-threading, from the start, and Toady[1] is not currently inclined to totally re-write it the way it would need to be to make it multi-threaded (and, along the way, change a lot of things so that it can be usefully parallelised).  Actually there is a separation of graphics from "the rest", I think, but right now you're stuck to one core.  OTOH, this means that if you have multiple cores, DF sat (mostly) on just one core would by default allow the rest of the running processes to spread around the other cores with minimal performance hit to everything else that you want to run (in foreground or background).  There's often a thread coming up about "how about just running the pathfinding as a parallel thread", or something, if you want to look up the community's own split of opinion about the practicalities.

Can't comment on the Linux root privileges thing, as the only way that I've run DF on Linux was (for reasons I can't recall) running the Windows version through Wine, which seemed to work perfectly Ok.  As far as the Linux-specific version, might it need only some chowning and/or limited sudoing to work?  If I were to make a guess as to why root is needed it might be to do with low-level hardware access, but that's a stab in the dark.

Source code: No way.  For the foreseeable future[2] it will not be Open Source.  Toady wants to retain full IP over the development of all but very selected elements by very trusted third-parties, and that's how he rolls.


BTW. your English is good.  I can't point out any particular errors (minor odd turns of phrases[3], but no odder than might come out of any given Anglophone dialect).  You might have used the Unordered List forum tags/markup for your 'bullet' points, but that's a style issue.


[1] Who is, in case you've not previously heard him referenced, the "guy wot writes the game", but you probably already know that.

[2] To the extent that we know that Toady has put a codicil in his Last Will And Testament regarding how ownership of the source code transitions...  Which doesn't mean he won't change his mind or be happy to do something different before then, but right now it's considered that it'll be pretty much his and his alone (legitimately, of course) for whatever the remaining duration of his life may be.

[3] Ok, so the "It's not my native" bit should have been "It's not my native language", or similar, but that could have been bad editing.  Especially as you also used a lower-case 'i' in "and i don't practice it often".  But that's better than a lot of natives seem to manage!
Logged

MrWiggles

  • Bay Watcher
  • Doubt Everything
    • View Profile
Re: Dwarf Fortress source code
« Reply #4 on: April 28, 2012, 06:00:06 am »

Hi and welcome new Forumite.
And thank you for making your obligatory suggest-something-that-has-already-been-suggested thread.

I hope you stay, and enjoy the community.
Logged
Doesn't like running from bears = clearly isn't an Eastern European
I'm Making a Mush! Navitas: City Limits ~ Inspired by Dresden Files and SCP.
http://www.bay12forums.com/smf/index.php?topic=113699.msg3470055#msg3470055
http://www.tf2items.com/id/MisterWigggles666#

malimbar04

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress source code
« Reply #5 on: April 28, 2012, 06:34:58 am »

- I am using linux. Dwarf Fortress is available from my linux mirror, that's great, but I was surprised when I found out that I need root privileges to start the game.

That's weird, I play DF on Ubuntu all the time (my main OS) and never use root privileges. What distribution are you using, and exactly how do you start it? command line crazy? funky custom launcher? double clicking the shell script that comes with?
Logged
No! No! I will not massacre my children. Instead, I'll make them corpulent on crappy mass-produced quarry bush biscuits and questionably grown mushroom alcohol, and then send them into the military when they turn 12...

CodexDraco

  • Bay Watcher
  • [SARCASTIC]
    • View Profile
Re: Dwarf Fortress source code
« Reply #6 on: April 28, 2012, 03:40:53 pm »

I can confirm that you don't need root privs to run the game on Linux so it looks like your distribution didn't package correctly. I suggest you download the game directly from the official site it's going to be way more up to date.

And no, no source code.
Logged
Finely minced dwarven wine... what?

slothen

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress source code
« Reply #7 on: April 28, 2012, 10:47:38 pm »

I wanted to ask local forum users, is there any possibility to have access to the source code of the game, or ideal way is to have access to repository (svn, git, hg or any) to be able to make some changes, or be able to look why is it so and how it works.

Ha ha ha.  no.
Logged
While adding magma to anything will make it dwarfy, adding the word "magma" to your post does not necessarily make it funny.
Thoughts on water
MILITARY: squad, uniform, training
"DF doesn't mold players into its image - DF merely selects those who were always ready for DF." -NW_Kohaku

DrKillPatient

  • Bay Watcher
  • The yak falls infinitely
    • View Profile
Re: Dwarf Fortress source code
« Reply #8 on: April 28, 2012, 11:15:19 pm »

As has been said, if you want to modify the current game's source code, there is no way to do so at the present moment. However, if, for educational purposes, you want to know how DF is structured, there is one thing that might help you: the source code for Battle Champs, a game that was meant to be a stripped-down version of DF's, and which was mentioned here but is apparently no longer present, possibly because it was released so long ago and was lost in ages past. Perhaps you could ask Toady if he's still willing to give that out.
Logged
"Frankly, if you're hanging out with people who tell you to use v.begin() instead of &v[0], you need to rethink your social circle."
    Scott Meyers, Effective STL

I've written bash scripts to make using DF easier under Linux!

Murgy

  • Bay Watcher
  • Is one of the first of his kind.
    • View Profile
Re: Dwarf Fortress source code
« Reply #9 on: May 02, 2012, 09:24:24 pm »

[2] To the extent that we know that Toady has put a codicil in his Last Will And Testament regarding how ownership of the source code transitions...  Which doesn't mean he won't change his mind or be happy to do something different before then, but right now it's considered that it'll be pretty much his and his alone (legitimately, of course) for whatever the remaining duration of his life may be.

But one amphibian man stands between us and the precious source code!
Logged
Quote from: Cruxador
Quote from: NW_Kohaku
I made a mod where giant spiders, snake-people, minotaurs, dwarves, and a gnome-like creature were all the same species.  In spite of being radically different sizes, a snake-person and a spider could get married and have a minotaur as a child.
A wonderful love story of a family that is truly without prejudice.

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: Dwarf Fortress source code
« Reply #10 on: May 02, 2012, 09:28:44 pm »

Never gonna happen.  Releasing the source code would lead to 20 separate incompatible branches of the code, almost overnight, as the big mods moved more of their stuff over into engine code, certain people changed the engine to display different graphics types, and yet others tweaked all manner of settings to make a "source mod" just because they can.

All in all, nobody would be playing the same game, the help forums would become an absolute joke, and Toady would stop making money off the game.
Logged
I like fortresses because they are still underground.

Urist McDepravity

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress source code
« Reply #11 on: May 02, 2012, 09:44:23 pm »

Never gonna happen.  Releasing the source code would lead to 20 separate incompatible branches of the code, almost overnight, as the big mods moved more of their stuff over into engine code, certain people changed the engine to display different graphics types, and yet others tweaked all manner of settings to make a "source mod" just because they can.

All in all, nobody would be playing the same game, the help forums would become an absolute joke, and Toady would stop making money off the game.
This is just typical anti-FOSS propaganda that has nothing to do with reality.
Commits to official repository are controlled by project leader and are to follow project guidelines.
Forks are not that common and do not have such devastating impact - check any FOSS game - it works perfectly fine.
For example there are no major forks of OpenTTD, which is quite complex game, with dozens of programmers working on it, and spanning over many, many years.

When people want to expand project into several directions, they just communicate and design some plugins specs, and then build their extensions as such plugins instead of polluting main engine.
Logged

Starver

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress source code
« Reply #12 on: May 02, 2012, 10:40:22 pm »

It's very much irrelevant whether Open-Sourcing will or will not cause such chaos, because it's just not happening for the foreseeable future.  And we've had loads of threads on this subject already so I doubt anybody will be able to add anything useful in this thread...

Darn, I probably look like the Thread Police by saying that.  Well, take it that way if you want to, I can't stop you.
Logged

dizzyelk

  • Bay Watcher
  • Likes kittens for their delicious roasts.
    • View Profile
Re: Dwarf Fortress source code
« Reply #13 on: May 02, 2012, 11:00:34 pm »

[2] To the extent that we know that Toady has put a codicil in his Last Will And Testament regarding how ownership of the source code transitions...  Which doesn't mean he won't change his mind or be happy to do something different before then, but right now it's considered that it'll be pretty much his and his alone (legitimately, of course) for whatever the remaining duration of his life may be.

But one amphibian man stands between us and the precious source code!
Hate to rain on your parade, but scuttlebutt is that the code doesn't get released should his death be under a cloud of suspicion.
Logged
Dwarf Fortress - Bringing out the evil in people since 2006.
Somehow, that fills me more with dread than anticipation.  It's like being told that someone's exhuming your favorite grandparent and they're going to try to make her into a cyborg stripper.

Capntastic

  • Bay Watcher
  • Greetings, mortals!
    • View Profile
    • A review and literature weblog I never update
Re: Dwarf Fortress source code
« Reply #14 on: May 02, 2012, 11:02:21 pm »

This is just typical anti-FOSS propaganda that has nothing to do with reality.

Toady's business model is currently "keep donating and I can keep working on the game".  If other people are able to work on the game, then I can only imagine donations will drop.  Monetary concerns aside, DF is his life's labor and I don't see why he should open it up to others if he doesn't want to.
Logged
Pages: [1] 2 3 4