# Does rectangular 4 point polygon collider = box collider?

Discussion and feedback on Construct 2

### » Fri Dec 12, 2014 4:13 am

In regards to setting up a collision polygon, does the engine always use polygon/polygon collision checks? Does the engine optimize the collision algorithm if both objects have perfect rectangles for collision shape (i.e. 4 points perfectly rectangular)?

Also will there ever be support for circle/circle or circle/rectangle collision support?

The reason why i ask is because I know that doing rectangle and circle collision checks are much simpler computationally than polygon collision checks. So I'm wondering if I can optimize my game by using only rectangles for colllision, or is that just wasting time?

Thanks!
B
12
S
3
G
2
Posts: 9
Reputation: 1,605

### » Fri Dec 12, 2014 12:58 pm

C2 only uses collisions polygons if the bounding boxes are overllaping already (the bounding box is the smallest non rotated rectangle that the object can fit in, if the object is rotated, the bounding box does not rotate), this is part of the reason why you cannot set a collision polygon outside if the object.

however polygons checks, when used, can be really time consuming but I would recommand: use a simple shape that just correspond to your object well. I do not think that, unless you have a very large number of poly checks in the debugger, changing the'polygons would help.

also, for all the behaviors that use collisions, and on your events (under some conditions), collision cells are used: on a big environnement, they just makes objects completely ignore collisions as, well, there will not be collisions between them anyway.

If you have perf. problems, try to see where that problem is comming from, if it is the collisions, then maybe you just need to check less collisions, accordingly to the design of your game.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
54
S
23
G
18
Posts: 2,123
Reputation: 17,200

### » Fri Dec 12, 2014 3:46 pm

I will just not worry about it until I detect performance issues.
B
12
S
3
G
2
Posts: 9
Reputation: 1,605

### Who is online

Users browsing this forum: No registered users and 4 guests