View Issue Details

IDProjectCategoryLast Update
0023391AI War 2Gameplay IssueSep 25, 2020 9:54 pm
ReporterChris_McElligottPark Assigned ToBadgerBadger  
Status resolvedResolutionfixed 
Summary0023391: Performance: mysterious drop from nomad planets (for Chris later).
DescriptionChris:

Wait, let me see if I understand.
1. If you stay on the planet view, there is no lag from them.
2. If you are on the galaxy map, it starts okay but gets slower the longer they move.
3. Going to the planet view and back to the galaxy view does not help once the galaxy view gets slow.
4. Going to the main menu and back to the galaxy view does solve it.
5. Even after it is slow on the galaxy map, going to the planet view is not slow.
Is that correct?

StarKelp:

Yes to all, with a note on 2 that it takes hours to reach it with regular settings.
I only discovered it by doing 10 planets with the fast setting.

Chris:

But nomad galaxy probably causes it very fast?

StarKelp:

I... don't think I noticed it when I was doing a Nomad Galaxy test game actually. Let me confirm that though before making that assumption.
TagsNo tags attached.

Relationships

has duplicate 0023477 closedBadgerBadger Nomad PLanets eat performance in galexy map 

Activities

StarKelp

Jul 13, 2020 5:27 pm

manager   ~0057575

Update: Also occurs during a Nomad Galaxy.

BadgerBadger

Jul 13, 2020 6:05 pm

manager   ~0057576

Last edited: Jul 13, 2020 6:09 pm

I was figuring this was a resource/memory leak of some sort, but I never had time to chase it. It's probably lurking in the visualization stuff that I don't know very well.

I am more than happy to have Chris chase this one ;-)

Chris_McElligottPark

Jul 13, 2020 9:54 pm

administrator   ~0057578

With a repro case, it shouldn't be too bad for me. I figure it's something in the vis code, too. As long as I can make it happen reliably and relatively quickly, I can knock that out sometime during the multiplayer beta period. Have to get into and through alpha first, though.

BadgerBadger

Jul 13, 2020 10:03 pm

manager   ~0057579

Hypothesis: There's a problem in PresentationLayer_AIW2.cs,
in public void CheckIfNomadMoved( Galaxy galaxy, Planet p, ref int debugCode )

I suspect that I'm doing something wrong in that area because I don't fully understand how the visual stuff works for the galaxy map. In particular I'm suspicious of something in here:

            p.GalaxyMapVisualObject.GalaxyMapLines.Clear();
            GalaxyMapPlanet pMap = (GalaxyMapPlanet)p.GalaxyMapVisualObject;
            debugCode = 2460;
            pMap.DeactivateAndReturnToPool();
            p.GalaxyMapVisualObject = null; //unset this to force a new object. <=========== If there are other pointers to this then this is a memory leak
            p.NomadHasMoved = false; //this is set in the Entity Sim logic and cleared here

Chris_McElligottPark

Jul 14, 2020 10:47 am

administrator   ~0057583

Ooh yeah, that would be a memory leak, probably. And not just any sort, but one that goes out of C# and into unmanaged code. I can probably fix that pretty straightforwardly.

Chris_McElligottPark

Jul 16, 2020 10:08 am

administrator   ~0057641

Can someone who sees this do a test and see how things do with one of these galaxies on fast forward? A nomad galaxy in particular would do well for showing an increase if it was going to happen. I've put in all the fixes, but have not tested them in this specific context and am shifting back to MP stuff at the moment.

RocketAssistedPuffin

Jul 21, 2020 11:52 am

reporter   ~0057742

