Code Monkey home page Code Monkey logo

unrealclr's Introduction

nxrighthere's github stats

Top Langs

unrealclr's People

Contributors

nxrighthere avatar olsondev avatar prokopst avatar qwe321 avatar realvictorprm avatar shalokshalom avatar tanner555 avatar tonetechnician 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  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

unrealclr's Issues

Crash on macOS Catalina 10.15.7

I tried to run the Install script on a new project. When I try to play the Unreal editor crash with the following stack trace:


__pthread_kill Address = 0x7fff68b2733a (filename not found) [in libsystem_kernel.dylib]
abort Address = 0x7fff68aae808 (filename not found) [in libsystem_c.dylib]
PROCAbort Address = 0x292d3795e (filename not found) [in libcoreclr.dylib]
PROCEndProcess(void*, unsigned int, int) Address = 0x29290af07 (filename not found) [in libcoreclr.dylib]
UnwindManagedExceptionPass1(PAL_SEHException&, _CONTEXT*) (.cold.4) Address = 0x292d3a4cc (filename not found) [in libcoreclr.dylib]
UnwindManagedExceptionPass1(PAL_SEHException&, _CONTEXT*) Address = 0x292b5a1de (filename not found) [in libcoreclr.dylib]
DispatchManagedException(PAL_SEHException&, bool) Address = 0x292b5a266 (filename not found) [in libcoreclr.dylib]
HandleHardwareException(PAL_SEHException*) Address = 0x292b53619 (filename not found) [in libcoreclr.dylib]
SEHProcessException(PAL_SEHException*) Address = 0x2928d43c1 (filename not found) [in libcoreclr.dylib]
PAL_DispatchException Address = 0x292910800 (filename not found) [in libcoreclr.dylib]
PAL_DispatchExceptionWrapper Address = 0x292910477 (filename not found) [in libcoreclr.dylib]
Unknown() Address = 0x2946f5552 (filename not found) [in ???]
Unknown() Address = 0x2947c04af (filename not found) [in ???]
Unknown() Address = 0x2941ee0bf (filename not found) [in ???]
Unknown() Address = 0x2941dbf17 (filename not found) [in ???]
UnrealCLR::PrePhysicsTickFunction::ExecuteTick(float, ELevelTick, ENamedThreads::Type, TRefCountPtr<FGraphEvent> const&) Address = 0x28ea3eacd [/Users/n23130/Documents/Unreal Projects/CLRsjekk/Plugins/UnrealCLR/Source/UnrealCLR/Private/UnrealCLR.cpp, line 1415] [in UE4Editor-UnrealCLR.dylib]
FTickFunctionTask::DoTask(ENamedThreads::Type, TRefCountPtr<FGraphEvent> const&) Address = 0x10fff7ffb (filename not found) [in UE4Editor-Engine.dylib]
TGraphTask<FTickFunctionTask>::ExecuteTask(TArray<FBaseGraphTask*, TSizedDefaultAllocator<32> >&, ENamedThreads::Type) Address = 0x10fff7815 (filename not found) [in UE4Editor-Engine.dylib]
FNamedTaskThread::ProcessTasksNamedThread(int, bool) Address = 0x10c9a5e86 (filename not found) [in UE4Editor-Core.dylib]
FNamedTaskThread::ProcessTasksUntilQuit(int) Address = 0x10c9a44a0 (filename not found) [in UE4Editor-Core.dylib]
FTaskGraphImplementation::WaitUntilTasksComplete(TArray<TRefCountPtr<FGraphEvent>, TInlineAllocator<4u, TSizedDefaultAllocator<32> > > const&, ENamedThreads::Type) Address = 0x10c9a178d (filename not found) [in UE4Editor-Core.dylib]
FTickTaskSequencer::ReleaseTickGroup(ETickingGroup, bool) Address = 0x10fff00ee (filename not found) [in UE4Editor-Engine.dylib]
FTickTaskManager::RunTickGroup(ETickingGroup, bool) Address = 0x10ffe9bea (filename not found) [in UE4Editor-Engine.dylib]
UWorld::Tick(ELevelTick, float) Address = 0x10f45254b (filename not found) [in UE4Editor-Engine.dylib]
UEditorEngine::Tick(float, bool) Address = 0x117fce290 (filename not found) [in UE4Editor-UnrealEd.dylib]
UUnrealEdEngine::Tick(float, bool) Address = 0x118ba0908 (filename not found) [in UE4Editor-UnrealEd.dylib]
FEngineLoop::Tick() Address = 0x10c614ebb (filename not found) [in UE4Editor]
GuardedMain(char16_t const*) Address = 0x10c62372f (filename not found) [in UE4Editor]
-[UE4AppDelegate runGameThread:] Address = 0x10c64158f (filename not found) [in UE4Editor]
-[FCocoaGameThread main] Address = 0x10cbbe2e1 (filename not found) [in UE4Editor-Core.dylib]
Unknown() Address = 0x7fff310087b2 (filename not found) [in Foundation]
_pthread_start Address = 0x7fff68be4109 (filename not found) [in libsystem_pthread.dylib]
thread_start Address = 0x7fff68bdfb8b (filename not found) [in libsystem_pthread.dylib]```

Segfault on Linux when unloading module during cook phase

I'm consistently getting a segfault ("Signal 11" in UE4 logs) when trying to package a project for Linux.

My environment is:

  • Gentoo Linux, kernel 5.16.1
  • Unreal Engine 4.27.2 (compiled locally)
  • UnrealCLR 1.31
  • .NET 6.0 (Gentoo package dev-dotnet/dotnetcore-sdk-bin-6.0.101::dotnet)

I can reproduce by:

  • Create a UE4 project (any template, C++ or blueprint, seems to have the issue)
  • Install UnrealCLR via the install script (dotnet run --project-path /path/to/my/project)
  • At this point, the UE4 editor won't open the project because it needs to rebuild the UnrealCLR module; I do this with /path/to/UnrealEngine/Engine/Binaries/ThirdParty/Mono/Linux/bin/mono /path/to/UnrealEngine/Engine/Binaries/DotNET/UnrealBuildTool.exe Development Linux -Project=/path/to/UnrealTest.uproject -TargetType=Editor -Progress
  • Open the project
  • Package for Linux (via File -> Package Project -> Linux -> Linux)

The packaging process fails during the cook phase. The editor's output log just mentions "Signal 11" and redirects me to a Log.txt file, which in turn redirects me to a Cook-<timestamp>.txt file, which says:


LogModuleManager: Shutting down and abandoning module UnrealCLR (274)
LogCore: === Critical error: ===
Unhandled Exception: SIGSEGV: invalid attempt to read memory at address 0x0000000000000008

LogCore: Fatal error!

0x00007f5a242d07a0 libc.so.6!UnknownFunction(0x3d7a0)
0x00007f5951cc4100 libUE4Editor-UnrealCLR.so!UnrealCLR::Module::ShutdownModule() [/home/captaincrutches/Projects/UnrealTest/Plugins/UnrealCLR/Source/UnrealCLR/Private/UnrealCLR.cpp:1372]
0x00007f5a2d577258 libUE4Editor-Core.so!FModuleManager::UnloadModule(FName, bool) [/home/captaincrutches/Downloads/UnrealEngine/Engine/Source/Runtime/Core/Private/Modules/ModuleManager.cpp:601]
0x00007f5a2d577eae libUE4Editor-Core.so!FModuleManager::UnloadModulesAtShutdown() [/home/captaincrutches/Downloads/UnrealEngine/Engine/Source/Runtime/Core/Private/Modules/ModuleManager.cpp:731]
0x0000000000246948 UE4Editor!FEngineLoop::Exit() [/home/captaincrutches/Downloads/UnrealEngine/Engine/Source/Runtime/Launch/Private/LaunchEngineLoop.cpp:4294]
0x0000000000246f70 UE4Editor!GuardedMain(char16_t const*) [/home/captaincrutches/Downloads/UnrealEngine/Engine/Source/Runtime/Launch/Private/Launch.cpp:193]
0x00007f5a2456f056 libUE4Editor-UnixCommonStartup.so!CommonUnixMain(int, char**, int (*)(char16_t const*), void (*)()) [/home/captaincrutches/Downloads/UnrealEngine/Engine/Source/Runtime/Unix/UnixCommonStartup/Private/UnixCommonStartup.cpp:264]
0x00007f5a242bc2fa libc.so.6!UnknownFunction(0x292f9)
0x00007f5a242bc3a8 libc.so.6!__libc_start_main(+0x77)
0x00000000002304d9 UE4Editor!_start()

Here's the entire files, in case there's something else significant in there:
Cook-2022.01.23-01.27.18.txt
Log.txt

I'm brand new to this plugin and even UE4 itself, so it's entirely possible this is environmental or just me doing something wrong with installation, in which case please do point out my mistake. And of course, let me know if there's any other logs/info that would help, or if I should make any local code changes to see if they help.

Install.cs does not seem to work.

Hi nxrighthere.
I stumbled onto UnrealCLR late last night, downloaded, tried the auto-install and it failed with message:
Compilation of the runtime was finished with an error!
I then followed the manual install procedure and eventually got everything loaded and running. Awesome!
Today, I saw there was an update about 10 hours ago.
It also appeared that the Install.cs got some change.
Alas, Install.cs did not work (same error message) and I cannot remember how I got it to compile and install manually.
I've tried for about 2 hours today. Can anyone help?
Thanks

InputComponent.BindAction() InputEvent.Repeat delayed

The following results in the debug message being displayed as soon as the key is pressed:

public static class ObjectOrientedDesign
{
    private static Player _player;
    public static void OnBeginPlay()
    {
        Debug.AddOnScreenMessage(-1, 3.0f, Color.LightGreen, MethodBase.GetCurrentMethod().DeclaringType + " system started!");

        Engine.AddActionMapping("TestInput", Keys.W);
        _player = new Player(nameof(Player));
    }

    public static void OnEndPlay() => Debug.ClearOnScreenMessages();
}

public class Player : Actor
{
    public Player(string name = null) : base(name)
    {
        Debug.AddOnScreenMessage(-1, 3.0f, Color.Orange, name);
        SetEnableInput(World.GetFirstPlayerController(), true);
        InputComponent.BindAction("TestInput", InputEvent.Pressed, TestInput);
    }

    public static void TestInput() => Debug.AddOnScreenMessage(-1, 0.1f, Color.Aqua, $"Input {World.RealTime}");
}

Changing InputEvent type to Repeat results in a noticeable delay of around 1-1.5 secs

public Player(string name = null) : base(name)
{
    Debug.AddOnScreenMessage(-1, 3.0f, Color.Orange, name);
    SetEnableInput(World.GetFirstPlayerController(), true);
    InputComponent.BindAction("TestInput", InputEvent.Repeat, TestInput);
}

Should the input system be taking this long to trigger the event?

Unreal Engine 5 module compilation error

From log:

[4/7] Compile Module.UnrealCLR.cpp
C:\Users\jerma\Documents\Projects\spruce_eel\Plugins\UnrealCLR\Source\UnrealCLR\Private\UnrealCLRFramework.cpp(407): error C2338: Invalid elements count of the [ControllerHand] enumeration
C:\Users\jerma\Documents\Projects\spruce_eel\Plugins\UnrealCLR\Source\UnrealCLR\Private\UnrealCLRFramework.cpp(410): error C2338: Invalid elements count of the [PixelFormat] enumeration
C:\Users\jerma\Documents\Projects\spruce_eel\Plugins\UnrealCLR\Source\UnrealCLR\Private\UnrealCLRFramework.cpp(412): error C2338: Invalid size of the [Bounds] structure
C:\Users\jerma\Documents\Projects\spruce_eel\Plugins\UnrealCLR\Source\UnrealCLR\Private\UnrealCLRFramework.cpp(503): warning C4996: 'UObjectBaseUtility::IsPendingKill': IsPendingKill() should no longer be used. Use IsValid(Object), IsValidChecked(Object) or GetValid(Object) instead. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
C:\Users\jerma\Documents\Projects\spruce_eel\Plugins\UnrealCLR\Source\UnrealCLR\Private\UnrealCLRFramework.cpp(985): warning C4996: 'UEngine::IsSplitScreen': IsSplitScreen was only ever checking if there are more than one local player. Use HasMultipleLocalPlayers instead. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
LogInit: Warning: Still incompatible or missing module: UnrealCLR
LogCore: Engine exit requested (reason: EngineExit() was called)
LogExit: Preparing to exit.

Seems like it's still incompatible with UE5?

`UDataAsset` support

Hey, I just wanted to ask if there was a way eventually to allow creation of Data Asset types in C# and use them like normal C++ classes.

It would make my life so much easier, but I understand if it's either hard to implement, or not possible.

Thanks

Unreal Engine 5 Preview 1 support

Hey there!

I've been trying to port a project that relies on UnrealCLR to UE5 Preview 1. I've found a strange compilation issue to occur

D:\Unreal Projects\Project\Plugins\UnrealCLR\Source\UnrealCLR\Private\UnrealCLRFramework.cpp(407): error C2338: Invalid elements count of the [ControllerHand] enumeration
1>D:\Unreal Projects\Project\Plugins\UnrealCLR\Source\UnrealCLR\Private\UnrealCLRFramework.cpp(410): error C2338: Invalid elements count of the [PixelFormat] enumeration
1>D:\Unreal Projects\Project\Plugins\UnrealCLR\Source\UnrealCLR\Private\UnrealCLRFramework.cpp(412): error C2338: Invalid size of the [Bounds] structure

Checking these structs I don't see that there is an issue with the static_assert but it still seems to fail.

In a clean project I can simply comment these lines and the issue goes away and I can compile. But in my current more complex project, when I comment the lines, I run into 100+ compilation errors.

1>D:\Unreal Projects\Project\Plugins\UnrealCLR\Source\UnrealCLR\Public\UnrealCLRFramework.h(35): error C2653: 'ESplineCoordinateSpace': is not a class or namespace name
1>D:\Unreal Projects\Project\Plugins\UnrealCLR\Source\UnrealCLR\Public\UnrealCLRFramework.h(35): error C2061: syntax error: identifier 'Type'
1>D:\Unreal Projects\Project\Plugins\UnrealCLR\Source\UnrealCLR\Public\UnrealCLRFramework.h(36): error C2653: 'ESplinePointType': is not a class or namespace name
1>D:\Unreal Projects\Project\Plugins\UnrealCLR\Source\UnrealCLR\Public\UnrealCLRFramework.h(36): error C2061: syntax error: identifier 'Type'
1>D:\Unreal Projects\Project\Plugins\UnrealCLR\Source\UnrealCLR\Public\UnrealCLRFramework.h(39): error C2061: syntax error: identifier 'EAudioFaderCurve'
1>D:\Unreal Projects\Project\Plugins\UnrealCLR\Source\UnrealCLR\Public\UnrealCLRFramework.h(41): error C2061: syntax error: identifier 'EViewTargetBlendFunction'
1>D:\Unreal Projects\Project\Plugins\UnrealCLR\Source\UnrealCLR\Public\UnrealCLRFramework.h(45): error C2061: syntax error: identifier 'EHorizTextAligment'
1>D:\Unreal Projects\Project\Plugins\UnrealCLR\Source\UnrealCLR\Public\UnrealCLRFramework.h(50): error C2061: syntax error: identifier 'EVerticalTextAligment'
1>D:\Unreal Projects\Project\Plugins\UnrealCLR\Source\UnrealCLR\Public\UnrealCLRFramework.h(51): error C2061: syntax error: identifier 'EPlaneConstraintAxisSetting'
1>D:\Unreal Projects\Project\Plugins\UnrealCLR\Source\UnrealCLR\Public\UnrealCLRFramework.h(487): error C2143: syntax error: missing ';' before '*'

It seems like it could be an issue with UE5 Preview UHT/UBT as the errors don't really make sense - UE5 Early Access there is no issue. Wondering if anyone else has experienced this, or if there may be a quick fix for now?

Many thanks!

How should I be using the Actor.InputComponent?

I have just been playing with the samples and I'm getting null ref exception when I call InputComponent.BindAction()

public static class ObjectOrientedDesign
{
    private static Player _player;
    public static void OnBeginPlay()
    {
        Debug.AddOnScreenMessage(-1, 3.0f, Color.LightGreen, MethodBase.GetCurrentMethod().DeclaringType + " system started!");

        Engine.AddActionMapping("TestInput", Keys.W);
        _player = new Player(nameof(Player));
    }
}

public class Player : Actor
{
    public Player(string name = null) : base(name) => InputComponent.BindAction("TestInput", InputEvent.Repeat, InputTest);
    public void InputTest() => Debug.AddOnScreenMessage(-1, 0.1f, Color.Aqua, $"Input {World.RealTime}");
}

Is this not the correct usage?

SplineComponent API

Hi. Hope you are doing well. Do you have any plans to expose spline components and controllers? Thank you.

Crash on Linux Pop!_OS 20.10

Hey there,
I wanted to give this a whirl on Linux, so I cloned the UnrealEngine repo, built the engine, everything was good there. Did a fresh clone of UnrealCLR, went through the process, set the project directory, that went well. Fired up UE and the project, it asked to build the plugin and that seemed to go as it should.

dotnet run

Plugin Build

LogPluginManager: Mounting plugin UnrealCLR
LogInit: Warning: Incompatible or missing module: UnrealCLR
Invalidating makefile for UE4Editor (Definitions.UnrealCLR.h deleted)
[1/4] Compile Module.UnrealCLR.cpp
[2/4] Compile Module.UnrealCLR.gen.cpp
[3/4] Link (lld) libUE4Editor-UnrealCLR.so
LogUnrealCLR: Display: StartupModule: Host path set to "/mnt/x/_unreal/Projects/dotnet_project/Plugins/UnrealCLR/Runtime/Linux/host/fxr/5.0.3/libhostfxr.so"
LogUnrealCLR: Display: StartupModule: Host library loaded successfuly!
LogUnrealCLR: Display: StartupModule: Host functions loaded successfuly!
LogUnrealCLR: Display: StartupModule: Host runtime assembly loaded succesfuly!
LogUnrealCLR: Display: StartupModule: Host runtime assembly initialized succesfuly!
LogUnrealCLR: Display: StartupModule: Host loaded succesfuly!

I then went and loaded the Tests map and went to hit Play to see if it was going to work, as I had seen at this section of Mikes video here: (https://youtu.be/t8nP0IEWLZU?t=299)

Unfortunately, as soon as I hit play and it began to load, I was greeted with a crash popup that contained the following error.

Segmentation fault
Caught signal 11 Segmentation fault

libpthread.so.0!UnknownFunction(0x14bb0)
libUE4Editor-UnrealCLR.so!UnrealCLRFramework::SceneComponent::GetComponentTransform(USceneComponent*, FTransform*) [/mnt/x/_unreal/Projects/dotnet_project/Plugins/UnrealCLR/Source/UnrealCLR/Private/UnrealCLRFramework.cpp:2462]
Unknown!UnknownFunction()

I have recreated the steps I took to achieve the error, just in case I missed something, or if something is different on Linux?

Crash clip

https://i.imgur.com/cRCxeng.gif

System Details
OS: Pop!_OS 20.10 x86_64 
Host: X570 AORUS ELITE -CF 
Kernel: 5.8.0-7642-generic 
Uptime: 1 day, 23 hours, 57 mins 
Packages: 3038 (dpkg), 23 (flatpak) 
Shell: zsh 5.8 
Resolution: 1920x1080, 2560x1080, 1920x1080 
DE: Unity 
WM: Mutter 
WM Theme: Adwaita 
Theme: Pop-dark [GTK2/3] 
Icons: Adwaita [GTK2/3] 
Terminal: Terminus 
CPU: AMD Ryzen 9 3950X (32) @ 3.500GHz 
GPU: NVIDIA GeForce RTX 2070 
Memory: 23689MiB / 64321MiB 

If any more information is needed, please do let me know.
Thanks,
-MH

Managed assemblies loading only from sub-folders

I have just created a new BP project, installed UnrealCLR, created a .NET Core class library, copied C# entry point code from the manual, added reference to UnrealEngine.Framework, built class library to Managed folder with dotnet build -o %Project%\Managed and then ran in editor.

I'm not getting any of the on screen debug messages which I'm assuming means the entry point isn't working. The class library/framework dll's are in the Managed folder.

Engine.AddActionMapping/AddAxisMapping possible improvements

Is there a limitation on the engine side preventing existing action/axis mappings from being remapped? Should there be Enigine.RemoveActionMapping()/Engine.RemoveAxisMapping()?

If they can exist then Enigine.TryAddActionMapping()/Engine.TryAddAxisMapping() should exist to create or update them, while Add remains only to add and throw an exception if the mapping exists.

Strings encoding for non-English characters

I can read a text file, but a few Chinese characters appear as black squares, or gibberish.

Test Code:
image

Result:
image

Could u add following code to translate before return in your source code?

image

Blueprint Event Dispatchers

Hi๏ผŒI implemented an C# Http client to get data by API. I would like to pass the result to blueprint in UE. I know i could use actor variable, but it's not convenient. So i would like to know can i use blueprint event to dispatch data? Any idea or example will be very appreciated.

Thanks
Have a nice day.

Restore deep profiling capability

With the initial version of the plugin, there was a capability for deep profiling using external .NET applications since all entry points were executing entirely from the managed code, thus with fully traceable call stacks. This feature lost due to extensive optimizations of the hot path through the native code for best performance. With C# 9.0 function pointers, it should be possible to restore this feature without trading performance. It will also allow the elimination of all native-to-managed redirection functions.

Install script fails on unknown target "net5.0"

When trying to install the plugin (from a fresh clone on 1.31) into a new project in UE 4.27.2, it fails to compile the plugin due to an unknown target net5.0.

$ dotnet run --project-path /home/captaincrutches/Projects/UnrealTest/
Welcome to the UnrealCLR installation tool!
Project file found in "/home/captaincrutches/Projects/UnrealTest" folder!

Do you want to compile and install tests? [y/n] y
Installation will delete all previous files of the plugin and content of tests. Do you want to continue? [y/n] y
Removing the previous plugin installation...
Copying native source code and the runtime host of the plugin...
Launching compilation of the managed runtime...
Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored /home/captaincrutches/Projects/UnrealCLR/Source/Managed/Runtime/UnrealEngine.Runtime.csproj (in 112 ms).
/opt/dotnet_core/sdk/6.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(267,5): error NETSDK1005: Assets file '/home/captaincrutches/Projects/UnrealCLR/Source/Managed/Runtime/obj/project.assets.json' doesn't have a target for 'net5.0'. Ensure that restore has run and that you have included 'net5.0' in the TargetFrameworks for your project. [/home/captaincrutches/Projects/UnrealCLR/Source/Managed/Runtime/UnrealEngine.Runtime.csproj]
Compilation of the runtime was finished with an error (Exit code: 1)!

Looks like the install script didn't get updated to use .NET 6 - if I replace net5.0 with net6.0 in Install/Install.cs it works.

Installation fails due to whitespaces in a path to the installation tool

Hi! I am Currently evaluating UnrealCLR and have high hopes for it ๐Ÿ‘

Just wanted to inform that the msbuild process fails with a "Can only contain 1 project" error if there is a space anywhere in the path to either the Unreal project or the UnrealCLR code.

Using Windows 10 (x64) and VS2019 preview

BR
Per

Verify blueprint classes matching with types of managed classes

At the moment, it's up to a programmer to ensure that blueprint classes have the same types as managed classes when blueprints dynamically loaded from managed code. There's no verification logic for this, therefore, loading of incompatible types of classes will lead to an error of the engine. An exception should be thrown instead.

Evaluate early migration to .NET 5

While .NET Core 3 provides straightforward embedding possibilities, the integration requires a lot of work with function pointers to make advanced blueprint nodes with direct data passing and events subscribing. The current workarounds are painful to work with and overcomplicated. Early migration to .NET 5 should be evaluated to solve this through C# 9.0 and new hostfxr functionality. The work on the framework API exposure can be continued mostly without problems.

Animation Blueprints public variables

You are doing great work here. I was wondering if you could help me.
I have some animation blueprints from a C++ project.
Can you tell me how I might update public variables from the framework?
I noticed that this does not throw an error:
Blueprint animBlueprint = Blueprint.Load("Blueprint path");
MeshComponent.SetAnimationBlueprint(animBlueprint);
but I cannot cast the blueprint to an Actor:
Actor actor = new Actor("CAT_BP", animBlueprint);
as IsValidClass(Type) returns false.
The log shows:
Error: UnrealCLR::Module::Exception: System.InvalidOperationException: Operation is not valid due to the current state of the object.
Can you suggest a work-around? Thank you.

Blueprint nodes generation at runtime

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.

An exception occurs when using Assembly.LoadFile() to dynamically load Assembly

I get an error when using the following code
Assembly scriptAssembly = Assembly.LoadFile(scriptAssemblyFullName);
Type[] types = scriptAssembly.GetTypes();

Error message:
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
System.IO.FileNotFoundException: Could not load file or assembly'test_lib'

I have ensured that the test_lib assembly is in the same directory as the assembly I need to load

Everything is normal when loading an Assembly without any dependencies, but if this Assembly depends on other assemblies, the above error will occur when using Assembly.GetTypes()

Managed code is not executing if the level actor doesn't persist in the world

  1. Create Unreal BP project.
  2. Install UnrealCLR.
  3. Create .NET 5.0 RC2 project referencing UnrealCLR framework dll.
  4. Add the following to the project:
using System;
using System.Drawing;
using UnrealEngine.Framework;

namespace Game
{
	public static class Main
	{
		public static void OnWorldBegin() => Debug.AddOnScreenMessage(-1, 10.0f, Color.DeepPink, "Hello, Unreal Engine!");

		public static void OnWorldPostBegin() => Debug.AddOnScreenMessage(-1, 10.0f, Color.DeepPink, "How's it going?");

		public static void OnWorldEnd() => Debug.AddOnScreenMessage(-1, 10.0f, Color.DeepPink, "See you soon, Unreal Engine!");

		public static void OnWorldPrePhysicsTick(float deltaTime) => Debug.AddOnScreenMessage(1, 10.0f, Color.DeepPink, "On pre physics tick invoked!");

		public static void OnWorldDuringPhysicsTick(float deltaTime) => Debug.AddOnScreenMessage(2, 10.0f, Color.DeepPink, "On during physics tick invoked!");

		public static void OnWorldPostPhysicsTick(float deltaTime) => Debug.AddOnScreenMessage(3, 10.0f, Color.DeepPink, "On post physics tick invoked!");

		public static void OnWorldPostUpdateTick(float deltaTime) => Debug.AddOnScreenMessage(4, 10.0f, Color.DeepPink, "On post update tick invoked!");
	}
}
  1. Publish to Unreal project Managed directory.
  2. In Unreal File -> New Level
  3. Play

Expected: Debug messages being displayed on screen.
Actual: Nothing

Haven't worked with the plugin in a while as I've been busy with my day job but this should be working right?

If I empty the Managed folder, publish the Tests and copy the Content folder and load the Tests level, the tests work. So not sure why my simple example doesn't run. Any ideas?

Crash on macOS Big Sur 11.5.2

First of all, I'd like to say that it's so kind of you to work on and distribute the UnrealCLR!
Unfortunately, I ran into an issue that I can't solve. Maybe you can suggest something?
My pipeline is as follows:

  1. Im creating new project in Unreal Engine (tried both 5.0EA and 4.27) of any type (tried both blueprints/c++).
  2. If I try to play the project at that moment, it works without any doubts.
  3. I'm shutting down the Unreal Engine, going to /Install directory of v1.30 UnrealCLR and executing dotnet run (dotnet version is 5.0.206), installation succeeds.
  4. If I try to launch & play the project, everything is ok.
  5. Now I'm creating my own net5.0 solution with the following csproj:
<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <TargetFramework>net5.0</TargetFramework>
        <RootNamespace>AeviumClient</RootNamespace>
        <Nullable>enable</Nullable>
        <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
        <OutputPath>../../UnrealProjects/Test/Managed/Build</OutputPath>
    </PropertyGroup>

    <ItemGroup>
        <Reference Include="FlatBuffers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
          <HintPath>..\flatbuffers\net\FlatBuffers\bin\Release\net5.0\FlatBuffers.dll</HintPath>
        </Reference>
        <Reference Include="UnrealEngine.Framework">
            <HintPath>..\UnrealCLR-1.30\Source\Managed\Framework\bin\Release\UnrealEngine.Framework.dll</HintPath>
        </Reference>
    </ItemGroup>

    <ItemGroup>
      <Folder Include="Network\org\aevium" />
    </ItemGroup>

</Project>

, executing it by dotnet publish --configuration Release, running Unreal Engine, clicking the Play button, and application terminates with the following trace:

Assertion failed: IsValid() [File:/Users/build/Build/++UE4/Sync/Engine/Source/Runtime/Core/Private/Apple/ApplePlatformFile.cpp] [Line: 355]

FGenericPlatformMisc::RaiseException(unsigned int) Address = 0x108043fc7 (filename not found) [in UE4Editor-Core.dylib]
FMacErrorOutputDevice::Serialize(char16_t const*, ELogVerbosity::Type, FName const&) Address = 0x1081fdd83 (filename not found) [in UE4Editor-Core.dylib]
FOutputDevice::LogfImpl(char16_t const*, ...) Address = 0x108317689 (filename not found) [in UE4Editor-Core.dylib]
AssertFailedImplV(char const*, char const*, int, char16_t const*, __va_list_tag*) Address = 0x108289b57 (filename not found) [in UE4Editor-Core.dylib]
FDebug::CheckVerifyFailedImpl(char const*, char const*, int, char16_t const*, ...) Address = 0x1082899e4 (filename not found) [in UE4Editor-Core.dylib]
FFileHandleApple::ReadInternal(unsigned char*, long long) Address = 0x107fc9314 (filename not found) [in UE4Editor-Core.dylib]
FFileHandleApple::Read(unsigned char*, long long) Address = 0x107fc8a9f (filename not found) [in UE4Editor-Core.dylib]
FArchiveFileReaderGeneric::ReadLowLevel(unsigned char*, long long, long long&) Address = 0x10808a18a (filename not found) [in UE4Editor-Core.dylib]
FArchiveFileReaderGeneric::Serialize(void*, long long) Address = 0x10808a75b (filename not found) [in UE4Editor-Core.dylib]
FPakFileDerivedDataBackend::GetCachedData(char16_t const*, TArray<unsigned char, TSizedDefaultAllocator<32> >&) Address = 0x122231b96 (filename not found) [in UE4Editor-DerivedDataCache.dylib]
FCompressedPakFileDerivedDataBackend::GetCachedData(char16_t const*, TArray<unsigned char, TSizedDefaultAllocator<32> >&) Address = 0x122234113 (filename not found) [in UE4Editor-DerivedDataCache.dylib]
FHierarchicalDerivedDataBackend::GetCachedData(char16_t const*, TArray<unsigned char, TSizedDefaultAllocator<32> >&) Address = 0x12223ef1f (filename not found) [in UE4Editor-DerivedDataCache.dylib]
FDerivedDataBackendAsyncPutWrapper::GetCachedData(char16_t const*, TArray<unsigned char, TSizedDefaultAllocator<32> >&) Address = 0x1222295d1 (filename not found) [in UE4Editor-DerivedDataCache.dylib]
FDerivedDataLimitKeyLengthWrapper::GetCachedData(char16_t const*, TArray<unsigned char, TSizedDefaultAllocator<32> >&) Address = 0x122243ee2 (filename not found) [in UE4Editor-DerivedDataCache.dylib]
FDerivedDataCache::FBuildAsyncWorker::DoWork() Address = 0x1222511ff (filename not found) [in UE4Editor-DerivedDataCache.dylib]
FAsyncTask<FDerivedDataCache::FBuildAsyncWorker>::DoWork() Address = 0x12224e914 (filename not found) [in UE4Editor-DerivedDataCache.dylib]
FAsyncTask<FDerivedDataCache::FBuildAsyncWorker>::Start(bool, FQueuedThreadPool*) Address = 0x122254383 (filename not found) [in UE4Editor-DerivedDataCache.dylib]
FDerivedDataCache::GetSynchronous(char16_t const*, TArray<unsigned char, TSizedDefaultAllocator<32> >&, TStringView<char16_t>) Address = 0x12224c4ea (filename not found) [in UE4Editor-DerivedDataCache.dylib]
FTexture2DStreamIn_DDC::DoLoadNewMipsFromDDC(FTexture2DUpdateContext const&) Address = 0x10e75e3cf (filename not found) [in UE4Editor-Engine.dylib]
FTexture2DStreamIn_DDC_AsyncReallocate::LoadMips(FTexture2DUpdateContext const&) Address = 0x10e78aac7 (filename not found) [in UE4Editor-Engine.dylib]
TRenderAssetUpdate<FTexture2DUpdateContext>::TickInternal(FRenderAssetUpdate::EThreadType, bool) Address = 0x10e79b254 (filename not found) [in UE4Editor-Engine.dylib]
FRenderAssetUpdate::FMipUpdateTask::DoWork() Address = 0x10e737d37 (filename not found) [in UE4Editor-Engine.dylib]
FAutoDeleteAsyncTask<FRenderAssetUpdate::FMipUpdateTask>::DoWork() Address = 0x10e771f4a (filename not found) [in UE4Editor-Engine.dylib]
FQueuedThread::Run() Address = 0x108106268 (filename not found) [in UE4Editor-Core.dylib]
FRunnableThreadPThread::Run() Address = 0x1080ff948 (filename not found) [in UE4Editor-Core.dylib]
FRunnableThreadPThread::_ThreadProc(void*) Address = 0x108070ab4 (filename not found) [in UE4Editor-Core.dylib]
_pthread_start Address = 0x7fff2045d8fc (filename not found) [in libsystem_pthread.dylib]
thread_start Address = 0x7fff20459443 (filename not found) [in libsystem_pthread.dylib]

Creation of properties from managed code

I have a class deriving from Actor, with a constructor that looks like:

public class Card : Actor {
    public Card(string name = null) : base(name) {
      // Set up mesh, material, register events
      AddTag("MyTag");
      SetInt("MeaningOfLife", 42);
      var meaningOfLife = 9001;
      var gotIt = GetInt("MeaningOfLife", ref meaningOfLife);
      Debug.AddOnScreenMessage(1, 3.0f, Color.Red, $"Meaning of life: {gotIt}; {meaningOfLife}");
    }
}

When I play in the editor, it outputs False; 9001 when I'd expect True; 42.

I've played around and moved the GetInt and SetInt calls all over, thinking perhaps it was an object lifetime issue, but I can't seem to get this to ever print out my expectations. Currently I'm instantiating a Card in OnWorldPostBegin(). I've also tried GetBool and SetBool and those didn't work either -- I'm guessing this is broken for all of the method pairs.

The AddTag() call seems to work -- I can see it when I inspect the Details pane with the Card actor selected.

Is this a bug or am I doing something wrong?

Character API

Any idea when Pawn.SetupPlayerInputComponent() is likely to be implemented? This along with Character.Jump() and Character.StopJumping() will be pretty important to getting some actual gameplay going through the plugin

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.