All Projects → sovietspaceship → ue4-remote-control

sovietspaceship / ue4-remote-control

Licence: MIT License
Control the Unreal Editor via HTTP with Node

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to ue4-remote-control

CrashBandicoot-Timetwister
Crash Bandicoot: Timetwister is a remaked version of Crash Bandicoot 3: Warped's Tomb Wader level on Unreal Engine 4.26
Stars: ✭ 26 (+18.18%)
Mutual labels:  unreal-engine, unreal-engine-4
UnrealMosquitto
A MQTT client with blueprint support for Unreal Engine 4, based on Mosquitto.
Stars: ✭ 41 (+86.36%)
Mutual labels:  unreal-engine, unreal-engine-4
FFMPEGMedia
Unreal FFMPEG Plugin to support more video formats and alpha videos
Stars: ✭ 162 (+636.36%)
Mutual labels:  unreal-engine, unreal-engine-4
Unreal-Development-Guides-and-Tips
High-level concept explanations, detailed tutorials, performance considerations, shortcuts and other useful content that aims to improve your Unreal Engine 4 development journey.
Stars: ✭ 118 (+436.36%)
Mutual labels:  unreal-engine, unreal-engine-4
gamedevguide
Game Development & Unreal Engine Programming Guide
Stars: ✭ 314 (+1327.27%)
Mutual labels:  unreal-engine, unreal-engine-4
BasicFramework
A basic framework for games made with Unreal Engine 4
Stars: ✭ 18 (-18.18%)
Mutual labels:  unreal-engine, unreal-engine-4
cg
This repo created to manage Issues and releases Cheat Gear.
Stars: ✭ 125 (+468.18%)
Mutual labels:  unreal-engine, unreal-engine-4
Unreal-Binary-Builder
An application designed to create installed Unreal Engine builds (aka Rocket builds) from Unreal Engine GitHub source.
Stars: ✭ 554 (+2418.18%)
Mutual labels:  unreal-engine, unreal-engine-4
UT GameEventSystem
A flexible event system in Unreal Engine 4
Stars: ✭ 33 (+50%)
Mutual labels:  unreal-engine, unreal-engine-4
UT Framework
Various advanced tools built for Unreal Engine 4
Stars: ✭ 45 (+104.55%)
Mutual labels:  unreal-engine, unreal-engine-4
RuntimeBPs
This project allows for visual scripting in UE4 similar to Blueprints, but at runtime. The way this is set up does not make use of any UE4 boilerplate and could with a few adjustments be used in another engine.
Stars: ✭ 77 (+250%)
Mutual labels:  unreal-engine, unreal-engine-4
Kosm-Classic-FPS-Template-UE4
Classic Arena First-Person-Shooter Mechanics for Unreal Engine 4.
Stars: ✭ 38 (+72.73%)
Mutual labels:  unreal-engine, unreal-engine-4
DataConfig
Unreal Engine JSON/MsgPack serialization framework
Stars: ✭ 81 (+268.18%)
Mutual labels:  unreal-engine, unreal-engine-4
tsu
TypeScript plugin for Unreal Engine 4
Stars: ✭ 62 (+181.82%)
Mutual labels:  unreal-engine, unreal-engine-4
UnrealAssets
Free Assets for Unreal Engine
Stars: ✭ 116 (+427.27%)
Mutual labels:  unreal-engine, unreal-engine-4
LocalizationUE4
Translation Editor for Unreal Engine 4
Stars: ✭ 59 (+168.18%)
Mutual labels:  unreal-engine, unreal-engine-4
FairyGUI-unreal
A flexible UI framework for Unreal Engine
Stars: ✭ 180 (+718.18%)
Mutual labels:  unreal-engine, unreal-engine-4
PsData
Flexible data model plugin for Unreal Engine 4
Stars: ✭ 34 (+54.55%)
Mutual labels:  unreal-engine, unreal-engine-4
UnrealEngine ShaderLinking
Simple Unreal Engine project showcasing how to link custom HLSL shaders into unreal engine.
Stars: ✭ 39 (+77.27%)
Mutual labels:  unreal-engine, unreal-engine-4
WebCameraFeed
Web Camera plugin for Unreal Engine
Stars: ✭ 50 (+127.27%)
Mutual labels:  unreal-engine, unreal-engine-4

Unreal Engine 4 Web Remote Control

This project implements a remote control client for the Unreal Engine 4 editor (since 4.23).

It implements the remote control protocol client over HTTP with JSON of a running Unreal Editor instance, and allows external programs to interact with the Unreal Editor in real time, with a fully object-oriented interface emulating C++ code. It can be used from the browser or with Node, and is fully typed. Several engine blueprint libraries are also included.

Read what you can do with Web Remote Control and the installation instructions below to get started.

