473,320 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Network Game in Python

I have to create a small and simple GUI app in Python which is similar
to a netwrok game. Let me expalain you. I need some suggestions. I
might use wxPython for GUI because that is the only GUI oolkit I know.

There are 6 players in the game. They are all connected though a LAN
(possible an internal network). There is one main supervirsor who
starts the game and other 5 are players.

Once the supervisor starts the game, a move goes randomly to any player
out of the 5 players. Once a player gets a move he has to act. Based on
his action next move will be generated by supervisor and sent to some
other player in the network. This process goes on untill the simulation
time ends. Winners and Loosers are decided by some point system which
supervisor keeps track of.

Some questions I have are:
1. How can I manage network messages among the players. Should
multicast be used or Actor should send the message to Supervisor and he
sends to all. ? What python modules can be handy in these things.

2. How can I manage moves among players. What move a player makes is
visible to all others in real time, so essentially all players have the
same consistent view of the game. Only the person with access can
actually make a move or carry out action. Any suggestion how to carry
out this thing.

3. Shold I use a flat file or some database in mySQL to measure points
etc ? I want to have a repository which keep tracks of all the mvoes in
the system and who played what move etc..? Any suggestions on this.

4. If you have any other input, it will be greatly appreciated.

Thanks

Aug 1 '06 #1
1 1733
di********@gmail.com wrote:
Some questions I have are:
1. How can I manage network messages among the players. Should
multicast be used or Actor should send the message to Supervisor and he
sends to all. ?
Send a message from one client to the supervisor, handle it, then get
the supervisor to send messages back out to notify all clients of the
change. That way, the supervisor always has the correct state, and
knows which clients are aware of it.
What python modules can be handy in these things.
The socket and select modules are all that you need. Perhaps there's a
higher-level solution somewhere but I don't expect you'd need it.
2. How can I manage moves among players. What move a player makes is
visible to all others in real time, so essentially all players have the
same consistent view of the game. Only the person with access can
actually make a move or carry out action. Any suggestion how to carry
out this thing.
As above: inform the supervisor/server of the move, and the server
informs all others of what is going on. Usually this is just a message
telling the client to update certain values. The client will update
those values and refresh the display. You may find it easiest to send
whole objects using pickle or something like that.
3. Shold I use a flat file or some database in mySQL to measure points
etc ? I want to have a repository which keep tracks of all the mvoes in
the system and who played what move etc..? Any suggestions on this.
Use whichever is easiest for you. Why do you need to save the data to
disk anyway? If you definitely need to do that, the shelve module is
often a good choice for basic needs. But it depends on what you need to
do with the information after you write it.

--
Ben Sizer

Aug 2 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Moosebumps | last post by:
When I have time, I am planning to evaluate Python for console game development (on Playstation 2, GameCube, and Xbox). Does anyone have any experience with this? Pretty much the only resource...
3
by: Michael Rybak | last post by:
Hi, everyone. In topic "2-player game, client and server at localhost", I've asked about subj, and Peter Hansen suggested to switch to Twisted, Pyro or the like. I've tried using Pyro. I've...
0
by: Michael Goettsche | last post by:
Hi there, for a project in our computer science lessons at school we decided to write a client/server based battleship like game . I know this game could be written without a server, but the...
1
by: Andreas R. | last post by:
Hello, I'm using Python's asynchat module for network support in a Python-based game, and I run into two problems, both of which occur at random times. Most of the time, the network sending and...
1
by: Jerry Fleming | last post by:
Hi, I have wrote a game with python curses. The problem is that I want to confirm before quitting, while my implementation doesn't seem to work. Anyone can help me? #!/usr/bin/python # #...
0
by: Richard Szlachta | last post by:
Readers of python mailing list of all ages and systems, I'd like to introduce you program called ' Piskworky '. It is written in python, uses tkinter gui and is made for playing game known as...
0
by: Jeff Rush | last post by:
At PyCon this year we're going to have a multi-day game programming clinic and challenge. This is a first-time event and an experiment to find those in the Python community who enjoy playing and...
1
by: Andrew | last post by:
Hello Everyone I am receiving an error in an application I am working on. The application when its done will be a Dungeons and Dragons Network game. I am having problems with the Networked...
10
by: Michael Lubker | last post by:
Any people that use Python as the predominant language for their game development here? ~Michael
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.