Will there be support for sub-families?

0 favourites
  • 7 posts
From the Asset Store
Controller Support ,TouchScreen Support , Keyboard Support , Action Platformer, Lots of Animations
  • It seems like the next logical step for families is to support sub-families. Families are already treated like normal objects in any every other aspect. In a relatively complex game such as the one I'm currently making, multiple levels of inheritance would be really handy.

    What's the demand like for this feature? Are there plans to support it in the future?

  • What would be the difference between sub families and simply putting an object into multiple families as can already be done?

  • Lots of time and space :)

    Someone asked about this a little while ago and Ashley more or less said it's not happening. Would be very useful though...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What would be the difference between sub families and simply putting an object into multiple families as can already be done?

    The main difference is that a sub-family would inherit the variables of its parent family, whereas two separate families would have no connection to one another.

    Say we have a family called Bullet that moves left and right at a set velocity and kills stuff. Then we have a sub-family called ChaserBullet that changes its velocity in order to chase someone. ChaserBullet can now access the parent family's velocity variables in order to modify them.

    Why wouldn't the approach of multiple families work? Because then, ChaserBullet cannot handle the logic for its child objects. There will be duplicated logic for each child, which defeats the purpose of the ChaserBullet family. Only the children will have access to all variables.

    I assumed Sub-Families existed until today (Families are treated like objects in almost every other way). I needed them and they weren't there, so I had to come up with a work-around, which did the trick although it makes the logic a little more convoluted and isn't as clean when assigning families. You basically have to make sure that anything that is ChildFamily is also ParentFamily.

    Someone asked about this a little while ago and Ashley more or less said it's not happening.

    Oh! I missed it when I searched. Could you point me to the thread? Thanks!

  • Arg, can't find it. Might've been in the "How Do I" section instead. He basically said it'd be difficult/impossible with the way families are currently set up.

    Inheritance is pretty important. I think it's far more efficient to give a behavior to a family instead of individual objects so that surface modifiers and such apply to everything. You could also do stuff like freeze any enemy when it's hit. If you do this now you won't be able to access the behaviors from the "Enemies" family :T I've resorted to making a single family with all behaviors and activating/deactivating them as needed, then using a variable to separate enemy from player, base from mask, and so on. It's not a very elegant solution...

  • Yeah, I can see that. Without looking at the code, I always got the sense that Families were a little restrictive in how they were set up behind the scenes, judging from the interface where you add/remove objects.

    Perhaps what is needed is a new feature entirely separate from Families that focuses on inheritance rather than merely being able to reference several objects at once.

    I'm visualizing something like a Parents property that can be set in the editor. When you click on it you can choose a sprite (or applicable object) to inherit from, and just like that all variables and behaviors are inherited.

    That would be a really advanced feature that I'm sure is hard to implement, but some kind of advanced inheritance system in Construct 2 would be extremely useful. I hope Ashley can consider it for a future release.

  • Since we're talking about Families:

    As i sad in this thread scirra.com/forum/suggestion-families-as-containers_topic70259.html i would like families to be used as containers.

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