Note: This is with my so named "Classic Fusion" abomination of a mod (which I can't ever give out for the most part).

On a test with 2 AIs, and 1 of almost every faction possible, with 5 Nomads on Fast movement, the performance went to sub-50% on the galaxy map within 35 minutes.

On a test with 2 AIs and no factions, with 10 Nomads on Fast movement and Nomad Galaxy, slowdown occurs as soon as they start moving. It appears to stop at around 50%, never going below.

Performance recovers if saved, then loaded, but temporarily.

Chris_McElligottPark

Jul 21, 2020 12:05 pm

administrator   ~0057743

Thanks for the info! Sounds like I still have more to look into.

Puppet Master

Jul 21, 2020 12:11 pm

reporter   ~0057744

let me beta test the DLC and I'll help :D

Puppet Master

Jul 22, 2020 4:54 pm

reporter   ~0057783

strangely 1x gives me x.8 ish, but 4x will give me 2.5x whilst in the galaxy, which is very odd

if it can handle 2.5x, I don't get why it wouldn't be able 1x

the bug goes away in planet view, I've not tested without nomad planets, but if you use your dev stuff to disable them, it might show if is the cause
Slow in Galaxy.save (456,343 bytes)

Chris_McElligottPark

Jul 22, 2020 5:07 pm

administrator   ~0057785

Bear in mind that when you get 250%, that's multiplied by 4. So really if you have 4x, it should be 400%, but you're only getting 250%, which is 62.5% speed instead. So you did have a drop in overall performance compared to 1x.

Puppet Master

Jul 28, 2020 4:25 pm

reporter   ~0057885

Nomad Planets eat performance in galaxy map, performance is so bad at the moment with Nomads enabled, especially if multiple.

This occurs whenever they move.

To help find the cause, I have made a save where over 50 nomad planets are about to move 10 seconds after load. Things get slow QUICK.

Please use this save to test rather than the previous one shared.

Chris_McElligottPark

Sep 25, 2020 9:54 pm

administrator   ~0058684

Way to go Badger on fixing it! :)

Issue History

Date Modified Username Field Change
Jul 13, 2020 5:09 pm Chris_McElligottPark New Issue
Jul 13, 2020 5:09 pm Chris_McElligottPark Status new => assigned
Jul 13, 2020 5:09 pm Chris_McElligottPark Assigned To => Chris_McElligottPark
Jul 13, 2020 5:27 pm StarKelp Note Added: 0057575
Jul 13, 2020 6:05 pm BadgerBadger Note Added: 0057576
Jul 13, 2020 6:09 pm BadgerBadger Note Edited: 0057576
Jul 13, 2020 9:54 pm Chris_McElligottPark Note Added: 0057578
Jul 13, 2020 10:03 pm BadgerBadger Note Added: 0057579
Jul 14, 2020 10:47 am Chris_McElligottPark Note Added: 0057583
Jul 16, 2020 10:08 am Chris_McElligottPark Status assigned => feedback
Jul 16, 2020 10:08 am Chris_McElligottPark Note Added: 0057641
Jul 21, 2020 11:52 am RocketAssistedPuffin Note Added: 0057742
Jul 21, 2020 12:05 pm Chris_McElligottPark Note Added: 0057743
Jul 21, 2020 12:11 pm Puppet Master Note Added: 0057744
Jul 22, 2020 4:54 pm Puppet Master File Added: Slow in Galaxy.save
Jul 22, 2020 4:54 pm Puppet Master File Added: Slow in Galaxy.savemet
Jul 22, 2020 4:54 pm Puppet Master Note Added: 0057783
Jul 22, 2020 5:07 pm Chris_McElligottPark Note Added: 0057785
Jul 28, 2020 4:25 pm Puppet Master File Added: 10secondsToNomadageddon.save
Jul 28, 2020 4:25 pm Puppet Master File Added: 10secondsToNomadageddon.savemet
Jul 28, 2020 4:25 pm Puppet Master Note Added: 0057885
Jul 28, 2020 4:26 pm BadgerBadger Relationship added has duplicate 0023477
Jul 28, 2020 4:26 pm BadgerBadger Status feedback => assigned
Sep 25, 2020 9:54 pm Chris_McElligottPark Assigned To Chris_McElligottPark => BadgerBadger
Sep 25, 2020 9:54 pm Chris_McElligottPark Status assigned => resolved
Sep 25, 2020 9:54 pm Chris_McElligottPark Resolution open => fixed
Sep 25, 2020 9:54 pm Chris_McElligottPark Note Added: 0058684