New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perf / Crash: Hiring dwarves in large numbers at one time will eventually crash game #944
Comments
Thank you very much for looking at this. I think I'm going to do the following.
It's worth noting that other games in this genre simply don't allow you to get new colonists on your own, instead they have colonists arrive without your intervention so they can balance this quantity over time. I wanted DwarfCorp to give the player more control, but perhaps we gave away too much control! |
I fixed several crashes/issues in this save, but I suspect not the underlying issues you were experiencing with hiring yet. |
Okay, I have limited the maximum number of dwarfs to 40. I have made this a parameter that players can control in the settings menu. I have also added a delay to hiring dwarfs that is a random number of hours between 2 and 6. |
@com1clyf3 let me know if this is still a problem |
This is still a problem. Got a crash. Again, it's likely multifaceted. I'll try and add a detailed report like last time. One thing I notice is that if you hire a group of dwarves, they still show up all at once, just later. Wouldn't it be better to pace out their arrival? Like one every hour? |
Okay, I'll pace out their arrival even further. I really need the stack traces on those crashes btw... otherwise it's kind of useless |
I've spaced out dwarf arrivals so that one happens each hour. |
Given that I used this to stress a crash, I'd suggest making the time between dwarves longer. Let's say three hours. |
I don't understand how this could have possibly caused a crash for you, or why it possibly makes performance worse.... |
I'll take some sampling to verify it's actually stressing things. |
even with 1 dwarf an hour it slows down your FPS by that much? |
Things have improved, but still not shippable. So maxed out my hires to 40 by hiring in phases of ten. Good news is that maxing out hiring with the new spacing is not crashing the game (or hasn't so far, anyway). Bad news is it's not passable performance-wise. Around 20 or so dwarves, FPS slowed down in 3x to 1-2FPS. 1x was still a workable 1-7 FPS. Took some sampling: Here's the 40 dwarf save: |
I think making new hires more expensive is a fix we should consider. It would naturally pace how many get hired at once. |
When you create dwarves through the god menu, do you similarly get really bad performance? |
For reference, as usual, I get 60 FPS even with about 100 dwarves. |
We might also just want to beef up performance requirements on Steam so that people with computers as low powered as yours will be warned away from buying the game. |
Okay. Spawned 40 dwarves into a flat debug world. With no tasks at all assigned and no other entities, performance is not affected at all. FPS is totally humming at 1x,2x, and 3x. Once you assign some tasks, things do begin to falter, somewhat, but not nearly as bad as in a long game. At 1x with tasks, everything is pretty much normal. At 3x with tasks, FPS fluctuates from ten or so seconds running normally to ten or so seconds running at 01-8 FPS. Good news over-all. Took profiling in release mode, just in case, but assuming we should focus on long plays instead of hiring. DwarfCorp181026_FunctionSummary.zip I'm going to go ahead and open up a separate issue for long term play perf issues, and then link it here. |
40 miners at 3x digging an entire mountain now works pretty smoothly. Few little lags here and there, but it's working great regardless. Considering this closed. |
Okay. So I took a look at our hiring dwarves question.
For some context, the below save is in a world with a large amount of monsters in it, due to a large cave biome + a huge amount of snake spawns (maybe due to the desert biome?). The only way to actually progress naturally was to wage spawn war, by hiring a wave after wave of axe and muskets until the area was safe enough. So this is all technically a realistic play situation. It was the only way I was able to continue on anyhow. This behavior leads to a crash, which makes games like this one relatively short (maybe a couple of in-game days at most).
Hiring dwarves in large numbers, all at the same time, considerably reduces FPS. The more you already have, the more this slows down the game ( i think?), FPS dipping to maybe 0-2 FPS for a few seconds. Eventually this will lead to crash.
Repro:
Some solutions:
It's important to note that the game seems fairly stable with a large number of dwarves. It's mainly the hiring that appears to be stressing things.
One other aside. It's currently very difficult to hire multiple dwarves at all. Can we add something to hire 5x/10x? The player will do it anyhow, and we're only causing it to be annoying to do so currently.
DwarfCorp181018_CallerCalleeSummary - profiling.zip
Bead Realm_411_131843937514660019.zip
Bead Realm.zip
2d713bb
The text was updated successfully, but these errors were encountered: