Car Remote Control

Develop Progress

Introduction

This project is an automotive configurator built on UE5, primarily designed to establish communication between the configurator and a remote server. Users can send data from the client to the remote server by issuing commands through the client, allowing the server to be operated via the client. This functionality is based on UE’s UnrealWebServer plugin, which enables the server to bind specific URLHandlers and trigger corresponding Callback Functions. Additionally, the plugin can unpack network data, and the unpacked data can be used to set parameters in the corresponding interfaces. On the client side, this project utilizes the VaRest plugin, enabling message sending from the client to the server via HTTP.

Implement

For the server-side development, I initially used the standard Input system to meet the project requirements, focusing on camera movement, car controller offsets, lighting systems, and other elements. In this project, I primarily used UE Blueprints to implement functionality by modifying values in BP_Audio via certain interfaces. For example, with the lighting system, I set up two states—on and off—and exposed a Blueprint interface that dynamically changes the lighting state based on an input string value.

Afterward, I tested functionalities using Postman, where I could send simple HTTP requests to the server to verify if the features behaved as expected. A key node used in UnrealWebServer for this purpose is Add URLHander. The Add URLHandler function allows listening for a function at a specific address on the server (JS-based) and provides a Callback return function. By unpacking values returned by this Callback function, we can adjust and modify certain variable values within the Blueprint.

The Unreal Web-Server plugin is a powerful tool for the Unreal Engine, designed to help developers implement networking capabilities in games and applications. The plugin provides an HTTP server that handles client requests and supports RESTful apis that enable Unreal Engine projects to interact with external systems. It allows developers to easily build online features such as data storage, user authentication, and real-time communication.

The plugin allows developers to respond directly to Web requests, process JSON data, and interact with databases in the Unreal Engine environment. This is essential for creating multi-player games, dynamic content updates, and online services. Overall, the Unreal Web-Server plug-in enhances the Unreal Engine’s networking capabilities, enabling the development of more complex and interactive applications.

If you want know more details about this plugin, you can check here.

Add URLHandler Method
Detail of turning light on/off
Utilize of Postman to test

For the client side, I use UE’s latest EnhancedInputSystem to control user input, the main implementation includes the following functions:

  1. Lens control
  2. Lighting control
  3. Material control
    After using the basic input mapping and confirming the print-out with a print string, I used the VaRest plugin to send the http request.

VaRest Document

VaRest is the plugin for Unreal Engine 4 that makes REST server communications easier to use.

Key features:
Flexible Http/Https request management with support of different Verbs and Content Types
No C++ coding required, everything can be managed via blueprints
Blueprintable FJsonObject wrapper with almost full support of Json features: different types of values, arraysbinary data content, both ways serializarion to FString, etc.
Blueprintable FJsonValue wrapper – full Json features made for blueprints!
Both bindable events and latent functions are provided to control the asynchronous requests

Result

The project will eventually run under the same LAN. I use my laptop as the client and another desktop as the server. By manually entering the IP address, the connection between the client and the server is realized. Below is a demo video.

It can be seen that the project has realized the basic requirements, including the remote connection of the server to the client, and the remote control of the server through the client’s instructions. The project can be used as a case study for UE vehicle configuration and remote network communication.