CLICK THE LINK DIRECTLY BELOW THIS LINE TO DOWNLOAD CONSTRUCT 2 PERFORMANCE TEST FOR R-161:
Steps to reproduce:
1. Run .Capx in debug mode. (little bug button next to preview button)
2. Point the little arrow guy to the right by using the mouse cursor and shoot for 30 seconds.
3. Simply hold down the mouse button and keep a close watch on the Frames Per Second
Incredibly low Frames Per Second on my computer...is yours different than mine???
60 Frames Per Second----
Internet Explorer: Not Confirmed
Operating system & service pack:
Windows 7 64-bit (Professional Edition)
Construct 2 version:
It's not a bug, it's bad coding. Add the condition If bullet is not on screen > destroy bullet
Great suggestion!! And I would've done that, except for the fact that I need the bullet to continue to hit objects no matter where they are on the layout.
It's intentional, quite necessary, and it's producing very slow framerate.
Good to know it was slowing down on your machine too though, thanks for the feedback.
In that case my suggestions would be to make the layout smaller or use less bullets. Less enemy objects may help as well. Also another type of trigger for your every tick events may help. Probably all things you don't want to do but it's still not a bug. :)
Develop games in your browser. Powerful, performant & highly capable.
I'll come up with a better .Capx then, a simpler one, according to your suggestions.
Another suggestion, since you want the bullets to destroy anything they hit on that large of a layout would be to check collisions only with objects that are in line of sight of the bullets. I haven't tested that though so I'm not sure if/how much it may help.
Edit: Also, did this issue only pop up after installing r161? If you run the capx in r160 it runs at 60fps or no?
One problem here is that you posted a capx from r161. So...how are we supposed to try it in another version? At least upload a caproj, so it can be modded to boot in an older version.
Edit: or, better yet, an identical capx from an earlier version.
1 - Considerably Reduced the Layout Size by 33%. --
2 - Greatly reduced the number of Objects Present.---
3 - Removed ALL 'Every Tick' events; (had to leave update angle & fps).
Here is the simplified .capx...Thanks for your help and feedback...
(This clearly shows an issue here.)
Closing because the problem is you collision test with objects on parallaxed layers. To find out more why this is a bad idea read this blog post: https://www.scirra.com/blog/ashley/6/collision-cell-optimisation-in-r155. In short, this disables the collision cells optimisation, *and* adds extra overhead on each collision check, since it must convert between layer positions taking in to account the parallax before it can even do the fast bounding box check.
Almost all the CPU is being spent in the last event checking for a collision with 'Enemy2'. There are 70 of these objects on a parallaxed layer. Change the layer parallax to 100,100 and it barely goes above 1% CPU.