Bay 12 Games Forum

Please login or register.

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

Author Topic: Hope is on the horizon - one day FPS drops might be a thing of the past!  (Read 8291 times)

Evans

  • Bay Watcher
    • View Profile

Hello,

We all love Dwarf Fortress. We all hate lags and FPS drops.

Thankfully for all of us here, science is hard at work to solve our issues:
https://www.theguardian.com/technology/2016/may/22/age-of-quantum-computing-d-wave

We are moving slowly into that direction. First few qubit units are already up and running.
http://www.pcworld.com/article/3065654/hardware/ibms-quantum-computing-processor-comes-out-of-hiding.html

Soon, maybe withing the next decade or two we might actually get quantum chips for PCs.
The day that happens we will all be able to embark on a site of maximum size and get our mist generators and water reactors up and running without any loss of performance :)

When I think of it, my retirement might be full of !FUN! :)
I wish to all of us that QC would arrive sooner rather than later :)
Logged
getlost.lua # How to get rid of tavern guests
function getlost ()
   local unit = dfhack.gui.getSelectedUnit (true)
   unit.flags1.forest = true
end
getlost ()

wierd

  • Bay Watcher
  • I like to eat small children.
    • View Profile
Re: Hope is on the horizon - one day FPS drops might be a thing of the past!
« Reply #1 on: September 18, 2016, 11:54:47 am »

FPS drop in DF is not usually caused by cpu speed, but by RAM access speed.

Modern CPUs are already much faster than the switching speed in most RAM modules, (Yes, even DDR4). This means that if the program does lots of things with RAM (Like DF does), then it will spend lots and lots of time waiting around for the memory bus to be free so it can perform another memory operation.

DF uses very large data structures in RAM (Like the creature and item index vectors), which get bigger the more dwarves or items you have in your fortress.  There are limits to how much data one can pull in or out of a memory read or write at a time. This is usually called the "Word size" and is processor and architecture dependent. 64bit processors have larger word sizes, which is one reason (among many!) that the 64bit version of the game is very well received, and likely results in a performance increase on the same hardware.

quantum computing uses entanglement to make decisions about the values of qbits "instantly", but will still suffer without quantum memory being also attached. The cost and complexity of the computer increases exponentially with each additional qbit that has to be maintained in an entangled state.  It is also a vastly different beast than a normal processor, and does not result in any increases of performance for certain classes of workload.

Throw on top of that that DF is a single threaded application intended for serial execution. Getting multi-core support in DF seems to be a losing battle, because toady has no interest in being a masochist. (Sorting out all the mutexes and spinlocks needed to keep concurrency in a multithreaded version of DF would be excrutiatingly painful mentally.)

So, no. I dont see DF running on a quantum architecture unless it is inside some kind of emulation wrapper.
Logged

Evans

  • Bay Watcher
    • View Profile
Re: Hope is on the horizon - one day FPS drops might be a thing of the past!
« Reply #2 on: September 18, 2016, 02:38:03 pm »

It's early days.

Let me remind you that weight of early computers was measured in tonnes.

As for ram access speeds I still have my ddr1 somewhere in the box with ancient stuff.

Science and technology is moving at such an accelerating pace over the last 15 years (I was watching very closely) that sometimes I have hard time believing it.

Few decades ago, quantum computing was a theory. Now it slowly being here.
My sd card ten years ago held around 128 mb of data. Now I have 128gb pendrive attached to this very laptop I am using.
HDDs were measured in GB once. Now my DF folder is bigger than that (all those versions and saves).

And on top of that we are getting storage crystals of 360tb capacity that can retain data for million year:
https://www.cnet.com/news/a-360tb-disc-that-holds-data-for-more-than-1-million-years/

These might sound like fiction today, as these are early days (literally, just invented and build, these are the firsts).

You just cant say, knowing all those facts now, that nobody will ever tackle the bandwith problem with RAM access.

Think of it. The first USB port dates how far back in time? 1996? something like that? It's ancient prehistory now, dinosaurs were still around at that time.
What version is actual today? 3.1? increase in transfer speed how many fold?

Be optimist.
Nobody is going to build a computer with ultra fast chip and leave RAM transfer times as a bottle neck :)
Logged
getlost.lua # How to get rid of tavern guests
function getlost ()
   local unit = dfhack.gui.getSelectedUnit (true)
   unit.flags1.forest = true
end
getlost ()

wierd

  • Bay Watcher
  • I like to eat small children.
    • View Profile
