winterhell, on 16 December 2014 - 12:24 PM, said:
<br/>
Jase, on 16 December 2014 - 06:25 AM, said:
If you had 100000 objects scattered around a massive level
If the collision algorithm was written in C++ or C# it wouldn't be a problem to test Sonic against 100 000 polygons realtime even on a single core.
Yeah but Construct 2 exports in javascript lol. javascript is weird, it has issues with keeping accurate time or something. I'd totally move over to C++ if I had the time to learn it.
EDIT: Just done some quick tests, spawning lots of squares in random positions between 0 and 10000, and then testing collisions constantly if I hold down a key (So if there's 100 squares and I hold down the key, it's doing 100 collision checks per tick). The collisions are against a separate different sprite. [FPS fluctuates but most often hit these numbers, and bare in mind this isn't reliable data and I had other software using my CPU at the same time. Also the objects are spawned randomly so cells may contain less squares to test against but heyho.]
Spawning 10,000
No collision testing : 400fps
Collision testing WITH cells : 380fps
Collision testing WITHOUT cells : 350fps
Spawning 10,000
No collision testing : 280fps
Collision testing WITH cells : 270fps
Collision testing WITHOUT cells : 210fps
Spawning 100,000
No collision testing : 85fps
Collision testing WITH cells : 80fps
Collision testing WITHOUT cells : 25fps
awesum
This post has been edited by Jase: 16 December 2014 - 04:23 PM