-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blueprints ;( #390
Comments
For those who is working solo or have configs in editor - use scripatble objects and create extenstion methods with scriptable object as parameter, this way you can create entities with custom logic and special cases based on this configuration. It's more extensible nd you don't miss required component, also changing components will not affect your configuration! ;) |
I'm personally so used to prefabs and being able to reference any assets and components directly in a prefab, that it's hard for me to imagine a better workflow (than prefabs). And I think the majority of Unity developers are using that workflow. Currently, it means that in Entitas I need to create scriptable objects for each type of object, and then a method that would read it and configure the object, and it is simple but it could be automated/generated. public static GameEntity CreateSpaceship(this GameContext context, Vector3 position, SpaceshipData data)
{
var entity = context.CreateEntity();
entity.AddSpeed(data.playerSpeed);
entity.AddHealth(data.playerHealth);
if (data.isSomething)
entity.isSomething = true;
//etc, etc.
return entity;
} So this approach is better for me than current blueprints, but ideally it would be automated and be like that: public static GameEntity CreateSpaceship(this GameContext context, Vector3 position, SpaceshipBlueprint blueprint)
{
var entity = blueprint.CreateEntity();
entity.ReplacePosition(position);
return entity;
} |
Glad i never used them now :) |
I keep the Blueprint sources and will only exclude Blueprints from the zip files. So if you really want to use it / improve it / play with it / you can by forking Entitas |
Tangentially related - I have implemented ICodeGenerator in order to generate some ScriptableObject-based replacements for Blueprints, but I haven't been able to get Entitas to find my generator. It doesn't appear in the Code Generators dropdown of the preferenecs window (in Unity), and if I add the full type name of the generator to the generators line in the Entitas.preferences text file, it is still not used. Any tips would be much appreciated - thanks! |
I assume you created a new class and implemented Make sure you specify this dll in the Entitas.properties file under the key Now the code generator will find your custom Hope that helps |
Thanks a lot for the detailed reply, I'll give that a try tomorrow. If any further tweaks are necessary I'll be sure to share. |
That actually sounds great, but as someone new to Entitas I have no idea how to even start creating such a configuration setup without some kind of learning material on the subject. 😞 I think a real lack of good, up-to-date learning material and detailed full featured examples is the biggest weakness of Entitas at the moment and the biggest thing preventing more people from using it. For me the most appealing aspect of blueprints was their intuitive Unity like nature. This was especially helpful for a lone Unity only indie developer like myself. I also think this intuitive designer friendly aspect is the key if you ever want widespread adoption of Entitas in the Unity community. Having to learn a completely new workflow from the very start isn't something most lone developers are gonna be really excited to do. At least not the creative / artistic focused kind. However, I understand all of this requires a huge amount of work not directly related to the core development of Entitas. So I can completely understand your need to abandon it for now. I'd love to help develop this aspect of Entitas myself, but I'm beginning to think I'm just not skilled enough to help in that area yet. 😞 |
Hey @IsaiahKelly, I've got something cooking that might be ready to be tested outside of my project soon. I think the logic behind discontinuing the Unity side of Blueprints is totally fair, but I'm in the same boat as you - lone developer, no existing approach to lean on. The solution I'm working on is actually fairly simple. It takes Unity's built-in serialization, Entitas' code generation pipeline, and the Prototype pattern, and mashes them together to make something that's pretty intuitive to use (I'm still working on my first Entitas project, myself) and has so far made injecting Unity assets into Entitas significantly less painful. Up until now, it's lived inside of my game's project but it's probably time I made a separate repository for it - thanks for the impetus! |
Blueprints… ;(
tl;dr;
I will probably stop supporting Blueprints as I don’t have the time to maintain them.
Entitas.Blueprints
will stay, butEntitas.Blueprints.Unity
will probably fade away.Taken from the wiki:
While this sounds great, in my experience games use a more sophisticated approach for configuration. Different teams have different workflows how to provide configuration, e.g. Google Docs, Excel Sheets, Json Cloud Service, etc.
Game Designers, Balancers and other people will work with Tools they feel comfortable with and produce and distribute some kind of configuration (json, binary, etc) which will be used for development but also be sent to game clients already shipped to the player. Requirements are different. Some configurations are fairly simple, some require to be able to apply complex math functions for balancing the economy.
Configuration also changes and needs to be versioned and you might need a migration workflow. I think configuration should not be modified to fit a certain architecture. Blueprints do that as they actually serialize entities. I strongly recommend a custom serialization solution which doesn't depend on the current architecture of the game.
Why do I plan to remove them:
But, it's so convenient
I also saw people not only using Blueprints for configuration but for convenience, e.g. setting up objects like a Spaceship with Health, Speed, Asset, etc. I did this myself :D
My suggestion:
Use c# extension methods for that, e.g.
This is quick and simple to do and also works with data from the config
The text was updated successfully, but these errors were encountered: