Loading...
  OR  Zero-K Name:    Password:   

State of optimisation - game speed

13 posts, 715 views
Post comment
Filter:    Player:  
sort


PLrankzenfur
4 months ago
Hello,

I'd like to explore a bit a subject of optimization of this game, to get more info on why it runs so sluggish and gets low fps pretty fast and what is a choke point of performance. These are mostly questions for main developers:
How often at developing you focus on optimization or use a profiler? Do you have plans to improve game performance?

Usually I thought it's just the case of my PC, but yesterday I've played with 2 of my roommates and they complained how terrible the game run. We all have decent modern computers from 2-3 years ago, and surely a project that dates over 10 years ago should have no problems with running smoothly on such machines, even kinda big battles like with chickens.

Roommates enjoyed gameplay a lot, but complained on its performance, and even on lowest settings it was running pretty bad.
Do you have any thoughts/comments on subject of game performance?
+3 / -0



PLrankAdminSprung
4 months ago
Most of the load is borne by the engine. As far as I can tell it would be fairly difficult to squeeze more performance out of it.

Nowadays GoogleFrog is perf-aware and pays a lot of attention to make his code optimized (at the algorithms & data structures level) but there's still a lot of horrible, perf-hungry code lying around (eg terraform, many xponen widgets) from the old times. The ZK codebase is fairly large so any single wupget will have little individual impact (even disregarding the giant engine chunk) and it's hard to get a visible perf boost. We have a Lua profiler but it gives fairly vague results (see https://github.com/ZeroK-RTS/Zero-K/issues/2836 ) so progress might be hard to measure here.
+1 / -0


CHrankConnetable
4 months ago
(edited 4 months ago)

I really never experience lag save for the occasionnal sand castle game.

I have a i7 from 2011 and 12gb ram.

I really wonder what is your CPU and maybe your ram level?
+1 / -0


PLrankzenfur
4 months ago
(edited 4 months ago)

intel i3 (4 core) and 8 gb ram
+0 / -0

LTrank[pikts]wolas
4 months ago
(edited 4 months ago)

I think default settings(at least for me) included horrible shadows settings which would impact FPS 3x. Basically you have to lower shadows and then game runs good enough on i5 4650. And this shadow setting come back to this horrible defaults 2 or 3 times in ~2 months time.

I did set to Max settings tho.
+0 / -0

LTrank[pikts]wolas
4 months ago
(edited 4 months ago)

Also people dont complain enough about performance drops. I heard that recently people said that FPS dropped.(I think there was some discusions about automated performance tests in some scripted battles years ago) I remember I started playing ZK on 4GB ram C2D 2.2GHz laptop on high settings and performance year by year droped until game on that laptop is unplayable at any settings on any size teams.
+2 / -0



AUrankAdminGoogleFrog
4 months ago
(edited 4 months ago)

I hear rumors of a drop but received no good report.

In general, there is very little I can do to directly impact performance. I frequently profile the code within my jurisdiction and fixed most of the worst offenders years ago. The playerlist widgets are still a bit terrible but the small one runs fairly well, the extended one is not enabled by default, and the pop-up one only tanks your FPS when/if you actually look at it. If a game is running slowly I'll often enable the lua profiler and see that most of the widgets and gadgets are running about as well as can be expected. The lua changes of the past years have been minor and a lot has been in optimization.

Two of the biggest impacts on performance (according to the lua profiler) are the UI framework and the lua particle system. I have only placed these partially within my jurisdiction because I don't have the experience to judge the reasonableness of their openGL parts. From what I've seen they look fairly reasonable and it makes sense to me that they would have a more noticeable performance impact than background widgets and gadgets. If anyone wants to have a look then there are probably some gains to be made.

The engine itself is the place to look for performance improvements. There are three approaches:
  • Fix behaviour that ZK replaced with lua.
  • Fix regressions.
  • Work on improvements.

A lot of engine behaviour is broken or lacks polish. For example the move command is now implemented in lua in ZK because otherwise units move in zigzag lines over medium distances and can become permanently stuck. Lua is surely slower than the engine.

The engine has had many longstanding performance regressions in its history. The worst persisted for over two years, during which we did not update ZK to use any newer engine version. It took a very long time to even prove to the devs that this regression existed. There have been a few other regressions which required the community to use the benchmarker to gather enough data for a fix. I don't know how much testing goes on but, if the bugs that reach me are any guide, it seems that engine development had no regression testing for performance. This is understandable because nobody is employed and such testing takes a long time. I don't know of any benchmarks beyond mine and they can take a long time to maintain and run. I ran some cut-down versions this afternoon and didn't find anything.

The last option is to improve the engine code in some way with an eye for performance. From looking at their github I get the impression that the engine devs do this, but I have not seen data to suggest that many of the improvements work. In my (biased) experience these changes are terrifying because many of the regressions were the result of messing with threading or memory management for performance reasons.

I don't have plans to improve performance because I don't have plans to get into engine development any time soon. However, the rumors of a regression started about two weeks ago and I updated the engine around three weeks ago. I have reverted the engine to the pre-update version (104.0.1-151-g11de57d) to see if people start reporting any changes.

quote:
We all have decent modern computers from 2-3 years ago, and surely a project that dates over 10 years ago should have no problems with running smoothly on such machines, even kinda big battles like with chickens.
Invoking age is a fallacy. People keep adding new graphics things (shaders, deferred rendering) and the engine is under constant development. If we demanded proper regression testing for engine development there would probably be no engine development. Therefore, performance is going to constantly be slightly better than whatever level causes widespread complaints.

quote:
I did set to Max settings tho.

LTrank[pikts]wolas if you're using max settings then maybe you'd better reduce them. Sounds simple enough to me.

I paid a lot of attention to settings at one point and have not really messed with them since. Fixing settings further requires a lot of data.

+4 / -0


PLrankOrfelius
4 months ago
My reception recently has been inconclusive. Some maps tend to lag me more than others (its not size, feature amount dependant) and it dips to 15 FPS. While on others the game runs better than before acheiving 50-60 FPS in a 1v1.

CPU: i7 4710HQ
GPU: Intel HD 4600
8GB RAM

no shaders, intel hack on, minimal graphical settings
+0 / -0


CHrankConnetable
4 months ago
(edited 4 months ago)

PLrankzenfur, i forgot to say, i play on ultra and have overclocked my i7 to 4.3ghz. Yours is probably more like 3ghz.

Your i3 is probably not a 4 core but a 2 core with Hyperthreading. However, this is probably not meaningful.
+0 / -0



AUrankAdminGoogleFrog
4 months ago
(edited 4 months ago)

I'm unable to find any evidence.



These are the average FPS buckets for a minute of my benchmark, run 20 times each. I compared two game versions (current and a month ago) and two engine versions. Three runs are the same while one seems a little worse, as some of the buckets have shifted downwards. This may be due to missing compatibility (which would cause error spam) or it may be just randomness.
+0 / -0



AUrankAdminGoogleFrog
3 months ago
I made some fixes as parts of the UI were redrawing even when they did not change. The number of redraws was cut by maybe a factor of 100 to 1000 and I've noticed the improvement.
+0 / -0

CArankTacoMan
3 months ago
What I love about ZK is that it's perfectly playable even on my crappy PC.

Intel Core 2 Duo, AMD HD 5450 and 4GB RAM. Runs at 40+ fps with minimum settings while still looking pretty good for low settings. I'll drop down below 30 when things get very heavy late-game with the striders, but in 90% of games I have no issues performancewise.


+1 / -0

PTrankraaar
3 months ago
the maps

are the map remakes more performance intensive than the old ones?

are people playing more maps with forests and such?
+0 / -0