Networked Multiplayer Deathmatch Template [2 or more players] WIP

how do i nstall it?

Hi there Morgade! Your work looks very cool! Does it needs python installed?

Thank you.

yep. python is definetly needed

:wink: Bzoo is still alive.
The creator would like improve it.

I think the quick way is enable to run gameEngine without graphical interface else we can’t develop a server dedicated.

The second way is to use bullet library under java or C++ like it’s wrote here. But is it too complicated to read a blend file?
( And I don’t like sdna ;p) the project to write blend file in Xml is dead ?

Marc++

The client/server worked seamless on my G5 and Powerbook. I’ll have to dissect this baby and learn how you got all this working so nicely. Thanks for finally breaking the networking barrier for the GE, and doing it so nicely :slight_smile:

One thing I would suggest is the option to customize the port settings for the server. Mostly because we don’t all use your birthday for our preferred port settings ;). Easily hackable to include it, but just a suggestion for your template. Looking great so far.

EDIT: Another suggestion, to expand upon your network design, is to include a simple in-game messaging system.

I was sitting here smackin my head on the wall, trying to figure out why my firewall was rejecting the connection, even tho the port was open. Then, I took another look at the port number, and smacked myself again . . . :eek: . . . 220378 isn’t a valid port connection. In fact, you cannot exceed 65535. Whats up with this? I’m lost with what you’re doing.

I’ve got to give some credit to someone who made a two player game (Cube VS Cube), but it was a game that had an always sensor connected to a python save script. There was an external save file, but I think that it would be cool to have the save file on a web page database. Then have it so it opens up everyone’s file that is online through the database and tells where everyone is. Talk about lagg, but has anyone tried it?

Is it possible to sync the movement of an NPC? For instance each NPC would have some sort of script attached to it that would update its location etc to all clients?

How?

Morgade, I am running Ubuntu 7.04 and Xubuntu 7.04 with Blender 2.44 and python 2.4.1 and it works fine for me. Superb work!! :smiley: My only crit is that (as kind of a noob at python) it doesn’t seem easy to apply this template to other games (I’m pretty sure you did say it was a template). I’ll keep working on that, though.

Phew … Finally got some time to take this project back (or not).

I was sitting here smackin my head on the wall, trying to figure out why my firewall was rejecting the connection, even tho the port was open. Then, I took another look at the port number, and smacked myself again . . . :eek: . . . 220378 isn’t a valid port connection. In fact, you cannot exceed 65535. Whats up with this? I’m lost with what you’re doing.
The port number should be 22378 (but i can’t access the file right now). If the code says 220378, then probably I mistyped it and mysteriously my Windows box accepted it.

Is it possible to sync the movement of an NPC? For instance each NPC would have some sort of script attached to it that would update its location etc to all clients?

How?
Just use the send state - receive state workflow. The server controls the NPC position-rotation, updates it based on some event or logic brick and broadcasts this position-rotation information to clients. Every time the client gets this specific message, it updates the local NPC postition.

My only crit is that (as kind of a noob at python) it doesn’t seem easy to apply this template to other games (I’m pretty sure you did say it was a template). I’ll keep working on that, though.
The idea is to modify the network scripts that handle game state messages and make it send and update your specific game state. But you should really create the game thinking about networking (server X client interaction) since beginning of the project.

In the current BGE, I really don’t think it its possible to create a usable networked game without getting the hands dirty with lots of code.

could u make a onine multiplayer FPS with the same system or do you have to use Bzoo?

looks good so far,
I use linux and tryed this on my machine. The server works perfectly and i can see player connect but the client is not working properly (i think). as i connect i see that i’m player 1 and on my server screen i see that a tank spawns but my camera is not fixed no the tank, nor can i move the tank.

Do you have a latest version? cause i downloaded the one in your first post because the update in a later post was not available.

dude that was 2 years ago… send a PM to the OP next time.

sometimes old things work the best. And this is way much simpler that WSAG that i try to use now (and no i havent tryed Bzoo cause that’s not good for the type of game i use)

i was wonderin… would i be able to take this and import it to my game, then just change some of the things, like make a different scene to play online. so instead of playing the tank game, you play my fps? oh and does this run on blenderplayer or .exe’s cause i only read about u open blender and press p to play, but all my friends dont have blender… so does it?

euh, changing this set up is possible and also a bit of the idea. This way other people won’t have to figure it al out by them self.

As for the blender player. I dont have any clue’s for that. i think it shouldn’t give a problem. so give it a try.

NICE post! ive always wanted to add a multiplayer function to the game that im making! thnx for the great post! :smiley:

I download the tank.blend and play it on my Ubuntu 9.04 with python2.6 and blender 2.49 installed. I got error messages as the follows. Can anyone help me fix this error?

import _socket
ImportError: No module named _socket
Error in sys.excepthook:
Traceback (most recent call last):
File “/usr/lib/python2.6/dist-packages/apport_python_hook.py”, line 38, in apport_excepthook
from apport.packaging_impl import impl as packaging
File “/usr/lib/python2.6/dist-packages/apport/init.py”, line 1, in <module>
from apport.report import Report
File “/usr/lib/python2.6/dist-packages/apport/report.py”, line 14, in <module>
import subprocess, tempfile, os.path, urllib, re, pwd, grp, os, sys
File “/usr/lib/python2.6/subprocess.py”, line 401, in <module>
import select
ImportError: No module named select

Original exception was:
Traceback (most recent call last):
File “NWS_SendState.py”, line 6, in <module>
File “/usr/lib/python2.6/socket.py”, line 46, in <module>
import _socket
ImportError: No module named _socket
Python script error from controller “ReceiveInput#CONTR#3”:
Traceback (most recent call last):
File “NWS_ReceiveInput”, line 6, in <module>
File “/usr/lib/python2.6/socket.py”, line 46, in <module>
import _socket
ImportError: No module named _socket

I think you need python 2.5x for the socket module, besides, I doubt the .blend is even compatible with the current version of blender anymore.