Running a Node.js app in UE5


I am trying to make this app run in UE5 to later use websockets or blueprints to get information to use for game mechanics. So far, I have been able to successfully run it on Windows.

Now, I tried using this plugin to be able to run a Node.js script in UE5 but as soon as I use it, UE5 crashes, no errors.

I’m a bit of a n00b when it comes to javascript implementation into Unreal. Any pointers would be very welcome!

Thanks guys!

1 Like

First, really? You need to run node.js to get some simulation parameters?
How about reading them from a file?
How about connecting to a web service and reading them out as a JSON object or something?

Second, if you really do need to run a second kind of thing, I highly recommend you spawn it as a second process, and give it a port number to listen on as argument, and make it listen on, and then connect to that port from the Unreal game. Then use web requests to read the values you need, and control that app. Pick an uncommon port number, like 28656, for the port-to-use.

Don’t bind to or ANY_HOST – this would open your user’s computer up to possible access from the rest of the network, plus it would needlessly request a firewall exception. Binding to localhost (and connecting to localhost) makes sure that the processes really only talk to each other.

Third: No, really, there has to be a better way than chaining a node-webkit-react application to your Unreal Engine game. You’re probably better off re-thinking this requirement.

1 Like

Thank you for your kind feedback!
I am more of a game designer than a backend programmer, so all this info is invaluable to me. :slight_smile:
I am trying to make this EEG device work with Unreal and I am throwing stuff at the wall to see what sticks.
I mean, gotta do something while the Neurosity devs cook up native support for Unreal, right?

I would still be very grateful for all your tips on this matter! :slight_smile:

It’s pretty likely that your EEG device doesn’t natively speak HTML/CSS.
Maybe you can figure out what their webapp is doing for communicating, and then do the same thing from your game instead?
That might end up being simpler.

1 Like

Fascinated by these new interfaces and kudos for thinking big. I have been experimenting with for different purposes but I think it does run a node server, not a big perf impact so far. I’m interested to learn more about this so just wanted to throw a comment in here. I would tend to agree with @jwatte but all I can find in their API is JS stuff so IDK. I wish this device was cheaper. I want one now! lol

Luckily, web stuff is pretty easy to reverse engineer with a bit of Wireshark.
Just sayin’ :slight_smile:

1 Like

You’re quite correct, the Neurosity Crown does not natively speak HTML/CSS… kinda. You can try using the BrainFlow plugin but I have had some issues with that as well.

And you were right, the Web App is a bit too much of a hassle, so the device developer suggested I try with something smaller. So, I used Node.js plugin to run this example. It worked:

Now I’ll reverse engineer the functionality of the Node web app I wanted to run directly in Unreal… and see if I can pull this off in UE5 as well.

1 Like

Quick update: I was able to upgrade to UE5! :slight_smile:

1 Like