Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Minor lag when chasming objects  (Read 1315 times)

Coriantumr

  • Bay Watcher
    • View Profile
Minor lag when chasming objects
« on: July 28, 2008, 04:28:36 pm »

This may not be a bug, so feel free to ignore it if it is.

When one of my dwarves throws an object into a chasm, it creates a noticeable 1/10 second or so lag in the game. Normally this isn't a problem but when I have more than just a few dwarves dumping at once it can more than halve my fps.

Is this just the game going through the overhead of permanently removing items from the game? I suppose depending on how Toady has written it, it must take at least a bit to remove the appropriate entry in the array/linked list/binary tree/sparse array/etc ... which ever method he uses to keep tabs on everything.
Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Minor lag when chasming objects
« Reply #1 on: July 28, 2008, 09:42:26 pm »

It shouldn't take that long.  Do you have a save right in the thick of the worst lag from this?
Logged
The Toad, a Natural Resource:  Preserve yours today!

Keldor

  • Bay Watcher
  • Blood for the blood god!
    • View Profile
Re: Minor lag when chasming objects
« Reply #2 on: July 30, 2008, 01:23:46 am »

Could it just be the dwarf pathfinding to his next task?
Logged
If ignorance is bliss, why are my dwarves all tantruming?

Awayfarer

  • Bay Watcher
  • Bork!
    • View Profile
Re: Minor lag when chasming objects
« Reply #3 on: July 30, 2008, 01:24:29 pm »

My money is on pathfinding. If you pause the game, mark several dozen items for dumping and unpause, the game needs to figure out paths for a large number of dwarves. It can cause a lot of lag all at once.

Happens to me when I mark a lot of goblin garbage for dumping. I only save shields and weapons (for dwarven/trap use), and chain shirts and chain leggings (for melting). Sixty dwarves trying to wind their way down to pit over my cave river will cause a huge lag spike.
Logged
--There: Indicates location or state of being.
"The ale barrel is over there. There is a dwarf in it."
--Their: Indicates possession.
"Their beer has a dwarf in it. It must taste terrible.
--They're: A contraction of the words "they are".
"They're going to pull the dwarf out of the barrel."

Coriantumr

  • Bay Watcher
    • View Profile
Re: Minor lag when chasming objects
« Reply #4 on: July 31, 2008, 04:07:06 pm »

I think I've figured it out, since I can no longer duplicate the effect.

Here's what I was doing:

I had dammed off a cave river and on the very bottom level of the map dug out a large, approx. 50x70 chamber that I was going to flood and then use to grow trees. Since the cave river exits the bottom of the map in a chasm, I figured I would just chuck all 3,500 or so stones into it to save the trouble of lugging them all the way back up to the fortress.

I'm not sure, when there are thousands of items designated for dumping how the next one is chosen. It doesn't seem to go by distance at all, so I am assuming that my minor lags each time a stone was chucked into the chasm probably had something to do with the dwarf deciding -which- of the remaining 3,499 stones they wanted to throw in next.

I now can't duplicate the effect because my 50x70 room now no longer has any stones left in it. I didn't think it was pathfinding because I only have seven adult dwarves and even if every single one of them wanted to find a new path quite frequently it shouldn't create noticable lag.

I can still find somewhere to upload the save if Toady still wants to see it, but there really isn't anything to see anymore. I should have kept an old one when the room was still full of junk.
Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Minor lag when chasming objects
« Reply #5 on: July 31, 2008, 07:45:03 pm »

Yeah, if you run into problems again, go ahead and send one in.  Hopefully it comes back just briefly enough for you to send in a save and then disappears forever.
Logged
The Toad, a Natural Resource:  Preserve yours today!