Things to know about the Remote Control API

[Disclaimer I am not 100% shure if this it the right place for this post. Pls tell me where to move it, if it is the case]

I am currently using the Remote Control API in UE 5.0.3 and I want to collect some useful information about Remote Control here, so that other people dont have to make same mistakes. First I also make mistakes, so please correct me if you find any in this post. This Post also build up on the basic knowledge obtained from the Remote Control Documentation

  1. Websockets do not function like I thought they would. They foremost allow you to register to a remote control preset with multiple instances (for example Control Interface). As soon as one instance changes some values this is propergated to all the other instaces. BUT the engine it self does not have the same possibilities as the instances. The engine can add and remove Enities from the remote Control preset. But the instances dont get notified when the enigine modifies values from the remote control preset.

  2. As you know from the Remote Control API HTTP Reference documentation site you have to add UEDPIE_X_ to the object path to communicate with an Actor at runtime. But what does happen when you dont add this and still send the request at runtime? It still does call the defiened actor but NOT the one in the live game. For example all the debug print to string nodes get executed, but communication with other Actors fails. I had to find that out the hard way, after trying to call a event dispatcher like this. So double/tripple check your object path when running into weired communication problem when using the Remote Control API.

I will try to keep this topic updated as I progress with my project. Pls feel free to also add your knowledge. Have a nice Day!

As mentioned in the documentation for 5.0, if you package a project you must run the .exe with these flags to start the remote control http and websocket servers:

-RCWebControlEnable -RCWebInterfaceEnable

I was using Remote Control Presets and I found that I also had to drag the actual preset into the scene as an actor, otherwise it was not available in my packaged game.

Finally, I was not able to actually change any properties of the preset when using the Remote Control API in a packaged game; the control preset existed, the properties were there but attempting to change them resulted in an error saying the property could not be updated. I noticed (when calling the remote/info endpoint) that there was no “ActivePreset” but I don’t know how to set that, and I don’t know if that would make a difference. (In the documentation it states that there can only be one active preset at any time)

2 Likes

Crazy that I stumbled upon this trying to get info about Slate Remote, but I have quite a lot of info from my travels through remote control!

I had to implement a system recently that needed to work similar to remote control, but needed to be a bit faster and less safe and not be stuck using the message format JSON that remote control requires. It’s a nice and flexible system but I didn’t need all the jazz so I butchered it into something that “worked”.

Essentially at a low level the plugin is leveraging the reflection system to set values via reflection.

There is a FieldPath struct that is used to recursively find a void* to the value inside of a container in order to achieve this. IE you have a float UPROPERTY() inside a struct so the field path calls itself recursively to get 3 things. The Owning struct, the container address and the field (which is basically an FProperty*)

You can find the function that is setting property values and getting them in the module.cpp file.

All the different protocols get stacked on top at a higher level but eventually they all come down and set/get via that system.

There’s also a lot of checks to find the object whether you are in PIE or not (Basically tries to find the object counterpart in the PIE work from the Editor Object or vice versa)

To get the type safety correct there’s a bunch of casts from FProperty to check if it’s the right type IE FFloatProperty.

I have notices that remote control isn’t trying to be runtime friendly, but technically speaking everything is setup to work. I would suggest making a subsystem that handles storing your Entities and then can register them with the remote control module when need be. Preferably in code also you are handling setting up the server yourself so you can ensure some behavior. If you have an actor do all this you might have trouble with handling map changes etc.

1 Like

Is there any way to modify the character properties like “AnimToPlay” using Remote Control API?
I have it successfully running and sending the data. Parameters change, although character behavior does not. In PIE everything is OK, but I’m looking for a solution for a packaged game.
Thanks!