Bay 12 Games Forum

Please login or register.

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

Author Topic: major FPS improvement, over 2x!  (Read 10573 times)

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #45 on: February 18, 2009, 04:34:16 am »

Also, now I'm really mad.  First I was convinced that this was all totally bogus, so I never bothered to test it out.  Then I was convinced it was all totally true, so I started writing a PM to Toady, but figured I should test it out to make sure, first.

AND MY TESTS ARE COMING BACK NEGATIVE.  Across multiple controlled experiments, I'm seeing no change between 1:1:5:25 and 1:2:5:25 on my own system.  My well-established fortress (with no zones defined) waffles between 27 and 28 FPS regardless.  It doesn't even care if I designate high everywhere on all levels at 1:2:5:25!  It's not even an average--There are NO outlying points at all, it never goes lower than 27 or higher than 28 ever!

I did notice ONE way to change my FPS that could be a big deal if not controlled for.  When my viewscreen is looking at the sky, or generally somewhere that dwarves aren't, my FPS magically rises up to 32.  If I stare at the main gate, it is always in the 27-28 range.  People who run these experiments and who designate high everywhere must remember to control for camera location, too!

In conclusion, I hate you all, (in the most good-natured way) and running all these experiments is like taking chemistry again.  Congratulations, you just shattered my illusions that I liked doing science, and reminded me that 95% of science is being bored out of your mind and getting no results.  I'm going to sleep now.  Wake me when you have something reproducable, instead of theories that are either wild or sensible.  They all fail in the cold hard light of evidence, for me.  I no longer care about theories until more evidence is shown, but I still wish I knew why Ignoro's results are so weird!

(For the record, when I was working on a game like two weeks ago, my pathfinding was horribly slow because I had my path cost set to 5 units per tile, while my heuristic was set to 10 * distance.  Essentially exactly what the situation SEEMS to be here, just multiplied by five.  I don't KNOW why it isn't failing horribly!  Don't ask me why it isn't failing horribly when you have a path cost of 2!  IT DOESN'T MAKE SENSE!  Toady must be using some heuristic besides Manhattan, hell, for all I know he could be using a Dijkstra search!  I know he said he was using A* but still...)


Oh yeah.  And you know what pisses me off more than anything else?  Realizing that people are trying to give a technical analysis of this system, when they believe that
Quote
The 999999 value means that it's multiplying that large number rather a lot which is expensive.
Look, I'm sorry, I just...Ugh.  I'm probably not immune to saying badly-technically-incorrect stuff, but seeing this, I no longer care what anyone thinks.  It feels like talking geology with someone who thinks the earth is six thousand years old.  Sure, they may have studied the grand canyon in great, great detail, more than you even, but you hit a certain point in the conversation where there's just no point anymore.

Yes, I've been a total ass in this thread.
« Last Edit: February 18, 2009, 04:45:41 am by Sowelu »
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

Akhier the Dragon hearted

  • Bay Watcher
  • I'm a Dragon, Roar
    • View Profile
    • My YouTube Channel
Re: major FPS improvement, over 2x!
« Reply #46 on: February 18, 2009, 04:43:48 am »

now dont be like that! science is fun and just to prove it i dropped cats into lava and then dropped cats into magma to test if there was a difference and dont worry i tried it with kittens to! same result of flame melty death for the furry menance. remember if a thing like this not you cup of tea let other people test then do like the rest of us and argue for or against it for no real reason. ;D
Logged
Quote
Join us. The crazy is at a perfect temperature today.
So it seems I accidentally put my canteen in my wheelbarrow and didn't notice... and then I got really thirsty... so right before going to sleep I go to take a swig from my canteen and... end up snorting a line of low-grade meth.

LegoLord

  • Bay Watcher
  • Can you see it now?
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #47 on: February 18, 2009, 08:16:33 am »

I DO NOT UNDERSTAND A WORD OF THIS.  CAN SOMEONE PLEASE EXPLAIN IN TERMS A CHEMIST COULD UNDERSTAND?
Logged
"Oh look there is a dragon my clothes might burn let me take them off and only wear steel plate."
And this is how tinned food was invented.
Alternately: The Brick Testament. It's a really fun look at what the bible would look like if interpreted literally. With Legos.
Just so I remember

dreiche2

  • Bay Watcher
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #48 on: February 18, 2009, 09:14:46 am »

That's actually all very interesting, and calls for some optimization of the default values and further experiments.

To learn the basics, here's some reading about A* that I found helpful:

http://www.policyalmanac.org/games/aStarTutorial.htm

It seems to me now that yes, like some have pointed out, even changing init values without designating anything could still alter things depending on which value the algorithm picks to calculate the heuristic, i.e. the estimated distance cost from the current tile to the target.

It also seems to be that by tuning that specific value against the normal one, you can influence how much the emphasis the algorithm puts on searching into the direction of the target first. E.g., possibly in a fortress you might assume that more often than not (because of player made hallways), the direction of the target is the better one to look into to. Thus, if you make the distance cost high in the heuristic, the algorithm will prefer tiles in that direction in its search.

I'd also like to see more results from what people can achieve in terms of FPS by designating direct routes as high traffic zones (if anything).
Logged

Techhead

  • Bay Watcher
  • Former Minister of Technological Heads
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #49 on: February 18, 2009, 11:27:00 am »

Would be nice to hear from the almighty Toad about this...

After reading the later comments, QFT.
Logged
Engineering Dwarves' unfortunate demises since '08
WHAT?  WE DEMAND OUR FREE THINGS NOW DESPITE THE HARDSHIPS IT MAY CAUSE IN YOUR LIFE
It's like you're all trying to outdo each other in sheer useless pedantry.

Jifodus

  • Bay Watcher
  • Resident Lurker
    • View Profile
    • Dwarf Fortress Projects
Re: major FPS improvement, over 2x!
« Reply #50 on: February 18, 2009, 01:57:10 pm »

Here's a warning for you guys. If you've been changing path costs in init.txt, make sure they have changed once you load the save.

I'm observing behavior that seems to indicate that DF saves the path costs, though I have yet to confirm it.

Edit #1:

* I have confirmed that DF is saving path costs.
* Path costs internally are multiplied by 256 or 362, I'm not sure what differentiates the usage between them yet.
« Last Edit: February 18, 2009, 02:15:12 pm by Jifodus »
Logged

dreiche2

  • Bay Watcher
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #51 on: February 18, 2009, 02:24:08 pm »

You mean you need to redesignate after loading...?
Logged

Jifodus

  • Bay Watcher
  • Resident Lurker
    • View Profile
    • Dwarf Fortress Projects
Re: major FPS improvement, over 2x!
« Reply #52 on: February 18, 2009, 02:33:44 pm »

Nope, I'm pretty sure you have to edit the path costs in game for it to actually have an effect.

For some reason I get the feeling that I've looked at the path finding algorithm before.
Logged

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #53 on: February 18, 2009, 02:37:09 pm »

Here's a warning for you guys. If you've been changing path costs in init.txt, make sure they have changed once you load the save.

I'm observing behavior that seems to indicate that DF saves the path costs, though I have yet to confirm it.

Edit #1:

* I have confirmed that DF is saving path costs.
* Path costs internally are multiplied by 256 or 362, I'm not sure what differentiates the usage between them yet.


Hmm.  I noticed that when I changed to [1:1:5:25], the 'designate path cost' menu still DISPLAYED that it was 1, 2, 5, 25.  I wasn't sure if that was an interface issue or whether those four values were getting stored instead of taken from the init.  If they're stored on world gen, half my experiments are invalid...but I personally still didn't see any difference between high@1 and medium@2.

Thank you for your memory hacking!

Also, that multiplication is clearly a horizontal/vertical vs diagonal movement, since 362 = 256*1.414.  Sounds like the numbers are still internally stored as 1, 2, 5, 25 though, instead of saved to disk as 256*whatever.  Actually, I would have thought that the values were stored as a two-bit flag...
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

numerobis

  • Bay Watcher
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #54 on: February 18, 2009, 04:05:15 pm »

I DO NOT UNDERSTAND A WORD OF THIS.  CAN SOMEONE PLEASE EXPLAIN IN TERMS A CHEMIST COULD UNDERSTAND?
We're trying to figure out whether the settings in init.txt can make hydroxyls attract methyl groups faster than they do by default.  It seems not impossible based on the theory, but we haven't really found a reliable empirical test yet.
Logged

Jifodus

  • Bay Watcher
  • Resident Lurker
    • View Profile
    • Dwarf Fortress Projects
Re: major FPS improvement, over 2x!
« Reply #55 on: February 18, 2009, 05:35:58 pm »

Hmm.  I noticed that when I changed to [1:1:5:25], the 'designate path cost' menu still DISPLAYED that it was 1, 2, 5, 25.  I wasn't sure if that was an interface issue or whether those four values were getting stored instead of taken from the init.  If they're stored on world gen, half my experiments are invalid...but I personally still didn't see any difference between high@1 and medium@2.

Thank you for your memory hacking!

Also, that multiplication is clearly a horizontal/vertical vs diagonal movement, since 362 = 256*1.414.  Sounds like the numbers are still internally stored as 1, 2, 5, 25 though, instead of saved to disk as 256*whatever.  Actually, I would have thought that the values were stored as a two-bit flag...
It isn't an interface issue, I was monitoring the addresses as they were being written/read upon loading and unloading a save.

And yes, they are still internally stored as 1, 2, 5, 25. The multiplication is done when it's computing the cost of movement. The actual cost storage per tile is two bits, so you are correct for that assumption.

I'll see if I can find where the heuristic is being calculated and what it's using for that, or Toady can beat me to describing the algorithm.
Logged

LegoLord

  • Bay Watcher
  • Can you see it now?
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #56 on: February 18, 2009, 05:47:32 pm »

I DO NOT UNDERSTAND A WORD OF THIS.  CAN SOMEONE PLEASE EXPLAIN IN TERMS A CHEMIST COULD UNDERSTAND?
We're trying to figure out whether the settings in init.txt can make hydroxyls attract methyl groups faster than they do by default.  It seems not impossible based on the theory, but we haven't really found a reliable empirical test yet.
I'm making a crack at chemistry here;  really say it in a very simple way (i.e., a way in which chemists would be able to understand it).
Logged
"Oh look there is a dragon my clothes might burn let me take them off and only wear steel plate."
And this is how tinned food was invented.
Alternately: The Brick Testament. It's a really fun look at what the bible would look like if interpreted literally. With Legos.
Just so I remember

Ignoro

  • Guest
Re: major FPS improvement, over 2x!
« Reply #57 on: February 18, 2009, 09:45:19 pm »

We need a better test than cat herding across flat land. Lets standardize a test for this. Can the people who actually know A* suggest something?

Anyone want to donate a well developed fort save? Or would DF saving the costs ruin that?

Perhaps just 250 cats standing?

BTW, my tests were free of DF saving path costs. I ctrl-alt-deleted out of the game so it wouldn't save and re-embarked to the same area each time (god bless embark setup saving), so it shouldn't have been a factor in mine. I think. I hope.
Logged

Nesoo

  • Bay Watcher
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #58 on: February 19, 2009, 12:30:05 am »

We need a better test than cat herding across flat land. Lets standardize a test for this. Can the people who actually know A* suggest something?

With a warning that I've never actually used patrols, so I have no clue how they function, nor do I know A*:

How about slaughtering the wagon animals (so they aren't causing any fluctuations), make sure you bring no pets, then drafting everyone and set patrol points for them? That seems like it would provide a fairly stable and regular test pattern.
Logged
000508 □ [dwarf mode][flows] flooding over a full pond will kill the fish inside

numerobis

  • Bay Watcher
    • View Profile
Re: major FPS improvement, over 2x!
« Reply #59 on: February 19, 2009, 02:17:47 am »

Turn invasions off.
Pause the game with 20-50 idle workers.
Make a stone stockpile of size 100 (10x10) or more.
Save while centered on a lone idle dwarf.
Get a stopwatch and a slowish computer.
Test 1: load, designate everything normal traffic.  Hit space, and use the chronometer to see how long until the lone idle dwarf moves.
Test 2: same, but designate everything high traffic.
Test 3: same, but low traffic.

Repeat a few times.
Logged
Pages: 1 2 3 [4] 5 6 7