Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Agent ID's changing during training

Discussion in 'ML-Agents' started by dewet99, Nov 9, 2022.

  1. dewet99


    Jun 13, 2021
    Hello there,

    I have a multi-agent setup where I use a custom algorithm with a Unity environment. I have a Python wrapper to allow the algorithm to interact with the environment, and everything with regards to that works fine.

    Recently, I made a few changes to the environment's layout, and after building the environment and running training on it, the agent ID's in the DecisionSteps object has changed from being [0,1] to being [2,3]. I have no idea why this suddenly started happening, it used to be fine until I changed the map layout.

    All well and good, I thought, it revealed that I didn't generalise my wrapper code enough to be able to interact with the environment regardless of agent ID's. Fixed that, tried again, and then the big issue: During training, the agent ID's suddenly change. They are [2,3] for a few seconds, then suddenly become [4,5]. I cannot understand the cause for this, and this is a rather big problem since each agent's actions are assigned to them based on their ID.

    Bringing me to my real question: Where do the agent ID's get assigned, in the DecisionSteps object? I would like to go have a look there, to see why the ID's suddenly change. Any other pointers as to why this might be happening would also be appreciated.