Optimization, Performance HELP

0 favourites
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I think i am about to drop Construct 2 for good. I made this little game these days, and it performs poorly, very very bad. On my desktop of course after i rewritten it 2 times, it works well on 60 frames, 3-5% CPU usage, and 7 mega vram usage.

    On the laptop the performance(2ghz dual core, 4gb ram, GE FORCE GT 415m - 1gb video) is horrid 20-30 frames based on browser. Chrome being the worse, which is strange. I tested with 155, 158, 162. Things are getting even worse.

    Now if any of the more advanced users, can take a look at the capx, and tell me what i am doing wrong, cause i dont get it, if i cant make a simple game work on the casual, portal gamers PCs, how the hell i am supposed to even dream about html 5 on phones ...

    The performance of this engine is horrible for regular PC/laptops. I looked at flash, a complex tower defense works flawlessly on my other 7 years old laptop(2 ghz single core, very bad ATI video card, 2gb ram, xp). Construct barely scores 10 fps there. At the same time i took a look at GMC html 5 examples, and they perform much, much better, almost perfectly.

    So now two things(3) are happening:

    1) I am not developing c2 games the "proper" way.

    2) The engine is horrible, even GMC is doing better on html 5 performance, by a lot.

    3) a little of both.

    Now, somebody please, prove me wrong, look at the capx, and explain to me, i am sure there is a big possibility that i am doing something wrong.

    livedemo: http://lw-games.com/stuff/f4 (press F for FPS, S sound off, M music off, P pause)

    Thanks

  • Solid 48 frames in Chrome for me - the awkward thing is that I'm running an Alienware laptop, and regardless of value for the money, Alienware doesn't skimp on power; so 48 FPS on effectively Flappy Birds is worrying when it runs Crysis at a steady 35.

    I'll have a look at your cap later, though from debugger figures you've posted I can't see how it could get faster

  • Thanks, the thing is that sometimes it shows me 50-60 fps, but those moving spikes that come at you, their movement is so sluggish...

    Also imagine that most of the people have on board cards, those horrible intel gfx. So if the game doesnt perform good on those, these HTML 5 hispter sh*t is useless, since you loose 70% of the players.

  • Constant 60 FPS here, but my comp is optimized for graphic performance.

    I'm sorry but I can't open your capx, because of the plugins in it I'm not going to download just for this purpose.

  • 55-60 fps with 5 years old laptop. 2Ghz Dual Core, Geforce G210M.

    I can't see specific problems from your capx, but recommand "grouping" your events. It's more easy to control events at once.

  • my bad, i removed the plugins, thanks!

  • Do the dirt spikes that come at you have a sluggish movement?

    Thanks

  • The performances are good for me, but I'll look at your capx

    lwgames

  • lwgames

    Only thing I saw in your capx was some collision check unnecessary (you check for collisions during the menu for instance), lots of code being evaluated every tick where a function/behavior would be better (for the background scrolling, use a bullet behavior for example, you will spare some events and lighten the logic), some big sprites for the background (I don't see how to optimize this), or some group activation that would benefit the project. All this can be optimized, but shouldn't be a problem for a standard computer. For a mobile device though, changing some of the backgrounds for lighter, more standard sized images would be better.

    The bullet behavior I talked about is used in the "infinite runner" template, you should look at it. it can be used for everything moving on the screen in your game : spikes, backgrounds, ...

  • Same as Guizmus for the most part, I edited and added some comments, it is not the best I could have done (I don't even know if it will run better for you), but I just wanted to be able to explain which changes I've made and why:

    dl.dropboxusercontent.com/u/10035971/Nouveau%20dossier/flappynator%20commented.capx

    Also try to search for groups, functions, and includes, that could help you a lot I think (since everything is on the same layout, being able to deactivate a entire group of event is very useful, also, try to see where a trigger once is enough sometimes)

  • Solid 60 and no sluggishness on my laptop.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Aphrodite lots of good feedback, thanks for taking time to help me, learned a few things. I usually use If/Else on php and other scripting languages, but on Construct 2 the events structure tricked me, now i see clearer with ur examples. Thanks, this helps.

    Guizmos, you are right, now i saw that i check for collision all the time with no reason, ill fix, that thanks. Ill check infinite runner, and analyze the tick events.

    Good feedback so far, thanks guys, still doesn't explain why 56 events game, with maybe 10 objects on screen and %5 cpu usage is sluggish on mediocre PCs. But i will investigate more and rewrite it based on feedback and more research.

    I will re install a fresh copy of windows on my laptop, and do more tests, based on your feedback, and improve the version considerably.

    Thanks, and also if others have more insight, let me know.

    I really hope that i am doing something wrong(which i will find out in the next days testing heavily part of the code, on my laptop) and is not the engine...

  • "Good feedback so far, thanks guys, still doesn't explain why 56 events game, with maybe 10 objects on screen and %5 cpu usage is sluggish on mediocre PCs. But i will investigate more and rewrite it based on feedback and more research."

    I think this is because CPU isn't the only thing limiting the fps, the GPU can also limit the fps (Too much memory used by pictures, bad graphic driver can also slow this down I think, but not sure)

    Also you have many layers, maybe that also affects that.

  • From what i read Ashley said layers dont affect performance, of course unless u make a lot of them(unproven). VRAM is at 8mega at the moment.

    Ill do some tests when the laptop is ready since i have on board intel on it but also Geforge 410m so i can switch. On my main i cant test, since its a i7, 3ghz, GTX 260 and 8 giga ram(not high end, but over most of the standard pcs.. so it doesnt help)

  • I don't know that much about the C2 engine, but I do think that it have limits, or the program might, not sure. But it doesn't seem to handle lots of objects very well.

    But if you play a game like Factorio and the amount of objects it can handle at the same time, its insane. If you don't know it, here is a video to give you an idea.

    Subscribe to Construct videos now

    Basically the game is about building a factory sort of thing, and you produce and extract all kind of different resources or products, which you can then transport around. Each of the small things that you see move around are either a product or resource. And you then have these "arms" that can pick them up and move them around, insert them to machines etc. My point is there are really a lot of things going on, and checks that needs to be made, collisions and so on all the time. Making a game of this kind in C2 I cant see how could be possible, simply because the amount of objects would completely kill it.

    But as I started by saying I don't know that much about the C2 engine, but it doesn't seem very hard to kill it you want. Even if you don't try to on purpose. But it would be very nice if it could do something like this. :D

    Ps. The game is still under construction, but seems very promising.

Jump to:
Active Users
There are 2 visitors browsing this topic (0 users and 2 guests)