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

EntityManager::copy works incorrectly on a remote client #1079

Open
MarcinSc opened this issue Apr 22, 2014 · 7 comments
Open

EntityManager::copy works incorrectly on a remote client #1079

MarcinSc opened this issue Apr 22, 2014 · 7 comments
Assignees
Labels
Multiplayer Affects aspects not visible in Singleplayer mode only Revive: Keep issue has been looked at and deemed potentially helpful for revive Status: Needs Investigation Requires to be debugged or checked for feasibility, etc. Topic: Architecture Requests, Issues and Changes related to software architecture, programming patterns, etc. Type: Bug Issues reporting and PRs fixing problems

Comments

@MarcinSc
Copy link
Contributor

MarcinSc commented Apr 22, 2014

When I copy an entity on a remote client and then modify the values of the components in the copy, the original is also getting modified.

Immortius thinks it might be

"probably you lose the original, because the entityref will get directed to the last registered thing with the given net id".

@MarcinSc
Copy link
Contributor Author

Most likely causing #1048

@Cervator Cervator added this to the Alpha! milestone Apr 22, 2014
@immortius
Copy link
Member

Arguably it is working as intended - it creates a copy of the entity, and the entity system doesn't know about the behavior of the components being copied, nor should it have to.

Probably the item system should not be doing a straight copy, and instead doing a copy excluding the NetworkComponent. A helper method to do this would be good.

I will also have a look and see if there is some way for the client to differentiate between replicated entities and created locally entities for the purpose of the network system ignoring the latter, or at least whining loudly when it occurs.

@MarcinSc
Copy link
Contributor Author

I'm not sure, isn't NetworkComponent something that EntityManager uses internally? If so, maybe the publicly exposed method should not be copying it this one component if it further confuses the EntityManager.

@immortius
Copy link
Member

The entity manager knows nothing of NetworkComponent, and does not use it internally. The only components the entity manager deals with specifically are EntityInfoComponent and LocationComponent, the latter probably being too much.

Perhaps this is somewhere a hook is needed for the network manager to apply behavior, will think about it.

@MarcinSc
Copy link
Contributor Author

Maybe the entity should have a "copy/clone" method and the NetEntityRef should not copy the NetworkComponent?

@immortius
Copy link
Member

That is a good idea.

@Cervator
Copy link
Member

Bump - ran across this one while testing other new inventory stuff and multiplayer inventory issues are still around.

@Cervator Cervator modified the milestones: v1.0.0, Alpha! Oct 12, 2015
@Cervator Cervator removed the API label Jan 14, 2016
@Cervator Cervator modified the milestone: Alpha 1 - v1.0.0 Oct 25, 2016
@jdrueckert jdrueckert added the Status: Needs Investigation Requires to be debugged or checked for feasibility, etc. label Aug 10, 2021
@jdrueckert jdrueckert added the Revive: Keep issue has been looked at and deemed potentially helpful for revive label Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Multiplayer Affects aspects not visible in Singleplayer mode only Revive: Keep issue has been looked at and deemed potentially helpful for revive Status: Needs Investigation Requires to be debugged or checked for feasibility, etc. Topic: Architecture Requests, Issues and Changes related to software architecture, programming patterns, etc. Type: Bug Issues reporting and PRs fixing problems
Projects
None yet
Development

No branches or pull requests

4 participants