Skip to content

Lod im - #61

Closed
BlenMiner wants to merge 6 commits into
devfrom
LOD-IM
Closed

Lod im#61
BlenMiner wants to merge 6 commits into
devfrom
LOD-IM

Conversation

@BlenMiner

@BlenMiner BlenMiner commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fbeb7a4e16

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +81 to +84
while (history.firstPending < history.sentTicks.Count &&
history.sentTicks[history.firstPending] <= ackedServerTick)
{
history.acknowledgedTick = history.sentTicks[history.firstPending++];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Do not treat global frame acks as per-root acks

When a root is in a sparse interest tier, normal frames are still sent through the unreliable SendFrameToRemote path, so a frame that included this root can be dropped while later frames still advance ackedServerTick. Advancing acknowledgedTick for every sentTick <= ackedServerTick then makes the next root update delta against a state the client never received, corrupting reconciliation under packet loss; this needs per-root delivery confirmation or an absolute/reliable resend after skipped sends.

Useful? React with 👍 / 👎.

Comment on lines +73 to +74
if (_relevance[i] != IsLocallyRelevant(i))
continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore re-entered local 3D bodies after rollback

When a locally culled subtree with LocalPhysics child rigidbodies re-enters during the rollback that applies the absolute frame, OnStartingToRollback has already forced the body kinematic, but relevance flips from false to true before this check. This branch skips restoring the saved state in exactly that re-entry case, leaving the now-active Rigidbody kinematic until some unrelated code changes it; only the true-to-false cull transition should keep the rollback freeze.

Useful? React with 👍 / 👎.

Comment on lines +74 to +75
if (_relevance[i] != IsLocallyRelevant(i))
continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore re-entered local 2D bodies after rollback

The same re-entry path affects LocalPhysics2D: if a culled subtree becomes relevant while the rollback is applying the authoritative frame, the body was already forced to Kinematic in OnStartingToRollback, and this relevance-change guard skips restoring the saved bodyType. Active Rigidbody2D children without their own prediction component can therefore remain kinematic after re-entry.

Useful? React with 👍 / 👎.

Comment on lines +1218 to +1219
if (i >= _systemsCount)
break;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Drop oversized positional frames before later reads

When a client is missing one of the server's positional systems, this new guard stops the loop but leaves the remaining state payload unread; because positional entries do not carry per-entry lengths, the following event-handler flag/entries are then decoded from the wrong bit offset. In that mismatch case, the frame needs to be discarded or converted to an ID/length-delimited repair path before continuing to later sections.

Useful? React with 👍 / 👎.

Comment on lines +3135 to +3137
bool force = forceAllRelevant ||
interestControls != null && interestControls.RequiresAbsolute(root);
return interest.ShouldSerializeState(player, root, localTick, force);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Force ownership updates before culling a released root

When ownership is released while the old owner's copy is already outside interest, the cull control is delivered but this path filters out the root's state because the server no longer sees system.owner == player and the resolved tier is culled. The old client never receives the owner = null metadata, so its local ownership exemption keeps the root materialized and predicted instead of applying the cull; cull transitions caused by ownership changes need to force at least the ownership/absolute state through.

Useful? React with 👍 / 👎.

@BlenMiner BlenMiner closed this Jul 23, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db91bb6599

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +373 to +374
interest?.Dispose();
interest = null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reset delivered tiers when reinitializing interest

If predictionLODProfile is changed or cleared while the manager is spawned, this drops the server-side interest module but leaves each existing PlayerPacker.interestControls with the tiers it previously marked delivered. On the next initialization, InitializePlayer only queues nonzero tiers, so a root that was previously delivered as culled/sparse and now resolves to tier 0 never sends the tier-0 control; affected clients keep the old local tier and can leave the root dematerialized or filtered until some later nonzero transition happens. Clear the per-client interest control state or explicitly queue reset tiers when reinitializing.

Useful? React with 👍 / 👎.

Comment on lines +572 to +574
if (changed && predictionManager && predictionManager.interest != null)
{
predictionManager.HandleLocalOwnershipChanged(this);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Invalidate owned-root cache even without interest

When interest has been disabled or cleared, ownership changes now skip HandleLocalOwnershipChanged, so the local owned-root cache is not invalidated. If the cache was populated before disabling interest and the profile is later re-enabled, GetLocallyOwnedRoots() can reuse the stale set and exempt the wrong roots from culling/policy overrides until another ownership change happens while interest is active; invalidate the cache on every owner change, even when no interest module is currently installed.

Useful? React with 👍 / 👎.


try
{
RemovePieceSet(_localInterestRecordsScratch, _localInterestMembersScratch, true, false, false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reattach child roots after parent culls

When a parent root is culled while a child root remains materialized, this local-only removal path calls RemovePieceSet, whose rescue logic detaches non-member descendants from the disappearing parent. Because the child root's hierarchy record did not change, later parent re-entry does not recreate or reattach that already-live child, leaving it unparented with the wrong transform relationship until some unrelated parent-state change occurs; restore affected child attachments when the parent materializes or avoid culling parent roots independently of live child roots.

Useful? React with 👍 / 👎.

@BlenMiner
BlenMiner deleted the LOD-IM branch July 26, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant