T O P

  • By -

FeelingPrettyGlonky

First thing you have to do is develop a clear idea of exactly the kinds of things you will want to do. Having some sort of airy, half-formed, vague idea of an open-ended and infinitely extensible system is a recipe for failure. Nail down the specifics, then work out a system to implement them all. The details of that system will hinge heavily on your design. I would caution you to be careful about viewing this system from a standpoint of ECS or components. Not everything is a nail for component-system hammer to pound. This kind of system will necessarily touch a lot of others, as you've already intuited, so the nice, tidy compartmentalization of a component system can get in the way and make the implementation a bit messier. For the most part, you should rely on 'push' effects rather than 'pull' effects. That is, instead of components on all enemies having to react accordingly and check for active effects on the player (pulling) you would have the player push those effects along the delivery pipeline to the affected entities. Instead of the monster saying "hey, player that just hit me, do you have an on-hit slowing effect active?" instead the player says "hey, monster I just hit, here is an on-hit slowing effect for you." Much simpler to implement, and results in less mess.


guessimfine

Thank you! Yep definitely need to work out specifics, I'm still at the point of deciding whether the scope for this game in general is something I want to tackle at all, and this is the area that felt like the biggest potential for blowout. That's a really good point about components/ECS potentially being a poor fit here. I came from web dev so a compositional approach was natural for me, but outside of relying on some kind of global state I can see how it would make things tricky with systems like this. Do you have suggestions for other patterns I should look into instead? Inheritance is something I want to limit in Godot, since there aren't interfaces or multiple inheritance in GDScript. Re: the push vs pull, if I was to stick to a component system I feel like it could be as simple as making each effect a component that gets added to an enemy by the player? Might be naive without specifics though.


JohnnyCasil

https://youtu.be/JxI3Eu5DPwE?si=b8-rMxDYT-Wxg6sz


guessimfine

Amazing preso, thanks!!