Strange Spawn Lag, First Time Only

Whenever I start a scene and collide with an enemy, the first spawned explosion creates some noticeable lag. Afterwards, however, it seems like all subsequent explosions spawn just fine in the same exact way, with no impact on performance. This seems to be the case with just about all first spawns, and the actors being spawned are very simple/low intense for the most part in terms of size/rules.

Any ideas on how to fix this/any workarounds? Does Pre-Load play a role in this at all?

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited November 2014

    @supafly129 said:
    Whenever I start a scene and collide with an enemy, the first spawned explosion creates some noticeable lag. Afterwards, however, it seems like all subsequent explosions spawn just fine in the same exact way, with no impact on performance. This seems to be the case with just about all first spawns, and the actors being spawned are very simple/low intense for the most part in terms of size/rules.

    Any ideas on how to fix this/any workarounds? Does Pre-Load play a role in this at all?

    There has always been an issue with the initial spawning of an actor, pre-load being checked doesn't seem to help, and even loading the images into the scene (manually placing actors in the scene / hidden out of the way somewhere off camera, so they are in RAM to start with) doesn't always resolve the issue either, @Armelline was commenting on this issue recently, so maybe has some input.

    One possible solution might be to run a false spawn (invisible or otherwise hidden) when a brief lag wouldn't be noticed (loading page, menu, fade in . . . etc).

  • supafly129supafly129 Member Posts: 454

    @Socks said:
    One possible solution might be to run a false spawn (invisible or otherwise hidden) when a brief lag wouldn't be noticed (loading page, menu, fade in . . . etc).

    Hmm false spawn doesn't seem to have much of an effect..I think you touched on this before but are particles generally more intensive on performance than spawning several actors at once? Or does it depend on other factors like the number of particles being spewed, particle startup time, etc.?

  • SocksSocks London, UK.Member Posts: 12,822
    edited November 2014

    @supafly129 said:
    Hmm false spawn doesn't seem to have much of an effect..

    Damn ! It was only a theory, I've not tested it myself as yet, pity it doesn't work.

    @supafly129 said:
    I think you touched on this before but are particles generally more intensive on performance than spawning several actors at once?

    Particles are a lot less intensive on performance than spawning a bunch of actors, but you can do a lot more with actors.

    @supafly129 said:
    Or does it depend on other factors like the number of particles being spewed, particle startup time, etc.?

    Everything in GameSalad is conditional !!

    Everything matters, so you need to test and test again ! For example I was spawning a hundred actors (for a controllable particle effect), and each actor had two constrains which were changing the colour over time (red to blue), but I found that if I dumped the two constrains and used an animated colour change (30 images going from red to blue) I quadrupled the amount of actors I could have on screen before things got laggy, so the lesson here is that animation is a lot less processor intensive than the constrain behaviour (at least in this scenario) . . . so yes, it all depends on a number of factors.

    But with all things being equal, with the same number of 'particles' doing the same thing . . (rotating, moving, same speed, same size, same size change . . . . etc) then particles are markedly less processor intensive than a bunch of actors.

Sign In or Register to comment.