Quote:
Originally Posted by kkz
Thanks for the help i appreciate it. I'm a bit confused by what you mean.. So I don't send the broadcast packet at all? Or I do - but after I send the individual packets?
So -> UpdateSurroundings (sort visibledictionaries etc)
Send -> individual packets to all objects on screen..
-> No need to broadcast as everyone gets the individual packets?
Is that right?
Thanks again! 
|
You must make sure that everyone receives your movement packet:
1. If I'm on your screen already, I receive the movement packet
2. if I'm enterinig your screen, I receive the movement packet
3. If Ii'm leaving your screen, I receive the movement packet
If you broadcast your movement before UpdateSurroundings, only who's on your screen will receive the movement packet;
If you broadcast your movement after UpdateSurroundings, only who's on your screen after the movement will receive the movement packet;
If you broadcast twice (before and after), some actors who already received the movement packet will receive it again.
Reminder: do not send MsgAction:RemoveEntity to remove users from screen, unless the actor is leaving the map (teleport, disconnect).
If someone do not receive your movement packet, you'll have a desync between entities and the client will request a spawn packet.
I would suggest you to:
1. Read Spirited doc about Screen system
2. Understand what it means, without thinking about code, just understand how it works
3. Create an algorithm in your head (or somewhere)
4. Recheck your code and find what's missing
And perform the jump before executing the update, you must update your surroundings only if the jump succeed.