unreal

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Unreal Skill (WIP)

Unreal Skill(开发中)

Automate Unreal Engine 5.x with PlayUnreal style external control.
Status: WIP. PlayUnreal repo: https://github.com/Randroids-Dojo/PlayUnreal
通过PlayUnreal风格的外部控制实现Unreal Engine 5.x自动化。
状态:开发中。PlayUnreal仓库:https://github.com/Randroids-Dojo/PlayUnreal

Quick Reference

快速参考

bash
undefined
bash
undefined

Launch editor with Remote Control enabled

启用Remote Control启动编辑器

UnrealEditor "/path/MyGame.uproject" -ExecCmds="WebControl.StartServer"
UnrealEditor "/path/MyGame.uproject" -ExecCmds="WebControl.StartServer"

Packaged build (enable Remote Control)

打包构建(启用Remote Control)

MyGame.exe -RCWebControlEnable -RCWebInterfaceEnable -ExecCmds="WebControl.StartServer"
MyGame.exe -RCWebControlEnable -RCWebInterfaceEnable -ExecCmds="WebControl.StartServer"

Wait for Remote Control and ping a PlayUnreal automation actor

等待Remote Control就绪并Ping PlayUnreal自动化Actor

python plugins/unreal/scripts/rc_wait_ready.py
--host 127.0.0.1 --port 30010
--object-path "/Game/Maps/Main.Main:PersistentLevel.PlayUnrealDriver_1"
undefined
python plugins/unreal/scripts/rc_wait_ready.py
--host 127.0.0.1 --port 30010
--object-path "/Game/Maps/Main.Main:PersistentLevel.PlayUnrealDriver_1"
undefined

Setup Checklist

设置清单

  • Enable Remote Control and Automation Driver plugins.
  • Add the PlayUnrealAutomation plugin to the project.
  • Place the PlayUnreal driver actor or subsystem in the map.
  • Tag key UMG widgets with automation IDs for stable selectors.
  • Keep Remote Control on LAN/VPN only.
  • 启用Remote Control和Automation Driver插件。
  • 向项目中添加PlayUnrealAutomation插件。
  • 在关卡中放置PlayUnreal驱动Actor或子系统。
  • 为关键UMG组件标记自动化ID以实现稳定选择器。
  • 仅在局域网/VPN环境下使用Remote Control。

Selector Strategy

选择器策略

  • id=StartButton
    maps to Automation Driver
    By::Id
    .
  • path=#Menu//Start/<SButton>
    maps to
    By::Path
    .
  • text="Start"
    can be implemented via custom traversal if needed.
  • id=StartButton
    对应Automation Driver的
    By::Id
  • path=#Menu//Start/<SButton>
    对应
    By::Path
  • 若需要,可通过自定义遍历实现
    text="Start"

PlayUnreal Python (target API)

PlayUnreal Python(目标API)

python
from playunreal import Unreal

async with Unreal.launch(
    uproject="MyGame.uproject",
    map="/Game/Maps/MainMenu",
    remote_control=True,
) as ue:
    page = ue.page()
    await page.locator("id=StartButton").click()
    await page.locator("id=HUDRoot").wait_for_visible()
    await page.screenshot("artifacts/started.png")
python
from playunreal import Unreal

async with Unreal.launch(
    uproject="MyGame.uproject",
    map="/Game/Maps/MainMenu",
    remote_control=True,
) as ue:
    page = ue.page()
    await page.locator("id=StartButton").click()
    await page.locator("id=HUDRoot").wait_for_visible()
    await page.screenshot("artifacts/started.png")

Packaged Builds

打包构建

  • Use
    -RCWebControlEnable -RCWebInterfaceEnable
    .
  • Ensure presets and assets are staged if using Remote Control presets.
  • 使用
    -RCWebControlEnable -RCWebInterfaceEnable
    参数。
  • 若使用Remote Control预设,确保预设和资源已完成预部署。

References

参考资料

  • references/remote-control.md
  • references/automation-driver.md
  • references/umg-automation.md
  • references/playunreal.md
  • references/remote-control.md
  • references/automation-driver.md
  • references/umg-automation.md
  • references/playunreal.md