Tuesday, February 12, 2008

TankAPE 1.1 Working!

Heck yeah! Multiplayer APE physics worlds unified via the JAGS 1.4m server.

Check out the TankAPE demo (link is on front page of fireleg.com).

I learned a whole lot about IExternalizable, and then I learned I didn't need to know squat about it. I rewrote the whole APE physics engine so you could serialize any particle across the net.

What I didn't realize was that the particles would be very large to send and they would cause weird problems upon receiving them (like APE would duplicate them upon creation because they do stuff with the engine).

Anyway, I then dropped back to plan B, and that worked way better. Plan B was to send just the x,y and velocity data per update, and only send updates when keystrokes happened.

This reduced the data size from 3000 bytes to about 100 bytes. And to think I was going to send 3000 bytes per tank 24 times per second! Ha! Now I send 100 byte packets when someone changes direction or every 2 seconds per tank just to keep everything synced up.

Have fun with it.

No comments: