User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16

Thread: Online Pong Example!

  1. #1
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jul 2006
    Location
    Pittsburgh, PA, USA
    Posts
    777
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Online Pong Example!

    Hello. I've just completed an example of an online action game using Lacewing. And because I just happen know everyone here loves bat-and-ball games, it's a simple game of Pong!

    The events actually do get a little complicated. I added comments to the events to make them a little easier to understand. I hope this example helps however it can.

    Required extensions:
    Lacewing

    Download Online Pong MFA

  2. #2
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jul 2006
    Location
    Pittsburgh, PA, USA
    Posts
    777
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Online Pong Example!

    Mathias and I discovered that if there's too much lag, player 1 will always score on player 2 because player 2 won't send the information that it hit the ball in time. I'll try to implement some way of predicting movement soon.

  3. #3
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Online Pong Example!

    Ahh, my solution was to have the ball be controlled by the player it was closest to. Here is RickyRombo's GwerdyPong (that I did all the coding for). It uses OINC, so I will convert it later..

    The only problem is that the ball seems to backtrack if there is too mucg lag. But it's a small price to pay for the non-glitchy scoring system.
    Attached files Attached files
    Working as fast as I can on Fusion 3

  4. #4
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Online Pong Example!

    This is what Lacewing Server would be good for
    You'd have the ball controlled by the server, and then each player would be lagged equally.

  5. #5
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Online Pong Example!

    Then the paddles would lag on the sever end :p
    Working as fast as I can on Fusion 3

  6. #6
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jul 2006
    Location
    Pittsburgh, PA, USA
    Posts
    777
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Online Pong Example!

    Ya I was originally going to have the ball switch control depending on which side of the screen it was on, and I guess that would work well. I was also thinking of predicting the ball's position on player 2's side by timing the lag, and speeding up the ball so that it would hit player 2's paddle at the same time on both screens. I'll fiddle around with it tomorrow.

  7. #7
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Online Pong Example!

    Still, it is hard to read a player's mind about where they are moving the paddle. ;P
    Working as fast as I can on Fusion 3

  8. #8
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Online Pong Example!

    I also created my own pong (without LB's help) and it still had problemos

  9. #9
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jul 2006
    Location
    Pittsburgh, PA, USA
    Posts
    777
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Online Pong Example!

    Quote Originally Posted by LB
    Still, it is hard to read a player's mind about where they are moving the paddle. ;P
    That doesn't mean I can't find where the paddle should be based on the received location and lag time. And the ball just happens to be extremely predictable. Anyways, the game works fine if you're playing off your own server with a nearby friend.

  10. #10
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Online Pong Example!

    How are you to know when a player suddenly changes thier direction? Sure, you can predict thier movement if they go up the whole time o down the whole time, but then it'd snap when the changed direction, and the lag for the message of their position would cause scoring glitches in some cases. I say it is better to have lag where it doesn't matter than where it does.
    Working as fast as I can on Fusion 3

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Ping Pong
    By Looki in forum Released Extensions
    Replies: 11
    Last Post: 31st December 2013, 11:50 AM
  2. Simple Pong Example
    By RickyRombo in forum File Archive
    Replies: 0
    Last Post: 22nd January 2010, 05:58 PM
  3. Pong A.I.
    By sam_sdc in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 6th February 2009, 10:10 PM
  4. Help with pong...
    By blehman in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 21st December 2007, 12:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •