Polygon: whats better?

Discussion and feedback on Construct 2

Post » Wed Jan 25, 2012 4:41 pm

[QUOTE=7Soul] What is more cpu-intensive: 100 objects with 4 polygon points, or one object with 400 points?[/QUOTE]
It's probably more CPU intensive to use one object with 400 points. It's best to use more objects with fewer collision points.

If an object is overlapping an object with 400 collision points, it will probably check all 400 collision points in that object. If it is overlapping an object with 4 collision points, it will check just those 4 collision points (100 times less!) and it will skip checking any of the other objects.

Of course using more objects has its own performance impact, but using lots of collision points isn't very efficient in the engine at the moment, so it's probably better to avoid that. This can probably be optimised in future, but this is how it is at the moment.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Post » Wed Jan 25, 2012 4:46 pm

Alright then, thanks for the help everybody
B
83
S
21
G
15
Posts: 1,039
Reputation: 15,134

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 13 guests