Re: Hope is on the horizon - one day FPS drops might be a thing of the past!
« Reply #3 on: September 18, 2016, 03:03:39 pm »

you are more likely to get a good performance boost from the switch to carbon nanofiber based processors.

Not really a pessimist. I have been using and repairing computers since the 90s.  I remember when processor speed was 8mhz.

I am just pointing out the kind of processes that go on inside of dwarf fortress, and the sources of the bottlenecks. quantum computing is not likely to improve DF's performance.

As for ram speed vs CPU speed, there are real limits preventing fast accesses.  Namely, the signal propogation delay between the CPU and the ram chips from the physical distance, among others.

Unless you build the memory directly into the CPU, (or vise versa), the speed of memory will always be slower than the speed at which the ALUs inside the CPU can crunch a computation, given modern designs.

So, yes-- CPUs are much faster than RAM, and will stay that way.
« Last Edit: September 18, 2016, 03:08:06 pm by wierd »
Logged

jecowa

  • Bay Watcher
    • View Profile
Re: Hope is on the horizon - one day FPS drops might be a thing of the past!
« Reply #4 on: September 18, 2016, 03:09:49 pm »

Will the existing code work with a quantum computer once someone writes a C++ compiler for a quantum architecture?
Logged

wierd

  • Bay Watcher
  • I like to eat small children.
    • View Profile
Re: Hope is on the horizon - one day FPS drops might be a thing of the past!
« Reply #5 on: September 18, 2016, 03:23:19 pm »

Not all tasks correlate well with quantum computing.  Massively parallelizable tasks work well, but serialized tasks do not.

Take for instance, asking the computer to find all the factor pairs for 45382937977283222.
The quantum computer can fire off a shitload of parallel factoral comparisons, and get the answer "instantly."
In contrast, a classical computer must try each possible set of factors until it exhausts the problem space.

The quantum computer wins hands down.  This is exactly why quantum computing is interesting for cryptography.

However, what about a complex logic chain, that makes decisions based on the outputs of prior decisions?  Say, computing the damage a dwarf takes from falling onto a spike trap?

The computer must first compute how fast the dwarf is falling, by evaluating how far they have already fallen. It must then make a decision about how the dwarf's stats factor into its ability to dodge, and also how the mass of the object it is landing on influences the impact energy, and then finally, compute how gibbtastic the dwarf will be after the fall's energy is distributed onto their body. 

It make each subdecision based on data in memory, stores the intermediate results in memory, and each decision is fundamentally tied to the output of the prior decision.

The quantum computer cannot evaluate this chain any faster than the classical computer can.
Logged

wierd

  • Bay Watcher
  • I like to eat small children.
    • View Profile
Re: Hope is on the horizon - one day FPS drops might be a thing of the past!
« Reply #6 on: September 18, 2016, 03:37:38 pm »

Again, you are more likely to get a profound boost in performance from a switch to carbon nanotube FET based processors.

http://nanotechweb.org/cws/article/tech/66080

Carbon nanotube based FETs are able to switch far faster, using far less power, and endure much higher temperatures than even the mathematically ideal silicon based FET could achieve.

The major technological hangup is efficient manufacture of nanotubes with arbitrary diameter, length, and number of walls with consistency.

When they can efficiently control nanotube manufacture, silicon based computers will be ancient history.
Logged

Evans

  • Bay Watcher
    • View Profile
Re: Hope is on the horizon - one day FPS drops might be a thing of the past!
« Reply #7 on: September 18, 2016, 04:08:53 pm »

Unless you build the memory directly into the CPU, (or vise versa), the speed of memory will always be slower than the speed at which the ALUs inside the CPU can crunch a computation, given modern designs.
You see? You even proposed a solution to the issue already :)

I believe that someone eventually will think of something. Really, things may not be that bad - we already had some weak AI set to solve certain problems, figuring out new and revolutionary architecture needed for getting the most of quantum computing and lowering the impact of bottle necks will probably be the next thing.

But seriously. I will take carbon nanotubes over QPU any time of the day if it lets me play DF with decent FPS.

Over a year ago I purchased this laptop with i7 and recently added fastest ram possible because of Dwarf Fortress.
Masterwork DF can't move to the most recent 64 bit version soon enough for me ;)

