Skip to content

Improve #2218 - #2318

Draft
DeathFishAtEase wants to merge 2 commits into
Phobos-developers:developfrom
DeathFishAtEase:ImproveLaserPositionUpdate
Draft

Improve #2218#2318
DeathFishAtEase wants to merge 2 commits into
Phobos-developers:developfrom
DeathFishAtEase:ImproveLaserPositionUpdate

Conversation

@DeathFishAtEase

Copy link
Copy Markdown
Collaborator

Starkku commented Jul 30, 2026, 18:56 GMT+8

This is currently performing expensive hash table lookups (std::unordered_map.find()) on every frame for every LaserDrawClass instance with zero mitigations in place f.ex disabling hooks after all parsing passes if tracking feature is not enabled, or even a simple skip if no tracking laser weapons exist. Ideally LaserDrawExt would be created for this purpose. Unlike EBolt, LaserDrawClass technically has enough padding to house extension pointer but it is not contiguous which would either require adding additional logic to the extension template to allow parsing pointer from non-contiguous offsets or a bespoke implementation.

Note

The LaserRT::TrackingMap[pLaser] = LaserRT::TrackingData {}; in the original implementation's CTOR hook cannot be directly removed for optimization, otherwise the laser ring of DiskLaser during the charging phase may have its start point on ring A and end point on ring B.

@DeathFishAtEase DeathFishAtEase self-assigned this Jul 31, 2026
@DeathFishAtEase DeathFishAtEase added No Documentation Needed No documentation needed whatsoever No test needed This PR is simple enough, or changes no in-game logic, so no in-game testing is required. labels Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No Documentation Needed No documentation needed whatsoever No test needed This PR is simple enough, or changes no in-game logic, so no in-game testing is required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant