MonoUE - C# and F# for UE4

F# - that is absolutely awesome! keep going with this! I would like to write all my AI logic in F#. It would be great to write a library and just plug it into my unreal game.

Hey @mhutch… If I can’t get VS For Mac to open project because of the MonoUE framework not supported error… How can I build mono game code project from command line… Then I try use VS Code or something to at lest edit the .cs files and rebuild until you get the VS for Mac going. ???

Oh My God … This is freakin awesome … Even WITHOUT Visual Studio For Mac working… Its still just a C# project…

So I just used VSCode to open the C# Game Source Project at folder that has the csproj… Now omniSharp is failing on opening the csproj for things like auto complete…

BUT… You can always just manually add your .cs class (I create a MackeyActor.cs). had to manually add to csproj compile section …

That is… MSBUILD does the reset… You can either setup a MSBUILD build task in VSCode or simple type ‘msbuild’ from command line in the Mono Game Source project…

Ill be dammed… I can then go into the editor and create a blueprint class … Search base classes and there she is… MackeyActor… All the editor stuff works great and everything…

When Visual Studio For Mac can open project files and provide auto complete… that is going to be the SHIZZNIT :slight_smile:

UPDATE: Just typing MSBUILD will only work if your using the Base Ue4 classes… you can’t make your C# class subclass a custom C++ class using MSBUILD command alone… It must be some kind of UBT command… Right???
@mhutch … When you get a chance can you please tell me IF there is a manual workaround to get Visual Studio For Mac to open the project without the “Project does not support framework 'MonoUE,Version=v1.0” error

or

Is there a command line I can use to build the game code while I wait for Visual Studio For Mac

PLEASE :slight_smile:

@MackeyK24 you can run the following command in your game directory:

[FONT=Courier New]msbuild ‘-p:Configuration=Development Editor’ -p:Platform=Mac GAMENAME_Managed.sln

VS Conde won’t work for game projects until it supports setting the build configuration/platform: Introduce build configuration drop down · Issue #1541 · OmniSharp/omnisharp-vscode · GitHub.

Tried building a C++/C# project but get the following error when building using the manual msbuild command from above:

/Users/mackey/Documents/Unreal/TesterProject/Source/TesterProjectMono/TesterProjectCharacter.cs(9,33): error CS0246: The type or namespace name ‘TesterProjectCharacterBase’ could not be found (are you missing a using directive or an assembly reference?) [/Users/mackey/Documents/Unreal/TesterProject/Source/TesterProjectMono/TesterProjectMono.csproj]
/Users/mackey/Documents/Unreal/TesterProject/Source/TesterProjectMono/TesterProjectGameMode.cs(8,39): error CS0246: The type or namespace name ‘TesterProjectGameModeBase’ could not be found (are you missing a using directive or an assembly reference?) [/Users/mackey/Documents/Unreal/TesterProject/Source/TesterProjectMono/TesterProjectMono.csproj]
/Users/mackey/Documents/Unreal/TesterProject/Source/TesterProjectMono/TesterProjectCharacter.cs(75,27): error CS0115: ‘TesterProjectCharacter.BindInput(InputComponent)’: no suitable method found to override [/Users/mackey/Documents/Unreal/TesterProject/Source/TesterProjectMono/TesterProjectMono.csproj]
/Users/mackey/Documents/Unreal/TesterProject/Source/TesterProjectMono/TesterProjectGameMode.cs(10,19): error CS0246: The type or namespace name ‘ClassFinder<>’ could not be found (are you missing a using directive or an assembly reference?) [/Users/mackey/Documents/Unreal/TesterProject/Source/TesterProjectMono/TesterProjectMono.csproj]
Done Building Project “/Users/mackey/Documents/Unreal/TesterProject/Source/TesterProjectMono/TesterProjectMono.csproj” (default targets) – FAILED.
Done Building Project “/Users/mackey/Documents/Unreal/TesterProject/TesterProject_Managed.sln” (build target(s)) – FAILED.

It does not see the Base Class From C++

How does the managed project KNOW about the C++ class it is supposed to subclass???

Blank Projects - PlayerControllerClass is READ ONLY

Just to let you know the Blank Projects get a read only error on the player controller class:
“/Users/mackey/Documents/Unreal/BlankProject/BlankProject_Managed.sln” (build target) (1) →
“/Users/mackey/Documents/Unreal/BlankProject/Source/BlankProjectMono/BlankProjectMono.csproj” (default target) (2) →
(CoreCompile target) →
/Users/mackey/Documents/Unreal/BlankProject/Source/BlankProjectMono/BlankProjectGameMode.cs(13,4): error CS0200: Property or indexer ‘GameModeBase.PlayerControllerClass’ cannot be assigned to – it is read only [/Users/mackey/Documents/Unreal/BlankProject/Source/BlankProjectMono/BlankProjectMono.csproj]

0 Warning(s)
1 Error(s)

So the question now is UNREAL going to help out with this :wink: … i remember a while they said, if mono for ue goes open source, they will help out and contribute :stuck_out_tongue:
[MENTION=9][/MENTION]

Hey, so i’ve got everything compiled and up and running.
I have a quick question, forgive me if its noonish, as I’m rather new to C#. I want to use the GameplayStatistics to get the player controller and other stuff as I would in C++ but it seems like all the methods I need to use are marked internal and I’m a bit confused how to go about using them.

