beyond-all-reason / beyond-all-reason/RecoilEngine

1821 (+2131?) Starlight unreasonably destroys lategame performance

Open
#1,106 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
679
Forks
290
Avg merge
3d 2h
Merged PRs (30d)
40

Description

I and others have noticed Starlight destroying performance in recent months. I don't recall it being this bad in previous years A Starlight firing puts Sim::MapDamage::Los to 15-20% CPU usage. With two the load jumped to 28%. The game had about 1700 units at this time. This is the game http://zero-k.info/Battles/Detail/1769993

![screen00004](https://github.com/beyond-all-reason/spring/assets/1318249/b2e04b3a-6a3c-41be-8ec8-2d04699d2092)

I was unable to reproduce by saving all the units at that point and spawning them into a game.
![screen00006](https://github.com/beyond-all-reason/spring/assets/1318249/43effa14-5cfd-48aa-97e4-142b7c595992)

Not even with a lot more Starlights. Sim::MapDamage::Los becomes noticeable a around 12%, but this is with eight Starlights. This is the unreasonable part, for some reason two Starlights 35 minutes into the game cost a lot more performance than eight spawned at the start, alongside similar unit counts.
![screen00008](https://github.com/beyond-all-reason/spring/assets/1318249/ae6a93f5-18ef-40e3-a4b6-21111256ff16)

I was able to reproduce somewhat with an AI game, 3x resource multiplier, and four spawned Starlights when the unit count hit 1700.
![screen00005](https://github.com/beyond-all-reason/spring/assets/1318249/73686aea-24ab-460e-b512-505265f73444)

I an unable to run later engines at this point.

Contributor guide

Open the contributing guide

Research direction

Start with the reported Sim::MapDamage::Los hotspot and compare the linked battle with the provided reproduction attempts. Investigate why late-game Starlight firing scales differently from many Starlights spawned at game start; done means reproducing the regression, identifying its cause, and confirming improved performance without changing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.