User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 15 of 15

Thread: Dead Reckoning

  1. #11
    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: Dead Reckoning

    View MFA

    That formula should work...

    Someone want to help me figure out why it doesn't always go where it should? Hopefully its pretty straight forward what I'm looking for - I want the "Actual X/Y" to be the same as the "New X/Y"

  2. #12
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleUnicode Add-on

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Dead Reckoning

    I don't completely understand what's going on, but I managed to isolate a collision (see attached file) that makes it bug so hopefully you can debug it. I set their starting angles and positions. It seems to happen when they are moving in different directions as the change occurs... but just a hunch.

    What is the every 1 second meant to be there for? Is that to simulate lag? It seems to be fine if you remove that.

    Also, make sure you untick "Destroy object if too far from frame" for the red 'ball'. Just so you can see what happens when it does bug.

    I'm pretty sure it's something to do with mixing "current" values and "past" values. I don't think the code factors in the ball colliding with walls and I think that's a problem:

    Eg. Ball crosses line, hits wall and turns around, 1 second passes and the red ball is placed at the green ball however its calculations are not correct because the green ball was not moving in a straight line the whole time.

    Also, don't forget to set the direction of the red ball when its internal flag 0 is on (I left that out in my file).

  3. #13
    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: Dead Reckoning

    Yes the "Every 1 Second" simulates what the lag could be. I realize that it might bug if it crosses the line near the top or bottom, I just don't know what I could do... The main thing I'm trying to achieve is for the actual game (this was just for testing theories), because when the ball crosses the line, it sends its position, direction and speed to the other player. The other player's screen doesn't lag at all. It puts the ball on the line and sets its speed and direction and there's virtually no lag. But back to the player who sent the data, their ball didn't stop on the line, so by the time the other ball gets moving and blasting coordinates, it has to jump back to stay synced. So I'm trying to get the ball not to be set at the line, but estimate how far away it should be, then use your smooth movement example to smooth it out.

    You didn't attach a file by the way

    EDIT: Oh and they aren't always supposed to be in sync in that test example. It's just after the second that the red ball should be placed on the green one.

  4. #14
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleUnicode Add-on

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Dead Reckoning

    Sorry - Here's the file. Doh!

    I have a think about the problem, but maybe you could consider other ways of sending and receiving the data? There are many ways to do an online pong game, but in the end it's really up to how "true" you want the data to be. It's up to you whether it matters if the ball is in the same place on both screens, or if you are only checking if the player managed to hit the ball back.
    Attached files Attached files

  5. #15
    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: Dead Reckoning

    OHHHHHH

    I think I have it figured out. It thinks the angle is 11.25 because the red ball bounced. But it's not!

    I'll change that and see if there are still any bugs!

    EDIT: I think it's working perfectly!!! THANK YOU SO MUCH ASSAULT ANDY!

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Dead Reckoning
    By Sumo in forum Lacewing
    Replies: 5
    Last Post: 19th January 2010, 09:55 PM
  2. Dead Reckoning?
    By Game_Master in forum Lacewing
    Replies: 6
    Last Post: 30th December 2009, 05:34 PM
  3. Dead reckoning for dummies?
    By Tiny in forum Lacewing
    Replies: 5
    Last Post: 31st December 2008, 02:06 PM
  4. Need some dead reckoning help
    By SEELE in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 27th August 2008, 02:07 PM

Posting Permissions

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