Improve browser performance

Get help using Construct 2

Post » Wed Jun 27, 2012 10:45 pm

I don't really know in which forum part I should post this tread. So I'm sorry if I placed it wrong.

As I'm working with web design I know the performance issues that HTML5 has. So it's quite understandable that my game is running quite slow as there are a lot of objects being spawned.

But I opened the task manager to check how my hardware resources were used and at the state where the whole game was just lagging insanely I was still only using about 25% of my CPU power and about the same of my RAM. So obviously Firefox don't use all my computer's processing power for rendering the game.

I'm wondering if anyone are familiar of any way to give the browser access to more system resources? Or something else causing this lag?
B
8
S
3
G
2
Posts: 45
Reputation: 2,186

Post » Thu Jun 28, 2012 4:12 am

Are you on a computer with a multi-core processor? Because if you were maxing out 1 core on a quad-core machine, it would read 25%.

Even trying to get C2 to max the CPU usage on my computer doesn't work because C2's runtime only uses one core.
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Thu Jun 28, 2012 8:21 am

Ah, of course. well that explains it all. Thank you.:) Well then I guess I can't do anything to boost the performance.
B
8
S
3
G
2
Posts: 45
Reputation: 2,186

Post » Thu Jun 28, 2012 10:17 am

For best performance, see performance tips.

You'll also want to make sure you have up to date graphics drivers to ensure the browser turns on WebGL for best performance.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,528

Post » Thu Jun 28, 2012 7:53 pm

Thank you for your reply Ashley.
I've followed the advice on the performance tips page and I'm running a system with a i5 2500k clocked at 4ghz, 8gb RAM and a GTX560 card with the latest drivers.
Though the performance issues were quite logical as I had several hundreds of object instances and a lot of collision checking going on.

But I've redone almost everything now when I'm familiar with the software so that it works more efficiently and uses about a third of the object amount. :)
B
8
S
3
G
2
Posts: 45
Reputation: 2,186

Post » Sun Jul 01, 2012 10:15 am

On my system (i5 3750k) no individual core goes above 50% even when the game is chugging.

[QUOTE=jimutt]
But I've redone almost everything now when I'm familiar with the software so that it works more efficiently and uses about a third of the object amount. :)[/QUOTE]
On this topic, I've been able to do some similar things. For example, I had a couple of hundred soldiers spawning bullets as they shoot, which then disappears and spawns a dust cloud when it gets to a certain range.

I've changed it to be twice as efficient by adding the dust cloud sprite to the bullet sprite as a second frame in it's animation - once it reaches full range the bullet stops, the frame changes to the dust cloud, and I trigger the Fade and Sine(size) behaviours to start.

Put simply, when possible instead of spawning objects, change existing object's animation frames to the new object. Half as many objects with exactly the same visual effect.


This is probably similar to the sorts of things you've been able to do, but I thought it might give some other people some ideas.

From my own experience lots of object creation and physics tend to slow the framerate the most. Tricks like I mentioned above help with object creation; it's worth lowering the physics iterations for better physics performance. Lowering it from 3 to 1 gave me no noticeable visual loss, and framerate went up by about 5 fps.

I'd love to hear about other techniques people use to get around performance drops.
B
9
S
2
G
3
Posts: 75
Reputation: 1,964


Return to How do I....?

Who is online

Users browsing this forum: Eisenhans, michaelverdi and 21 guests