Hey, I appreciate the response but my question is more about the movement updating for other players and their appearance not our local players.
It seems to read the movements for each player and expects me to write them? That's what I don't get,
Like this:
Code:
int count = buffer.readBits(8);
Reads the count of players we wish to update movements for in our local area.
Then immediately does this after it:
Code:
playerCount = 0;
for (int i = 0; i < count; i++) {
int index = playerList[i];
Player player = players[index];
int updateRequired = buffer.readBits(1);
The rest of the block is identical to movement updates like P81. WHo's bits am I sending here lol? (movement bits, as it expects it every player we send... surely I don't send all of them in my local area right?)
Like this:
Code:
if (movementType == 0) {
playerList[playerCount++] = index;
player.time = tick;
mobsAwaitingUpdate[mobsAwaitingUpdateCount++] = index;
} else if (movementType == 1) {
playerList[playerCount++] = index;
player.time = tick;
int direction = buffer.readBits(3);
player.walk(direction, false);
int update = buffer.readBits(1);
if (update == 1) {
mobsAwaitingUpdate[mobsAwaitingUpdateCount++] = index;
}
}
I've got 0 idea how I'd determine their bloody movements lol
As for the index, I presume it's that initial uid sent in the login procedure for each new client? Shall I loop over everyone?
Also about the masks, you need to send it after previous data if you are updating this player, that isn't optional man.
I am using an event based observable architecture which emits on a specified tick too btw