Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question Loading a Unity environment by using an external Python script without using ML-Agents

Discussion in 'ML-Agents' started by AHHHZ, Apr 26, 2024.

  1. AHHHZ

    AHHHZ

    Joined:
    Feb 29, 2024
    Posts:
    2
    Hi,

    I use Unity 2022.3.20f1 and ML-Agents Release 21 (3.0.0-exp.1). I could successfully connect a Python script to my Unity environment executable file (.exe) using the ML-Agents package and trained an agent using Low-Level APIs (LLAPIs) and it works well. More specifically, this was done by calling the "UnityEnvironment()" function API in the "mlagents_env.environment" and then using proper function APIs in ML-Agents to send/receive information like actions, observation, ... to/from the Unity executable file (.exe).

    However, my goal is to load a Unity scene in a Python script without using the ML-Agent package. So, is there any other way to load a general Unity scene (not only the ones that include the ML-Agent package) and send/receive data to/from a Python script or generally an external application outside the Unity application without using the ML-Agent package?

    I know that one way is to develop a customized network layer over the Ethernet TCP/UDP protocols in both Unity and Python side to communicate between these two applications. But, before doing that, I wanted to ask here and make sure whether there is another way of doing this because I don't want to implement things from scratch as much as I can.


    I would appreciate it if someone could guide me on this. Thank you in advance.


    Best,
    Amir
     
  2. AHHHZ

    AHHHZ

    Joined:
    Feb 29, 2024
    Posts:
    2
    Hi,

    Can someone update me on this, please?