How do I load multiple characters efficiently?

Get help using Construct 2

Post » Mon Mar 16, 2015 12:05 am

I didn't know how to phrase my question properly so my excuses in advance.

So, presently in a menu I can choose up to 8 different types of characters and each character possess up to 4 different heads.
What I did was to use variables to determine wether I was choosing one or another to load the proper animations. Now, the problem is
that I would like to do this in a more efficiently level, since eventually I'll be adding armos, gears etc. Is there a proper way to load only
the animations that will be used in the game and discard the rest from memory?
If anyone could poitn me in the right direction I would really appreciate it.

Thanks :)
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Mon Mar 16, 2015 1:59 am

A while back I was building a mobile RPG that had extensive customisation for appearance. For a typical PC it shouldn't really matter how you go about it.

If you are making a game for mobile then the only way to do it without getting bogged down by memory is to keep all equipped items etc as individual sprites instead of having 1 item with multiple animations. That way you *are* never loading anything unnecessary into memory.
Last edited by GenkiGenga on Tue Mar 17, 2015 1:52 am, edited 1 time in total.
ImageImage
B
102
S
21
G
7
Posts: 1,058
Reputation: 12,325

Post » Mon Mar 16, 2015 11:45 am

@ GenkiGenka : Thanks
I forgot to mention it was for PC didnt't I ? sorry about that :D

So presently I have a Player with the 8 variations (sets of animations). Is that more costly than having 8 different sprites each one with its own animation set?
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Tue Mar 17, 2015 1:48 am

No worries Fraktal. If I understand it correctly, when you start your game (or load a new layout within your game) all of the animations in any objects present in that layout are loaded into memory. So if you have a bunch of animations in your player object that you will never switch to, then yes it is more costly as you are loading things unnecessarily into memory.*

The benefits of having all the animations loaded the way you currently have it set up is: If you can change your equipment mid stage, the animation will switch without the potential jank that comes from creating or destroying objects at runtime.

*One major thing to keep in mind when weighing the pros and cons of which style to use is whether or not you will actually feel a difference. If your making your game for pc only, I don't think you really need to worry about it and should instead go with whatever style is easiest for you to work with.
ImageImage
B
102
S
21
G
7
Posts: 1,058
Reputation: 12,325

Post » Wed Mar 18, 2015 4:40 pm

@GenkiGenga Thanks a bunch! This clarifies a lot :)
B
43
S
12
G
14
Posts: 488
Reputation: 10,570


Return to How do I....?

Who is online

Users browsing this forum: SneakyHands, Zaksoid and 3 guests