As for manufacturing this key component, work is pretty advanced. Vapor deposition method on silicon sheets is quite effective and one day... who knows?
I bet it will come unexpected, there are already things being build of CNTs.
http://www.sciencedirect.com/science/article/pii/S1369702114002582
Logged
getlost.lua # How to get rid of tavern guests
function getlost ()
   local unit = dfhack.gui.getSelectedUnit (true)
   unit.flags1.forest = true
end
getlost ()

wierd

  • Bay Watcher
  • I like to eat small children.
    • View Profile
Re: Hope is on the horizon - one day FPS drops might be a thing of the past!
« Reply #8 on: September 18, 2016, 04:22:56 pm »

do you want to replace your cpu to do a memory upgrade?

there is a reason ram is outside the cpu. (well, aside from cache)
Logged

Evans

  • Bay Watcher
    • View Profile
Re: Hope is on the horizon - one day FPS drops might be a thing of the past!
« Reply #9 on: September 18, 2016, 04:30:30 pm »

I have maxed out specs for my rig.
But if you are referring to your suggestion, I can only say - I don't know what will be invented in the next 20 years.

Hopefully something will come along that will let us play DF at stable 100 FPS no matter what happens on the map.

Looking back 20 y in t he past, I would not rule it out as impossible.
It's just... we don't know what will happen.
Logged
getlost.lua # How to get rid of tavern guests
function getlost ()
   local unit = dfhack.gui.getSelectedUnit (true)
   unit.flags1.forest = true
end
getlost ()

jecowa

  • Bay Watcher
    • View Profile
Re: Hope is on the horizon - one day FPS drops might be a thing of the past!
« Reply #10 on: September 18, 2016, 04:34:35 pm »

there is a reason ram is outside the cpu. (well, aside from cache)

Because CPU cache is hellaxpensive. The Broadwell i5-5675C and i7-5775C processors are probably good economical choices for a Dwarf Fortress rig with their 128 MB of L4 cache.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Hope is on the horizon - one day FPS drops might be a thing of the past!
« Reply #11 on: September 18, 2016, 04:36:59 pm »

Looking back 20 y in t he past, I would not rule it out as impossible.

super mario 64 came out 20 years in the past and advances since then have been almost all algorithmic and incremental, with parallelization being the primary advance.

Evaris

  • Bay Watcher
  • Random Bored Kitsune
    • View Profile
Re: Hope is on the horizon - one day FPS drops might be a thing of the past!
« Reply #12 on: September 18, 2016, 06:25:19 pm »

Pretty much the ideal current-gen technology would probably be something like HBM - tossing a non-upgradable set of RAM in close proximity to the CPU via an interfacer.  Given HBM 2.0 is set to go up to 32GB (or 64, can't remember which 2.0 was specced' up to), it might be viable in the consumer space, but is unlikely to be something we see given the ATX standard. 

That said, it's still possible in the next couple years we might see some systems coming out with embedded x86 SOCs which would have a more ideal RAM configuration for DF, but... we'll see.


But as others have said, quantum computing is unlikely to speed up DF.  Or be viable in the next 20 years.  Maybe 50, but probably not 20. 
Logged
Orichalcum Dwarf Fortress: An expansion mod giving extra realistic options to many un-and-underused materials in game.  [currently out of date, may be revived in the future]

wierd

  • Bay Watcher
  • I like to eat small children.
    • View Profile
Re: Hope is on the horizon - one day FPS drops might be a thing of the past!
« Reply #13 on: September 18, 2016, 06:55:49 pm »

while not a real SoC, the chromebook I am using right now (crouton for the win) is cheap and effective. 2gb RAM, baked in zram from factory, 1.6ghz intel. 64bit. the distance between the ram and the cpu is less than one inch. 

A scaled up version would run it like a boss.  currently running a 5x4 embark with 60 dwarves at 25fps.

given intel's desire to hit the tablet market, a ram-integrated chip may well be on the horizon.
Logged

jecowa

  • Bay Watcher
    • View Profile
Re: Hope is on the horizon - one day FPS drops might be a thing of the past!
« Reply #14 on: September 18, 2016, 07:26:24 pm »

I found a chart that shows the latency of various levels of cache and RAM on someone's system. https://forums.aida64.com/topic/2864-i7-5775c-l4-cache-performance/

It looks like Intel's L4 cache is about 20ms faster than DDR3.

given intel's desire to hit the tablet market, a ram-integrated chip may well be on the horizon.

That would be pretty awesome. It'd be nice to have a bunch of really fast RAM built-in. It seems like they are moving towards making it only available for their integrated GPU, though.
Logged
Pages: [1] 2 3 ... 5