Opened 6 years ago

Last modified 5 years ago

#4957 new defect

Improve ClumpPlacer performance

Reported by: elexis Owned by:
Priority: Should Have Milestone: Backlog
Component: Maps Keywords:
Cc: Patch:

Description

If the ClumpPlacer is used with a large number of circles, it can consume minutes of map generation time.

There have been many commits that therefore changed the ClumpPlacer to a ChainPlacer:

r14183: Increasing thIncreasing the generation speed of the maps: Phoenician Levant
r14173: Increasing the generation speed of the maps: Northern Lights, Rhine ...
r14162: Increasing the generation speed of the maps: Unknown Land
r14160: Increasing the generation speed of the maps: Archipelago, Gulf of ...
r14159: Increasing the generation speed of the maps: Aegean Sea
r14158: Increasing the generation speed of the maps: Syria
r14131: Increasing the generation speed of the maps: Alpine Lakes
r14120: Increasing the generation speed of the maps: Continent
r14108: Increasing the generation speed of the maps: Islands, Lake
r14095: Again increasing the generation speed of Islands random map by using ...

As of r20894, the map Canyon still has this problem, likely more.

The performance should be fixed at the root cause, if possible. Otherwise we could also abandon the placer entirely if it received arguments that exceed the capacity and throw a JS error, so that the map designer can change it.

Change History (3)

comment:1 by elexis, 6 years ago

I challange anyone to wait for a giant Canyon map generation to finish.

comment:2 by FeXoR, 5 years ago

"The performance should be fixed at the root cause, if possible." Using Placers, Painters, Constraints is the root cause. The 2nd is calling functions that call function calling functions.... (and this is more often than not to avoid duplicated code or - for older functions - to avoid the need of giving arguments [so called "helper" functions]).

EDIT:

Canion:

Most of the time spend: Creating hills... 59.935s.

Total map generation time: 82.772s.

Total entities: 8573, Terrain entities: 5549, Textures: 13.

Last edited 5 years ago by FeXoR (previous) (diff)

comment:3 by FeXoR, 5 years ago

Another cause specific to path/road placement is the quite excessive use of placing small patches along the road. This could be done a lot faster and in addition provide information about the path's direction that would allow to place nice alleys if we used curves for the paths. I'm thinking about this and actually have a way to implement that in mind.

This may take some time though and increasing the performance of the placers would be an improvement anyways.

Version 0, edited 5 years ago by FeXoR (next)
Note: See TracTickets for help on using tickets.