Performance Question

Discussion and feedback on Construct 2

Post » Fri Mar 06, 2015 2:12 am

hi! so, i have many questions... if some of you samaritan can help me, i would apreciate it.

1-what happens if i get my cpu usage to 100% does it start to lag?
if so, i have a quad core phenom gaming CPU, wich i use to play BF4, you are telling me that javascript intentionally does not take full use of my CPU? why would that be a good thing?

2- if you see my debbuger screen shot, i have 1700+ objects using 100mb of video, on my pc, (my game is being made for pc only)
and 17000+ collision checks per second, on a 10000x10000 layout, is that too much? i mean, how much collision cheks is too much, i have done my best to make my game extremely optimized, but i still get lag here and there on my gaming pc, i just dont get it. and yes im using an old version of NW.js becuase the newest version are a mess.

most of my objects are static, its a platformer, i dont even use physics, or many shaders, but still, im getting dissapointed with C2.
and about the collision cells, i need some clarification, about the position of the events. how is this supposed to be done? ( see image) and would the cells still be used, if there is more than 1 overlapping condition?
You do not have the required permissions to view the files attached to this post.
B
23
S
6
G
3
Posts: 316
Reputation: 3,461

Post » Fri Mar 06, 2015 3:22 am

It might not be "static" if a sprite has platform behavior. A "static" sprite might have no behavior.
B
110
S
28
G
280
Posts: 4,488
Reputation: 156,568

Post » Fri Mar 06, 2015 3:59 am

BF4 is very well threaded, it will use up to 8 threads so fully using most CPUs.

C2 is single threaded. 1/4 of your CPU is being used if you see 100% CPU usage.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Fri Mar 06, 2015 6:46 am

Platformer behavior = lots of collision checks
Lots of collision checks = high CPU usage

1 core + JavaScript itself + browser issues = forget about too advanced games
B
18
S
7
G
1
Posts: 783
Reputation: 4,247

Post » Fri Mar 06, 2015 6:55 am

~800 col checks per tic isn't that high. It's definitely due to all the other AI and events.

And yes, there's limitations. One needs to be very careful to optimize it. If the game is too complex in scope, best to use another engine with multi-threading support.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Fri Mar 06, 2015 7:06 am

Multi-thread programming is not easy, it also need to separate logic very well into Independent parts.
B
110
S
28
G
280
Posts: 4,488
Reputation: 156,568

Post » Fri Mar 06, 2015 7:07 am

What fps do you get outside of the debugger? (ie text object set text to fps) The debugger can't really be trusted to that regard sometimes.

In my game, most of my layouts have over 2k objects with ~130mbs of memory used. Every enemy and play have the platform behavior and have over 50 events per enemy towards their behavior and I can keep an even 60 fps (+/- 5 for the very awful node-webkit jankiness). Granted, I have a high end i7 with a high end nvidia card, so not much can make this machine chug.

Regarding the collision cells, the events should be layered with the overlapping on TOP, and then everything else as a subevent. I had that issue, too, for a while and then realized that switching it cut the collision checks down by a 1/4.

Also, it's actually not C2's fault, it's the fact that C2 uses HTML5. It's HTML5 is creating all the limitations, not C2.
B
44
S
12
G
1
Posts: 545
Reputation: 4,271

Post » Fri Mar 06, 2015 12:17 pm

What does the debugger profile page show? It's cpu loading is less as well, so you'll see a more representative game play / frame rate - but most importantly you'll see what's eating up most of your cpu time. As long as you've broken your events into groups it'll be easy to identify what's using up the most cpu time.
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,285
Reputation: 47,554

Post » Fri Mar 06, 2015 1:44 pm

Try the current r198 beta which has an optimization in rendering and the latest NW.js 12. I think you'll get much better performance at least concerning any jittering you might have.

-EDIT- Also, Ashley just posted a blog post in response to your question about single core usage.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Fri Mar 06, 2015 9:55 pm

@eli0s

why is everyone saying that NW.js 12 is good? its horrible! take a look, this is with the exact same project!!
You do not have the required permissions to view the files attached to this post.
Last edited by Lunatrap on Fri Mar 06, 2015 10:10 pm, edited 1 time in total.
B
23
S
6
G
3
Posts: 316
Reputation: 3,461

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 2 guests