2025-07-21 13:48 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003451Spring engineGeneralpublic2014-01-08 03:07
Reporterabma 
Assigned ToKloot 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version91.0.1+git 
Target Version92.0Fixed in Version 
Summary0003451: Initializing PathCache takes very long (>1 minute)
Descriptioncould be omp related?!
Steps To Reproducedidn't report this, because i always used a debug compile, now its the first time i use a release build...
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
has duplicate 0003832resolvedabma notAmap (generated map): starting lag 
+Relationships

-Notes

~0009729

abma (administrator)

Spring 91.0.1-1321-gc19898c release (OMP)

~0009730

abma (administrator)

also "Initializing PathCache" takes ages, maybe 2 minutes!?

~0009731

jK (developer)

"Initializing PathCache" stage isn't related to the previous pathing stages and is new in 92.0

it's by design slow and can hardly optimized, except faster pathfinder itself

~0009732

Kloot (developer)

Last edited: 2013-02-08 22:44

View 2 revisions

It could be made faster by only calling UpdateFull if Lua has triggered any heightmap changes and letting normal map features be gradually repathed as before.

~0009733

jK (developer)

many map features can cause a lot of dirty squares, too

~0009734

Kloot (developer)

Last edited: 2013-02-08 23:52

View 2 revisions

nobody ever reported that being much of a problem (unlike changes caused by Lua) and now the final loading stage is ALWAYS SUPER SLOW on such maps

~0009735

jK (developer)

Last edited: 2013-02-09 08:13

View 2 revisions

Before the buffered patch cache was initialized AFTER the map feature were placed.
You moved the map feature placement behind the pather, so the game already start with a lot dirty squares taking minutes to calc if my tests were right.

~0009736

Kloot (developer)

Last edited: 2013-02-09 11:12

View 5 revisions

Yes and no.

In 91.0, features were loaded _before_ the pathfinder, so it _never_ received TerrainChanged events from them. After my change it did receive those events but they were still processed _gradually_ over many simframes. However with the UpdateFull call in LoadFinalize feature-heavy maps can now cause minute-long _hangs_.

~0009737

abma (administrator)

Last edited: 2013-02-09 12:19

View 2 revisions

if i understood it right the problem seems to get worse by gadgets which:

- place many features
- change heightmap
- place many units

at game start / after the pathfinder is initialized?

if so: can't the engine offer a way to place units/features or change heigtmap before the pathfinder is initialized? would this fix the problem?

i know this would require to change some maps...

~0009738

Kloot (developer)

That requires creating the Lua environment much earlier which is near-impossible now due to dependency hell.

The only viable solution is to not eat through every pending update in one single frame.

~0009740

jK (developer)

Last edited: 2013-02-09 13:46

View 4 revisions

I added the alt+b pather info & UpdateFull cause my profiling showed that some maps started with such many dirty squares that it takes >10mins to process them continuously ingame. Also they block any new terrain updates -> pathfinder won't ever reach a decent amount of dirty squares in a 30mins match. And the pathfinder will run the whole time at 100% of its max allowed time.

viable solutions I see:
1. faster pathfinder, I see another ~ 30% speedup possibility in it.
2. split pathfinder creation & path filecache initialization, so it can run after Lua

~0010822

abma (administrator)

2. split pathfinder creation & path filecache initialization, so it can run after Lua

imo this becomes more important over time as people seems to write code, that modifies map in gadgets... also feature placement affects this, so it would be good if lua-code could somehow run before pathcache is created... maybe add some modoption that allows to disable the pathcache creating / loading and allow creation of it directly before game start?

~0010825

PepeAmpere (reporter)

yes, if it would be possible to touch the "height map" just in the middle of the conversion of heightmap-image => into some spring heightmap representation, it would be the perfect. Many ways of generating map need somehow play with this property of map and path calculations before lua touch is wasting of time.

~0010829

jK (developer)

| maybe add some modoption that allows to disable the pathcache creating / loading and allow creation of it directly before game start?
???
You didn't seem to understand the current system at all.

~0010832

PepeAmpere (reporter)

Truth is i dont get it at all, but from loading screens i get information about many operations over "some" heightmap representation, that is later used in game, and there are done some pathing caluclations over that version of heightmap represantion, that was not touched by gadgets (completely changing shape/heightmap of final map).
+Notes

-Issue History
Date Modified Username Field Change
2013-02-08 21:18 abma New Issue
2013-02-08 21:20 abma Note Added: 0009729
2013-02-08 21:21 abma Note Added: 0009730
2013-02-08 22:30 jK Note Added: 0009731
2013-02-08 22:42 Kloot Note Added: 0009732
2013-02-08 22:44 Kloot Note Edited: 0009732 View Revisions
2013-02-08 22:45 jK Note Added: 0009733
2013-02-08 23:41 abma Summary calculating pathcosts seems to be slower than with spring 91.0 => Initializing PathCache takes very long (>1 minute)
2013-02-08 23:52 Kloot Note Added: 0009734
2013-02-08 23:52 Kloot Note Edited: 0009734 View Revisions
2013-02-09 08:12 jK Note Added: 0009735
2013-02-09 08:13 jK Note Edited: 0009735 View Revisions
2013-02-09 11:05 Kloot Note Added: 0009736
2013-02-09 11:05 Kloot Note Edited: 0009736 View Revisions
2013-02-09 11:06 Kloot Note Edited: 0009736 View Revisions
2013-02-09 11:09 Kloot Note Edited: 0009736 View Revisions
2013-02-09 11:12 Kloot Note Edited: 0009736 View Revisions
2013-02-09 12:10 abma Note Added: 0009737
2013-02-09 12:19 abma Note Edited: 0009737 View Revisions
2013-02-09 12:51 Kloot Note Added: 0009738
2013-02-09 13:42 jK Note Added: 0009740
2013-02-09 13:43 jK Note Edited: 0009740 View Revisions
2013-02-09 13:45 jK Note Edited: 0009740 View Revisions
2013-02-09 13:46 jK Note Edited: 0009740 View Revisions
2013-02-10 12:21 Kloot Assigned To => Kloot
2013-02-10 12:21 Kloot Status new => assigned
2013-06-03 00:45 abma Relationship added related to 0003832
2013-06-03 00:48 abma Relationship replaced has duplicate 0003832
2013-06-03 08:56 abma Note Added: 0010822
2013-06-04 05:07 PepeAmpere Note Added: 0010825
2013-06-04 13:24 jK Note Added: 0010829
2013-06-04 19:42 PepeAmpere Note Added: 0010832
2014-01-08 03:07 Kloot Changeset attached => spring develop 9954f41d
2014-01-08 03:07 Kloot Status assigned => resolved
2014-01-08 03:07 Kloot Resolution open => fixed
+Issue History