Will there be support for sub-families?

Discussion and feedback on Construct 2

Post » Fri Jul 05, 2013 8:19 pm

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?
Image
B
10
S
3
G
2
Posts: 196
Reputation: 2,053

Post » Fri Jul 05, 2013 9:50 pm

What would be the difference between sub families and simply putting an object into multiple families as can already be done?
Moderator
B
92
S
32
G
33
Posts: 3,005
Reputation: 27,582

Post » Fri Jul 05, 2013 10:03 pm

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...Tokinsom2013-07-05 22:05:24
Image
B
236
S
27
G
13
Posts: 1,784
Reputation: 18,329

Post » Fri Jul 05, 2013 10:32 pm

[quote='Arima']What would be the difference between sub families and simply putting an object into multiple families as can already be done?[/quote]
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.

[quote='Tokinsom']Someone asked about this a little while ago and Ashley more or less said it's not happening.[/quote]
Oh! I missed it when I searched. Could you point me to the thread? Thanks!Dalal2013-07-05 22:40:48
Image
B
10
S
3
G
2
Posts: 196
Reputation: 2,053

Post » Fri Jul 05, 2013 10:48 pm

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...Tokinsom2013-07-05 22:52:31
Image
B
236
S
27
G
13
Posts: 1,784
Reputation: 18,329

Post » Fri Jul 05, 2013 11:04 pm

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.Dalal2013-07-05 23:04:57
Image
B
10
S
3
G
2
Posts: 196
Reputation: 2,053

Post » Fri Jul 05, 2013 11:31 pm

Since we're talking about Families:
As i sad in this thread http://www.scirra.com/forum/suggestion-families-as-containers_topic70259.html i would like families to be used as containers.
B
14
S
6
Posts: 14
Reputation: 1,868


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests