Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tp3 network rewrite #646

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft

Tp3 network rewrite #646

wants to merge 28 commits into from

Conversation

NateTheGreatt
Copy link
Contributor

@NateTheGreatt NateTheGreatt commented Jul 6, 2023

remaining:

  • RPCs
  • network actions
  • fix up XR
  • rework matrix network interface
  • spawnables as a non-host peer
  • authority transfers
  • script replicators

@github-actions
Copy link

github-actions bot commented Jul 6, 2023

🚀 Deployed on https://deploy-preview-646--thirdroom.netlify.app

@github-actions github-actions bot temporarily deployed to pull request July 6, 2023 17:06 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 6, 2023 17:35 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 6, 2023 17:39 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 6, 2023 17:56 Inactive
Copy link
Contributor

@robertlong robertlong left a comment

Choose a reason for hiding this comment

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

Looking great so far!

rigVelocity: float_t[3]
}

struct AvatarXRModeUpdate {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we explain what this struct is used for in this document? Is it an RPC?

const type = schema[key];
const value = object[key];
const write = BinaryToWriteFunction[type];
write(v, value as never);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you casting to never here?

import { Codec } from "./Codec";

export enum NetworkMessage {
// old
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove the old messages before we merge?

src/engine/network/NetworkMessage.ts Outdated Show resolved Hide resolved
let b = 0;

const position = node.position;
changeMask |= writePropIfChanged(v, position, 0) ? 1 << b++ : b++ && 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this use your new mutationEncoder?

@@ -1,28 +1,28 @@
import { addComponent } from "bitecs";
Copy link
Contributor

Choose a reason for hiding this comment

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

How much of this file do we still need? Can we get rid of it now?

addChild(container, rig);

quat.fromEuler(rig.quaternion, 0, 180, 0);
const avatarFactory = (ctx: GameContext) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks great! Good proof that using the replicator API internally cleaned some things up.

@@ -77,7 +77,7 @@ export function useWorldLoader(): WorldLoader {

registerMatrixNetworkInterface(matrixNetworkInterface);

await enterWorld(mainThread, session.userId);
// await enterWorld(mainThread, session.userId, hostId);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove this now?

@@ -1,31 +1,23 @@
// import { describe, it } from "vitest";
import { ok, strictEqual } from "assert";
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens with these network tests after we've removed the old network messages? Is this no longer needed?

return createBall(ctx, module, physics, 2, emissiveMaterial, ballAudioData, kinematic);
},
});
module.replicators = {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should come up with a better way of registering replicators on load/enter world for our own internal code.

@github-actions github-actions bot temporarily deployed to pull request July 6, 2023 18:55 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 6, 2023 19:01 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 6, 2023 19:16 Inactive
@github-actions github-actions bot temporarily deployed to pull request July 6, 2023 20:32 Inactive
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.

2 participants