Question of efficient use of sprites

Discussion and feedback on Construct 2

Post » Sat Nov 22, 2014 5:40 am

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!
B
7
S
1
Posts: 13
Reputation: 363

Post » Sat Nov 22, 2014 8:06 am

Hi @iac249. You might find this useful.
Image
B
9
S
3
G
1
Posts: 346
Reputation: 1,560

Post » Sat Nov 22, 2014 7:28 pm

Message: iac249 is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
hundredfold wrote:Hi @iac249. You might find useful.


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

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.
B
7
S
1
Posts: 13
Reputation: 363

Post » Sat Nov 22, 2014 7:38 pm

Yeah @iac249 - it really helps to plan ahead with this kind of thing.
Image
B
9
S
3
G
1
Posts: 346
Reputation: 1,560


Return to Construct 2 General

Who is online

Users browsing this forum: Brendan2007, zenox98 and 7 guests