Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 6 7 [8] 9 10 11

Author Topic: Is the constant simulation of the game world worth getting 1/5th the FPS?  (Read 24723 times)

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: Is the constant simulation of the game world worth getting 1/5th the FPS?
« Reply #105 on: September 26, 2014, 10:40:08 am »

I think the greater FPS drain in zombie  sieges is because they're all building destroyers and thus path to buildings alongside dwarves.

That would do it -- BUILDINGDESTROYER is much laggier than normal pathfinding.
Logged

malvado

  • Bay Watcher
    • View Profile
Re: Is the constant simulation of the game world worth getting 1/5th the FPS?
« Reply #106 on: September 26, 2014, 11:30:13 am »

I think the greater FPS drain in zombie  sieges is because they're all building destroyers and thus path to buildings alongside dwarves.

That would do it -- BUILDINGDESTROYER is much laggier than normal pathfinding.

I wonder if the fps frame drop can be a combination of several factors, looking at my old log it seems that there's a lot of armies not finding their way (supposedly to my fortress?) , so perhaps :

*Problems with armies.
*Problems with Buildingdestroyers
= Performance problems.

Then you also might have problems with caravans not dissapearing after visiting your fortress , I will try to see if I can get some time to test a freshly generated 40.13 fortress towards this and anote when fps drops occurs.
Logged

ShadeJS

  • Bay Watcher
    • View Profile
Re: Is the constant simulation of the game world worth getting 1/5th the FPS?
« Reply #107 on: September 26, 2014, 03:59:54 pm »

1: fix things. 2: add things 3: fix more things 4: fix even more 5: add one or two more things 6: optimize.

Lifted from Wikipedia:
On Optimisation--
"More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason — including blind stupidity." — W.A. Wulf
"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%. A good programmer will not be lulled into complacency by such reasoning, he will be wise to look carefully at the critical code; but only after that code has been identified" — Donald Knuth
"Bottlenecks occur in surprising places, so don't try to second guess and put in a speed hack until you have proven that's where the bottleneck is." — Rob Pike
"The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet." — Michael A. Jackson

The last quote is probably the most relevant here...

Unless an optimization is as trivial as being able to copy and past some 'significant' work out of a loop, or stopping a spammy and expensive check, it's just not worth the effort 99% of the time, especially in a sub-feature that isn't near complete. The exception would be something quantifiably expensive that gets done in every iteration of the main loop. Fluid, pathing, FOV, and stuff like that.

On threads--

"A programmer had a problem. He thought to himself, "I know, I'll solve it with threads!". has Now problems. two he" — Davidlohr Bueso

The world simulation SEEMS pretty segregated from fort / adventure mode, and you may be able to offload that to a thread. Though it shouldn't be gobbling all that much CPU. Given that the GUI was released as separate ball of source you may be able to hive that off to it's own thread. The locking might not drive Toady too insane. The waiting on locks might not eat up all of the gains... Beyond that it gets worse... I could only imagine the amount of locking and careful attention to order that would be required to really pull appart big subsystems and put them into threads.

In both the optimization case, and the threading case, it would come at the direct expense of adding features and fixing bugs (while adding new and potentially nightmarish bugs).
Logged

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: Is the constant simulation of the game world worth getting 1/5th the FPS?
« Reply #108 on: September 26, 2014, 06:36:15 pm »

The world simulation SEEMS pretty segregated from fort / adventure mode, and you may be able to offload that to a thread.

This assumption will become increasingly unrealistic as Toady adds more ability for the fortress to interact with the world.
Logged

draeath

  • Bay Watcher
  • So it has come to this...
    • View Profile
Re: Is the constant simulation of the game world worth getting 1/5th the FPS?
« Reply #109 on: September 28, 2014, 11:24:10 am »

Threading is not optimization - it's something that has to be designed in from the get-go. You could mangle an existing system into doing this, by taking pieces out of the main loop and ensuring a call to the dispatcher is in the main loop as well - but you'll be finding, creating, and fixing a crapton of bugs by doing it after the fact.

A "simple" way to go about this is to have each major process going on (pathing, rendering, etc) all "checking in" with a dispatcher thread that does nothing but "keep time" - waits for all threads to check in before releasing them for another tick. Even this isn't as simple as it appears though, as the order that they get released can have a huge effect on what happens. Does the pathing thread get a leg up on combat, or the other way around, for example.

The hardest part of threading is making sure that threads don't overwrite each others changes to data without the other threads knowing about it. Threads should be as atomic as possible.
Logged
Urist McAlchemist cancels extract isotope: interrupted by supercriticality accident.
This kea is so raw it stole my wheelbarrow!

dwarf_reform

  • Bay Watcher
  • [NOT_BUTCHERABLE]
    • View Profile
Re: Is the constant simulation of the game world worth getting 1/5th the FPS?
« Reply #110 on: September 29, 2014, 05:16:18 pm »

Another query from someone with no real knowledge :) Since the accelerated/modest/fps mods seem to focus on generic leather and wood, and reduced common stone, just how much do those things (and other annoyances like excess worn-out clothing) actually help fps in the new version, compared to those hard-hitters like pathing and fluids?? (I personally hate going with generic wood and leather, leather especially..)
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Is the constant simulation of the game world worth getting 1/5th the FPS?
« Reply #111 on: September 30, 2014, 12:23:15 am »

It should be no different from previous versions as far as those hard-hitters go.

Authority2

  • Bay Watcher
  • [ETHIC: INCREASE_FPS: REQUIRED]
    • View Profile
Re: Is the constant simulation of the game world worth getting 1/5th the FPS?
« Reply #112 on: September 30, 2014, 08:50:13 am »

In my four-year-old 2x2 Modest Accelerated Mash fort capped at 12 dwarves, the fps has fallen to 17. I tried adding [CANNOT_JUMP] and [CANNOT_CLIMB] to all the creature_standard and creature_subterranean creatures, with no change whatsoever. Then I decided to try clearcutting the dozens of trees that had sprung up on the surface over time, and before the map was even a quarter clear my fps had doubled to 34.

I think it's the trees. It would make sense.

EDIT: about halfway cleared, fps is 55. I might try some of the trees in the caverns as well after I'm done.
« Last Edit: September 30, 2014, 09:02:15 am by Authority2 »
Logged
"But I tell you what the Queen wants is impossible. The story of her mandate to create floodgates in our desert fortress cannot be told in less than 314160 stanzas! Art bows not to any dwarf!"

StagnantSoul

  • Bay Watcher
  • "Player has withdrawn from society!"
    • View Profile
Re: Is the constant simulation of the game world worth getting 1/5th the FPS?
« Reply #113 on: September 30, 2014, 08:58:00 am »

^ Give this person a cookie. And a ☼Roc Tallow Roast☼.
Logged
Quote from: Cptn Kaladin Anrizlokum
I threw night creature blood into a night creature's heart and she pulled it out and bled to death.
Quote from: Eric Blank
Places to jibber madly at each other, got it
Quote from: NJW2000
If any of them are made of fire, throw stuff, run, and think non-flammable thoughts.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Is the constant simulation of the game world worth getting 1/5th the FPS?
« Reply #114 on: September 30, 2014, 10:33:41 am »

In my four-year-old 2x2 Modest Accelerated Mash fort capped at 12 dwarves, the fps has fallen to 17. I tried adding [CANNOT_JUMP] and [CANNOT_CLIMB] to all the creature_standard and creature_subterranean creatures, with no change whatsoever. Then I decided to try clearcutting the dozens of trees that had sprung up on the surface over time, and before the map was even a quarter clear my fps had doubled to 34.

I think it's the trees. It would make sense.

EDIT: about halfway cleared, fps is 55. I might try some of the trees in the caverns as well after I'm done.
The trees surely are the doom animal of DF2014.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Authority2

  • Bay Watcher
  • [ETHIC: INCREASE_FPS: REQUIRED]
    • View Profile
Re: Is the constant simulation of the game world worth getting 1/5th the FPS?
« Reply #115 on: September 30, 2014, 11:02:33 am »

The trees on the surface are growing back too fast for me to start a cavern defoliation with my eight workers. Also, exploding trees have injured two of them so far.

The trees surely are the doom animal of DF2014.
So true.
Logged
"But I tell you what the Queen wants is impossible. The story of her mandate to create floodgates in our desert fortress cannot be told in less than 314160 stanzas! Art bows not to any dwarf!"

than402

  • Bay Watcher
  • DF2014:we all knew it was inevitable
    • View Profile
Re: Is the constant simulation of the game world worth getting 1/5th the FPS?
« Reply #116 on: September 30, 2014, 11:11:10 am »

i play on 2x2 or 3x3 embarks anyway, so personally i think i'll just construct floors on most of the surface and the caverns. it will take a while,but that should definitely stop them.
Logged

rhoxa

  • Bay Watcher
    • View Profile
Re: Is the constant simulation of the game world worth getting 1/5th the FPS?
« Reply #117 on: September 30, 2014, 11:37:38 am »

I'll see about clear cutting my area tonight.

Although I thought someone in this thread embarked in an area with no trees and had the same FPS problem?  Do underground trees grow if you don't breach the caverns?
Logged

Authority2

  • Bay Watcher
  • [ETHIC: INCREASE_FPS: REQUIRED]
    • View Profile
Re: Is the constant simulation of the game world worth getting 1/5th the FPS?
« Reply #118 on: September 30, 2014, 11:48:02 am »

i play on 2x2 or 3x3 embarks anyway, so personally i think i'll just construct floors on most of the surface and the caverns. it will take a while,but that should definitely stop them.
Paved roads should work too, and be cheaper in building materials.
Logged
"But I tell you what the Queen wants is impossible. The story of her mandate to create floodgates in our desert fortress cannot be told in less than 314160 stanzas! Art bows not to any dwarf!"

dennislp3

  • Bay Watcher
    • View Profile
Re: Is the constant simulation of the game world worth getting 1/5th the FPS?
« Reply #119 on: September 30, 2014, 12:36:30 pm »

I tend to pave large areas...so I suppose I have not really noticed the FPS issues as much
Logged
Pages: 1 ... 6 7 [8] 9 10 11