Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: More questions about FPS  (Read 590 times)

thebear

  • Bay Watcher
    • View Profile
More questions about FPS
« on: August 23, 2011, 11:23:46 pm »

I have two questions about FPS maximization that I have been wondering about.

1) Item clutter is a drain on FPS. How is it counted? For instance is a barrel of seeds one item, or does each individual seed count as a discrete item? If each seed is a discrete item then wouldn't each seed have its own temperature calculation?

2) I'm trying to understand pathfinding better. Mined out space is a drag on FPS because of pathfinding right? But what if a mined out space is then completely walled up? Would that reverse the FPS hit?

Thanks to anyone who takes the time to help me out.
Logged

Excedion

  • Bay Watcher
    • View Profile
Re: More questions about FPS
« Reply #1 on: August 23, 2011, 11:26:47 pm »

2) I'm trying to understand pathfinding better. Mined out space is a drag on FPS because of pathfinding right? But what if a mined out space is then completely walled up? Would that reverse the FPS hit?

As far as I know walling up unused areas does mean your dwarves won't try to path there. But I may be wrong
Logged
If adamantine is perfectly rigid, as shown by having 0 strain at fracture in the raw files, then the speed of sound in the metal approaches the speed of light. Adamantine musical instruments would produce ultrasonic vibrations, and cut off the fingers of the musician.

Kay12

  • Bay Watcher
  • Fighting for Elite Liberal values since 2009!
    • View Profile
Re: More questions about FPS
« Reply #2 on: August 24, 2011, 01:09:39 am »

1) Item clutter is a drain on FPS. How is it counted? For instance is a barrel of seeds one item, or does each individual seed count as a discrete item? If each seed is a discrete item then wouldn't each seed have its own temperature calculation?

Hum dum dum... a single stack of items can, at least in all DF situations I can think of now, be abstracted into a single "stack item" with a variable keeping track of quantity. I assume that's how it works in DF as well. Multiple smaller stacks, I guess, reduce framerate more than the same amount of items in a large stack.

But seeds and such aren't the real killer - they have much less properties needing tracking than most items in DF - a single piece of clothing, for example. Just imagine all that junk the goblins bring - for each item, the game'll have to keep track of material, quality, possible decorations, size, whether it's currently ablaze or not, whether it's being used for something (typically dumping) etc... and the goblins bring HUNDREDS of these items while simultaneously pathing and bleeding and doing all sorts of fascinating stuff...
Logged
Try Liberal Crime Squad, an excellent Liberal Crime adventure game by Toady One and the open source community!
LCS in SourceForge - LCS Wiki - Forum thread for 4.04

MarcAFK

  • Bay Watcher
  • [INSANITY INTENSIFIES]
    • View Profile
Re: More questions about FPS
« Reply #3 on: August 24, 2011, 01:34:38 am »

I read somewhere in the forums that walled off areas actuallyhurt your fps because the game still has to calculate how to reach them, or maybe it was walled off stones which causes the FPS hit. I'l try a forum search.
Logged
They're nearly as bad as badgers. Build a couple of anti-buzzard SAM sites marksdwarf towers and your fortress will look like Baghdad in 2003 from all the aerial bolt spam. You waste a lot of ammo and everything is covered in unslightly exploded buzzard bits and broken bolts.

Kay12

  • Bay Watcher
  • Fighting for Elite Liberal values since 2009!
    • View Profile
Re: More questions about FPS
« Reply #4 on: August 24, 2011, 01:51:02 am »

I read somewhere in the forums that walled off areas actuallyhurt your fps because the game still has to calculate how to reach them, or maybe it was walled off stones which causes the FPS hit. I'l try a forum search.

Pathfinding in general is tricky, especially if there's a lot of branching. However, I assume walled-off areas will cause an FPS hit only if your dwarves/goblins/etc decide they need something inside there.
Logged
Try Liberal Crime Squad, an excellent Liberal Crime adventure game by Toady One and the open source community!
LCS in SourceForge - LCS Wiki - Forum thread for 4.04

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: More questions about FPS
« Reply #5 on: August 24, 2011, 02:14:34 am »

-DF uses a modified A* pathfinding algorithm.
-Tiles on the map that can be walked between are kept in groups.
-If you wall off an area, the game won't attempt to path there because the start and finish points are in different groups.
-A current bug with creatures that fly is that they won't use their ability to fly unless they could also walk there on foot instead.
-If you try to build a workshop in one walkable group of tiles, then the game won't list wood logs that are lying in a different walkable group. I get "No access to building material non-economic item" when I try to designate a wall in a small, empty room with a locked door. I can designate the wall if I unlock the door.
-Items in walled-off areas therefore don't cause an extra cpu or pathfinding hit.
-Hallways that lead towards a location where a dwarf wants to go, but dead-end before they get there, cause large pathfinding lag because they trick the pathfinding algorithm into exploring a false path.
-The pathfinding algorithm generally explores the easiest path first (a straight line).
-Laying out "high traffic" traffic designations helps FPS.

See http://www.youtube.com/results?search_query=a+star+pathfinding&aq=f

My current fort is spherical, with food/booze storage, bedrooms, and meeting rooms at the core so dwarves only have to walk in straight lines to get to their destination. Workshops and industry rooms are on the outside of the sphere, at the end of radial spoke hallways.

Kay12

  • Bay Watcher
  • Fighting for Elite Liberal values since 2009!
    • View Profile
Re: More questions about FPS
« Reply #6 on: August 24, 2011, 02:26:31 am »

That's pretty much what I assumed it to work like. The flyer part is not all true though, I'm afraid... I had a fort designed under that assumption (=even fliers will enter this trap tunnel bridge muahaha!) but the Roc just decided to fly over the walls and savaged my dwarves. On the other hand, goblin cave swallow troops were very inept at even moving at all...
Logged
Try Liberal Crime Squad, an excellent Liberal Crime adventure game by Toady One and the open source community!
LCS in SourceForge - LCS Wiki - Forum thread for 4.04