[Request] One Point Collision

0 favourites
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • I was thinking we could need one point collision which is designed to RTS, Puzzle and game uses a lot of objects. One point collision is related to origin point.

    We can't have less than 3 collision poly points, currently this method could affect the performance.

    Technically, a point of collision equals the distance from other objects, adjust the distance depends on intended according to sprite size or variable defines the numbers could do trigger. Applies to all objects with this option.

  • Good point! ...

    +1

  • How much does it affect performance?

  • Could this not be done using disabled collisions and distance expression?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • What we need is a sprite condition like "is (x,y) in collision polygon of object A" or a system condition like "is (x,y) solid".

  • You can disable collisions and start checking the distance between objects.

    That's how I did the collision system of Golden Lotus.

  • For performance C2 would be better off with a anything but a bruteforce collision detection. There is

    Binary Space Tree

    Qaud Space Tree

    and Oct Space tree

    the idea is to put objects into a sorted branching tree. Only when 2 objects are using the same space/branch would there even be a collision check possible. In this model if the system wanted to compare bullet against enemy. it would check to see if bullet is in the same tree branch. if "no" there is nothing to further check against.

    Where as the current model. the bullet needs to check against every enemy. even if the enemy is on the other side of the screen or map.

  • disable collisions and check position or distance, and if your game is tile based, you can use an array instead.

  • Joannesalfa

    Implementing a quadtree into C2 wouldn't be that hard; especially as there is an API ready to be turned into a behaviour. The down side is that like C2 Physics which is Box2D, it's an entirely different collision check.

    This means that like the Platform/Solid/Jumpthru/Bullet behaviours this Quadtree would not be compatible :( You couldn't take advantage of say Bullet Bounce off wall, and use Solid. Those are built to work together. Where as Bullet and Physics won't.

    However, if you don't need Platform and Jumpthru. It can be created and implemented to good effect. The best solution is for Ashley to implement a quadtree into the natural behaviours. Might even be possible to slip it right into the basic object collision making the overhead minimal. Maybe next time there is a poll we should suggest it :)

    But in the mean time maybe someone or myself if given the time can look into a behaviour.

    So I tried the demo. One of the options is 500 objects. In a brute force model wich C2 uses. That would be 252,000 = 500 x 504 (+4 for walls). That's a lot of collision checks. Where as in this it looks like maybe 200-500 checks or something like that. Certainly not 200k+

  • jayderyu

    My experience with C2:

    -Fake physic with falling blocks

    50 objects with collision enabled for iOS is slow and bad performance.

    Then, 50 objects collision disabled for iOS is great and good

    performance so i used distance method to alternate collisions.

  • remember that demo. I think I still have it in my downloads.

    While I agree that better collision is a good idea. I still feel that in regards to a puzzle game like you were aiming for. That using collision is not the best way. A board plugin, and good animation is the best recourse. The best way is to check for an empty spot in the board. Then animate the blocks above to look like a naturual drop.

    Rexrainbow has a bejewled like plugins.

  • jayderyu You are right, but not at all if we are developing like RTS, Puzzle is not only one. We might have games that use a lot of objects.

  • Joannesalfa

    Your right, full blown RTS games with lot's of bullets flyign aruond probably would be best with a better collision detection. probably could use a quadtree beaviour then as it doesn't use the platform or related behaviour.

  • Well how many rts type games have you seen using bullet collision?

    I've seen zero because they all use instant hit, and work off of probability.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)