getnamo / NodeJs-Unreal

Embed node.js as an Unreal Engine plugin.
MIT License
239 stars 34 forks source link

Unreal 5 Support #31

Open Ty-lerCox opened 3 years ago

Ty-lerCox commented 3 years ago

How realistic would it be to get this working in the Early Access of UE5?

getnamo commented 3 years ago

Based on other plugin updates, it isn't too bad. Usually just removing win32 platform support and misc updates. I'll add this to the docket, but no promises on timeline atm

getnamo commented 3 years ago

didn't realize I already patched it here: https://github.com/getnamo/nodejs-ue4/commit/448cfdc22154936a98b945043c4b6f581a734ca1. I'll make a release

getnamo commented 3 years ago

made an early release here: https://github.com/getnamo/nodejs-ue4/releases/tag/0.8.0

socket.io updated and current plugin updated with fixes, nothing else changed. May have bugs.

neurogamedev commented 2 years ago

Hello!

I am trying to use your plugin to make this app work inside of UE5. I am not quite sure what I am doing wrong, but whenever I try to run the game, UE5 just crashes... no errors or anything.

Do you guys have the same issue? Or is it just me being a n00b? Thanks for any pointers!

getnamo commented 2 years ago

Does the plugin run in general in ue5 (using the 0.8.0 release?)

If it does but you still get a crash with the app, check what your log/crash dmp says

neurogamedev commented 2 years ago

So, apparently, the plugin is installed correctly, but UE5 still crashes. I have tried with a simple Hello World, which works with Unreal.js, but when I try running it from a Node component, the Engine crashes and logs show literally nothing. The Engine crashed before it could log anything.

I also tried the plugin for UE4 and I have the exact same issue. I downloaded the example project and played with the plugin without crashes. I upgraded the example project to UE5, same result. I could use it without a problem.

I carefully followed the step by step guide in both UE4 and UE5 and I still don't get what I am doing wrong... I am thinking there may be something I missed in the preferences or project settings?

getnamo commented 2 years ago

Did you use the .7z for release and not source?

neurogamedev commented 2 years ago

Yes. I suppose that was the issue? Lemme try source code instead. Again, since I am a bit of a n00b in these matters, why does this matter?

neurogamedev commented 2 years ago

Welp, I tried using the source code release instead and when I try to rebuild in Visual Studio, I am given the following error: Unable to find plugin 'SocketIOClient' (referenced via default plugins -> NodeJs.uplugin). Install it and try again, or remove it from the required plugin list.

I am guessing that one is very important and I shouldn't try to remove it?

getnamo commented 2 years ago

The .7z release is correct as it contains all the necessary dependencies if it's for a matching editor.

If the example project works for you, you can also try to just copy over the plugins folder from the example project to your project as long as the engines match it will work

neurogamedev commented 2 years ago

Well, that's what I did. I took the example project, replaced the plugins with the UE5 versions and upgraded the example project to UE5. That worked.

So, I am stumped.... why does it only work in the example project but not on any other project if it's the exact same plugin files?

getnamo commented 2 years ago

You likely have a misconfiguration editor version/plugin version or are using the blueprints in a way that is missing some resource.

Keep in mind that this is a very rough plugin and apart from basic engine version updates I don't have the resources to properly support it atm, so YMMV. Code contributors are welcome to expand it

neurogamedev commented 2 years ago

I see. Well, thank you ever so much anyway! It is literally the only thing that can make this app run in Unreal.

Except for the .env part... oh, well, I think I can find a way around that with Blueprints.

neurogamedev commented 2 years ago

I seem to be able to solve the problem by copy/pasting the node_modules folder from ...root\Plugins\nodejs-ue4\Content\Scripts and into ...root\Content\Scripts

neurogamedev commented 2 years ago

So... new problem. X-D

I have a weird error when trying to package my game for Android platforms: "Windows.h file not found". After making sure I could package an empty project for Android without the plugin, I figured something in the plugin itself may be the issue. Here's the error log that I got. Any help would be appreciated. Updated plugins or step by step instructions are preferable, since my IT skills only go so far. X-D

image

Thanks again!

getnamo commented 2 years ago

This plugin won't work for Android, but if you don't need it to work, you can probably use a #if platform compile flag to bypass problematic code on target platform where you wish to ignore it.

TheLazyIndianTechie commented 1 year ago

@neurogamedev - Which version of 5 did you get it working in? Would love to get this working as well.

neurogamedev commented 1 year ago

@neurogamedev - Which version of 5 did you get it working in? Would love to get this working as well.

@TheLazyIndianTechie - Initially I ran it in UE 5.0.1. I have been able to make it run in UE 5.1.1 last week, but it only runs in the editor once you have added the project to your Environment Paths in Windows. It was not ready to ship back in 5.0 and I am not quite certain it is ready to package and distribute yet (I haven't tried, though).

TheLazyIndianTechie commented 1 year ago

@neurogamedev - Thanks. Would you have any idea if I would be able to get it working on a Mac. Maybe that's the wall I'm running into

@neurogamedev - Which version of 5 did you get it working in? Would love to get this working as well.

@TheLazyIndianTechie - Initially I ran it in UE 5.0.1. I have been able to make it run in UE 5.1.1 last week, but it only runs in the editor once you have added the project to your Environment Paths in Windows. It was not ready to ship back in 5.0 and I am not quite certain it is ready to package and distribute yet (I haven't tried, though).

neurogamedev commented 1 year ago

@TheLazyIndianTechie Well, if the readme is any indication: no, because "Current builds are Win64 only."

@neurogamedev - Thanks. Would you have any idea if I would be able to get it working on a Mac. Maybe that's the wall I'm running into

@neurogamedev - Which version of 5 did you get it working in? Would love to get this working as well.

@TheLazyIndianTechie - Initially I ran it in UE 5.0.1. I have been able to make it run in UE 5.1.1 last week, but it only runs in the editor once you have added the project to your Environment Paths in Windows. It was not ready to ship back in 5.0 and I am not quite certain it is ready to package and distribute yet (I haven't tried, though).

TheLazyIndianTechie commented 1 year ago

@TheLazyIndianTechie Well, if the readme is any indication: no, because "Current builds are Win64 only."

@neurogamedev - Thanks. Would you have any idea if I would be able to get it working on a Mac. Maybe that's the wall I'm running into

@neurogamedev - Which version of 5 did you get it working in? Would love to get this working as well.

@TheLazyIndianTechie - Initially I ran it in UE 5.0.1. I have been able to make it run in UE 5.1.1 last week, but it only runs in the editor once you have added the project to your Environment Paths in Windows. It was not ready to ship back in 5.0 and I am not quite certain it is ready to package and distribute yet (I haven't tried, though).

Yeah I was wondering if that's just the pre-built binaries or the entire project. I guess I'll try to do this on a windows system separately!

getnamo commented 1 year ago

It's largely windows only, because this lazy plugin uses windows api to run a background process via CreateProcessW and then uses a socket.io bridge to auto-translate inputs between the two instances.

To make it run on mac/linux you'd need to use the mac equivalent (likely the unix fork) and use some #if PLATFORM_WINDOWS and #if PLATFORM_MAC to cordon off the platform specific API via a parent class type interface.

TheLazyIndianTechie commented 1 year ago

It's largely windows only, because this lazy plugin uses windows api to run a background process via CreateProcessW and then uses a socket.io bridge to auto-translate inputs between the two instances.

To make it run on mac/linux you'd need to use the mac equivalent (likely the unix fork) and use some #if PLATFORM_WINDOWS and #if PLATFORM_MAC to cordon off the platform specific API via a parent class type interface.

Got it. Thank you for the great work though.