Anonymous Login
2021-10-24 20:07 UTC

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001105OpenClonkScenariospublic2016-08-19 09:38
Assigned ToMaikel 
Platform64 bitOSWindowsOS Version7
Product Version 
Target VersionFixed in Version 
Summary0001105: Iron Peak Goal - Lags
DescriptionThe goal, trying to locate the flag area lags hard core.
Additional InformationWe had lag in Iron Peak (LAN) and Zapper tracked the lag down to the goal object.
TagsNo tags attached.
Attached Files




Zapper (developer)

Confirmed. The FPS drop by around 10 or so (bad laptop hardware, but can run other scenarios at full speed).

Some script-profiler results of different duration during that round:
[17:00:03] 02492ms Goal_Expansion.FxIntAreaMonteCarloTimer
[17:00:03] 02343ms Goal_Expansion.CoveredByFlag
[17:00:03] 01278ms Ropeladder.FxIntHangTimer
[17:00:03] 01277ms Ropeladder.TimeStep
[17:00:03] 00881ms Ropeladder.SatisfyConstraints
[17:00:03] 00550ms Ropeladder.ConstraintLength
[17:00:03] 00346ms Ropeladder.UpdateLines
[17:00:03] 00317ms Ropeladder.ConstraintLandscape
[17:00:03] 00236ms Cloud.FxProcessCloudTimer
[17:00:03] 00160ms Cloud.Evaporation
[17:07:54] 02356ms Goal_Expansion.FxIntAreaMonteCarloTimer
[17:07:54] 02229ms Goal_Expansion.CoveredByFlag
[17:07:54] 00093ms Cloud.FxProcessCloudTimer
[17:07:54] 00059ms Cloud.MoveCloud
[17:07:54] 00035ms Global.FxIntScheduleCallTimer
[17:07:54] 00029ms Global.GetDefHeight
[17:20:23] 25135ms Goal_Expansion.FxIntAreaMonteCarloTimer
[17:20:23] 23780ms Goal_Expansion.CoveredByFlag
[17:20:23] 01718ms Cloud.FxProcessCloudTimer
[17:20:23] 01083ms Cloud.Evaporation
[17:20:23] 00571ms Cloud.MoveCloud
[17:20:23] 00362ms Global.GetDefWidth

The goal is only contested by the ropeladder...


Maikel (developer)

I'll have a look on how to improve this.


Maikel (developer)

What kind of hardware were you using?

I think I can reduce the lag by a factor of 4, but it also implies it take 4x as long to calculate the increased coverage if a new flag is build


Maikel (developer)

I have improved the speed by a theoretical factor of 4, can you tell me if it still lags?


Zapper (developer)

Last edited: 2014-12-25 14:36

View 2 revisions

It's still pretty slow for the gain (see log), but at least on my high-end computer, it does not seem to produce noticable lag (in a short test).

Someone with a lower-end hardware should try it and see if they can get 38FPS in the scenario.

00371ms Goal_Expansion.FxIntAreaMonteCarloTimer
00367ms Goal_Expansion.CoveredByFlag
00023ms Global.FxIntScheduleCallTimer
00016ms Clonk.FxIntWalkTimer
00014ms Clonk.FxIntTurnTimer
00012ms Lorry.TurnWheels
00010ms Clonk.FxIntScaleRotTimer

PS: In this test I had removed all clouds, because they got in the way and I constantly dragged them around..


Zapper (developer)

PS: I'd still suggest an approximation using the area of intersecting squares instead of the current Monte Carlo approach. The approximation would be extremely fast and would have to be calculated only when new flags are built.

Even if the Monte Carlo approach is obviously cooler.


Sven2 (developer)

Last edited: 2015-01-22 13:32

View 2 revisions

Doesn't the power library already keep a list of all connected flags and in the process needs to find overlapping neighbours? It could easily calculate the area, subtract overlaps and keep that result to be queried by the goal object.

If flags are prioritized, subtracting overlaps is also simple: You subtract the full overlap if your flag has lower priority than the overlapping one. That way you don't need to worry about triple overlaps, etc.

Edit: Formula for overlapping region is here:
 (A(d, R, r) = overlapping area). I'm sure it can be approximated well enough by a 2nd order polynomial.


Zapper (developer)

