Skip to content

Improve #2218 - #2318

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

Improve #2218#2318
DeathFishAtEase wants to merge 8 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 test needed This PR is simple enough, or changes no in-game logic, so no in-game testing is required. labels Jul 31, 2026
Comment thread src/Ext/WeaponType/Body.cpp Outdated

@Coronia Coronia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we're not hurry for a LaserDrawExt I'd suggest merge this first to solve the immediate problem

@Metadorius Metadorius added Skip Changelog PR does not need a changelog entry in docs/Whats-New.md Skip Docs PR does not need a documentation entry Skip Credits PR does not need a credits entry in CREDITS.md and removed No Documentation Needed labels Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No test needed This PR is simple enough, or changes no in-game logic, so no in-game testing is required. Skip Changelog PR does not need a changelog entry in docs/Whats-New.md Skip Credits PR does not need a credits entry in CREDITS.md Skip Docs PR does not need a documentation entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants