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

State of optimisation - game speed

44 posts, 3855 views
Post comment
Filter:    Player:  
Page of 3 (44 records)
sort

6 years 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?
+7 / -0

6 years 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
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
intel i3 (4 core) and 8 gb ram
+0 / -0
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
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.
+3 / -0
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
6 years 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
@zenfur, 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
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


6 years 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
6 years 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

6 years 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
5 years ago
very fast on ultra settings after CPU upgrade to Ryzen 5 2600. I suppose Zero-k is very critical to CPU. Especially after i found it uses only one CPU core every time.
+3 / -0
5 years ago
quote:
Most of the load is borne by the engine

Is LuaUI a part of the engine? Because when I do /luaui disable, my FPS increases to 200-400% of normal.

quote:
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.

This is why I have a feeling something is very wrong with the performance in this game. I have a newer CPU and 8GB RAM and I get 50-60FPS at teamgame starts and it crawls all the way down (in very large teamgames) to 4-10FPS and at then it starts "reverse-catching up" from the server.
+1 / -0
quote:
Is LuaUI a part of the engine? Because when I do /luaui disable, my FPS increases to 200-400% of normal.

Some of the things LuaUI does are expensive because it causes engine things to happen, e.g. various rendering things.

Current ZK Chili UI is pretty inefficient wrt this because it kind of redraws everything every frame.
+0 / -0
Firepluk
quote:
This is why I have a feeling something is very wrong with the performance in this game. I have a newer CPU and 8GB RAM and I get 50-60FPS at teamgame starts and it crawls all the way down (in very large teamgames) to 4-10FPS and at then it starts "reverse-catching up" from the server.

If you run via chobby try "Multiplayer in a new window" option and nuke chobby itself when big team game starts...
I get ~1.5x-2x fps in late game and it seems to prevent OOM Lua crashes in huge team games

but I run on pretty weak ultrabook with eGPU and 16gb ram, i7 7500u is pretty shitty for zk...
+1 / -0
I've found it's usually one or two widgets that do it. The worst one for big games I've found is Chili FacPanel, but that's not default-on.

One way to figure out what's slowing things down, though it's a bit technical, is to load up a big team games replay, fast-forward to where things have gotten super slow, go to Settings/Misc/Toggle New Widget Profiler (you'll need "Simple Settings" in the bottom-right corner unchecked, and "Settings/Misc/Show Advanced Settings" checked), and see what happens when you disable the widgets with the highest percentages (apart from the Widget profiler itself and the Chili Framework). The high-percentage widgets aren't necessarily the most processor intensive (GPU-side processing isn't profiled), but it's a good starting point. Typing "/fps" also helps, since that's the number we're trying to raise.
+0 / -0
Hehehe. For odd reason, zero-k pop up in my youtube so I thought of taking a look on how the game has improved. I mainly stopped because my potato cpu just can't handle late game, is very frustrating to lose when not because of your skill sucks but just because of delays.

Zerok is very heavy on single core performance, having better cards don't necessary improve performance, is really mostly about cpu. Yet, the funny thing is this, there is this game I am playing called Guild Wars 2 which too is cpu heavy and the community asked dev to implement dx12 but devs claim it wouldn't improve much. Fast forward a few years, someone recently made a proxy d3d dll that wire DX9 API to DX12 API. The min FPS improvement gain is as high as 200%. You can find the project here.

So what does this all really means? MT rendering and api overhead reduction boost the fps up even if the game is not optimized.

Given that zerok engine is a open source project, I doubt they will implement dx12 anytime soon but if there's any d3d programmer here, can take a look at that proxy and see if it can help boost zerok performance up.
+0 / -0
Firepluk
Optimise my ass
https://zero-k.info/Battles/Detail/692322

30 min in game, fps down to 6-8 with lag spikes to 2-4...
Even after we put game on 0.8 speed it still lags like hell and I can't get above 10-16 fps in the most optimistic times :\
when conflict starts fps drops to like 2-4 on 0.8 speed...

Jesus, what have u done with the game?...
and on top of this lagcrap RUrankizirayd crashed with memory error
+0 / -0
Page of 3 (44 records)