Easiest way to implement a controller

I need to implement a plugin that accepts commands from a remote source representing updates in the scene. At this point I only need to change simple things like positions, colors, etc for some properties inside actors, but in the future I might need to call some UFUNCTION.

What would be the easiest path to implement those updates?

Is there any code I can look for reference?

Is there any way to change an arbitrary value in the scene from the in-game console?

Thanks in advance,
Jorge

Depends on the device. Usually Sockets or HTTP Requests will do (C++ or with Plugins, wiki has example Code). Otherwise lookup if there is a SDK avaivable for the Device and go from there.

You can create Console Commands Quickly by creating a Event in your Level BP. You can call that event inside your console like this “ce YourEventName”.

Sorry, wording on my side wasn’t very helpful. The communication side isn’t a problem, the “setting an arbitrary property” is what I’m after.

Also, this is sort of a player and it has to be generic. I can’t use BP (or edit levels for that matter).

Sry I still don´t have a clue what exactly you want to achive? Setting a Value by Property Name? Adding a new Property? The “Remote Source” throws me off here a bit too. Is it really remote (not inside the Engine/Game) and is this part already established or do you need to Code it (thats what I explained btw.)

Any Examples avaivable?

The remote source is a separate program (in a different address space or machine) that sends us the desired updates in whatever format we decide. Something like this comes to mind:

MyActor.StaticMeshComponent.RelativeLocation.X = 123.456;

But I can change it to be whatever is best for the UE4 side.

In order for this to work you need some sort of Property Reflection. Asside from that you missing a way to identify who recives that message since you can have multiple instances of “MyActor” in your Scene.

Usually you do this with a Message protocol that can look like this:

ReciverID | Channel | MessageType | OperationCode | SerializedData

OpCode and the Serialized Data is pretty much needed the others depend on the use case. But UE4 will recive a bunch of Data its your job forward it to the right Objects to call the right Function and to deserialize it in any way you see fit.

You might want to google up “Games networking message protocols” and research a bit. Its a pretty big topic. Cant recall any good resources on top of my head to link. I remeber a GDC talk about WoW protocols that was nice.

Not sure how I can help you beyond that. But once you figure out some basics you should be able write something you can work with. Also not sure if you can hook somehow into UE4s Networking (unfamiliar with it sorry)

Yes, I need property reflection and I guess I could end up writing this stuff via FindObject/FindField. But I was wondering if there’s some helper code in UE4 hiding somewhere that could turn this hypothetical plugin into a “low maintenance” plugin. Maybe the in-game console already allows setting arbitrary properties and I could just adopt its syntax and avoid writing this stuff myself.