Important: The feature is currently in Beta in the engine, so it may require updating between different engine releases.

The client is written in TypeScript and provides an object interface emulating UE4's object intefaces, and some type definition for engine data structures.

Contents

Installation

You need a Node.js installation with npm.

git clone https://github.com/sovietspaceship/ue4-remote-control
cd ue4-remote-control
npm install

To build, run npm run compile. This will compile all TypeScript files to ECMAScript 6 in dist/, with typings included. This step is optional as compiled files are already provided in the repository, but required if you make any changes.

To use in your library as a dependency, run

npm install https://github.com/sovietspaceship/ue4-remote-control

and then require or import it in one of the following ways:

import { UObject } from 'ue4-remote-control/dist/classes/uobject' // full access to all classes by path; dist is required for the time being
import { UObject } from 'ue4-remote-control' // this only exposes some core functionality exported by src/index.ts
const { AActor } = require('ue4-remote-control/dist/classes/actors/actor')

Classes

Classes can extend UObject to emulate their interface in the engine code. This is not necessary to interact with the engine, but ensures all requests are typechecked by TypeScript.

To create a new object type, extend UObject. See src/objects for more examples. Blueprint libraries are referenced by their default object, e.g. /Script/EditorScriptingUtilities.Default__EditorLevelLibrary. Classes can inherit from each other, e.g. AStaticMeshActor can inherit from AActor. The system is designed to mimick regular engine code, with the caveat that objects are not serialised in request payloads, but referenced by their path instead.

import { AActor } from 'ue4-remote-control/classes/actor'

type PetCatRequest = {
    cat: ACat,
    duration: number
}

export class AHuman extends AActor {
    async petCat(cat: ACat, duration: number): Promise<boolean> {
        const { returnValue } = await this.call('PetCat', { cat, duration } as PetCatRequest)
        return returnValue as boolean
    }
}

then, to use the new method

const human = new AHuman('/Game/CatGame:Level.Level:Human.CatPetter')
const cat = new ACat('/Game/CatGame:Level.Level:Cat.Nyasu')

const catIsHappy: boolean = await human.PetCat(cat, 15120)

If you create some useful engine object classes, please submit a merge request!

Libraries

Several engine libraries are included. Check src/classes/libraries to see available methods. Most of these have been generated with scripts/generate-methods-from-docs.js so, while it tries to preserve as much type information as possible, some signatures may not match. This also generates a lot of classes, structs and enums with empty definitions, which will have to be implemented.

Examples

  • Getting all actors in the currently open level:
import { EditorLevelLibrary } from './classes/libraries/editor-level-library'
const ell = new EditorLevelLibrary()
const actors = await ell.GetAllLevelActors()
/*
    actors = [
        '/Game/Project/Level.Level:PersistentLevel.Actor1',
        '/Game/Project/Level.Level:PersistentLevel.Actor2'
    ]
*/
  • Getting and setting actor location
const actor = new AActor('/Game/Project/Level.Level:PersistentLevel.Actor1')
const location = await actor.GetActorLocation()
// location = { X: 0, Y: 482, Z: 0 }
const result = await actor.SetActorLocation({ X: 420, Y: 90, Z: 123 })
/*
    result = {
        SweepHitResult: {
            bBlockingHit: false,
            bStartPenetrating: false,
            FaceIndex: -1,
            ...
        },
        ReturnValue: true
    }
*/
  • Managing actor properties:
const actor = new AActor('/Game/Project/Level.Level:PersistentLevel.Actor1')
const properties = await actor.loadAll()
const property = await actor.get('propertyName')
await actor.set('propertyName', 100)

Properties are cached when first retrieved. To reload, call loadAll or pass true as second argument to get.

Low level API

If you don't need the whole object architecture, you can use makeRequest, defined in src/index.ts:

import { makeRequest } from 'eu4-remote-control'

// makeRequest(method: HttpMethodCalls, endpoint: string, body: Object)

const response = await makeRequest('put', '/remote/object/call', {
    objectPath: "/Game/Project/Level.Level:PersistentLevel.Actor1",
    functionName: "SetActorLocation",
    parameters: {
        NewLocation: { X: 10, Y: 20, Z: 40 },
    },
})

Roadmap

The main goal is to implement the following libraries:

Additional libraries implemented:

Missing development:

  • Add implementations for classes, structs and enums lacking a body.
  • Type signatures for class properties.

Also, I created a separate project for functions that are not provided by the engine:

Documentation links

Unreal Engine Web Remote Control (Official)

Contributing

Since everyone updates the engine at different times, I may not notice if there are issues with specific versions, or the latest. Please let me know if there are any breaking changes to the remote control API by opening an issue, or creating a merge request if you want to contribute fixes or improvements!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].