Bay 12 Games Forum

Please login or register.

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

Author Topic: What does it take to MAX Dwarf Fortress?  (Read 2769 times)

AdeptAdventurer

  • Bay Watcher
    • View Profile
What does it take to MAX Dwarf Fortress?
« on: December 07, 2014, 02:40:12 pm »

Assuming the largest size embark at 200ish dorfs + lifestock + flowing water on the map + everything else turned on like Temperature.
Logged

smeeprocket

  • Bay Watcher
  • Collectivist Socialist Feminist Freeloader
    • View Profile
Re: What does it take to MAX Dwarf Fortress?
« Reply #1 on: December 07, 2014, 05:21:41 pm »

other than getting 1-10 fps, even if you used an outside program to allow DF to utilize 4gb of ram, what would be the purpose?

Tunneling directly into a volcano is a great way to kill your fps if that helps. Magma flowing everywhere will just slow everything down until it feels like nothing is even moving anymore.
Logged
Steam Name: Ratpocalypse
Transpersons and intersex persons mod for Fortress mode of DF: http://dffd.wimbli.com/file.php?id=10204

Twitch: http://www.twitch.tv/princessslaughter/

"I can't wait to throw your corpse on to a jump pad and watch it take to the air like a child's imagination."

dennislp3

  • Bay Watcher
    • View Profile
Re: What does it take to MAX Dwarf Fortress?
« Reply #2 on: December 07, 2014, 07:02:46 pm »

Sounds like something I do before getting a new processor...max out DF on current PC, upgrade, be in awe of the improved performance :P
Logged

smeeprocket

  • Bay Watcher
  • Collectivist Socialist Feminist Freeloader
    • View Profile
Re: What does it take to MAX Dwarf Fortress?
« Reply #3 on: December 08, 2014, 12:25:01 am »

I don't think it would help much, tbh. I have an i5, which isn't too shabby, and I wouldn't be able to do all the stuff mentioned and have any sort of normal, or even moderately low fps.
Logged
Steam Name: Ratpocalypse
Transpersons and intersex persons mod for Fortress mode of DF: http://dffd.wimbli.com/file.php?id=10204

Twitch: http://www.twitch.tv/princessslaughter/

"I can't wait to throw your corpse on to a jump pad and watch it take to the air like a child's imagination."

utunnels

  • Bay Watcher
  • Axedwarf
    • View Profile
Re: What does it take to MAX Dwarf Fortress?
« Reply #4 on: December 08, 2014, 12:44:11 am »

Maybe somebody rich can test that out on a high end computer (perhaps someone already did that before?) ::)
Logged
The troglodyte head shakes The Troglodyte around by the head, tearing apart the head's muscle!

Risen Asteshdakas, Ghostly Recruit has risen and is haunting the fortress!

Astrid

  • Bay Watcher
  • This is a text.
    • View Profile
Re: What does it take to MAX Dwarf Fortress?
« Reply #5 on: December 08, 2014, 03:23:17 am »

Even a high end computer is utterly useless and will turn to a crawl on this.
Because high end computers are multi core processors.
And DF Works with only 1 core ever.

I myself have a 6 core cpu. The game still manages to slow without breaking my cpus sweat.
Logged

utunnels

  • Bay Watcher
  • Axedwarf
    • View Profile
Re: What does it take to MAX Dwarf Fortress?
« Reply #6 on: December 08, 2014, 03:29:25 am »

Yeah, even if you use liquid nitrogen to overclock it to 8GHz, it can hardly double the performance.
Maybe from 2fps to 4fps or so. :P
Logged
The troglodyte head shakes The Troglodyte around by the head, tearing apart the head's muscle!

Risen Asteshdakas, Ghostly Recruit has risen and is haunting the fortress!

Magistrum

  • Bay Watcher
  • Skilled Fortresser
    • View Profile
Re: What does it take to MAX Dwarf Fortress?
« Reply #7 on: December 08, 2014, 06:25:35 am »

I ended up buying a single core processor, and want to upgrade to a maximum dual core one,since those usually have 4,5 ~ 5 Ghz per core... I once had a processor with 8 cores and 2 Ghz each, so DF was always crawling...
Logged
In a time before time, I had a name.

Naryar

  • Bay Watcher
  • [SPHERE:VERMIN][LIKES_FIGHTING]
    • View Profile
Re: What does it take to MAX Dwarf Fortress?
« Reply #8 on: December 08, 2014, 08:02:51 am »

