Skip to content

Fix #55: Add ProgressTrackingSpeedBoost#57

Merged
gotmachine merged 1 commit into
KSPModdingLibs:devfrom
JonnyOThan:fix-progress-tracking
Jul 13, 2022
Merged

Fix #55: Add ProgressTrackingSpeedBoost#57
gotmachine merged 1 commit into
KSPModdingLibs:devfrom
JonnyOThan:fix-progress-tracking

Conversation

@JonnyOThan
Copy link
Copy Markdown
Contributor

KSP's stock ProgressTracking evaluates every progress node for every vessel in the universe.
There are ~19 progress nodes per celestial body, and this can get extremely expensive for mods with a
large number of bodies or saves with a large number of vessels.
This tweak only evaluates the currently active vessel and removes the per-body checks which don't
have any effect, at least in the stock game.

KSP's stock ProgressTracking evaluates every progress node for every vessel in the universe.
There are ~19 progress nodes per celestial body, and this can get extremely expensive for mods with a
large number of bodies or saves with a large number of vessels.
This tweak only evaluates the currently active vessel and removes the per-body checks which don't
have any effect, at least in the stock game.
@gotmachine
Copy link
Copy Markdown
Contributor

Evaluating only the active vessel would be a breaking change, not only for "world firsts", but also for contracts.

The part about removing the per body update delegate feels alright. Not 100% safe, but I doubt anybody ever added custom tracking nodes.

@JonnyOThan
Copy link
Copy Markdown
Contributor Author

I’ll do a more diligent search…I’m pretty sure all the contract related stuff is not things that are handled by OnVesselIterate

@JonnyOThan
Copy link
Copy Markdown
Contributor Author

JonnyOThan commented Jul 12, 2022

Confirmed: Every stock class that populates the OnIterateVessels callback only looks at the active vessel inside the callback.

For example: CelestialBodyFlyby operates by handling the OnVesselSOIChange event, not by using OnIterateVessels.

@gotmachine
Copy link
Copy Markdown
Contributor

Ok, did a quick review of the ContractConfigurator codebase too, couldn't find anything that might be affected.
Also found a bunch of other mods manipulating ProgressTracking stuff in a way or another, but it doesn't seem any of them is relying on IterateVessels callbacks.

Will merge for next release, thanks for the contribution.

@gotmachine gotmachine merged commit f1dfc55 into KSPModdingLibs:dev Jul 13, 2022
@JonnyOThan JonnyOThan deleted the fix-progress-tracking branch July 13, 2022 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants