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

Thread: MeshinMesh

  1. #11

    MeshinMesh

    Hello,

    just a quick question to have a start:

    Do you think it is more efficient to 1 or 2?

    1) When a single Item is moved, check collision of this item only with all others. Do this each time a single item is moved

    2) move all items one time. then check each item against each other item.

    In my old spaceshooters made with DelphiX/Omega there was already a collision detection worked like 1.

    I hoped this was easy to understand. What would you prefer?

    Thanks,
    Firle

  2. #12

    MeshinMesh

    You need to check on every movement.

    Otherwise the following could happen:

    Object A and B are close to each other.

    You move A in direction of B. They now collide but you do not test.
    You move B in direction of A.
    You move all other objects (not of interest here)
    What to do now? You check collisions and your result is: A + B collide. But how do you know how far you need to move A and B in which direction to seperate them again?

    You see the problem?
    <a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&amp;utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>

  3. #13

  4. #14

    MeshinMesh

    Checking collisions on every move will kill performance later or sooner.
    Usally the collsision test cycle looks like this:
    Code:
    for i1 &#58;= 0 to ItemsCount-1 do for i2 &#58;= i1+1 to ItemsCount-1 do CheckCollision&#40;i1, i2&#41;;
    CheckCollision(i1, i2) checks for collision between item with index i1 and item with index i2.

    Or you can use an engine which supports collision checking and may be even response.

  5. #15

    MeshinMesh

    The amount of collisionchecks should of couse be reduced to items that are near the checking entity.

    Usually I "tile" my maps virtually in areas and in the update of the objects I only check entitys that are in the area of the checking entity, or in the bordering areas (to be sure you get the collisions when moving from one area to another).

    In large levels this minimizes the collision checks.

    There my be better ways but thats how I usually do it... and for a project like a space shooter this should be enough to keep performance up.

    I mean, if there are 50 objects to check, this should not kill performance, especially if Eric does not use MeshInMesh collisions but some more abstract method like I suggested...
    <a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&amp;utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

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