External user input

Hi guys & girls.

I’ve asked this question in many places, but have yet to have a response and so I am hoping that someone here can help.

Essentially, I have a client-server architecture and I would like to collect user input (mouse and keyboard events) on the client and then send that input to UE4 to move and control the game. The client is a separate application from the UE4 application.
I know that I could collect all user input on the client, format as JSON (for example) and send that JSON to UE4, deserialise the data and map the user input to whatever within UE4, but that is a very long process.

Is there a better way? I.E, does UE4 have some interface that accepts keyboard and mouse events? The keyboard and mouse events from the client will be communicated to the server (UE4) via UDP.

Any help would be greatly appreciated.

hi rich2020, you can use the old school electronic method, instead send an json, just send string with begin and end read, something like this: r300 300/r witch the first “r” is to begin to read, then some value, then a space to know where you need break the info and read another portion, and finally “/r” return, is harder but is faster!.
To create UDP severals tutorials exist around the forum, take a look: A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums

Hope help!

Cheers

Hi ZkarmaKun, Thank you for your reply.

My question is more about how to pass the incoming input events to the UE4 application, rather than how to transmit them. I have communication between my application (client) the UE4 application (server) working via UDP and TCP. Communication is not the problem. The problem is that I can capture the user input on the client and transmit it to the server, but how do I feed that data to UE4? I do not want to have to map the incoming data to certain events in UE4, such as if in_data.key = ‘x’ then move.forward; I want to pass the incoming input directly to UE4 so that it can be managed automatically as if the UE4 application was being run locally. I hope this clears things up.

Kind regards,

P.S my client application is NOT an Unreal Engine application - it is a custom piece of software.

Hi rich2020,
Now I see, mmm if you are running local, you can set your game run on background and handle the inputs in regular way, but only work for local, mmm your problem is very interesting because from time to time I need similar things, and yeah I know you are not using a client based on unreal and thats why is a bit harder, perhaps you can use delegates but I think is same history, you need bind your data by statements, for me the right way to do this, it´s by creating custom input events, really you will need bind your data but at least you will have custom input events, take a look: A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums

however, your problem is very interesting for me too, maybe some authority can help us.

Cheers!