Giter Site home page Giter Site logo

pixeyehq / actors.unity Goto Github PK

View Code? Open in Web Editor NEW
730.0 730.0 75.0 150.53 MB

🚀Actors is a framework empowering developers to make better games faster on Unity.

License: MIT License

C# 100.00%
actors ecs ecs-signals entity entity-component-architecture entity-component-system game-framework innovation management pooling-gameobjects unity unity-editor unity-engine unity-framework unity-scripts unity3d unity3d-framework workflow

actors.unity's People

Contributors

allexeee avatar desendo avatar favoyang avatar geobrain avatar help01 avatar jimboa avatar maximetinu avatar pixeyehq avatar xpyct avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

actors.unity's Issues

🐞 Object Pooling for Actors on the scene doesn't work properly.

Using ispooled variable in the actor is unsafe and should be redesigned. The problem is only for actors that were put in the scene from the editor. The Poolmanaged doesn't know anything about those prefabs. The framework managed that by caching prefabs before making a build but it won't work for scenes that were not added to the scene manager.

Another solution is to remove entirely editor prefab check and ispooled variable. Instead, add the string name of the prefab in the actor that will be used for getting proper prefab instance id.

Actor.entites - опечатка?

entites, а не entities. Опечатка или намеренно - не знаю, по-моему опечатка (:

    public class Actor : MonoCached, IPoolable
    {
        public static Actor[] entites = new Actor[EngineSettings.MinEntities];
        . . .
    }

Unity.IL2CPP.CompilerServices.Il2CppSetOptionAttribute option wrong usage

You use:
[Il2CppSetOption(Option.NullChecks | Option.ArrayBoundsChecks | Option.DivideByZeroChecks, false)]
but Option is not a bitmask enum, so you just turn off Option.DivideByZeroChecks = 3, because (1 | 2 | 3) will be 3.
To fix this, just replace [Il2CppSetOption(Option.NullChecks | Option.ArrayBoundsChecks | Option.DivideByZeroChecks, false)] to
[Il2CppSetOption(Option.NullChecks, false)]
[Il2CppSetOption(Option.ArrayBoundsChecks, false)]
[Il2CppSetOption(Option.DivideByZeroChecks, false)]

You are welcome ;)

There is a typo at line 647 of README.md

Expected Behavior

I expected to read "perform" instead of "perfrom"

Current Behavior

I am currently reading "perfrom"

Possible Solution

To switch 'o' and 'r' characters positions.

Steps to Reproduce

  1. Go to actors.unity repo
  2. Read the readme until ECS Events section
  3. There it is, on the line below

Context (Environment)

