News:

MegaGlests' game mods menu let's you install many new mods. Even more are available on the MegaGlest Wiki and the Mods forum.

Main Menu

[fixed] Strange Lag

Started by -Archmage-, 23 December 2012, 04:08:15

-Archmage-

About every second MG freezes for probably a 1/8 of a second, it's very noticable and annoying.
My framerate is great... and I checked task manager. CPU usage and RAM are a-ok. GPU usage hangs between 20-30 percent, but I have to alt-tab it may be dropping as soon as I leave fullscreen..
This issue doesn't occur when the game is paused but as soon as I unpause it starts happening again.

tomreyn

I'm not sure this is what you are seeing (since you say CPU usage is ok - is this the total on all cores, or are all cores ok if oyu look at them individually?), for me this happens when I the CPU core which most of MegaGlest runs on is entirely maxed out. In this case the total CPU load is still mediocre, it's just that the main thread is completely busy, so the processing stops repeatedly for short sequences.

Which faction were you using, what was your game setup? Does this always happen, also on 64x64 maps with just two players playing the same faction?
Is this MegaGlest 3.7.1 on Windows 7?
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

-Archmage-

Quote from: tomreyn on 23 December 2012, 04:34:31
I'm not sure this is what you are seeing (since you say CPU usage is ok - is this the total on all cores, or are all cores ok if oyu look at them individually?), for me this happens when I the CPU core which most of MegaGlest runs on is entirely maxed out. In this case the total CPU load is still mediocre, it's just that the main thread is completely busy, so the processing stops repeatedly for short sequences.

Which faction were you using, what was your game setup? Does this always happen, also on 64x64 maps with just two players playing the same faction?
Is this MegaGlest 3.7.1 on Windows 7?


Windows 8, MG 3.7.1. Playing with my own custom techtree, as tech though. I was on a 256*128 map I think. And I believe one of my cpu cores was maxed out... It always uses my second core and leaves my last 2 doing nothing.

I'll open my save game and gather more info.

tomreyn

This can be an effect of a complex techtree. It would be interesting to know whether you are able to reproduce it with a simple setup, too, such as with a small map and Magitech. Maybe also with your techtree on a small map (and one where pathfinding is not an issue).
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

softcoder

Without having something to actually test ourself its going to be hard to comment on this. Package up the techtree and give a link so that we can see the issue for ourselves.

-Archmage-


ElimiNator

Quote from: -Archmage- on 26 December 2012, 20:59:43
https://www.dropbox.com/s/fjhedrdfghtp0m3/magitech-refit.7z

Get a big game going and you'll come across this issue.
Ahh, must be windows 8, I heard it has problems...
Get the Vbros': Packs 1, 2, 3, 4, and 5!

softcoder

Please explain the exact steps to reproduce the issue. Which factions and how many slots etc and what exactly we should look for?

-Archmage-

How about I upload the save file?

Quote from: ElimiNator on 26 December 2012, 22:57:14
Quote from: -Archmage- on 26 December 2012, 20:59:43
https://www.dropbox.com/s/fjhedrdfghtp0m3/magitech-refit.7z

Get a big game going and you'll come across this issue.
Ahh, must be windows 8, I heard it has problems...

Right now I have Premiere, After Effects, Photoshop, Dishonored, Cheat Engine, Skype, Adobe Bridge, Steam, and Firefox open and at the same time I'm playing Far Cry 3 at high settings. I don't think it's an issue with Win8 or my computer.

softcoder

Arch please upload the saved game at the point where performance is bad. Explain exactly what i am looking for also.

Thanks

-Archmage-

Quote from: myselfAbout every second MG freezes for probably a 1/8 of a second, it's very noticable and annoying.

Download

softcoder

That link requires me to 'have permission' to access the file which i do not have.

-Archmage-


softcoder

I've made a small improvement allowing AI decisions to be multi-threaded. This does not get rid of the lag but seems to make it less noticeable.

Try out svn.

-Archmage-

QuoteTry out svn.

How?

MightyMic


softcoder

There is a windows build available here every time we commit code into svn (as already mentioned in the megaglest forum):

http://w32.nightly.megaglest.org/nightly/

The build for windows has not been working for a month so i am fixing it, don't download unless the date has todays date, then you will know it is fixed.

-Archmage-

Oh, then I'm gonna wait..

-Archmage-

I installed the latest nightly build.

On my I7-740qm processor I get the same issue, it maxes out multiple threads(not all at once, it's kinda chaotic), particularly my 2nd thread in the 2nd core. Overall usage is very consistently 25%.

softcoder

Try adding this to glestuser.ini

MaxPathfinderNodeCount=1000

(the default is 2000, so try smaller #'s and see if that improves performance in this case)

-Archmage-

I tried values from 1-20000, no difference. Is there some world time setting that I might have messed up?

softcoder

#21
I finally chased down the performance problem, has to do with calculating things related to fog of war.I have a cache for this but disabled it before 3.7.0 release due to some memory consumption concerns. I'll revisit this (when i turn on the cache i no longer see your saved game playing with lag).

Update: I re-enabled the cache and committed the changes to svn rev# 3988 and let me know what you think.

-Archmage-

Ooo sounds good, I'll download now. :o

-Archmage-

Much improved! There is still a tiny almost unnoticable lag, but it's much much better! The 'ok' button in the options menu works as well!

softcoder

So this shows how expensive calculating fog of war is, anyway glad you confirmed its improved.