User Tag List

Results 1 to 9 of 9

Thread: Movement and Collision Detection

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Tuna's Avatar
    Join Date
    Feb 2008
    Location
    Central Texas
    Posts
    1,853
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Movement and Collision Detection

    I'm interested in developing a game that will host up to 25 players at a time.

    The server side will keep track of everyone's stats, and all "objects" in the game (i think).

    How will I handle movement and collisions so that all players in the area see the same thing?

    example. A projectile (an arrow) is fired from player 1 and hits player 2. Both players need to see the arrow, and see the same thing when the arrow hits player 2.

    Is this possible with OINC?

    What handles the movement? The client side launches the arrow, so I guess the arrow needs to be created on player 2's screen and it's movement, direction, speed need to match with no lag. possible?

  2. #2
    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: Movement and Collision Detection

    Well, you can try to figure it out from my Pong game, for I had the same problem, although my version of getting collisions is a little buggy sometimes :whistle:

    Attached files Attached files

  3. #3
    Forum Moderator Multimedia Fusion 2 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    DizzyDoo's Avatar
    Join Date
    Oct 2006
    Location
    South England
    Posts
    718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Movement and Collision Detection

    Everything you have mentioned can be done if you have a decent server. The server does all the game logic, collisions, movement, accounts, and then syncs all the clients up to it. I suggest you take a look at Python and Poinc.
    Cranktrain - Currently finishing a new game called The Cat Machine!
    @MattLuard on Twitter.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Tuna's Avatar
    Join Date
    Feb 2008
    Location
    Central Texas
    Posts
    1,853
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Movement and Collision Detection

    Python eh... I guess a VB developer can work in Python... eventually



  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export ModuleXNA Export Module
    Fusion 2.5 (Steam)
    Mathias's Avatar
    Join Date
    Jun 2006
    Location
    Copenhagen, Denmark
    Posts
    1,083
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Re: Movement and Collision Detection

    Tuna, doing full implementations for the various languages there causes major maintenance problems for us, so we strive to have server implementations in a few languages (currently C++ and Python), and client implementations in as many as possible

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Tuna's Avatar
    Join Date
    Feb 2008
    Location
    Central Texas
    Posts
    1,853
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Movement and Collision Detection

    yeah, I meant that I'll be learning Python, because this does seem like the right choice.

    My game will have objects that are constantly moving. When a client (player) enters an area (lets call the area a sector), the server will tell the client to create the objects, and tell them what direction and speed they are moving.

    Then, the client will send back the location of each object... this way, if someone else enters the sector, that client will essentially see the same objects in the same place.

    I'll be using time based movement, so it should be reasonably close to accurate.

    Do you think that makes sense and will work?

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export ModuleXNA Export Module
    Fusion 2.5 (Steam)
    Mathias's Avatar
    Join Date
    Jun 2006
    Location
    Copenhagen, Denmark
    Posts
    1,083
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Re: Movement and Collision Detection

    That definitely makes sense and shouldn't be too hard (if you've grasped Python yet, it can be solved with a dict pointing from the channel to a list of object instances, and then sending these objects to clients when they join)

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Tuna's Avatar
    Join Date
    Feb 2008
    Location
    Central Texas
    Posts
    1,853
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Movement and Collision Detection

    I'm having trouble getting two different clients running and seeing the same thing.

    Player 1 see's player 2's ship, and player 2 see's player 1's ship, but they don't agree on the position. On one client, both ships are side by side, but on the other, one of the ship's position is off by about 100 pixels to the left.

    I feel like I'm really close to getting it right, but discouraged that simple positioning isn't working. I can't imagine how the players will be able to shoot at each other if the two clients dont agree with the x,y coordinates.

    Just for a sanity check, I have each client send it's x,y coordinates (for the sake of position correction) every 1/2 second. Still, only one of the two seems to get it right.

    Any thoughts?

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Tuna's Avatar
    Join Date
    Feb 2008
    Location
    Central Texas
    Posts
    1,853
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Movement and Collision Detection

    Ok, so movement is working now, and it's semi accurate, but there are still some hurdles to overcome.

    When a player presses the thrust key, it sends the command to the channel to tell the view of the same ship to move as well. this works. But when they stop thrusting, they will drift, as you would expect. So if another player joins while players are drifting, positions and direction are not accurate. I guess I need to send the direction and speed, but vector movement with the clickteam movement controller is making this a difficult task.



Similar Threads

  1. Possible bug in PMO collision detection
    By K1kk0z90 in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 4th August 2011, 01:56 PM
  2. détection collision
    By graboide in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 12th December 2010, 05:24 AM
  3. Pinball movement and Collision detection.
    By N13astra in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 18th May 2008, 01:51 PM
  4. Custom movement -- collision detection problem
    By Poprocks in forum File Archive
    Replies: 1
    Last Post: 17th May 2007, 12:58 AM
  5. Collision detection
    By Crash86 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 1st April 2007, 04:50 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
  •