Flags do have a priority: their construction time is saved.


Maikel (developer)

I can have a look at this when looking into the power library again. Currently not that motivated, so maybe for a 6.1 release. I think we have an arccos anyways (or we can derive it from Angle()), so no need for approximations I think.


Caesar (developer)

Sven: If you subtract overlaps, you have to readd triple overlaps, then subtract quadtruple overlaps, … No fun.


Sven2 (developer)


> If flags are prioritized, subtracting overlaps is also simple: You subtract the full overlap if your flag has lower priority than the overlapping one. That way you don't need to worry about triple overlaps, etc.


Caesar (developer)

Sven: I don't think you have thought this through, at least I don't see why priority should help in any way. Maybe you should implement it and show me…

Let me ask: What do you do with that flag, that has middle priority, in a triple overlap?


Sven2 (developer)

Hm you are right, always subtracting the full overlap subtracts too much.

I don't implement anything until my disseration is done :P


Clonkonaut (developer)

What's the progress on this?


Caesar (developer)

Last edited: 2015-10-14 09:43

View 2 revisions

None, afaik. I've tried implementing a function that calculates the circle area by partitioning it in sectors and the polygon spanned by the midpoints and the intersections. However, the order of intersections on the circle is crucially important but I couldn't keep it (screw numerics).

Host background thread engine monte carlo implementation anyone? Or maybe Netwon's polygon library?


Maikel (developer)

The situation can be improved by making GetFlagpoleForPosition faster for a large number of flags. I will try this.


Maikel (developer)

This only barely worked, but locally I don't have any noticeable lag. Let's test this in a network round.


Maikel (developer)

We played a test round with a steady 38 FPS, on large map. So I close this report for now.


Newton (administrator)

arhiving old resolved bugs

-Issue History
Date Modified Username Field Change
2014-08-09 15:22 ala New Issue
2014-08-09 15:28 Zapper Note Added: 0003076
2014-08-09 15:28 Zapper Assigned To => Zapper
2014-08-09 15:28 Zapper Status new => acknowledged
2014-08-11 10:10 Zapper Assigned To Zapper =>
2014-08-14 08:43 Maikel Note Added: 0003086
2014-08-14 08:43 Maikel Assigned To => Maikel
2014-08-14 08:43 Maikel Status acknowledged => assigned
2014-08-14 10:10 Maikel Note Added: 0003087
2014-08-17 14:37 Maikel Note Added: 0003092
2014-08-17 14:37 Maikel Assigned To Maikel => Zapper
2014-08-17 14:37 Maikel Status assigned => feedback
2014-12-25 14:35 Zapper Note Added: 0003274
2014-12-25 14:36 Zapper Note Edited: 0003274 View Revisions
2015-01-22 09:48 Zapper Assigned To Zapper =>
2015-01-22 09:51 Zapper Note Added: 0003444
2015-01-22 13:28 Sven2 Note Added: 0003446
2015-01-22 13:32 Sven2 Note Edited: 0003446 View Revisions
2015-01-23 09:27 Zapper Note Added: 0003447
2015-01-23 09:37 Maikel Note Added: 0003448
2015-03-31 05:01 Caesar Note Added: 0003566
2015-03-31 09:14 Sven2 Note Added: 0003567
2015-04-02 08:38 Caesar Note Added: 0003569
2015-04-02 12:02 Sven2 Note Added: 0003570
2015-10-13 14:05 Clonkonaut Note Added: 0003912
2015-10-14 09:42 Caesar Note Added: 0003920
2015-10-14 09:43 Caesar Note Edited: 0003920 View Revisions
2015-10-16 00:32 Sven2 Target Version => 7.0
2015-12-02 10:01 Maikel Note Added: 0004226
2015-12-02 10:01 Maikel Assigned To => Maikel
2015-12-02 10:01 Maikel Status feedback => assigned
2016-01-02 21:09 Maikel Note Added: 0004449
2016-01-03 21:53 Maikel Note Added: 0004454
2016-01-03 21:53 Maikel Status assigned => resolved
2016-01-03 21:53 Maikel Fixed in Version => 7.0
2016-01-03 21:53 Maikel Resolution open => fixed
2016-08-19 09:38 Newton Note Added: 0005305
2016-08-19 09:38 Newton Status resolved => closed
+Issue History