I found that the project works great in JetBrain’s Rider on my Mac running the 12.13 beta, building and autocomplete. You can grab the free 30 day trial as a workaround.

In theory the build system generates c# bindings for all the c++ projects and the c# projects reference them all automatically.

It may have regressed though. I filed an issue at https://github.com/mono-ue/UnrealEngine/issues/14 already

This seems to have regressed… I haven’t tested the empty projects since 4.4, I usually use the ThirdPerson ones.

Issues at
https://github.com/mono-ue/UnrealEngine/issues/34 and https://github.com/mono-ue/UnrealEngine/issues/12

Cant find a JetBrains Beta 12.13 anywhere on the internet… I tried there latest 2017 version… and is does not work… no auto-complete or building :frowning:

Yo @BlueSpud … Where did you get that 12.13 beta of JetBrains Rider ?

I meant on OS X beta 12.13 lol. When I opened the solution I didn’t get any autocomplete until I changed the build configuration to Development Editor | Mac

Give that a go and see if it works

I landed a change that fixes IntelliSense in VS Code (at least on Windows) as a stop-gap until the VS/VSMac extensions are ready.

Yo @BlueSpud … Do you REMOVE the ‘<ProjectTypeGuids>{AE3DEEA0-4A95-41F6-B9AC-AF2CCF420B89};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>’
from the project as well… I see you change to Development Editor (Mac) in the IDE… Not manually editing the .csproj file… Just wondering :slight_smile:

Yo @BlueSpud I tried again… It does not have ‘Development Editor (Mac)’ as a valid configuration… It does have ‘Development (Mac)’
I get all kinds RED errors because there is NO reference to the UnrealEngine.Runtime assembly

Can I just manually add that assembly… if so FROM Where… Where are the UnrealEngine.Runtime.dll located ???

UPDATE:
Yo @BlueSpud … hey man you are right… Once you get the proper configuration selected in JetBrains Rider… Everything works… Building and auto-complete.

Thanks bro…

I still can’t get VSCode to work… won’t read the csproj file correctly … But hopefully @mhutch will have that VS/VS For Mac extensions ready by the time my JetBrains Rider eval runs out :slight_smile:

Yo @mhutch … First off… AMAZING JOB

Each time I get further with creating the 4 Project Variants (2 C#/C++ and 2 C#), I am more amazed…

ONE BIG QUESTION… Why is this not a real thing (For Microsoft and Epic)… This is a real game changer in “Everyday Game Coding” … especially for those folks like me who
HATE the spaghetti blueprint way of doing ANYTHING that not a simple “Controlling Mechanism” and building the C++ game code is a absolute NIGHTMARE for constant BUILD and RUN type
things… I mean you need a freakin KRAY super computer to work with the C++ and Xcode for everyday game code…

But the C#/C++ approach (Which I finally got going with a bit of manual binding project building and sticking the C++ to C# bindings in the ‘MonoEditor’ folder then reference that dll from the game mono project) gives us the luxury of C# and still being able to THUNK things down to the underlying C++ base class or even Crete a static ‘Blueprint Function Library’ that can be called from either blueprint or c# (haven’t tested calling a custom blueprint function library from C#… but I assume that is working if all the other stuff is working)…

Im luvin it…

A SIMPLE question… What is the C# equivalent to UE_LOG or GLog->Log for logging to the editor console ???

AND

I know there is a ton stuff from the editor point of view like cooking and hot reloading… But are there ANY parts of the actual UnrealEngine C# API that are not there or working that I should know about ???

Again… Great Freaking Job… Yo go girl :slight_smile:

I just wanna note… JetBrains Rider is an excellent alternative IDE for Visual Studio For Mac (Until MONO UE extensions are ready)… For ANYBODY on a Mac trying to get a project up and running… building smoothly and auto complete… Cost $$$ for the Full version… But again the eval is a great STOP GAP until Mikayla gets the real Microsoft IDE’s VS/VS Mac going…

Good luck to all… I am sure you will luv it too :slight_smile:

@MackeyK24 The API binding is generated automatically via the UE reflection system. By default it generates bindings from all the blueprint-visible types and functions; there’s also a manually-created whitelist for a few useful things that are in reflection but not blueprint-visible, and a blacklist for some that are unnecessary or cause conflicts.

When types/members are not present in the binding, it could be for one of several reasons:

  1. They use some pattern the generator does not support. For example, latent functions are not currently supported as it was difficult to map them cleanly to C#.
  2. They are present in UE reflection but not marked Blueprint-visible. In such cases we can upstream patches to make them Blueprint-visible, or add them to the generator whitelist.
  3. The are not present in reflection. There are 3 possible fixes for this:
    a. In some cases we may be able to upstream patches to expose them to reflection.
    b. We may be able to bind them manually. However, binding raw C++ types directly from C# is very difficult.
    c. We may be able to reimplement them in C# and inject them into the binding.

We can fix these on a case by cases basis when people run into them.

For logging, we don’t expose the C++ log API, but we do reroute Console.Writeline to the unreal log.

Also… you can access C# static and instance functions from Blueprint: