Comunicating between mobile and pc

Hi, i’d like to make a control surface for my UE4 Pc app using an android UE4 app. Has anyone tried this? I’d create an entirely different build (which would just be buttons and sliders) on the android tablet and send data into my PC build. I’ve had a play with the network session functionallity between 2 pc instances but I suspect you need to have both apps running the same game.

Any pointers would be great! i was thinking of trying this with OSC if i couldn’t get direct engine to engine comms working.

Dan

it should be possible - just have the PC as the host and the android app as the client. You would send client events from the android phone to the host, and then have it send that as input to the camera/controller.

It might be laggy/glitchy - but then again you could make the PC spectate the character being controlled by the android device - it will have network smoothing so it might actually look ok

the guys who are making the game space dust racing have done this i think

Just bumping this because I have a similar question and this thread seems like the best place to ask for more details.

How would one go about making (just for instance) a 3D side scrolling Mario game (just assume very first level) that you play on your PC where a mobile device (client) can connect to the PC (server) and:

  1. How do I exclude data from certain clients? Assuming there’s a second pc client (Luigi) playing real-time how does relevance and all of that factor? Let’s say that I don’t want the server to “tell” mobile device 1 where Luigi is but do tell M.D. 2 where Luigi is but not Mario (idk teams?) And vice versa for M.D. 1.

  2. On mobile I just want, say, sprite versions of everything. How do I make sure that I never load a 3D mesh or anything like that? In fact, can i make the mobile App not even come with those meshes, materials, ect? How would I do so? Could I just make a separate UE4 project for mobile? How would I connect them? Say I just want X,Y (Y,Z?) Coordinates fed to mobile clients either every .15 seconds (dynamics like players) or a simple notify on status change (brick hit, turtle kicked, player died); how?

  3. How would I send tap locations based on world position to the server for the server to figure out?

Only 3. Seems obvious to me: Client controller’s on tap event gets the world position of the tap and then runs an event on the server with the world position as the input. Sorry for the massive question.

Ain’t an easy task. Biggest problem here is how to make the app on the PC and Mobile Device know that it is a PC or a Mobile. Second, how to make the PC contain all the meshes and textures and Mobile to contain only the needed ones for basic functionality.

I’d try doing something like this:
Create a project for PC, build basic functionality. But, you need to keep in mind to spawn all the important for the PC version stuff after or during the begin play. I have no knowledge if there is a way to read if the fevice running actual UE4 app is a mobile or PC or MAC. There IS a Device Unique ID but this gives me only numbers, no Idea if there is any way to decipher it to “Android” or “Windows”. A workaround might be, a hack really, that PC doesn’t have a Accelerometer. If on a begin play there’s a read from the Gravity node or something then it’s a mobile = don’t spawn stuff designed to PC.

Then, I’d copy, yea, copy the project and changed it for Mobile functionality. Removed textures and meshes that aren’t used in the mobile version. And using this hack determining if it’s a PC or Mobile you can spawn only stuff that are mobile specific.
You can have an actor that is replicated from server (PC) to client (Mobile) and send all the necessary data through there, or just use Game Instanse (I think it’s one of those actors, classes shared among all of the clients but controlled by the server mostly, can’t remember).

This is just an IDEA. I can’t promise it works. Maybe worth a try.

There is a BP that detects the operating system. You can use that in combination with booleans to swap out meshes and materials.

Which one is it? Cause I looked and couldn’t find it. Question is, can meshes and materials be NOT packaged in the mobile app and packaged in the PC app.

Get Platform Name

As far as packing assets, you will want 2 content folders, I would name them PC and the other Mobile. Then include / exclude the appropriate folder for the build you’re doing. You may need to run the build twice (once for PC, once for mobile), as I do not think that the folder include/exclude is per-package, but rather, per-project.