Google Chrome | 84.0.4147.89 (Official Build) (64-bit)
Revision | 19abfe7bcba9318a0b2a6bc6634a67fc834aa592-refs/branch-heads/4147@{#852}
OS | macOS Version 10.15.6 (Build 19G73)

Errors after adding dependency

Hi, after adding adding dependency via UPM, bunch of errors pop up:

Library/PackageCache/com.pixeye.ecs@b0136155b5/Editor/Drawers/DrawerScene.cs(22,31): error CS0246: The type or namespace name 'SceneReference' could not be found (are you missing a using directive or an assembly reference?)

Library/PackageCache/com.pixeye.ecs@b0136155b5/Editor/Drawers/DrawerInfoBox.cs(10,34): error CS0246: The type or namespace name 'InfoBoxAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library/PackageCache/com.pixeye.ecs@b0136155b5/Editor/Drawers/DrawerScene.cs(22,31): error CS0246: The type or namespace name 'SceneReference' could not be found (are you missing a using directive or an assembly reference?)

Library/PackageCache/com.pixeye.ecs@b0136155b5/Editor/Drawers/DrawerTags.cs(14,31): error CS0246: The type or namespace name 'TagFilterAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library/PackageCache/com.pixeye.ecs@b0136155b5/Editor/Drawers/DrawerTags.cs(22,10): error CS0246: The type or namespace name 'FastString' could not be found (are you missing a using directive or an assembly reference?)

Library/PackageCache/com.pixeye.ecs@b0136155b5/Editor/SceneProcessors/PostHandlePools.cs(66,70): error CS0246: The type or namespace name 'Starter' could not be found (are you missing a using directive or an assembly reference?)

Library/PackageCache/com.pixeye.ecs@b0136155b5/Editor/Inspector/InspectorOverride.cs(279,11): error CS0246: The type or namespace name 'FoldoutGroupAttribute' could not be found (are you missing a using directive or an assembly reference?)

Library/PackageCache/com.pixeye.ecs@b0136155b5/Editor/Inspector/InspectorReordarable.cs(439,41): error CS0246: The type or namespace name 'ReorderableAttribute' could not be found (are you missing a using directive or an assembly reference?)

🐞 Эксепшен при вызове метода Obj.Create с передачей параметра parent = null.

В юнити, если parent = null - то это означает, что объект находится в "корне сцены" (где выше по иерархии - только сама сцена).

Вызывая метод Obj.Create с parent = null я предполагаю, что объект просто будет размещен в корне сцены, как если бы я не передавал parent вообще.

Код реализации метода:

public Transform Create(GameObject prefab, Transform parent, Vector3 startPosition = default,
  Quaternion startRotation = default)
{
  return GameObject
    .Instantiate(prefab, parent.TransformPoint(startPosition), startRotation * parent.rotation, parent)
    .transform;
}

Эксепшен из-за startRotation * parent.rotation, т.к. parent = null.

Rename Tags Extentions

В Tag.cs:

        public static bool Has(this int entityID, int filter) { }
        public static bool Has(this int entityID, params int[] filter) { }
        public static bool Has(this Actor a, int filter) { }
        public static bool Has(this Actor a, params int[] filter) { }
        public static bool HasAny(this Actor a, params int[] filter) { }
        public static bool HasAny(this int entityID, params int[] filter) { }

изменить название методов расширения на:

        public static bool HasTag(this int entityID, int filter) { }
        public static bool HasTags(this int entityID, params int[] filter) { }
        public static bool HasTag(this Actor a, int filter) { }
        public static bool HasTags(this Actor a, params int[] filter) { }
        public static bool HasAnyTag(this Actor a, params int[] filter) { }
        public static bool HasAnyTags(this int entityID, params int[] filter) { }

P.S. заодно хочу спросить, почему изменился стиль именования этих методов?
Раньше было:
TagHas, TagAdd, TagRemove, и т.д.
Теперь:
HasTag, AddTag, RemoveTag?
Это личное предпочтение или что-то другое?

Async scenes loading 💬

The code below will download a sub-scene in 1 frame even if the scene is big, ignoring async callbacks of the framework.

public class LayerTerrain : Layer<LayerTerrain>
 {
   protected override void Setup()
   {
     SceneSub.Add("Scene Game");
   }

Possible solutions:

  • You can delay the loading of a scene for 1 frame. In this case, a scene will be downloaded after several frames.
  public class LayerTerrain : Layer<LayerTerrain>
  {
    protected override void Setup()
    {
      // Using `WaitFor` framework method to perform delay.
      WaitFor(Time.deltaTime, delegate { SceneSub.Add("Scene Game"); });
    }
  }

You may leave thoughts on why this code behaves like this. 👍

Описание процессингов

Стоит дополнить описание процессингов в README-rus.md & README.md, объяснив посылку сигнала:
"...каждый раз когда вы используете ProcessingSignals.Default.SendSignal(new ваштипсигнала); он отправит этот сигнал всем подписанным экземплярам с IRecieve<ваштипсигнала>"
Что-то на подобии.
P.S: мой первый Issue :D

🐞 Setup of Monocached is triggered twice.

Ситуация

Создаем в реалтайме сложный объект с акторами и монокешами. Используя методы Obj.Init или Obj.InitChilds инициализируем все акторы и монокеши. Но монокеш может инициализироваться самостоятельно (в Start()) из-за чего возможна следующая ситуация:

(Именно в такой последовательности)
Bootstrap -> Setup()
Start -> Setup()

В результате получается 2 вызова Setup.

Текущая реализация самостоятельной инициализации монокеша:

protected virtual void Start()
{
  if (!LayerKernel.InstanceInternal || !LayerKernel.Initialized[gameObject.scene.buildIndex]) return;
  Layer = LayerKernel.Layers[gameObject.scene.buildIndex];
  Setup();
}

Возможное решение

protected virtual void Start()
{
  if (!LayerKernel.InstanceInternal || !LayerKernel.Initialized[gameObject.scene.buildIndex]) return;
  if (Layer != null) return;
  Layer = LayerKernel.Layers[gameObject.scene.buildIndex];
  Setup();
}

Ситуация из проекта

В монокеше происходила подписка на изменение стейта стройки. Как только стройка заканчивалась - ставилась стена.
Из-за двойного вызова Setup происходила двойная подписка на изменение стейта, из-за чего строилось 2 стены, а не одна.

📘 Add stop method for observers

In the past, the only way to stop the observer was removing the entity that held the observer. This is not a good practice as the release of entity is always a delayed operation and in some cases this may lead to unwanted observations before stopping.

Stop method will allow to clean observers instantly.

Improving Actors + Unity Jobs

Не удобно работать с джобами для перемещения обьектов в параллельности.
Суть: не используется очистка групп от сущностей через фреймворк акторсов, вместо этого через дополнительные проверки пропускаются сущности, которые должны уйти из группы.

вся логика "мучений" подписана в ProcessingJobsMoveDirection ))
после запуска нажимать пробел
issuesActrosJob.zip

🐞 Entities are disposed after scene is loaded.

When the scene has destroyed all entities on that scene are killed. The components cleanup method for released entities triggers after the scene gets destroyed. This may rewrite the setup of Actors on the next scene.

Rename fields "component" and "storage" in Group<T,Y, ... > class

        public T[] component = new T[EngineSettings.MinComponents];
        public Y[] component2 = new Y[EngineSettings.MinComponents];
        public U[] component3 = new U[EngineSettings.MinComponents];
        Storage<T> storage = Storage<T>.Instance;
        Storage<Y> storage2 = Storage<Y>.Instance;
        Storage<U> storage3 = Storage<U>.Instance;

Переименовать component в component1, storage в storage1

        public T[] component1 = new T[EngineSettings.MinComponents];
        public Y[] component2 = new Y[EngineSettings.MinComponents];
        public U[] component3 = new U[EngineSettings.MinComponents];
        Storage<T> storage1 = Storage<T>.Instance;
        Storage<Y> storage2 = Storage<Y>.Instance;
        Storage<U> storage3 = Storage<U>.Instance;

возможно это личное предпочтение, но при написании кода выглядеть будет лучше

This framework vs. the official implementation

Hey there,
I was curious as it looks like a lot of work went into this and it really shows, why might someone consider using a framework like this over the official Unity ECS implementation with Burst capability? I had not really thought about it before, is it at all possible for systems other than the official ECS to take advantage of Burst? Is someone able to take advantage of things like multiple separate worlds, Unity's newer physics, the new incarnation of scene serialization and streaming, etc?

Thanks!
-MH

Апдейт Readme

Думаю было бы неплохо добавить часть, где объясняется использование компонентов, и что они вообще такое, а так же фабрик на каком-нибудь примере (тот же FactoryPlayer)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.