Skip to content

Open3D engine gem providing integration with external simulation model: video output to external model and motion input from external model

License

Notifications You must be signed in to change notification settings

Ornstein89/Open3DE-ExtSimInt-Gem

Repository files navigation

Open3DE-ExtSimInt-Gem

logo

Open3D Engine gem providing interaction with external simulation model without ROS, via system Inter Process Communication (IPC): video output to external model/application and motion input from external application. Work is in progress yet, see TODO & current progress (dev branch).

Under development, coming soon

Contents

Use

  1. Create game project in O3DE Project manager on choose existing one.

  2. Open project menu and select Configure Gems...

  3. Open top right menu, choose Add Existing Gem and find this gem repository folder. Then save changes.

  4. Build project.

  5. If build successful, Open project in O3DE Editor.

  6. To use ReceiveMotionParamsComponent

    6.1. Choose entity you want to move.

    6.2. Add ReceiveMotionParamsComponent in Add Component dialog:

    6.3. Build and launch examples/minimal_app, choose IPC method (yet only UDP) in combobox, press start.

    6.4. Launch Play Game in O3DE Editor.

    ReceiveMotionParams Demo

    (Project, entities, level, assets are not included in this repo, used copter 3D model, terrain made by tutorial1 and tutorial2)

  7. To use TranslatePictureComponent In progress yet TODO when ready

Development guidelines

  • To make development more automated, I recommend VS Code with Microsoft C++ Estension Pack.

  • To generate IntelliSense hints when using O3DE classes, add path to O3DE SDK to extension paths in .vscode\c_cpp_properties.json

    c_cpp_properties.json code sample
    {
        "configurations": [
            {
                ...
                "includePath": [
                    ...,
                    "<path>/<to>/<your>/O3DE/23.10.3/Code/**" // added this in VS C++ Extension to scan O3DE headers and generate IntelliSense hints
                ],
            }
        ],
    
    }
    

    or do the same in VS Code C++ Extension dialog:

  • To build project with gems and components directly from IDE, create .vscode/tasks.json file, add two tasks based on lines from your O3DE Project Editor Cmake log and make them run in Visual Studio Developer Command Prompt, like in example below:

    tasks.json code sample
    {
        "version": "2.0.0",
        "windows": {
            "options": {
                "shell": { // run all tasks below in Visual Studio Developer Command Prompt !!!
                    "executable": "cmd.exe",
                    "args": [
                        "/C",
                        "\"C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/Tools/VsDevCmd.bat\"",
                        "&&"
                    ]
                }
            }
        },
        "tasks": [
            { // Cmake configure task
                "type": "shell",
                "label": "O3DE Project configure",
                "command": "cmake",
                "detail": "CMake configure task, copy of O3DE Project manager command",
                "options": {
                    "cwd": "<!!! your/path/to/o3de_project>/YourProjectName"
                },
                "args": [ // made from original command line, shown in O3DE Project Manager Cmake Log 
                    "-B",
                    "<!!! your/path/to/o3de_project>/YourProjectName/build/windows",
                    "-S",
                    "<!!! your/path/to/o3de_project>/YourProjectName",
                    "-DLY_3RDPARTY_PATH=<!!! copy_from_your_cmake_log>"
                ]
            },
            { // Cmake build task, depends on configure
                "type": "shell",
                "label": "O3DE Project build",
                "command": "cmake",
                "detail": "CMake build task, copy of O3DE Project manager command",
                "options": {
                    "cwd": "<!!! your/path/to/o3de_project>/YourProjectName"
                },
                "args": [ // made from original command line, shown in O3DE Project Manager Cmake Log 
                    "--build",
                    "<!!! your/path/to/o3de_project>/YourProjectName/build/windows",
                    "--config",
                    "profile",
                    "--target",
                    "YourProjectName.GameLauncher",
                    "YourProjectName.ServerLauncher",
                    "YourProjectName.UnifiedLauncher",
                    "Editor"
                ],
                "dependsOn": "O3DE Project configure"
            },
        ]
    }

Links and resources

  1. Open 3D Engine (O3DE) Tutorials and Examples. - URL: https://www.docs.o3de.org/docs/learning-guide.
  2. Open 3D Engine and Atom API Reference. - URL: https://www.docs.o3de.org/docs/api.
  3. Open 3D Engine (O3DE) User Guide. Components. - URL: https://www.docs.o3de.org/docs/user-guide/components.
  4. Open 3D Engine (O3DE) User Guide. Gems in Open 3D Engine. - URL: https://www.docs.o3de.org/docs/user-guide/gems.
  5. Your First Network Component. - URL: https://docs.o3de.org/docs/learning-guide/tutorials/multiplayer/first-multiplayer-component, https://github.com/SelfishOlex/O3DEBookCode2111.
  6. Olex Lozitskiy. Game Programming with O3DE. - URL: https://o3debook.com.

API documentation yet is very poor and formal. For this reason it's often required to look into the source code:

  1. O3DE. - URL: https://github.com/o3de/o3de/tree/development.

TODO & current progress (dev branch)

  • ReceiveMotionParams component + example external app, UDP.
  • ReceiveMotionParams component + example external app, shared memory.
  • TranslatePicture component: render viewport + display in external example app via UDP.
  • TranslatePicture component: render viewport + display in external example app via shared memory.
  • Add Editor GUI options to components.
  • 80% Documentation
  • Release: reliability, usability, optimization.

About

Open3D engine gem providing integration with external simulation model: video output to external model and motion input from external model

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published