Scofano's Forum Posts

  • Scofano

    On browser.

    Really i didn't test my game on mobile.

    If you have the time, give it a try.

    I´ve been very upset with the results (but trying to figure it out how to improve them) of c2 mobile on an action game I´m working on.

  • Thanks, both of you.

  • I don't think the layout size had anything to do with the image memory.

    One of my layout's is 92000 by 3000 px, And the size is 40 mb with tons of trees and grass...etc.

    That file size on a mobile or browser?

  • Yes, or toggle them visible/invisible. At least, if you're getting trouble because of your CPU usage. Creating and freeing objects into memory gives a lot of work to your garbage collector. Anyway, you're already setting the position of your active bullets all of the time in your code, aren't you? So by pooling your objects, you'll technically simply remove all of the object creation and destruction calls during gameplay sessions.

    Good luck going forward, and don't hesitate to tell me if you need anything!

    Great and inspiring works of yours, Nathan. Thanks for the response. I'm listening to your tunes, righ now.

    I've doodled what I understood you told me about the bullets. Is that correct?

    So I've got to define how many bullets I can have on my screen (by speed) and create them all at once on start of layout? Then, everytime it goes off the screen or get hit I move it back to the ship?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Groups that are not active will be ignored at runtime. Using a single "every tick" condition to check the active type of gun with 3 elseif conditions wouldn't make a significant difference.

    Like I thought: deactivated group = 0 processing. That's nice to know.

    On mobile, it's mainly collision/overlap checks, loops and physics that will quickly eat up your CPU power. Creating and destroying many objects as well, like bullets for example. If you haven't done so by the way, you will need to pool any type of object that's being created and destroyed often (that is to say create them only once, store them in an array for example and reuse them).

    Good luck!

    In a case of a shooter, are you saying that it is best for me to create, let's say 30 bullets (20 of main ship and 10 for the enemies) and just move them around (on and off the screen) instead of spawning and destroying them?

  • Technically though, scofano, as I understand it the first is best, but by such a small amount I doubt you could tell the difference even doing it a bunch of times over a project.

    Thanks, Arima.

    Everything that I test on browser (pc) runs fine. My problem is when I test it on my Ipad(new).

    So I've started to read forums and ppl always blame the everytick (among other things, like number of objects) for performance.

    What I think I should do (please tell me if I'm wrong):

    I'm coding a top down shooter and there are 4 types of guns. So I coded every gun on their own group (inside each group there is an everytick for each gun) and I activate and de-activate the groups depending on the powerup(gun) I get.

    I will be using 1 'everytick' call (go rotate, for example) instead of using them all in a single 'everytick' that is doing things on gun2, 3, and 4 (sprites) but only gun1 is on the scene. Waste of time putting them all on a single event if they are not on the scene, right? (or, is it ignored for the sprite not to be seen?)

    Thanks

  • Hi, ppl. I've got a noobie question about perfomance.

    What is the difference (on performance) of using (1 event or 3 events):

    Every tick{

    rotate.sprite

    scale.sprite

    move.sprite}

    and:

    Every tick{

    rotate.sprite

    }

    Every tick{

    scale.sprite

    }

    Every tick{

    move.sprite

    }

    Creating more events will slow down the app or do they all "catch the same train"?

    I've got some trouble on organizing the groups and now and then I think "hmmm, the code needs another every tick", then I remember that I've got one everytick event running up there and so I search for it and add to it). Is that something I really should worry about?

    Thanks in advance

  • Same here, one player get the host, next one gets the kicks...