Dwarf Fortress will kill your CPU if you intend to MAX it.

You have been warned.

Foxite

  • Bay Watcher
    • View Profile
Re: What does it take to MAX Dwarf Fortress?
« Reply #9 on: December 08, 2014, 10:54:55 am »

I think trying that on about any normal(non-supercomputer) system the CPU would melt from the sheer heat of all those calculations, even if you used various performance increasing tools and mods.

But for the legitimate question, setting the population cap to something ridiculously high like 65536 and embarking on a map with access to flowing water, a volcano, the oceans and then draining it into the caverns, and uncovering absolutely every tile with many many items created in the process, and many more things it would pretty much bring DF beyond the worst performance a human can possibly fathom.
« Last Edit: December 08, 2014, 10:59:03 am by latias1290 »
Logged
The best way to demonstrate it to him is take a save of 40 year old fortress with 150 dwarves in it on a good sized embark with a volcano that just breached the circus and install it on his gaming rig and watch it bring his rig to its knees.

BoredVirulence

  • Bay Watcher
    • View Profile
Re: What does it take to MAX Dwarf Fortress?
« Reply #10 on: December 08, 2014, 05:42:30 pm »

I've done a 16x16 embark, with a river, nothing turned off, with 500 starting dwarves.

I think it was about 1 fps. If you don't LAA DF, it will crash. If you do, you won't play it.

A super computer wouldn't (generally) help (I've thought about it, I have access to a pretty decent one). The right one might, one optimized for large data sets. But considering the amount of memory used by DF for this, it would have to have very large caches to help, and most wouldn't have a cache quite large enough for this. The constraint on DF isn't CPU speed, its how large your CPU's cache is, and how quickly can it shuffle that data around. Even then, to really utilize any super computer, DF would have to be multi-threaded. My schools beowulf cluster would not help.

What would be interesting would be to write a virtual machine that DF can run on, but does nearly all of the calculations on the GPU. Your memory problem should be nearly solved and it may be possible to optimize some of the map calculations without DF knowing. This I may have to look into...

My personal machine is an old phenom x4 running 1.8 GHz, with pretty average RAM (8 GB). It does surprisingly well most of the time, I guess its got a decent cache size.
Logged

smeeprocket

  • Bay Watcher
  • Collectivist Socialist Feminist Freeloader
    • View Profile
Re: What does it take to MAX Dwarf Fortress?
« Reply #11 on: December 08, 2014, 06:04:43 pm »

if you figure that out, that would be awesome.
Logged
Steam Name: Ratpocalypse
Transpersons and intersex persons mod for Fortress mode of DF: http://dffd.wimbli.com/file.php?id=10204

Twitch: http://www.twitch.tv/princessslaughter/

"I can't wait to throw your corpse on to a jump pad and watch it take to the air like a child's imagination."

PatrikLundell

  • Bay Watcher
    • View Profile
Re: What does it take to MAX Dwarf Fortress?
« Reply #12 on: December 09, 2014, 03:27:19 am »

It would probably be better if the problem was attacked at the root, i.e. if DF itself was redesigned to be/support multithreaded. One clear candidate for a separate thread is the calculations for events external to the fortress (at least in fortess mode) since they have a very small interaction with the fortress itself (probably only diplomat/liason reports) and thus should have a limited need for multiple access protection and separation, another one is graphics, a third one is equipment wear, and a fourth is liquid flow and temperature calculations (there are probably others as well).
I doubt a GPU would be of much help for most of DF, since GPUs are very good at doing a very narrow range of repetitive tasks really fast, but are quite poor for general computing. There is, after all, a reason CPUs aren't just replaced by GPUs.
Another problem with GPUs is that they are not nearly as standardized as CPUs are, so you may end up with separate binaries for separate GPU configurations.
I would also suspect virtualization will slow things down rather than speeding them up, since emulation carries an overhead cost. If there is something that a virtualization improves, it can probably be improved more and better if the corresponding change was made in DF itself (but if the virtualization was targeted to a specific architecture, it might do tricks unsuitable for a general solution).
Logged

BoredVirulence

  • Bay Watcher
    • View Profile
Re: What does it take to MAX Dwarf Fortress?
« Reply #13 on: December 09, 2014, 02:37:07 pm »

