0 Favourites

Question of efficient use of sprites

  • 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 iac249. You might find this useful.

  • Hi iac249. 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.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • 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)
Similar Topics Posts Views Last Post
Unread hot topic
353 32,095
yojona's avatar
yojona
Unread hot topic
0 Favourites
Sprite Font Generator - v3
368 112,324
RetroDaddy's avatar
RetroDaddy
Unread sticky
192 1,337,445
Kyatric's avatar
Kyatric Construct Team Support