Performance Question

Discussion and feedback on Construct 2

Post » Fri Mar 06, 2015 10:06 pm

@Colludium my AI its quite complex, so that what is taking most, im doing some optimizations right now.

@ome6a1717 i get 60 fps smooth with the old nodewebkit (the new one sucks and i think im stuck with it forever) but my pcs is powerful too, but that practice you are doing is very bad, why?? becuase your benchmark is your pc, and that means your game will be intended for pc as powerful as yours only, just becuase in my pc i get 60 fps, that does not mean that all people will have a pc like mine, so i need to understimate my game so it will work in less powerful pc's, you should try your game in less powerful pc's and you will notice that it does not run like you want.

dont take your pc performance as the only benchmark to see if your game i well optimize.
B
23
S
6
G
3
Posts: 316
Reputation: 3,461

Post » Sat Mar 07, 2015 12:22 am

@Lunatrap

This is my result on i7 2600, Radeon HD5870. Without debugger i got about 60 fps on PC (Chrome and NWjs), on galaxy s3 i got the 51-56, on note4 i got a smooth 60fps.

My object count is less than you but my collisions check is higher. Maybe image memory usage ? Or some logic causes it ? I didn't use any is overlapping trick yet. Don't forget to disable collisions and animations on static sprites.

This is basically a super mario platformer kind of game.
You do not have the required permissions to view the files attached to this post.
B
58
S
20
G
14
Posts: 385
Reputation: 11,586

Post » Sat Mar 07, 2015 1:42 am

Lunatrap wrote:@ome6a1717 i get 60 fps smooth with the old nodewebkit (the new one sucks and i think im stuck with it forever) but my pcs is powerful too, but that practice you are doing is very bad, why?? becuase your benchmark is your pc, and that means your game will be intended for pc as powerful as yours only, just becuase in my pc i get 60 fps, that does not mean that all people will have a pc like mine, so i need to understimate my game so it will work in less powerful pc's, you should try your game in less powerful pc's and you will notice that it does not run like you want.

dont take your pc performance as the only benchmark to see if your game i well optimize.



This is very true, which is why I have friends that don't have my machine test my game. However, if MY machine can't obtain 60 fps, something is certainly wrong.
B
24
S
3
Posts: 462
Reputation: 2,207

Post » Sat Mar 07, 2015 4:31 am

Lunatrap wrote:@eli0s

why is everyone saying that NW.js 12 is good? its horrible! take a look, this is with the exact same project!!


Yes, I saw this on the other topic and I am very surprised. I don't understand how or why on some machines the recent updates made things worse. In my case the improvement is dramatically for the best on a recent benchmark I made. On this particular example I don't experience any lag, jerkiness or frame rate inconsistencies.
However, just to be on the safe side, before I replied with this post I visited my old post about the jerkiness in the movement and run the ridiculously simple capx I 'd made on that first post. I must say the results are not as smooth as I would have wished for.
composer - multimedia artist
www.eli0s.com/en/
B
59
S
24
G
3
Posts: 1,133
Reputation: 8,628

Post » Sat Mar 07, 2015 10:34 am

@tumira

well, im consfused, my game is 1080p i guess that why it takes so much

@ome6a1717

yeah, thats a goodpoint.

@eli0s

i dont know why is that, but im very worried of getting stuck with 10.5 for the 2 years of the development of my game.
i hope someday i will be able to update, is not on my part, becuase my debugger screenshots use the exact same project.
its annoying.

btw, your jet forest demo, was amazing :D
B
23
S
6
G
3
Posts: 316
Reputation: 3,461

Post » Sat Mar 07, 2015 10:45 pm

try to optimize your events. there's a lot of stuff that can be done easier and it just needs proper thinking.

i've found one optimization in my code when i was doing pathfinding - instead of pathfinding for every object i've added it to family of those objects (one object can be in more families) and set stuff through pathfinding, but since my obstacles move so does map need to be regenerated, if you do that on each tick it's very very costly in performance, so in my example i put every 0.2 sec - which works good and sprites don't get stuck.
also you can include calculating collisions for your visible window. if your layer is 10k x10k and your window is 1000x1000, you don't need collisions on other then 1000x1000. (use Is on-screen condition) . also through instance variables i control where each instance moves, (foreach enemy on screen i take his x var and find path to it and move along ) - there's really a lot of lot of optimizations to do to improve your speed.
also try disabling collisions on all objects that don't need collision (like background sprites, static sprites that are never touched and are just aestethicly there, and others)

also use overlapping instead on collision. (i herd it helps)
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
32
S
11
G
11
Posts: 612
Reputation: 8,493

Post » Sun Mar 08, 2015 3:20 am

Luna - I came across something interesting you might like to know today. I implemented some new enemies to my game, and quickly found that my collisions per tick sky rocketed to ~400 on idle. This was a stage with just as many enemies and platforms as other stages (in fact, this was the only stage to have all enemies with the platform behavior OFF due to their in-game behaviors). I scoured through event sheet after event sheet disabling events, deleting objects, trying to find what I did to cause this, but EVERY other stage idled at ~20 collisions per tick except this one (and used all the same event sheets).

So I did the only thing I could think of - created a new layout and copied every object and repasted them in the new layout, and to my very big surprise....my idle is now ~40 collisions per tick. I'm not saying this might be what's happening to you, but I find it incredibly strange. Between the two comparisons, not ONE line of code or sprite was moved or changed. I'm wondering if somehow my layout was just "corrupt" and needed a fresh coat of paint? I still have no idea, but hopefully you'll find the information somewhat helpful?
B
24
S
3
Posts: 462
Reputation: 2,207

Post » Sun Mar 08, 2015 7:39 am

Thanks, yes, after some optimization i manage to get the collision down to about half

got the CPU from 70% to 60% average

but im still worried about NW.js 12. since for me its really bad, NW.js gets my CPU to 95% for not apparent reason.

stuck with 10.5
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

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: Felipesz and 1 guest