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

Update to Bevy 0.13 #198

Merged
merged 16 commits into from
Feb 21, 2024
Merged

Update to Bevy 0.13 #198

merged 16 commits into from
Feb 21, 2024

Conversation

dgsantana
Copy link
Contributor

Since we are working on a simple game that is using replicon, and we would like to switch to 0.13, to catch any early bugs and take advantage of the new features, I made this PR.

Changes:

Missing review of entity id serialization, couldn't find where it was.

Migrate to bevy 0.13
- PR on rennet (lucaspoffo/renet#147)
- Deprecated `MapNetworkEntities` and `Mapper`
- Conditions systems follow the new Bevy pattern

- Needs review for entity serialization id
@dgsantana dgsantana mentioned this pull request Feb 19, 2024
Copy link
Contributor

@Shatur Shatur 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 a lot!

Could you please apply formatting, fix doctests and silence deprecation warnings for existing Mapper impls to make CI happy?
Also I would appreciate if you update the changelog :)

But it's all optional, I can do all of the above myself later.

Copy link
Contributor Author

@dgsantana dgsantana left a comment

Choose a reason for hiding this comment

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

Fixed version and missing extra LF

- Cargo fmt to fix any formatting issues
- Fixed all tests (forgot to run test in the previous run, only tried samples).
- Added allow deprecated in a few places to silence clippy.
Copy link
Contributor

@Shatur Shatur left a comment

Choose a reason for hiding this comment

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

Thanks!

Since we changed our generics to accept MapEntities instead of MapNetworkEntities, it will stop to compile anyway. Maybe remove this trait instead of deprecation?

@dgsantana
Copy link
Contributor Author

There is a test on the other.rs that as 5 more bytes on the stats. I silence the assert, since I don't see any regressions, and maybe something from the rennet update.

Thanks!

Since we changed our generics to accept MapEntities instead of MapNetworkEntities, it will stop to compile anyway. Maybe remove this trait instead of deprecation?

I agree, I just deprecated mostly because of the comment on #185.

@Shatur
Copy link
Contributor

Shatur commented Feb 19, 2024

I agree, I just deprecated mostly because of the comment on #185.

Let's ask @UkoeHB about it. Do you think it worth to remove the old mapper trait since all methods now accept the built-in one?

@UkoeHB
Copy link
Collaborator

UkoeHB commented Feb 19, 2024

Do you think it worth to remove the old mapper trait since all methods now accept the built-in one?

Yes remove it. By 'deprecate' I just meant to use Bevy's instead (not a rust deprecation).

@Shatur
Copy link
Contributor

Shatur commented Feb 19, 2024

@dgsantana could you remove it then?

@dgsantana
Copy link
Contributor Author

Of course. Also bevy_renet should be ready to be merged. Bevy_egui is now published.

@Shatur
Copy link
Contributor

Shatur commented Feb 19, 2024

Also bevy_renet should be ready to be merged. Bevy_egui is now published.

Great! But bevy_renet is maintained by a different person, so we need to wait until he merges the PR.

@Shatur
Copy link
Contributor

Shatur commented Feb 20, 2024

@UkoeHB could you take a look into entity serialization?

@UkoeHB
Copy link
Collaborator

UkoeHB commented Feb 20, 2024

Ok let's do it in a new PR (easier for me to handle).

@dgsantana
Copy link
Contributor Author

There is something broken on component serialization, the client receives always 0 bytes after the entity id. I'm debugging on a different branch.

@Shatur
Copy link
Contributor

Shatur commented Feb 20, 2024

Make sure to apply changes from @UkoeHB. I will fix the CI and merge his branch today after work.

@dgsantana
Copy link
Contributor Author

Make sure to apply changes from @UkoeHB. I will fix the CI and merge his branch today after work.

I did, but there is something broken probably on the collect_changes on the server... I have to leave for a few hours, but will look into this later on.

@Shatur
Copy link
Contributor

Shatur commented Feb 20, 2024

Pushed some minor changes to make CI happy.

I did, but there is something broken probably on the collect_changes on the server.

Are you sure? Because all tests pass and all examples work.

Copy link

codecov bot commented Feb 20, 2024

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (56af700) 89.06% compared to head (88d1e09) 89.12%.

❗ Current head 88d1e09 differs from pull request most recent head f6bfdf4. Consider uploading reports for the commit f6bfdf4 to get more accurate results

Files Patch % Lines
src/client/diagnostics.rs 75.00% 6 Missing ⚠️
src/client.rs 88.88% 1 Missing ⚠️
src/parent_sync.rs 66.66% 1 Missing ⚠️
src/server/replication_messages.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #198      +/-   ##
==========================================
+ Coverage   89.06%   89.12%   +0.05%     
==========================================
  Files          20       20              
  Lines        1427     1416      -11     
==========================================
- Hits         1271     1262       -9     
+ Misses        156      154       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dgsantana
Copy link
Contributor Author

dgsantana commented Feb 20, 2024 via email

Copy link
Collaborator

@UkoeHB UkoeHB left a comment

Choose a reason for hiding this comment

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

LGTM, removing unused #[allow(deprecated)].

@Shatur
Copy link
Contributor

Shatur commented Feb 20, 2024

Great!
I will merge when @dgsantana confirms that everything is fine and Renet drafts a new release.

@dgsantana
Copy link
Contributor Author

Great! I will merge when @dgsantana confirms that everything is fine and Renet drafts a new release.

I'm pulling all changes from the current PR into my instrumented branch just to double check everything.

@dgsantana
Copy link
Contributor Author

dgsantana commented Feb 20, 2024

It's very weird...
image

2024-02-20T18:32:40.837400Z DEBUG bevy_replicon::client: applying Removal components for 0 entities
2024-02-20T18:32:40.837642Z DEBUG bevy_replicon::client: applying Insert components for 2 entities
2024-02-20T18:32:40.837811Z DEBUG bevy_replicon::client: reading components for 13v2 with 0 bytes
2024-02-20T18:32:40.838129Z DEBUG bevy_replicon::client: reading components for 14v2 with 0 bytes

Left is Server, Right is Client. The entities are send, but not the components, the buffer after reading the entity is just empty on the client side. But Tic Tac Toe is working.

@Shatur
Copy link
Contributor

Shatur commented Feb 20, 2024

Could you provide a minimal example to reproduce?
Preferably in a form of test :) But any other form is also fine.

@dgsantana
Copy link
Contributor Author

Could you provide a minimal example to reproduce? Preferably in a form of test :) But any other form is also fine.

I will try to create a minimal sample or test for this.

@dgsantana
Copy link
Contributor Author

Ok here goes a "minimal" example. It uses a menu system to handle the connection, instead of the command line. And it as the issue. Feel free to use as a extra example.
minimal_with_menu.zip

@UkoeHB
Copy link
Collaborator

UkoeHB commented Feb 20, 2024

@dgsantana it looks like you are not registering any components for replication. Docs

@dgsantana
Copy link
Contributor Author

@dgsantana it looks like you are not registering any components for replication. Docs

Ok, I made it too minimal. I removed serde by mistake.
Player, PlayerStone in the original code as Serialize and Deserialize.
image

@dgsantana
Copy link
Contributor Author

Oook, manually registering with replicate::<...>() works.

@dgsantana
Copy link
Contributor Author

Ok it was my bad, I indeed forgot to register the components for replication, sorry for the false alarm.

@Shatur Shatur merged commit 84ea563 into projectharmonia:master Feb 21, 2024
5 checks passed
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.

3 participants