{"id":13662658,"url":"https://github.com/AlanSherba/DeepAction","last_synced_at":"2025-04-25T10:33:04.841Z","repository":{"id":54404344,"uuid":"361055708","full_name":"Sherbb/DeepAction","owner":"Sherbb","description":"A platform to create complex action games in Unity.","archived":false,"fork":false,"pushed_at":"2023-11-23T18:27:48.000Z","size":2205,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-21T11:51:22.691Z","etag":null,"topics":["ecs","entity-component-system","game-development","unity"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sherbb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-04-24T02:49:01.000Z","updated_at":"2024-02-09T16:27:29.000Z","dependencies_parsed_at":"2024-04-21T11:56:02.859Z","dependency_job_id":null,"html_url":"https://github.com/Sherbb/DeepAction","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sherbb%2FDeepAction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sherbb%2FDeepAction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sherbb%2FDeepAction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sherbb%2FDeepAction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sherbb","download_url":"https://codeload.github.com/Sherbb/DeepAction/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":213630945,"owners_count":15615381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecs","entity-component-system","game-development","unity"],"created_at":"2024-08-02T05:02:04.530Z","updated_at":"2024-11-10T18:31:13.624Z","avatar_url":"https://github.com/Sherbb.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"\n```\nWORK IN PROGRESS\n```\n```\nRequires Unity 2021.3+\n```\n\n\n# DeepAction\nAn `object-oriented` `entity-component-system` for creating complex action games in Unity.\n\nEntities behavior is defined entirely in c#\n```csharp\n//an entity is defined as a \"template\" which can be used to instantiate\npublic static EntityTemplate ExampleEnemy()\n{\n    EntityTemplate t = BaseEntity();\n\n    //attributes are floats that drive entity behavior and can be modified by behaviors\n    t.attributes[D_Attribute.MoveSpeed] = new A(Random.Range(20f, 40f));\n    t.attributes[D_Attribute.MaxMoveSpeed] = new A(Random.Range(20f, 40f));\n\n    //behaviors are like monoBehaviors \n    t.behaviors = new DeepBehavior[]{\n        new MoveTowardsPlayer(),\n        new AvoidOtherEntities(D_Team.Enemy,D_EntityType.Actor,60f),\n        new VFXOnDeath(\n            new VFX.Sparks(new Color(1f,.256f,.256f),5),\n            new VFX.SquarePop(new Color(1f,.256f,.256f),5f,.2f)\n        ),\n    };\n\n    t.team = D_Team.Enemy;\n    t.type = D_EntityType.Actor;\n\n    return t;\n}\n```\n\n## DeepEntity\n\nThe core gameplay entity has Behaviors, Attributes, Flags, and Resources\n\n### DeepBehaviors\n\nA behavior is the replacement for MonoBehaviors that gets attached to entities. It has a Initialize/Destroy method that you can use to hook into the parent entities events.\n\nThese events are things like: `Update`,`OnEnable`,`OnCollisionStay`. But also things like: `OnDealDamage`,`OnBounce`,`OnCast`.\n\n```csharp\npublic class AreaDamageOnDeath : DeepBehavior\n{\n    private float radius;\n    private Damage damage;\n    private D_Team targetTeam;\n\n    public AreaDamageOnDeath(float radius, Damage damage, D_Team targetTeam)\n    {\n        this.radius = radius;\n        this.damage = damage;\n        this.targetTeam = targetTeam;\n    }\n\n    public override void InitializeBehavior()\n    {\n        parent.events.OnEntityDie += OnDie;\n    }\n\n    public override void DestroyBehavior()\n    {\n        parent.events.OnEntityDie -= OnDie;\n    }\n\n    private void OnDie()\n    {\n        DeepActions.AreaDamage(parent.transform.position, radius, damage, targetTeam);\n    }\n}\n```\n\n\u003e TODO: explain attributes\n\n\u003e TODO: explain resources\n\n## Goal\nThe purpose of this is to create a really solid base that allows for a ton flexibility and freedom in design.\nBeyond freedom, a major goal is creating a system that is very FAST to work with.\n\nI find that doing a system like this through mono-behaviors is very messy and error prone (and a little less performant).\n\nDefining entity behaviors inside c# is both very fast and EXTREMLY flexible. Creating this kind of flexibility in an editor GUI is possible, but a huge waste of time imo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlanSherba%2FDeepAction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAlanSherba%2FDeepAction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlanSherba%2FDeepAction/lists"}