0 Favourites

How do I load multiple characters efficiently?

  • 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

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

  • GenkiGenka : Thanks

    I forgot to mention it was for PC didnt't I ? sorry about that

    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?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • 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.

  • GenkiGenga Thanks a bunch! This clarifies a lot

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