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

The IDs are not consistent between connected systems #315

Open
TobbetheStalker opened this issue Feb 16, 2017 · 0 comments
Open

The IDs are not consistent between connected systems #315

TobbetheStalker opened this issue Feb 16, 2017 · 0 comments

Comments

@TobbetheStalker
Copy link
Collaborator

TobbetheStalker commented Feb 16, 2017

The situation is the following:

Both the Host and Clients systems is identical:
Player1 EntityID = 1
Player2 EntityID = 2
Ball1 EntityID = 3
Ball2 EntityID = 4

The way we update them over the network is by sending the update together with the ID of the entity.
Then when the client receives the packet, it will check the ID and do one of the following things:
if ID == 1
Player2->GivePacket()
if ID == 2
Player1->GivePacket()
if ID == 3
Ball1->GivePacket()
if ID == 4
Ball2->GivePacket()

untitled
The problem is that if we have a condition like this:
if (Player1 && Ball1)
//Do something

it will mean different things on other machines since the object that got moved on one system is not the one moved on the other system.

This is NOT that great of a deal currently since this only involves ONLY the Player1,Player2,Ball1,Ball2 variables in 'LevelState'. The only place we currently uses Fields is to change level between maps, and then the condition is only if both players is inside the field, which both will be on both systems.

NOTE: I only put up this issue to clear this up. If you still have question on what to or not to do, just come and ask me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant