ENDLESS™ Legend is a turn-based 4X fantasy-strategy game, where you control every aspect of your civilization as you struggle to save your homeworld Auriga. Create your own Legend!
I'm observing that Endless legend consumes a lot of CPU time, even when in the main menu while that application is minimized. My GPU seems fine and framerates are ok. One core seems particularly busy:
The game is playable, but my CPU fan is working hard, and it gets more laggy when actually in game play. I do not observe this behavior with other games on my system. After quick Google I found that several other people on the Steam forums had complained of high CPU only for EndlessLegend.
I thought it weird that the game should consume so much even in the main menu, so I used Sysinternals' Process Monitor (https://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx) to see if I could figure out why it was consuming so much CPU. I observed that EndlessLegend.exe seemed to be making roughly 50 calls to the Windows registry every second:
That number looks suspiciously close to my frame rate, which the Steam overlay reported as being between 50-54 frames per second. Based on this, I'm guessing that there is code in the main render loop that is making a call each frame. I then used the Sysinternals procmon again to look at the stack for those calls:
It looks like that game is calling 'SteamAPI_IsSteamRunning' to check if the Steam client is running....every frame of the game! I'm not a game programmer or a windows guy, but I'm wondering if this could be the cause of the high CPU usage on my machine?
I'm on Windows 10, running Endless Legend 64 bit version V1.5.7 S3.
12GB RAM
Intel Core i7 at 3.2 GHz
AMD Radeon HD5800 with 4gb, running at 1920x1080. (latest driver installed)
My resource monitor says that EL uses an average of 17% CPU (i7-4790K at 4.5-4.8 GHz, although with Endless Legend idling in-game - not in the menus - it sits around 1.6-1.9 GHz):
Like you, I'm seeing a lot of registry checks:
And the callstack points to checking the Steam connection:
What I'd guess:
1. Although the game is multi-threaded (I see 62 threads running in my game - not in the menus), there's one "main" thread which does most of the work, and is probably also used to spawn additional threads.
2. The game checks the connection to Steam e.g. for achievement unlock purposes.
3. Although there's a CPU hit, I'm not sure how big of an impact it causes.
Process Explorer says the same 17% CPU for EL, and a whopping 40% (!) for my GPU (an AMD R9-290 w/ 4 GB, slightly OCed):
and
The GPU usage has me far more worried than the CPU usage ...
So if I were to invest more resources, I'd have a look at GPU optimization. It seems to use far too much for a turn-based strategy game. Perhaps it renders the whole map instead of only the visible part of it - I have no idea.
Thanks for the confirmation, @icarus86 ! Yeah, I believe the 'main' thread is responsible for the game's rendering loop (draw screen, update game, check for input) because the registry calls per sec meet my frame rate. Ironically, my outdated graphics card may actually help, because if it were more beefy, the increased frame rates would translate to even more calls to the windows registry. I doubt that the windows registry was designed to be hit at this frequency. Looking at the stack trace, we can see that the call is transitioning from user space (U) into kernal space (K), which is expensive.
I also bet that the devs would have a hard time observing this problem because the call to ''SteamAPI_IsSteamRunning' would probably be disabled in their development environments.
With regard to your GPU usage, do you have vsync enabled? Having it disabled may cause much higher frame rates and GPU usage.
From my experience with Windows-based servers, the registry is indeed designed to handle large amounts of reads and writes.
My systems mainly use 16-core / 32-thread CPUs and 64-128 GB RAM, with lots of IIS application pools, each with hundreds of threads, which also read from the registry a lot.
Yes, the call goes to the kernel because I don't see how you can read the key otherwise :) But this code belongs to Valve anyway (SteamAPI).
I don't contradict your assessment - checking every frame for the Steam connection is way too much - I was just thinking that it shouldn't be that bad. But it's definitely something which can be improved.
You're right about the GPU - I usually disable VSync for my games.
Interesting findings. I have always wondered why the game always uses a significant percentage of my cpu resources, even when not a lot is going on (like when I have a menu open or am in one of the subscreens like the diplomacy screen). In my case (having an older cpu and hard disk) I found that turning on vsync and lowering the max frame rate gave me a more stable experience and less stuttering.
Here's hoping Amplitude has noticed and will address this.
commodious
Newcomer
commodious
Newcomer
11 600g2g ptsReport comment
Why do you report commodious?
Are you sure you want to block commodious ?
BlockCancelAre you sure you want to unblock commodious ?
UnblockCancelVIPicarus86
VIP
https://www.flickr.com/photos/icarus86
VIPicarus86
VIP
28 600g2g ptsReport comment
Why do you report icarus86?
Are you sure you want to block icarus86 ?
BlockCancelAre you sure you want to unblock icarus86 ?
UnblockCancelcommodious
Newcomer
commodious
Newcomer
11 600g2g ptsReport comment
Why do you report commodious?
Are you sure you want to block commodious ?
BlockCancelAre you sure you want to unblock commodious ?
UnblockCancelVIPicarus86
VIP
https://www.flickr.com/photos/icarus86
VIPicarus86
VIP
28 600g2g ptsReport comment
Why do you report icarus86?
Are you sure you want to block icarus86 ?
BlockCancelAre you sure you want to unblock icarus86 ?
UnblockCanceleruanion
Shifter
eruanion
Shifter
18 000g2g ptsReport comment
Why do you report eruanion?
Are you sure you want to block eruanion ?
BlockCancelAre you sure you want to unblock eruanion ?
UnblockCancelsunvald
Newcomer
sunvald
Newcomer
100g2g ptsReport comment
Why do you report sunvald?
Are you sure you want to block sunvald ?
BlockCancelAre you sure you want to unblock sunvald ?
UnblockCancel