Hi Matthew,
Welcome to the list.

I'm sorry I'm a little late with this thread, but  I figured you could
still use some help since I didn't notice any other replies posted. Your
problem lies in sending too many messages at one time. Even if you are
running at a comfortable 15 frames per second, each player will generate 15
messages every second. This amounts to a phenomenal 900 messages every
minute. Not good....I'd cut down the frame rate drastically to a more
manageable 1 fps.

But if you need to have a high frame rate, then I'd suggest using a filter
of sorts to make sure messages are sent only once every second or so.
Discard key strokes in between those time intervals.

You might also consider sending the actual locations of the widget rather
than sending the keystrokes and then calculating the distance moved. Then
all you need to do is write a script which finds the location of the widget
every second, and if it has moved from its previous location, broadcast the
new position to the other players.

As an alternative, you could also upgrade to Director 8.5 and MUS 3 which
offers UDP connections. UDP is considerably faster than TCP/IP and much
more suited to games.

HTH.
Regards,
Pranav
-----------------------------------------------------------
"Simply stated, it is sagacious to eschew obfuscation."
--Norman Augustine



<snip>
Hello all....I just joined the list, and figured what better way to start
than with a question:)


I am currently developing a small game using Director 8 and Multiuser
server.  Basically, I need the users to be able to move a widget around the
screen using arrow keys.
The move is then sent to the opponent via the MU server.

         Code is as follows:
                    (frameScript)
                   on keyDown me
                     if the keyCode = 126 then
                         sprite(1).locV = (sprite(1).locV - 5)
                         SendMessage( "wm", (the keycode))
                     else if the keyCode = 125 then
                         sprite(1).locV = (sprite(1).locV + 5)
                         SendMessage( "wm", (the keycode))
                     else if the keyCode = 124 then
                         sprite(1).locH = (sprite(1).locH + 5)
                         SendMessage( "wm", (the keycode))
                     else if the keyCode = 123 then
                         sprite(1).locH = (sprite(1).locH - 5)
                         SendMessage( "wm", (the keycode))
                     end if
                   end


However, this is causing a slight problem.  Since the user is able to hold
down the key to move his/her widget around the screen continuously, I am
noticing lag on
their opponents screen.  The lag usually appears after a few seconds, and
then persists
until the movement has been completed.  Obviously, there is some sort of
buffering of input
taking place on the recieve side.  Is there any way around this, or has
anyone dealt with this type of thing before?
<snip>





[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to