-
Notifications
You must be signed in to change notification settings - Fork 241
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
Blueprint nodes generation at runtime #33
Comments
The first prototype implemented. Current challenges:
|
Seems like it's possible to generate blueprint nodes dynamically at runtime. The current challenge at this point is the invocation of user functions with variable-length parameters. In terms of performance, the invocation of functions with predefined fixed-length parameters are 195% faster than the closest equivalent for variable-length parameters: BenchmarkDotNet=v0.12.1, OS=Windows 10.0.19041.508
AMD Ryzen 5 1400, 1 CPU, 8 logical and 4 physical cores
.NET Core SDK=5.0.100-rc.1.20452.10
[Host] : .NET Core 5.0.0 (CoreCLR 5.0.20.45114, CoreFX 5.0.20.45114), X64 RyuJIT
All delegates for user functions should be stored as This approach has a significant impact on performance, unlike the code generation where all functions with parameters can be predefined at compilation time. A performant solution might be a custom blittable representation of function parameters using a single predefined function for the invocation from blueprints, but that means intermediate conversion to appropriate data types in the user function itself. This approach is counterproductive. |
Related to dotnet/csharplang#3718 |
Blocked by dotnet/runtime#42275 |
Looking forward to this feature. Is it in the main branch or is it pending the initial stable release? |
This feature is on hold at the moment, but I think I can ship it partially in the following weeks with certain limitations. The main problem is that .NET 5 lacks functionality to implement this feature the right way. |
Happy to wait if .NET 5 is the blocker here (does 6 help?) but equally very happy to kick the tyres of your implementation. |
Unfortunately, as long as this issue remains unresolved, it wouldn't help. |
As of July 12, 2021, it seems they moved the feature to the Future roadmap, which basically means "anytime between tomorrow and the next big bang, if we're still alive" although I agree with the feature, MS is MS... I think it would be a good time to think on alternatives. I'll check what I can come up with. |
Since the API has been approved, I think a PR from community will definitely push the process of implementing dotnet/runtime#42275 |
What about use Source Generator instead runtime to improve performance? |
@danielmeza Blueprint function libraries compiled from C++ can't be hot reloaded. You have to restart the editor to reflect changes of nodes. |
@nxrighthere so, every code made with a Source Generator, will need an editor restart to see it on the editor? I´m talking about this |
C++ can be hot reloaded into UE4 without an editor restart however it does a temporary patch of the DLLs meaning at times an editor restart is needed. Saying that USharp was able to implement hot reloading of blueprint nodes from C#. |
I'm talking about the cases where static blueprint callable functions are used. Once they are loaded into memory, the engine locks the entire module from hot reloading.
It's based on a very different approach, such as a mix of runtime pointer manipulations and code generation. |
It seems that issue is gaining some traction now (yay!) so hopefully once it's done it will help to fix this important one. They're having an ongoing discussion now and are asking for feedback. The more we can help, the better! :) |
A robust and flexible system should be implemented to generate blueprint nodes and data types weaved with managed code that exposes functionality to the engine.
The text was updated successfully, but these errors were encountered: