Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Seeking advice for RPG game design.

Discussion in 'Entity Component System' started by Bagazi, Aug 25, 2023.

  1. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    609
    Suppose you're developing an RPG game where players have a series of skills attributed to their characters. Let's assume these skills can be described using a unified data structure. As players progress in the game, they continuously acquire new skills. How should this structure be designed for optimal results? If each skill is a ComponentData, should these data be attached to the player's entity as a list?

    Additionally, is using an object pool reasonable within an ECS system? For example, if you're dealing with player bullets or effects, could an object pool be employed to reduce the overhead caused by frequent initialization?
     
  2. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    3,976
    I suggest prototyping a very small game in ECS that does not involve any sort of complex data structure or skill system to get familiar with how ECS works first. What you are suggesting doesn't make any sense, but you wouldn't know that until using the API first.

    Only for managed objects. Otherwise, there's generally better options.
     
    Bagazi and xVergilx like this.
  3. poon2

    poon2

    Joined:
    Oct 30, 2022
    Posts:
    10
    I'd suggest creating separate entities for skills because it's easier to trigger the skills when they are separate entities. You can just have a tag component like `ActivateSkill` that you can add to the skill's entity and have a system that reacts to existence of that component.
     
  4. Laicasaane

    Laicasaane

    Joined:
    Apr 15, 2015
    Posts:
    288
    You should analyze your skills to find common patterns in their data and/or logic. As for my experience, it's quite rare to have singular entity due to special data/logic. That means most skills and status effects can be generalized so a system can process multiple entities at once.
     
    Opeth001 likes this.