Very Simple Multiplayer Demonstration...

I took a look at a demo from Blendenzo’s site, then watched one of Brave’s (Braveheart’s) threads, and suddenly it popped into my head…
And here it is…
Instructions:
Keys: Arrow Keys to Move
(Remember to uncheck “Enable All Frames”)
1:Fire up file “P1.blend”
2:Move the bluecube Upwards…
3:Fire up file “P2.blend”
4:Make a cube chrash into another, then switch between blender windows in order to see it work…
Sidenote: On my PC it ran on 30 MBRam which, (Atleast on my system) is good 'cause, blender normally runs on 21 :slight_smile:
Since this isn’t a very good method, but still working, I recomend using it in co-op games…

Let me guess, you are constantly saving player one’s position and loading it on player 2 and vice versa? That’s really nice! I love the seamless smooth movement!!

Now your next challenge, have a server in the middle handle the saving and loading! Good luck. Actually, i love this method, very effective peer-to-peer like system, good for smaller multiplayer games, maybe bigger ones as well?

Network programming is supposedly easiest done in Python!

Yep that’s correct…

Now I’m bugged…for a while XD

My guess is that it’s only good for small multiplayer games, since it can eat up your RAM pretty quickly…

But is it the most efficient?

(It might be a good idea creating a tutorial for this, since we get bombed with over excited noobs every once in a while :P)

And by the way, how do you make your multiplay work? Sockets?

Well, i don’t actually know that much about Python… Let alone any other programming language, but i’m thinking if you had a choice then obviously C++ would be the best. But, Python makes it easy and can be very efficient. The MMORPG game “Eve”’, the networking code was for that game was done in Python!

Yes, the set-up i’m using works with sockets.

Interesting work. At first thought, it seems like it would benefit from server interaction, even for LAN play (like Brave suggested), but something just occurred to me: What about using this on thin clients?

I don’t know exactly how thin clients work (since I’ve never set them up), but I’m pretty sure they all run off of one master system. If the files were saving and loading to the system, and each thin client was reading what the others were doing, it would provide a rather quick arcade style multiplayer setup. Plus, all of the actual graphics handling would occur at the client itself if I understand correctly.

That’s correct :slight_smile: But I for one have no idea what a thin client is XD

Hehe i with you on that one :p. Wiki:

A thin client (sometimes also called a lean client) is a client computer or client software in client-server architecture networks which depends primarily on the central server for processing activities, and mainly focuses on conveying input and output between the user and the remote server. In contrast, a thick or fat client does as much processing as possible and passes only data for communications and storage to the server.

You could use sockets, as sockets are the best way to network program in python (as far as i know). I found this tutorial really good for understanding and using them (still not even finished it yet :S):

http://www.devshed.com/c/a/Python/Sockets-in-Python-Into-the-World-of-Python-Network-Programming/

I don’t know exactly how thin clients work (since I’ve never set them up), but I’m pretty sure they all run off of one master system. If the files were saving and loading to the system, and each thin client was reading what the others were doing, it would provide a rather quick arcade style multiplayer setup. Plus, all of the actual graphics handling would occur at the client itself if I understand correctly.
I worked on a thin client game in Java some time ago. The architecture is quite simple:

  • The server controls most of the game state information like objects position, score, even some basic physics. Changes in the internal state of the game are computed at the server (a player moving to some location, or a shot being fired, etc … ) and is informed to the clients mostly using asynchronous network messages (UDP packets). LAN games uses multicast messages to save network traffic. The server does not need to have a GUI.

  • The clients need to connect (using TCP) and “register” at the servers to receive updated game state data. The client does not use local logic to update objects position or velocity. All the client do is get updated game state from the server and render it. Also, every user action (like the pressing of a move key) is not applied to local object. This action is informed to the server using another asynchronous network message.

Of course, implementations of this architecture uses a lot of tricky optimizations methods, but this is the general idea.

I’ll look python’s sockets implementations and try do something like this.

I get an error when running this script Image

Advice anyone?

Hmm, should sending be indented with receiving?

Brilhant! Congratulations James! Even an idiot like me can understand your scripts.

Very cool demo!

Thank you, but truly, all credit to Blendenzo and Brave, without them none of this would’ve ever happened…