1
\$\begingroup\$

I am developing an game with ECS architecture and trying to design a character damage system.

Does the following design fits into ECS conception and will it be extendable in future?

  • I have an Actor component with health percent attribute and ActorsDamage system.

  • I also have an inventory system, so actors can use some food to increase their health.

  • When actors use inventory items, their Lua handlers executes and generates ActorHit event.

  • ActorDamage system receives this event and increases or decreases the actor's health.

  • Other game systems link actors' AI system or actors' keyboard control systems can also trigger hit events.

So, is this an appropriate design conception, or is there something I need to correct or improve?

\$\endgroup\$
3
  • 2
    \$\begingroup\$ It sounds like you have a well thought out plan for how you want to handle these interactions. Have you observed a specific problem with this approach that we can help you solve, or an aspect of it that you find unsatisfactory that we can help you improve? If not, my general advice is to try it. You'll learn a lot more about whether this solution meets the needs of your game by actually implementing it in your game, rather than relying on hearsay from Internet strangers who don't know your game, your dev team, or your situation at all. \$\endgroup\$
    – DMGregory
    Commented Mar 5, 2021 at 13:05
  • \$\begingroup\$ Thank you, @DMGregory, I will follow the advice! Actually, now I haven't any specific problems, but I am not very experienced in architecture design, so I wanted to ask some advices if someone have them. \$\endgroup\$
    – Nikolai
    Commented Mar 5, 2021 at 13:19
  • 1
    \$\begingroup\$ You could try to think about risks and maintainability and flexibility, will it be easy to change if you need something more complex or simple? I have over engineered things in my game that I scrapped after I found an easier way so don't overthink either I guess... \$\endgroup\$
    – Emil
    Commented Mar 12, 2021 at 7:32

0

You must log in to answer this question.