Server/Client Repainting

I am creating a game that has a server, and up to 8 clients.

The server holds the information of the "ships", each having an x and y value. Every time a ship moves on the server, it sends a message to all of its clients saying "ship ID X Y" ex: "ship 24 200 300" which would tell the clients to move Ship 24 to coordinate 200,300

The server's timer ticks 10x per second.

The client's timer also ticks at 10x per second.

Here is a snippet of data from a file that was created while I ran the program:

moveShip = data the client received from the server

painted = a call to the paint method in the client

moveship 0 156 142

moveship 0 158 144

moveship 0 160 147

moveship 0 162 149

moveship 0 164 151

moveship 0 166 153

moveship 0 168 155

painted--

moveship 0 170 158

moveship 0 172 160

moveship 0 174 162

moveship 0 176 164

moveship 0 178 167

moveship 0 180 169

moveship 0 182 171

painted--

moveship 0 184 173

moveship 0 186 175

moveship 0 188 178

moveship 0 190 180

moveship 0 192 182

moveship 0 194 184

moveship 0 196 187

painted--

moveship 0 198 189

moveship 0 200 191

moveship 0 202 193

As you can see, the client is only repainting about once every 7 ticks.

The first thing I did to try and fix it was to turn the client's timer to a very slow speed, and have the client just repaint everytime the server ticked. This just gave the same results.

This is the first game i'm making using multiple computers, so this is all new territory for me.

Additional Info:

The client and server use DataInputStream and DataOutputStream

The computers are connected together so there is virtually no lag

This problem occurs with only one ship and no other graphics, so it is not some sort of memory problem.

Thanks for reading!

[1972 byte] By [Nethera] at [2007-10-3 2:58:39]
# 1

I think client doesn't need timer ticks. Server output intervals should be sufficiently long to enable client repainting. In the client code, after each message is received, your updateDrawingParameters() method should be called and the last line of the method should be a repaint() call on your game panel.

hiwaa at 2007-7-14 20:48:09 > top of Java-index,Java Essentials,New To Java...
# 2
what should updateDrawingParameters() do?
Nethera at 2007-7-14 20:48:09 > top of Java-index,Java Essentials,New To Java...
# 3
> what should updateDrawingParameters() do?The name suggests it.
hiwaa at 2007-7-14 20:48:09 > top of Java-index,Java Essentials,New To Java...