Hi there,
This is another template for network multiplayer. This is like a deathmatch (actually not a FPS, sorry)
I made a lot of improvements over the first version.
- Server and client are in a single file (but in different scenes)
- This version uses only non-blocking sockets. So, it does not freeze blender and don't need multithreading
- Interface to choose run server, or type server IP address and run client
- Real multiplayer. 1, 2 3,.., 20, 400 players can join the game. It is limited only by server memory and network lag. You can use this in your MMORPG ( it's a joke !!! Check posts below)
- On screen message log
What is missing:
- Detect clients disconnection to remove avatars from game. (I already did it, but the script simply disapeared
)
- Detect when client fall from arena and send a "frag" message (and count "frags")
- Some UV scroll on tank movement
How to test (in one single machine):
- Open multiple Blender instances with the tank.blend file and position windows side-by-side (you can see 4 blender instances in the pic below)
- Run ("P") the game engine in all Blender's
- Choose one Blender to run server (click "Run as Server")
- Choose the remaining Blenders to run client (click "Run as Client")
- Use WSAD in a client to move the tank. Arrows to aim the turret. Space to shot
- See action sychronized in all blender's
How to test (in a network):
- Chose someone to be the server (everybody must know the IP addres of the server machine)
- Run Blender (tank.blend) on server machine and click on "Run as server"
- Run Blenders (tank.blend) on other machines. Type the server IP address and click "Run as client"
- Try a deathmatch (and tell me if it works
)
I tried to put a lot of comments in the network code to help people understand it. But what people must be aware is that the network code is not the hard part. The most complex task in any networked multiplayer game is to define and control the communication protocol and synchronization messages and procedures.
I wil try make this a complete game
There it is:
http://www.4shared.com/file/82320784/232ff1b3/tank.html
PS: Linux users. Plz, tell me if it works in your linux box
Bookmarks