sschmid / Entitas

Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
MIT License
7.09k stars 1.11k forks source link

Visual Coding - Node-based scripting #160

Closed sschmid closed 6 years ago

sschmid commented 8 years ago

Moving the chat discussion to this issue

sschmid commented 8 years ago

@behealed Hey thanks for the reply. I don't want to start a debate over which ECS system is better, but seeing how both of these ECS systems are open source now, is there anything that Entitas does better than uframe ECS? Also I'm curious, since both are open source, if Entitas is more powerful on the code end, would it be wrong or illegal or unethical or whatever to simply take the graphic node system from uframe and copy it to Entitas?

sschmid commented 8 years ago

@cloudjubei Sept. 11 20:33 @behealed about your suggestion of node-based scripting - I've spoken to @sschmid about it a month ago and after Simon has enough time to work on the current issues it might be something to look into. I think it's a very useful feature to have, but I don't expect people that like to code to use it too much - which is our target Entitas audience atm The reason why you should be using Entitas over other ECS frameworks is that it's really battle tested - we are currently using it at Wooga to make real games and we talk about it all the time to try and improve it. We've seen it improve the way we code in many ways so it's not just a framework but also a methodology, a way of thinking and coding. I believe that Entitas makes us better and cleaner coders - so if you have no preconceptions - I would really advise you with all my heart to try it out for yourself and ask if there's something you don't get - we're always happy to help new people out

sschmid commented 8 years ago

@behealed Sept. 11 21:08 @cloudjubei I like to code too. And I used to think that nodes were kind of useless. Then I tried shader forge, and I changed my mind to "most nodes are useless". That's because shader forge actually renders a little image into each node, and the image (often) illustrates the result of whatever math that node output, including all the math that led up to that node. You can be the greatest shader coder ever, but seeing those little renders happening on every node is a world of information... sometimes. Anyway, so now I'm a believer in nodes, but only if the nodes display something that would otherwise be hard to see when coding.

sschmid commented 8 years ago

@behealed Sept. 11 21:15 Of course none of that applies too good to a ECS system... but the idea is the same, the nodes should either display something useful that I can't see very easily while coding, or else the nodes are indeed pretty useless, except maybe they would help a child who wants to see big pictures in their story book lol.

sschmid commented 8 years ago

@cloudjubei Sept. 11 22:46 @behealed I understand fully - I was blown away by Shader Forge too only problem with it is that it's quite inneficient - we had to rewrite all shader forge shaders as they were super unoptimised for mobile. So yes - for your Technical Artist doing them in SF it was great... but for the guy who was later on 'translating' SF shaders to normal+fast shaders it wasn't It's very similar with Entitas actually, this example, because if you really do do it right - it will be very efficient But as I said also - I think the future does lie in GUI or graphical based programming - so I guess we will have to look into it sooner rather than later

sschmid commented 8 years ago

The thing that pops to my mind immediately when thinking about this is refactoring. So far I didn't have any good experience with node-based systems. I remember mecanim animation controllers quickly growing very big and "refactoring" was a mess; so much clicking... But maybe we can do it better ;)

How exactly do you guys envision this to work?

Also, since this will rely on code generation, this should be definitely tackled after the roslyn code generator is finished.

echeg commented 8 years ago

The only node-base system that I liked it Behavior Designer Its main advantage is that you can visually understand what's going on with the selected object. And also a big + that all logic serialized to ScriptableObjects.

But graphical programming systems possess two critical drawbacks. The first is impossible to understand what was done by the commit. The second is the inability to merge. And almost all of these systems have a drop in performance.

alimoeeny commented 8 years ago

May I suggest, very humbly, that

behealed commented 8 years ago

Unity's Object / Component / Inspector model would be a potentially good model to build it on top of.

In this model,

1) "The nodes" would be nothing more than empty GameObjects deriving from UnityEngine.Object 2) "The scripts" would be nothing more than c# files, and could be attached to the nodes similar to the way UnityEngine.Components are attached to GameObjects. 3) The "Node Graph" would be nothing more than a custom Unity Inspector Editor. 4) The "Code Generator" would be... obsoleted I think. If you use Unity's design model, you won't need a code generator because Unity has a code generator built in?

The advantages of using this design model: 1) It's already built into unity, so it is standard. 2) Less likely to break every time Unity is upgraded. 3) Can just write scripts to create new nodes, with no need to constantly rework the inspector to be able to display them correctly. 4) Users can create their own nodes just as easily as right clicking the nodes folder in the project view, and selecting "new c# file".

We can call this the UOCI (unity object, component, inspector) design model. :)

Plz note that I pulled all this ideas out of my behind just 5 seconds ago and I don't really know anything about Entitas, or anything about anything, so don't listen to me :/

cloudjubei commented 8 years ago

One thing to remember is that - Entitas on its own can be used without Unity - i.e. you should be able to build .NET apps on top of it - therefore we CANNOT tie ourselves too much to Unity.

alimoeeny commented 8 years ago

+1 to @cloudjubei and being able to run tests on a CI server/service is a huge plus.

mgmhunt commented 8 years ago

"Also I'm curious, since both are open source, if Entitas is more powerful on the code end, would it be wrong or illegal or unethical or whatever to simply take the graphic node system from uframe and copy it to Entitas? " - micah the founder/creator of uFrame has actively encouraged this (he's wiped the reference but it's here https://github.com/micahosborne/uFrame/commit/7fa1e2e1464ab60a4a90dd1c4ec340544331e809 "Here's some idea of what it would be really cool to see the community come up with that we have never really shared....Other frameworks such as strangeIOC, Entitas... etc".

uFrame Architect could be the visual node editor/generator which then generates Entitas. It's a matter of creating the nodes that generate the classes. Also uFrame Architect was visualised as Unity independent plugin (say for Visual Studio too etc). ie uFrame Architect generates ECS code and MVVM code and could possibly generate any other code framework.

KumoKairo commented 7 years ago

@mgmhunt have you tried using uFrame Architect? I couldn't make it work on Unity 5.5, not even that fancy package manager

mgmhunt commented 7 years ago

@KumoKairo not with Entitas. But I'm running 5.5 with uFrame from https://github.com/uFrame/ALLINONE/tree/dev . Few niggles with generation but check out https://trello.com/b/j4iGjQPb/uframe-opensource for current status, particularly user fuutou who seems to have fully understood Architect and is helping revive the project (original author micah has moved on, or taken a side line at least)

VladislavKostin commented 7 years ago

I would definitely use uFrame version of Entitas. @mgmhunt I saw you on uFrame Trello, are you using uFrame for your work, can you tell me how well does it perform, and is it reliable enough?

mgmhunt commented 7 years ago

@VladislavKostin No not at the moment, I'm a hobbyist. fuutou is the person to ask on the Trello board, see above. And I'm not sure the uFrame can be used to generate Entitas, but it was originally developed to be 'architecture neutral', currently it can generate MVVM and ECS code, and should/might be able to generate any modules... would require creating new nodes for the Architect. Note uFrame Architect is the code agnostic generator & uFrame ECS/MVVM are two architectures that it can currently generate (plugins). Anyway try fuutou, s/he seemed to get it (not sure commercial use). There was one major project that used it and eventually gave up on it as the project got bigger, but they were using an older/much slower version of uFrame. I think Visual code probably best for designers and prototyping.... ongoing debate...

sschmid commented 6 years ago

Move conversation to #475