These last days I've not had much time to code, but I have been able to squeeze in about 30-40 minutes every morning and about 1-2 hours later during the day.
Today I have a little YouTube video for you showing the early stages of the multiplayer action. This time I'm playing on the same screen in linux. When things work more smoothly I'll record a new video when I'm playing with one of my friends.
What works so far:
- The Host sends frequent data of the enemies position, direction, state and life. In between the client interpolates and moves the enemies according to the state that was received.
- Both Client and Host send the players position, direction and state very frequent so that there is no LAG. The package is 15 bytes, which means that if we sent the package 30 times / sec it would only be 450 bytes. (1 kb = 1024 bytes), so there is practically no bandwidth taken even if we wanted to send the package 60 times / sec (900 bytes)
- If Client or Host presses the shoot button, a small package (14 bytes) is sent with the start x,y position, direction and identity (fireball, iceshot etc) of the shot. When the package is received the shot is activated and handled locally.
- Whenever the Client attacks an enemy, a small package is sent to Host with the enemies life and state.
There is also some "bugs" left to take care of. As you could see in the movie I have not yet fixed the "damaged state" on the player. It is not canceled until you move the character.
And here you have the YouTube Video: (Watch in FULL HD)
See you next post!