[Newbies] Network Game - Server Client Approach

Steve Wessels swessels1955 at yahoo.com
Fri Jun 5 10:57:42 UTC 2009


UDP protocols are a good way to go here.  I agree with Herbert.

However, you have design work to do beyond just "how will this multiplayer node talk and listen".  There's considerable design work involved in "what" these nodes need to be saying.  An agreement on how timing and network delays or drops, especially with UDP Sockets, are handled would be part of your networked game design.

There are design notes available on the World Wide Web about multiplayer UDP networked game designs that are pretty good reading.  These folks aren't likely going to be talking about Smalltalk, but the concepts and general lessons learned are good.

- Steve

On Jun 5, 2009, at 5:05 AM, Herbert König <herbertkoenig at gmx.net> wrote:

Hi Martin,


MB> I am still looking for a way to program my network game (four
MB> players on four different computers collaboratively control the
MB> direction of one object, each is responsible to move the object in
MB> one of four directions.)

you may try simple Socket connections via UDP. ByteArrays make nice
Buffers as ByteArray has methods to stuff in Floats, Integers and
Strings.

The class to look at is Socket.
On the class side newUDP will create a new UD socket, which you assign
a port via setPort:

Receiving and sending is done via receiveUDPDataInto: and
sendUDPData:toHost:port:

You query the receiving socket with dataAvailable before actually
receiving data.

If you search the swiki or the mailing list archives for these method
names you will find examples.


Cheers,

Herbert   

_______________________________________________
Beginners mailing list
Beginners at lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners



      


More information about the Beginners mailing list