Family performance issue

0 favourites
  • 9 posts
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • I am working on a game where objects collide with water and create a splash (i.e. spawn a one-shot particle object).

    Originally I had a single object with the splash behavior, but I wanted other objects to create splashes as well. So I created a "Splash" family and added objects that should splash. I then applied the splash behavior to the family instead of the individual object.

    This was the only change I made, and the splashes work correctly, but the framerate drops to an unplayable level. Works fine when the individual objects have the behavior.

    Any ideas why this would happen? I want to use a family so I don't have to repeat code.

  • Hard to say without showing a .capx. The change you made does not sound like it should have affected performance at all. It might be coincidence, e.g. a new background process starting on your computer that starts to use up resources, and it made you mistake the change as causing a performance drop.

  • I think I found the problem - some other behaviors originally in the separate objects needed to be shifted to the family, I think there may have been some conflict there.

    Anyways, thanks for the fast response - the program is great and getting better!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • When you set a behavior to a family, if one of the family's object have that behavior already, then that object will have two times the same behavior.

    I think that can cause some problems... Am I wrong? maybe the individual objects should take the previos behavior or the new behavior, not both.

  • GamerGon - there is a bug where you can add two behaviors with the same name using a family, but it's fixed in r100.

  • Ashley, are you sure it's a bug?

    If a family uses a behavior, and then an object in that family uses the same behavior, only the one behavior should be added, and the parameters of the instance (in other words, the more specific) should override the parameters of the family - I think this gives enormous flexibility that's very hard to achieve otherwise!

    Unless of course that's what you mean by "fixed".

  • Fimbul - it was to do with having for example a 'Bullet' behavior in Sprite1, a 'Bullet' behavior in Family1, then adding Sprite1 to Family1. It ends up with two behaviors named 'Bullet', which causes some errors. Instead it prevents you from adding the object to the family until you rename one of the behaviors.

  • Ashley are you sure? In r99 when I add a family behavior it renames like Physics2 in every family member if they already have Physics behavior added. Then, the family member would have "Physics" and "Physics2".

  • For those curious I'm using r95 and it was a Physics behavior that was duplicated.

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