Comments (9)
It is also possible to add the source code directly to the project, but it makes package versioning difficult. Shouldn't these features be true by default? Alternatively, if there is a distribution method that supports the Unity Package Manager, we can support #define, but are there any plans to support UPM?
from arch.
I attempted to port Arch for the Unity Package Manager, but found it difficult: the main body of Arch is written in code that requires C#10 or higher, but must be downgraded to C#9 if it is to be Unity compatible. This makes simple porting nearly impossible, as the default constructor for struct is no longer available. (The latest Unity has a higher version of Roslyn, so C#10 or later can be used with the compiler options. However, this is not the official recommendation and some features are not available due to runtime limitations).
from arch.
Hey there! :)
Have you looked at : https://github.com/genaray/Arch/wiki/Integration-Guides#unity
Theres an Project that uses Arch via dll. Theres also a Buildscript in /Scripts to build the different Variants as dlls. Somewhere was a pr Back then or a discussion which explained Its usage.
Besides that Arch is "Performance First". Thus the Flags stay deactivated by Default. A own fork could Help Here, or building the fitting dlls manually or via the Script :)
from arch.
Thank you for your reply!
Of course, I understand that Arch prioritizes performance. Performance is very important!
However, Arch depends on several packages such as System.CompilerServices.Unsafe and Arch.LowLevel. Of course, it is possible to download the dlls from all of these and add them to the Plugins folder, but it is very cumbersome. I also don't think Arch should encourage forking to use this. Events are almost a must-have feature.
When using these packages in Unity, your best bet is to use Nuget For Unity to resolve dependencies. (In fact, prominent libraries such as R3 and ZLogger have adopted this method of distributing Unity, and MessagePack-CSharp is also moving to this method.)
Is it possible to use another method instead of preprocessor?
from arch.
Thank you for your reply! Of course, I understand that Arch prioritizes performance. Performance is very important!
However, Arch depends on several packages such as System.CompilerServices.Unsafe and Arch.LowLevel. Of course, it is possible to download the dlls from all of these and add them to the Plugins folder, but it is very cumbersome. I also don't think Arch should encourage forking to use this. Events are almost a must-have feature.
When using these packages in Unity, your best bet is to use Nuget For Unity to resolve dependencies. (In fact, prominent libraries such as R3 and ZLogger have adopted this method of distributing Unity, and MessagePack-CSharp is also moving to this method.) Is it possible to use another method instead of preprocessor?
How would Arch have to be prepared for UnityNugget? Is there anything to consider?
from arch.
NugetForUnity is a Nuget client for the Unity editor and works by placing the dll under Assets/Packages. Therefore, there is no need to do anything on the Arch side, but the preprocessor is not available due to its specification.
My suggestion would be to enable the event feature by default, but I agree that there are performance concerns. But honestly it seems to me that there is no other solution as far as going through the dll.
from arch.
I would like to put my 2 cents into this conversation (please correct me where I'm completely wrong) :)
What the point of EVENTS
logic inside of World
class? Implementation of callbacks?
From Wiki:
Events are awesome, you can easily and efficiently hack into the API and execute logic when an entity is created, destroyed or modified. Arch supports this, but since not everyone wants this (because it affects efficiency somewhat), it is hidden behind a preprocessor flag. You can enable events with the "#define EVENTS" flag and an Arch fork.
For me it seems that this area should be redesigned.
What problems does `World' solve?
From Readme:
The world acts as a management class for all its entities, it contains methods to create, destroy and query them and handles all the internal mechanics.
Should the world really have that many concerns? Maybe World
should only act as a container/hub/collection of entities, and we should delegate the rest of our concerns to other systems?
For example, Command Buffer (and the Command pattern in general) can have full control over entity management (as Bevy does, for example), and World can gain these capabilities through `extension methods'.
So what about EVENTS
, should they be inside the world directly? Maybe it should be a separate package that extends the world and allows the user to create their own, pretty callbacks?
Personally, I would like to get such EVENTS
, which allowed me to execute systems based on EVENT
execution (because who told that systems should always run continuously?).
For me its sounds like that Arch should become framework and ECS part should be Arch.ECS module XD
I understand, that is a gigantic work, but what if? :D
from arch.
#201 Could come in handy here.
I don't think that events can be added by simple extension methods. You would have to hack into Arch itself to generate events from the method calls ^^
from arch.
#201 Could come in handy here. I don't think that events can be added by simple extension methods. You would have to hack into Arch itself to generate events from the method calls ^^
Yea, by events I meant something like in this direction.
from arch.
Related Issues (20)
- Mark classes as sealed
- BitSet can cause exceptions on certain platforms HOT 1
- EVENTS and PURE_ECS together is unsupported
- World should have an IsAlive for EntityReference HOT 1
- Component Lifecycle Query Filters
- Component adding/removing events are inconsistent HOT 1
- Broken example on wiki page Query techniques (Custom enumeration)
- Bug in JobScheduler makes Arch not close all job threads. HOT 2
- Is it normal for coimponents not being removed on the entities? HOT 2
- Event handling via generics instead of conditional compilation HOT 3
- Command Buffer without world in constructor HOT 2
- chunk.Has<T>() is possibly broken HOT 2
- Remove auto reset from Command Buffer `PlayBack()` method HOT 5
- Disable entity? HOT 1
- IndexOutOfRangeException in SparseJaggedArray HOT 5
- Faster version "World.Get<T>(Entity entity)" HOT 3
- Adding components within inline query affects references to current components HOT 2
- Emotes keep playing when falling / teleporting
- Arch and Blazor webassembly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arch.