Skip to content

Network Update Loop#8

Merged
0xFA11 merged 24 commits intomasterfrom
rfc/network-ticker
Feb 10, 2021
Merged

Network Update Loop#8
0xFA11 merged 24 commits intomasterfrom
rfc/network-ticker

Conversation

@0xFA11
Copy link
Copy Markdown
Contributor

@0xFA11 0xFA11 commented Jan 31, 2021

@0xFA11 0xFA11 changed the title Network Ticker Network Update Loop Jan 31, 2021
Copy link
Copy Markdown
Member

@NoelStephensUnity NoelStephensUnity left a comment

Choose a reason for hiding this comment

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

Thank you Fatih!
Looks very nice and a better implementation!

Copy link
Copy Markdown
Contributor

@LukeStampfli LukeStampfli left a comment

Choose a reason for hiding this comment

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

Clean and decoupled API, I like it!

Comment thread text/0000-network-update-loop.md
Comment thread text/0000-network-update-loop.md Outdated
Comment thread text/0000-network-update-loop.md
Comment thread text/0000-network-update-loop.md Outdated
Comment thread text/0000-network-update-loop.md Outdated
Comment thread text/0000-network-update-loop.md Outdated

N/A: We need to have this, other systems such as network tick, network variable snapshotting and others will be relying on this pipeline.

# Rationale and alternatives
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.

I'm a bit dubious about instituting a structured loop concept that lives on top of the PlayerLoopSystem. It feels like, if executed poorly, it could limit flexibility in the PlayerLoopsystem. Maybe it's OKAY because enough other parts of the engine break if you customize the system beyond where we're hooking in, but it feels wrong that the entire system might stop working if you change your player loop enough for special case without giving the user any way to remedy it by composing their own network loop.

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.

Perhaps an alternative approach is to model this as a series of helpers/extensions, along with some default settings, rather than a system-unto-itself.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we're modifying the existing player loop system, we are not building a new one from scratch. users are still able to modify the player loop system after we inject our methods into the existing one — they might even unplug our systems! I believe our approach is right here but I will reconsider where we inject network methods as you suggested above.

Copy link
Copy Markdown
Contributor Author

@0xFA11 0xFA11 Feb 9, 2021

Choose a reason for hiding this comment

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

looking at this one more time again, I think I got what you were saying. however, I still think "we" should decide where we would inject our network loop methods because it will also have implications on the framework itself. I believe I went a little bit too far without considering and fully understanding what are the existing steps (systems running under player loop systems) the player loop currently takes (injecting after MemoryFrameMaintenance doesn't sound right). I will investigate more and elaborate reasons why certain places are selected to inject network loop methods. awesome feedback, thank you very much Jesse :)

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.

I'm trying to unpack 'you' and 'your' in @JesseOlmer's comment:

it feels wrong that the entire system might stop working if you change your player loop enough for special case without giving the user any way to remedy it by composing their own network loop.

Do you mean the system will stop working if Unity makes changes to PlayerLoop? Or if the SDK team makes changes that break existing users? Or (my guess) that users that are already aware and using Player Loop now have to sidestep this system?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If I understand the concern here, maybe we offer a way for users to adjust where the Network Update Loop registers its hooks? Perhaps this could be a new MLAPI tool within the editor that allows one to visualize where the network update loop is registered and make any adjustments relative to their own registered player loop systems? This provides the user with the ability to make adjustments if needed, and of course the tool would have to have a way for the user to "reset back to default settings" in the event they fiddle with it too much.

Comment thread text/0000-network-update-loop.md
Comment thread text/0000-network-update-loop.md Outdated
Copy link
Copy Markdown
Contributor

@JesseOlmer JesseOlmer left a comment

Choose a reason for hiding this comment

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

lgtm

@0xFA11 0xFA11 merged commit 65a4b9e into master Feb 10, 2021
@LukeStampfli LukeStampfli added accepted RFC has been accepted final-comment-period RFC is in final comment period and removed accepted RFC has been accepted final-comment-period RFC is in final comment period labels Feb 15, 2021
@0xFA11 0xFA11 deleted the rfc/network-ticker branch March 9, 2021 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted RFC has been accepted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants