Bay 12 Games Forum

Please login or register.

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

Author Topic: Maximizing FPS?  (Read 4626 times)

Niseg

  • Bay Watcher
    • View Profile
Re: Maximizing FPS?
« Reply #15 on: March 03, 2011, 03:40:39 pm »

other than that I haven't tried the openGL method I'm using 2dasync which loads another core.

2dasync uses more than one core to process the game/graphics?
Yes I noticed that it loads another core to about 20% so when I'm under 100fps cap the game is  taking 30% cpu and I got 4 cores . It's not necessarily faster than openGL but when  I restricted the game to one core it showed performance degradation . I think there is an explanation of modes that multi-core   processor can benefit from 2dasync mode.


That's exactly why. How else would you program dwarves to find stuff? More stuff, longer time to look for stuff.

As far as I understand dwarf, goblins and other characters don't have a super computer in their brain. But if they go through the map's inventory they have probably have "collective memory". I know how I find things :

a. I stop and think where  I saw an item. If I don't know, I ask around. if none knows I either start searching or give up
b. if I found a suitable then I plot a course to my destination - If i know how to get there i go  I go to a map which is more time I'm not going to the destination.
c. as I  start moving to my destination I check around if I see the item that matches my criteria (I'm more advanced than avg dwarf but this may be time consuming).

All those things I described are not hard to code but I also learn by my experience and mistakes . The issue here is if a dwarf tries to be a super computer he'll try to find the item on the map and it would take him only 1 frame . You'd be in luck if he'll remember where he's going because as far as I know they don't go through the items every step of the way.

The only thing I could think of that might be causing trouble is a psychic thief - he might know the fort has a high  value or item and he wants to sneak inside and take it. he has to keep calculating gain vs risk . It has to track a  lot of creatures and variables and if it tries to be a supercomputer it will go over everything over and over trying to figure out what to go for and do it in 1 frame.

If you loop through all the items each time it would  take more and more time as that number grows. But if you have a limit of 50 items per frame the number of the items on the map is irrelevant but it would take the dwarf or whatever more time to find the item. There is also ways to optimize it by keeping separated lists .A thief won't go through all the stone in your fort because they are heavy and less valuable. The thief can also keep his own "shopping list" of things he wants and how to get to them. then he can attempt to reach one of them and fail due to high risk he would go to the next item on his list and  not go over the list of the entire map.

This may be a data structure issue if using link lists but as I said I don't think memory bandwidth or speed affects the game as much as cpu speed but this game is very complex. The fact it still runs very different types of  processes so memory speed may be a factor I just have to find a way to test it.
Logged
Projects:Path finding simulator(thread) -A*,weighted A*(traffic zones), user set waypoints (path caching), automatic waypoint room navigation,no-cache room navigation.

Marthnn

  • Bay Watcher
  • Everything's possible
    • View Profile
Re: Maximizing FPS?
« Reply #16 on: March 03, 2011, 04:20:05 pm »

World map size matters. Going from "smaller" (33x33) to "medium" (129x129) can easily halve your Fortress Mode FPS. Keep that in mind next time you gen a world.

Wait wait wait, a bigger world means less FPS?
uh. Yeah. Bigger world, more stuff to keep track of, more memory and cpu used, less frames per second (or FPS), so slower game and all that closer to Death By FPS.
Logged
Marthnn likes obsidian, steel, star ruby, goblin-cap wood, the color bloody red and giant desert scorpions for their tails. When possible, he prefers to consume sunshine. He absolutely detests cave blobs.

A dwarf wants to heal.  A dwarf is motivated to heal.  A dwarf is, by Armok, going to heal or die trying!  Because if he doesn't heal, he doesn't get alcohol.

arkhometha

  • Bay Watcher
    • View Profile
Re: Maximizing FPS?
« Reply #17 on: March 03, 2011, 05:31:56 pm »

other than that I haven't tried the openGL method I'm using 2dasync which loads another core.

2dasync uses more than one core to process the game/graphics?
Yes I noticed that it loads another core to about 20% so when I'm under 100fps cap the game is  taking 30% cpu and I got 4 cores . It's not necessarily faster than openGL but when  I restricted the game to one core it showed performance degradation . I think there is an explanation of modes that multi-core   processor can benefit from 2dasync mode.


That's exactly why. How else would you program dwarves to find stuff? More stuff, longer time to look for stuff.

As far as I understand dwarf, goblins and other characters don't have a super computer in their brain. But if they go through the map's inventory they have probably have "collective memory". I know how I find things :

a. I stop and think where  I saw an item. If I don't know, I ask around. if none knows I either start searching or give up
b. if I found a suitable then I plot a course to my destination - If i know how to get there i go  I go to a map which is more time I'm not going to the destination.
c. as I  start moving to my destination I check around if I see the item that matches my criteria (I'm more advanced than avg dwarf but this may be time consuming).

All those things I described are not hard to code but I also learn by my experience and mistakes . The issue here is if a dwarf tries to be a super computer he'll try to find the item on the map and it would take him only 1 frame . You'd be in luck if he'll remember where he's going because as far as I know they don't go through the items every step of the way.

The only thing I could think of that might be causing trouble is a psychic thief - he might know the fort has a high  value or item and he wants to sneak inside and take it. he has to keep calculating gain vs risk . It has to track a  lot of creatures and variables and if it tries to be a supercomputer it will go over everything over and over trying to figure out what to go for and do it in 1 frame.

If you loop through all the items each time it would  take more and more time as that number grows. But if you have a limit of 50 items per frame the number of the items on the map is irrelevant but it would take the dwarf or whatever more time to find the item. There is also ways to optimize it by keeping separated lists .A thief won't go through all the stone in your fort because they are heavy and less valuable. The thief can also keep his own "shopping list" of things he wants and how to get to them. then he can attempt to reach one of them and fail due to high risk he would go to the next item on his list and  not go over the list of the entire map.

This may be a data structure issue if using link lists but as I said I don't think memory bandwidth or speed affects the game as much as cpu speed but this game is very complex. The fact it still runs very different types of  processes so memory speed may be a factor I just have to find a way to test it.


Really? Never tested myself, but heard that DF didn't have multi core processing. The FPS deaths I had, changing the print mode didn't helped a bit. I have to check it out, tough.

World map size matters. Going from "smaller" (33x33) to "medium" (129x129) can easily halve your Fortress Mode FPS. Keep that in mind next time you gen a world.

Wait wait wait, a bigger world means less FPS?
uh. Yeah. Bigger world, more stuff to keep track of, more memory and cpu used, less frames per second (or FPS), so slower game and all that closer to Death By FPS.

Never tested this. Didnt't the game in Fortress mode mainly keep track of the map, not of the world?
Logged

Granite26

  • Bay Watcher
    • View Profile
Re: Maximizing FPS?
« Reply #18 on: March 03, 2011, 05:36:42 pm »

World map size matters. Going from "smaller" (33x33) to "medium" (129x129) can easily halve your Fortress Mode FPS. Keep that in mind next time you gen a world.

Wait wait wait, a bigger world means less FPS?
uh. Yeah. Bigger world, more stuff to keep track of, more memory and cpu used, less frames per second (or FPS), so slower game and all that closer to Death By FPS.

Never tested this. Didnt't the game in Fortress mode mainly keep track of the map, not of the world?
[/quote]

First I've heard of it, but there is stuff going on outside your fort these days, so it's plausible

ral

  • Bay Watcher
  • Praying to arm_ok
    • View Profile
    • Steam Profile
Re: Maximizing FPS?
« Reply #19 on: March 03, 2011, 05:59:12 pm »

But is 2dasync actually faster than opengl?

Granite26

  • Bay Watcher
    • View Profile
Re: Maximizing FPS?
« Reply #20 on: March 03, 2011, 06:06:34 pm »

It's marginally slower for me (46 v 37)

daishi5

  • Bay Watcher
    • View Profile
Re: Maximizing FPS?
« Reply #21 on: March 03, 2011, 06:10:07 pm »

World map size matters. Going from "smaller" (33x33) to "medium" (129x129) can easily halve your Fortress Mode FPS. Keep that in mind next time you gen a world.

Wait wait wait, a bigger world means less FPS?
uh. Yeah. Bigger world, more stuff to keep track of, more memory and cpu used, less frames per second (or FPS), so slower game and all that closer to Death By FPS.

Never tested this. Didnt't the game in Fortress mode mainly keep track of the map, not of the world?

First I've heard of it, but there is stuff going on outside your fort these days, so it's plausible
[/quote]
My own tests seem to show the same thing.  Current fort is 3x3 embark, small world, 179 dwarfs, kind of shallow with one cavern, only about 55 z levels deep.  With temp turned off and weather still on I get about 60-70 fps normally, a large number of dump or designation jobs drops it to the 40-50 range, invasions drop it to about 20-30.  This is with a 3 Ghz cpu, I have never had forts last this long on large maps.  I used to have fort death around 120 dwarfs at 10-15 fps on large world maps. 
Logged

Catastrophic lolcats

  • Bay Watcher
  • [FORTRESSDESTROYER:2]
    • View Profile
Re: Maximizing FPS?
« Reply #22 on: March 03, 2011, 08:49:03 pm »

Here's a short guide on my experiences of increasing fps.

Remember to generate a region rather than an island. Islands have much more in the way of Z levels.
2x2 is usually fine, although 1x1 through the use of nano fort can get really good fps on even the worse computers. For extra fun embark in a hunted forest with 7 military dwarves and attempt to hold out.

Also embark in flat areas. Like forests, deserts or along the coasts. The added bonus of this are closer magma seas. So far I haven't seen a difference in fps compared to large worlds and small worlds, nor the amount of time history had to generate. This however was never tested with huge maps or very long histories.

Temp and weather have a massive affect on my crappy netbook, so if you need the fps crunch get rid of them. Pets are also terrible. Kill them, all of them.
Beware ghosts, they seem to also attack the fps. This means that traders might have to be protected by raids (if turned on) or have a large supply of slabs on hand.

Population should also be kept low. Min in the game appears to be 20. Digging out large spaces can really slow down the fps, I've found. Forbidding mine shafts or tower cap farms is recommended.
Large amounts of items seem to drag it down for me, less if the temp is deactivated so there could be some connection there.

Flowing water will destroy your fps, avoid it like the plague.
Magma is useless without temp enabled so you'll have to maintain your fort without it's wonderful uses. 

Generate worlds with less caverns. The gameplay might get a bit crazy with trolls, neither caps and others all mixing in a single cavern, just pretend its hard mode. No caverns is best, although you'll be missing out on some context and modding will have to be done to allow dwarven civs to have access to under ground crops.

As far as I know, the lair of the protectors of the shiny blue metal cannot be removed without the magma sea going with it. The number of them can be turned to 0 however in world gen which will allow you to dig the blue metal unmolested without ruining your fps due to a careless designation.

Resources will be very low. Consider investing in an industry thats renewable such as clothes making or cooking. Trading will become very important for metals, even more so in today's world of .19.
A reaction to turn cloth into metals by a large ratio is a good way to combat this.
 
 
Logged

arkhometha

  • Bay Watcher
    • View Profile
Re: Maximizing FPS?
« Reply #23 on: March 03, 2011, 09:30:24 pm »

Here's a short guide on my experiences of increasing fps.

Remember to generate a region rather than an island. Islands have much more in the way of Z levels.
2x2 is usually fine, although 1x1 through the use of nano fort can get really good fps on even the worse computers. For extra fun embark in a hunted forest with 7 military dwarves and attempt to hold out.

Also embark in flat areas. Like forests, deserts or along the coasts. The added bonus of this are closer magma seas. So far I haven't seen a difference in fps compared to large worlds and small worlds, nor the amount of time history had to generate. This however was never tested with huge maps or very long histories.

Temp and weather have a massive affect on my crappy netbook, so if you need the fps crunch get rid of them. Pets are also terrible. Kill them, all of them.
Beware ghosts, they seem to also attack the fps. This means that traders might have to be protected by raids (if turned on) or have a large supply of slabs on hand.

Population should also be kept low. Min in the game appears to be 20. Digging out large spaces can really slow down the fps, I've found. Forbidding mine shafts or tower cap farms is recommended.
Large amounts of items seem to drag it down for me, less if the temp is deactivated so there could be some connection there.

Flowing water will destroy your fps, avoid it like the plague.
Magma is useless without temp enabled so you'll have to maintain your fort without it's wonderful uses. 

Generate worlds with less caverns. The gameplay might get a bit crazy with trolls, neither caps and others all mixing in a single cavern, just pretend its hard mode. No caverns is best, although you'll be missing out on some context and modding will have to be done to allow dwarven civs to have access to under ground crops.

As far as I know, the lair of the protectors of the shiny blue metal cannot be removed without the magma sea going with it. The number of them can be turned to 0 however in world gen which will allow you to dig the blue metal unmolested without ruining your fps due to a careless designation.

Resources will be very low. Consider investing in an industry thats renewable such as clothes making or cooking. Trading will become very important for metals, even more so in today's world of .19.
A reaction to turn cloth into metals by a large ratio is a good way to combat this.

Nice tips. I plan on playing with 100 cap limit for dorfs, 2 caverns layers(one feels a bit empty), change the mode to 2dasync or opengl and for Armok's sake, with temperature ON. I can't live without my magma. What will become of my dorfs without them sacrificing cats and goblins to the Armok's holy volcano? We can't have that. The dorfs and I will pray for this sacrifices being enough.

I personally didn't notice problems with brooks, on the matter of flowing water screwing my FPS, but I may be wrong, since all my forts died an FPS death. Guess I will have to get my water from the underground.
Logged

plisskin

  • Bay Watcher
  • That's "Plissken"
    • View Profile
Re: Maximizing FPS?
« Reply #24 on: March 03, 2011, 09:42:32 pm »

World map size matters. Going from "smaller" (33x33) to "medium" (129x129) can easily halve your Fortress Mode FPS. Keep that in mind next time you gen a world.

Wait wait wait, a bigger world means less FPS?
uh. Yeah. Bigger world, more stuff to keep track of, more memory and cpu used, less frames per second (or FPS), so slower game and all that closer to Death By FPS.

Oh sweet . . . Armok my apologies, I misread that completely. I somehow read that post as "Bigger world = Better FPS" and was taken aback.

My faith in all logic is now restored.
Logged
Legendary Wrestler
Legendary Ambusher

Left Eye

baslisks

  • Bay Watcher
    • View Profile
Re: Maximizing FPS?
« Reply #25 on: March 03, 2011, 09:53:35 pm »

say you wished to make a pc that could play dwarf fortress. What would you build it as?
Logged

arkhometha

  • Bay Watcher
    • View Profile
Re: Maximizing FPS?
« Reply #26 on: March 03, 2011, 10:08:53 pm »

say you wished to make a pc that could play dwarf fortress. What would you build it as?

The talk is one core cpu speed is more important. So overclock that 3.0GHZ pentium 4 to a 4.0GHZ, put some good RAM in it, a windows xp, install nothing else and put a big ass monitor. Also, place you bed near the computer.

Congratulations! Now you don't have a life anymore!
Logged

helf

  • Bay Watcher
    • View Profile
Re: Maximizing FPS?
« Reply #27 on: March 03, 2011, 10:42:23 pm »

say you wished to make a pc that could play dwarf fortress. What would you build it as?

Get a i5-2500k, a cheap mobo, few gigs of the lowest latency and fastest possible ddr3 you can afford. Getting a ddr3 speed rated ram thats higher than your mobo "supports" is perfectly fine as you will be overclocking anyways. And if not, you can usually run higher speed rated ram at lower speeds and even lower latencies.

Get a good air cooler and one of those workbench "computer frames" that just hold everything in the open so you dont have to worry about airflow. With a good air cooler, the cpu should be able to hit around 5ghz without issue. Set up the ram to the fastest possible speeds and tightest timings itll post at.

Run memtest86+ for at least 24 hours. if it runs with no issues, install a barebones, stripped windows xp install on some drive and just run DF and the tools you like. By stripped, I mean it. disable every service you wont use. disable anything from auto loading on bootup, etc.

oh, put in a cheap nvidia 9800gt or something. They are like $30 on ebay and plenty powerful enough.

You should end up with MONSTER FPS in DF no matter what size world you have or number of dwarves.

Depending on the BIOS in your mobo, you may actually be able to disable cores at the BIOS level. If you can, disable as many as you can (2 or 3) and then push the cpu clock even higher. Less heat will be generated, normally, and you might be able to go even higher on air without issue. If I'm not mistaken, it will also allow one core to handle more of the on-die cache without interference as well which should improve performance even more.

seriously, a 5-5.5ghz sandybridge i5 with some cas6 ddr3-2333 or such should net you some mind bending fps in DF no matter what.

This is what I plan on doing in a few months when I have some spare cash :) I will pst my results when I do it. heh.
Logged
YOUR GAMES GLITCH: Hey, I got out of the map boundry!
OUR GAMES GLITCH: Hey, a horrid monstrosity just migrated to my fortress! Let's recruit it!

rephikul

  • Bay Watcher
  • [CURIOUSBEAST_IDEA]
    • View Profile
Re: Maximizing FPS?
« Reply #28 on: March 03, 2011, 10:59:03 pm »

if you are into modding, removing as many gems, metals, alloys, stones, soils, crafts, plants, creatures, vermins and body parts as you can will help fps.
Logged
Intensifying Mod v0.23 for 0.31.25. Paper tigers are white.
Prepacked Dwarf Fortress with Intensifying mod v.0.23, Phoebus graphics set, DFhack, Dwarf Therapist, Runesmith and a specialized custom worldgen param.

ral

  • Bay Watcher
  • Praying to arm_ok
    • View Profile
    • Steam Profile
Re: Maximizing FPS?
« Reply #29 on: March 03, 2011, 11:04:38 pm »

This is what I plan on doing in a few months when I have some spare cash :) I will pst my results when I do it. heh.

Call me a dork but I'm actually considering doing this myself. UNfortunately I'm not an overclocking genius so please do post your results!!
Pages: 1 [2] 3 4