It would probably be better if the problem was attacked at the root, i.e. if DF itself was redesigned to be/support multithreaded. One clear candidate for a separate thread is the calculations for events external to the fortress (at least in fortess mode) since they have a very small interaction with the fortress itself (probably only diplomat/liason reports) and thus should have a limited need for multiple access protection and separation, another one is graphics, a third one is equipment wear, and a fourth is liquid flow and temperature calculations (there are probably others as well).
I doubt a GPU would be of much help for most of DF, since GPUs are very good at doing a very narrow range of repetitive tasks really fast, but are quite poor for general computing. There is, after all, a reason CPUs aren't just replaced by GPUs.
Another problem with GPUs is that they are not nearly as standardized as CPUs are, so you may end up with separate binaries for separate GPU configurations.
I would also suspect virtualization will slow things down rather than speeding them up, since emulation carries an overhead cost. If there is something that a virtualization improves, it can probably be improved more and better if the corresponding change was made in DF itself (but if the virtualization was targeted to a specific architecture, it might do tricks unsuitable for a general solution).

Of course the best solution would be for DF itself to be optimized, but thats not happening any time soon. I've done quite a bit of thought, and there are a lot of calculations that can be done on the GPU for a great gain. All map calculations for instance. The CPU can't efficiently do calculations on the map, because not only does it iterate through every tile for temperature, it also iterates through many tiles to calculate flow, as well as probably thousands of iterations for pathfinding. On the GPU, it could run a single iteration for all tiles for temperature, a single iteration for all flow. Pathfinding is more complex, but it could run those iterations in parallel, essentially meaning it only iterates for a single path, but the largest path. Offloading those calculations onto the GPU would be very efficient. Also, the GPU wouldn't have the issue of caching part of the map, it could store all of the map data, so there is less memory being manipulated constantly.

And thats the idea of the emulation, for this. While it does slow things down, an efficient VM is very much comparable to a native executable. Separate binaries would be an issue, for the VM, not DF, and could be done. The calculations that aren't suitable on the GPU, and there are many, could be done separately. And with some clever memory mapping, we might even be able to perform some of DF's calculations in parallel. Of course, it wouldn't truly be parallel, it would be more like predicting it, and when DF finally calls the specific function, finds that the VM already did the calculations. This would be difficult, if possible at all. Its an idea, an intriguing idea, but even if the project were possible, it certainly wouldn't be feasible by a single person.

Even if it did work, it would be such a hack, very much dependent on disassembly of DF, and it would have huge compatibility issues between versions, that it wouldn't be suitable for normal use without a team supporting it. I'd say the community is strained enough supporting DF hack, let alone a Frankenstein-esque VM designed to work around an inefficient program. Although, to Toady's credit some optimizations that may have huge benefits would be very difficult, so there is certainly no fault in not producing that, although some simple multi-threading in a few key places would go a long way, as you mentioned.
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: What does it take to MAX Dwarf Fortress?
« Reply #14 on: December 10, 2014, 03:46:38 am »

I don't think a virtual machine could change how things are done on a higher level, such as merging tile calculations. To do that, you'd have to rip out the appropriate parts of DF and replace it with the modified logic.
To precompute or use alternate calculation methods you'd have to identify the appropriate internal interfaces or "API"s and replace the code underneath. If some of the calculations are made by .dll/.so/... binaries, such binaries could be replaced with ones that use the modified logic/GPU resources.

I'd say these kinds of improvements/modifications would require DF to be opened up even more, and possibly that more people would work on DF itself.

The problem with "simple" multi threading is that bolting it on afterwards is no easy thing. If designed for multithreading in mind from the start, it might be easy, but otherwise you'd probably enter a quagmire of multiple access protection issues and computation order dependencies. Take equipment wear, for instance:
- You can have a thread that goes through all wear-prone items and applies wear to them. Normally, that would be it, but:
- Sometimes things are destroyed or subject to non standard wear (such as being exposed to fire), and this would likely be applied by the main thread.
- You could link items subject to wear from different sources into a temporary list that's post processed after the normal calcuations.
- You could let it be "random" whether wear is applied before or after an item is used (if a piece of clothing is falling apart, and it's hit in combat, chance [i.e. the order in which the threads processes the item] governs whether it was hit or whether it had already been destroyed, for instance).
- All of this hinges on the item structure being such that it safely can be accessed from multiple threads. A linked list where you remove an item from the list or reshuffle the list can give "interesting" results.
Logged
Pages: [1] 2