Decision Requester component provided by Unity ML-Agents.
Create a central command center that controls the timing of all simulations, communication with the C++ DLL, and toggles the ML-Agents mode globally.
VoxelEngineManager.VoxelEngineCore.csVoxelRobotBuilder.csVoxelRLManager.csDll Folder Path: Enter the absolute path to the directory containing your built C++ DLL file. (Alternatively, use the custom editor menu Voxel Engine > Select DLL File to set this automatically).Is Ml Agent: (Crucial) This single checkbox toggles the entire scene between Training (RL) mode (ON) and pure Rendering/Physics Test mode (OFF). Ensure this is checked for training.Steps Per Simulation Cycle: The number of micro-steps the C++ engine computes per call (e.g., 20).Custom Decision Period: The AI's decision-making frequency (e.g., 25). This variable centrally forces the action cycle for all robots.Action Size Per Robot: The total number of actions the neural network outputs (e.g., 4 motors × 2 parameters = 8).Set up the isolated stage where each robot will act independently.
TrainingEnvironment_0.VoxelPhysicsManager.cs script to this object. (This relays rigid-body collision forces within the training environment).TrainingEnvironment_0:
VoxelRobot_0.3D Object -> Plane to act as the floor.Rigidbody and a Box/Sphere Collider attached).Interactive Objects array in the VoxelPhysicsManager inspector.Configure the actual robot object where voxels will be rendered and the AI will reside.
VoxelRobot_0 object created earlier and attach the following scripts:
VoxelGraphicRenderer.csVoxelPhysicsInfo.csVoxelRobotAgent.csVoxelRobotAgent, Unity will automatically attach the Behavior Parameters component alongside it.Decision Requester component is attached, you must delete it (Remove Component). Action requests are handled manually by the VoxelRLManager.If you are training for target tracking tasks, set up a target object.
TrainingEnvironment_0, create a 3D Object -> Sphere and rename it to Target.Create an asset that defines the robot's brain specifications (observation size, action size, morphology).
Create -> RL Tasks -> Target Tracking Profile to create a new asset file.[ReadOnly]. These values are hardcoded internally based on your task design to prevent accidental misconfigurations.VoxelRobot_0 object in the scene again.VoxelRobotAgent component.Runtime State section will expand below it. Drag and drop the Target object (from Step 4) into the Target Transform slot located there. (Internal calculation variables are cleanly hidden via [HideInInspector]).Perform a final visual check to ensure the ML-Agents parameters match the profile's specifications. (Applying the profile usually overwrites these automatically).
Behavior Parameters component of VoxelRobot_0, visually verify the following:
TargetTrackingProfile.🎉 All preparations are complete!
Is Ml Agent checkbox.TrainingEnvironment_0 GameObject as many times as you want (e.g., 16 times). This will immediately initiate parallel training, fully utilizing 100% of your multi-core CPU threads!