Question of efficient use of sprites

0 favourites
  • 4 posts
From the Asset Store
2d mushroom sprite 2d game character enmy sprite game art
  • I have a question on which approach has the least negative impact on performance. I'm working on an rpg. I've a list of a dozen or so possible mobs that can roam the game. Each type of mob will have about 24 animations associated with it. Is it better (performance wise) to have a different sprite for each mob type and then load the 24 animations into it, or have one sprite and load all the mob animations into it and then just use something like an instance variable to classify which mob type (and animation set) to display?

    Thanks!

  • Hi You might find this useful.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi You might find useful.

    Thanks. I also found this under performance tips in the manual:

    [quote:8of65nab]Not placing all used objects in the layout

    If objects are not placed in a layout but are created by events, Construct 2 will load the textures for those objects the moment you create them. This can cause a momentary pause or "jank" and make the game feel less responsive. This can be avoided by placing any used objects in the layout. They can be placed off-screen and destroyed on startup to avoid interfering with the gameplay. Then Construct 2 will preload all their textures when the layout starts, avoiding any "jank" as they are created and destroyed at runtime.

    Since there will be many levels and not all mobs are encountered at every level, it seems better to break them up into specific sprites instead of one with all the animations attached to prevent unneeded animations from being loaded into memory.

  • Yeah iac249 - it really helps to plan ahead with this kind of thing.

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