Is C2/C3 good for large 2D desktop games?

0 favourites
From the Asset Store
A cool way for kids to write and practice English Alphabets
  • jobel - the largest image is 640 x 360 (only one of them - the BG). I have probably about 1000-1100 objects (600 are invisible menu items) and only a few (maybe 30-40) are on the screen at a time. None of them but the player has any behaviors (platform) and one tilemap that has solid. Layout is about 4500 x 2600.

  • Question to Ashley: does Scirra use their own engine to develop larger games? If not, perhaps it would be a good idea to work on at least one larger project to see for yourselves if there exist any issues.

    As I said before, we've already seen these issues with the Construct 2 editor itself. It doesn't change much though, we still can't fix broken drivers.

  • jobel - the largest image is 640 x 360 (only one of them - the BG). I have probably about 1000-1100 objects (600 are invisible menu items) and only a few (maybe 30-40) are on the screen at a time. None of them but the player has any behaviors (platform) and one tilemap that has solid. Layout is about 4500 x 2600.

    It all depends on what your game is doing. I have far more objects and an unbound layout and my game runs at a steady 60fps. My game is a decent size, I have about 3500 events and the main layout also loads at least 10+ large sprites over 800x800, they are not always visible. The player character has around 48 frames of animation and currently it's a good 300x300px (downsized in-game).

    The only time I had a frame drop issue, was when I didn't cap out one of my spawners. I had been creating too many objects that were never destroyed (only if the player was near them).

    Not sure what to tell you, except that I've always tested gradual.. any time I add something new, I would check to make sure the game ran okay. When I had my one frame drop issue, I noticed it right away after I implemented it. So I knew I had a problem that I needed to deal with. Adding a cap system worked great, and the player never notices it.

    I think you need to find exactly what is causing it. What are those non menu object doing? there's about 600 of them. Do they have lots of frames of animation? try eliminating a group and see what happens. As long as you can reproduce your frame drop, you can always find the culprit, just gotta do some investigative work...

  • jobel - the non menu objects are only maybe 15-20 sprites with no animations or large frames (most of them are just duplicates of each other; a lot of them spritefonts). Some of the spritefonts have effects, but they're all on invisible layers so they shouldn't be rendered. I'm considering rewriting all of my code to dynamically create the menu instead of have it on a global layer. I'm not sure that'll even do anything, but at this point I'm kind of not sure what else to optimize.

    I have noticed that alt tabbing back in and back out can sometimes make the fps drop to ~30, but then if I alt tab out and back in, it'll go back to 60. I honestly have no idea what's happening. Ironically I've changed the node webkit from my powerful GPU to integrated intel HD graphics and I'm not getting ~60 fps as long as I don't maximize the window full screen.

  • I have probably about 1000-1100 objects (600 are invisible menu items) and only a few (maybe 30-40) are on the screen at a time. None of them but the player has any behaviors (platform) and one tilemap that has solid. Layout is about 4500 x 2600.

    generally speaking this should not be happening. I've seen enough C2 platformer games to know something weird is up with what you are trying to do. The fact that none of your objects except the player has a behavior and you've disabled all the events and still get the frame drop is very suspect.

    btw this doesn't even sound like a large desktop game.

    Ironically I've changed the node webkit from my powerful GPU to integrated intel HD graphics and I'm not getting ~60 fps as long as I don't maximize the window full screen.

    I don't understand what you are saying here.

  • jobel - it's a big game for C2, not necessarily as far as 2d games go.

    Basically what I meant was that my laptop has a graphics card and a motherboard video (integrated HD). If I disable the graphics card and use the much less powerful integrated graphics from the motherboard the fps actually improves.

  • it's a big game for C2, not necessarily as far as 2d games go.

    I guess that's a subjective term. What do you consider a big game for C2?

    Basically what I meant was that my laptop has a graphics card and a motherboard video (integrated HD). If I disable the graphics card and use the much less powerful integrated graphics from the motherboard the fps actually improves.

    does your laptop run other hardware accelerated games well? I would try it out on a various computers if you can to help narrow the issue. if you send me a build I can try to run it on my system (it's a couple years old and very moderate desktop).

  • So to wrap up, in my opinion it is possible to make a big project (not sure about a huge one) in C2 in a way to make it work very well, but it's not an easy task. Definietely not a task for a C2 newbie. It needs experience and deep understanding of how the memory managament works in C2, which conditions are the real triggers and which are fake triggers, what takes the most CPU, how to make workarounds for high CPU intensive parts etc. Without all this knowledge you will probably fail in making a big game in C2 as C2 is simply difficult for such projects.

    From the other hand if you pick Unity or any other engine you also need to learn how to use it properly.

    Maybe scirra should add such optimization tips to the manual. I always read this sort of stuff when going into a new engine.. Yet in Scirra's case all they have is a blog post that says 'dont worry about code optimization', but according to you we should...

    In comparison Unity released last year a few videos on optimization tips, turns out making performant games with the tool is hard.

    One interesting thing was how ppl really shouldn't use RegEx and generally any string operation, and if ppl had to do strings, use strbuilder. Because there was a lot of array copy-pasting going on, etc. Unity has it's quirks.

    So, in construct's case I wonder where it stands, I mean browsers and the js machines have a lot of optimizations ppl underestimate or don't know about, so all in all it would be cool if there were coding guidelines for construct, based on real world scenarios/experience.

    Draw calls is another matter really, and happens on the CPU side. It's probably best to split that topic off to a new thread. We have OpenGL ES 3 equivalent capabilities with WebGL 2 though, so if at any point draw calls prove to be a bottleneck, it's something we can potentially optimise in exactly the same way a native app would adjust their draw calls to be more efficient. Most 3D APIs, WebGL included, are specifically designed to allow as much drawing as possible with the fewest draw calls, to as far as possible eliminate the CPU overhead.

    What i understand from this is:

    1.Construct is does not have any internal optimization regarding drawcalls.

    2.There is so far no interest to do so.

    Did I miss read this? I mean shouldn't something like this at least be on the roadmap.

    Ashley Btw thanks for all the replies in the thread, it's not every company that has a lead dev replying to regular users.

  • Also, forgot to point out in the other post.

    According to this manual entry https://www.scirra.com/manual/183/memory-usage .

    Once a sound is loaded it stays in memory forever. I guess this isn't a bottleneck for most cases, specially with modern smartphones, but is this a good design choice to begin with. Shouldn't users be able to unload stuff as needed?

    Edit: To answer my own question -> https://www.scirra.com/construct2/releases/r242

  • I think if your image memory exceeds 1 gb, C2 actually has a pop up recommending other software, but below that, if you're not targeting mobile, seems to work great.

  • Yet in Scirra's case all they have is a blog post that says 'dont worry about code optimization'

    Can you please link to this post please?

    Shouldn't users be able to unload stuff as needed?

    Unloading sounds is possible starting from r242.

    I'm not sure why Ashley did not implement the "Unload by tag" action, but if you really need this one then you can also use my Experimental Audio plugin.

  • > Yet in Scirra's case all they have is a blog post that says 'dont worry about code optimization'

    >

    Can you please link to this post please?

    I meant this: https://www.scirra.com/blog/83/optimisa ... -your-time

    And about the audio, yeah i eventually found that, they have to update the manual! <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    Thanks for the plugin link!

  • And about the audio, yeah i eventually found that, they have to update the manual! <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    Thanks for the plugin link!

    Please note that you should use this plugin only if unloading by tag is crucial for your project as all the other unloading actions were ported to the official plugin so it's better to use the official one.

    I meant this: https://www.scirra.com/blog/83/optimisa ... -your-time

    Ah this one. Yeah well I must say that this article was always controversial to me, but we have to note that it has been written 5 years ago so the GPUs (especially on mobiles) were not that good/useful for HTML5 games. I mean WebGL wasn't supported that widely and well as these days. So the article says that most common performance issues are related to the rendering part. Fair enough as for 5 years back.

    But CPU usage is also very important and overusing loops etc. will just hurt the CPU, not the GPU. I saw tons of time people abusing everytick condition which also hits the CPU a lot. Well it's really a wide topic and there are tons of things to take care/ways to optimize the code. You can kill the app performance on CPU and GPU level easily, that's the truth.

    Anyway my statement is that as a C2 developer (and actually any developer including game engines, web dev and anything you code) you should take care about optimizing your code. But a very important note here is that even though optimization is important, the code architecture and readability is even more important. So the golden goal is to find the balance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • But a very important note here is that even though optimization is important, the code architecture and readability is even more important.

    I can vouch for that. After all my time using construct, that is what I have found to be the most important. I can probably safely say that because construct allows fast development, it probably is the reason why I learnt this lesson. You can create stuff pretty quickly in construct, but if your code architecture is bad, if it is unorganized, unreadable- you'll have difficulty scaling your projects as you spend more time on them. It's pretty crazy. Like not seeing the forest for the trees.

  • Maybe scirra should add such optimization tips to the manual.

    We've got that. It's been there for years. People still make the same mistakes, not everyone reads the manual.

    [quote:3a4n02ln]1.Construct is does not have any internal optimization regarding drawcalls.

    Completely, utterly wrong! We have very heavily optimised this part of the engine with a sophisticated batching engine based on years of engine development experience. C2's renderer is even better at batching than our old C++ DirectX 9 engine.

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