Skip to content

Commit

Permalink
Update to 2022.3 LTS and batched raycasts (#5950)
Browse files Browse the repository at this point in the history
* Updated to Unity 2022.3.

* Added support for batched raycasting in ray perception sensor. Only for 3D (batched raycasting is only supported in 3D).

* Added batched raycast tests and docs.

* Updated meta file validation exclude list.

* Added unity physics module dependency to core package.
  • Loading branch information
miguelalonsojr committed Jul 25, 2023
1 parent 4cfe3c0 commit 4ea8995
Show file tree
Hide file tree
Showing 101 changed files with 1,325 additions and 465 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Please wrap in triple backticks (```) to make it easier to read.
If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information):**
- Unity Version: [e.g. Unity 2020.1f1]
- Unity Version: [e.g. Unity 2022.3f1]
- OS + version: [e.g. Windows 10]
- _ML-Agents version_: (e.g. ML-Agents v0.8, or latest `develop` branch from source)
- _Torch version_: (you can run `pip3 show torch` to get this)
Expand Down
2 changes: 1 addition & 1 deletion .yamato/com.unity.ml-agents-pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pack:
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
conda activate python3.8
python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
unity-downloader-cli -u 2021.3 -c editor --wait --fast
unity-downloader-cli -u 2022.3 -c editor --wait --fast
./.Editor/Unity -projectPath Project -batchMode -executeMethod Unity.MLAgents.SampleExporter.ExportCuratedSamples -logFile -
npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
upm-ci project pack --project-path Project
Expand Down
4 changes: 2 additions & 2 deletions .yamato/com.unity.ml-agents-performance.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
test_editors:
- version: 2021.3
- version: 2022.1
- version: 2022.3
- version: 2023.1
---
{% for editor in test_editors %}
Run_Mac_Perfomance_Tests{{ editor.version }}:
Expand Down
2 changes: 1 addition & 1 deletion .yamato/com.unity.ml-agents-promotion.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
test_editors:
- version: 2021.3
- version: 2022.3
test_platforms:
- name: win
type: Unity::VM
Expand Down
4 changes: 2 additions & 2 deletions .yamato/com.unity.ml-agents-test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% metadata_file .yamato/coverage_tests.metafile %}
test_editors:
- version: 2021.3
- version: 2022.3
# We want some scene tests to run in the DevProject, but packages there only support 2020+
testProject: Project
enableNoDefaultPackages: !!bool true
- version: 2022.1
- version: 2023.1
testProject: DevProject
enableNoDefaultPackages: !!bool true

Expand Down
2 changes: 1 addition & 1 deletion .yamato/coverage_tests.metafile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
coverage_test_editors:
- version: 2021.3
- version: 2022.3
testProject: DevProject

coverage_test_platforms:
Expand Down
2 changes: 1 addition & 1 deletion .yamato/standalone-build-webgl-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% capture editor_version %}2021.3{% endcapture %}
{% capture editor_version %}2022.3{% endcapture %}
test_webgl_standalone_{{ editor_version }}:
name: Test WebGL Standalone {{ editor_version }}
agent:
Expand Down
4 changes: 2 additions & 2 deletions .yamato/test_versions.metafile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# For each "other" test, we only run it against a single version of the
# editor to reduce the number of yamato jobs
test_editors:
- version: 2021.3
- version: 2022.3
extra_test: gym
- version: 2022.1
- version: 2023.1
extra_test: sensor
- version: trunk
extra_test: llapi
7 changes: 4 additions & 3 deletions DevProject/Packages/manifest.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"dependencies": {
"com.unity.ai.navigation": "1.1.4",
"com.unity.coding": "0.1.0-preview.13",
"com.unity.inputsystem": "1.3.0",
"com.unity.inputsystem": "1.6.1",
"com.unity.ml-agents": "file:../../com.unity.ml-agents",
"com.unity.ml-agents.extensions": "file:../../com.unity.ml-agents.extensions",
"com.unity.package-manager-doctools": "1.10.0-preview",
"com.unity.package-validation-suite": "0.23.4-preview",
"com.unity.test-framework": "1.1.29",
"com.unity.test-framework": "1.1.33",
"com.unity.test-framework.performance": "2.2.0-preview",
"com.unity.testtools.codecoverage": "1.0.0-pre.3",
"com.unity.testtools.codecoverage": "1.2.4",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.physics2d": "1.0.0",
Expand Down
40 changes: 22 additions & 18 deletions DevProject/Packages/packages-lock.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{
"dependencies": {
"com.unity.ai.navigation": {
"version": "1.1.4",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.modules.ai": "1.0.0"
},
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
},
"com.unity.barracuda": {
"version": "3.0.0",
"depth": 1,
Expand All @@ -12,7 +21,7 @@
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
},
"com.unity.burst": {
"version": "1.6.6",
"version": "1.8.7",
"depth": 2,
"source": "registry",
"dependencies": {
Expand All @@ -37,7 +46,7 @@
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
},
"com.unity.inputsystem": {
"version": "1.3.0",
"version": "1.6.1",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down Expand Up @@ -72,14 +81,14 @@
}
},
"com.unity.nuget.mono-cecil": {
"version": "1.10.1",
"version": "1.11.4",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
},
"com.unity.nuget.newtonsoft-json": {
"version": "3.0.2",
"version": "3.2.1",
"depth": 1,
"source": "registry",
"dependencies": {},
Expand All @@ -106,7 +115,7 @@
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
},
"com.unity.settings-manager": {
"version": "1.0.3",
"version": "2.0.1",
"depth": 1,
"source": "registry",
"dependencies": {},
Expand All @@ -120,7 +129,7 @@
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
},
"com.unity.test-framework": {
"version": "1.1.29",
"version": "1.1.33",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -141,7 +150,7 @@
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
},
"com.unity.testtools.codecoverage": {
"version": "1.0.0-pre.3",
"version": "1.2.4",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -166,6 +175,12 @@
},
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
},
"com.unity.modules.ai": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.imageconversion": {
"version": "1.0.0",
"depth": 0,
Expand Down Expand Up @@ -206,17 +221,6 @@
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.uielementsnative": "1.0.0"
}
},
"com.unity.modules.uielementsnative": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"m_Name": "Settings",
"m_Path": "ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json",
"m_Dictionary": {
"m_DictionaryValues": [
{
Expand All @@ -20,4 +18,4 @@
}
]
}
}
}
4 changes: 2 additions & 2 deletions DevProject/ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 2021.3.11f1
m_EditorVersionWithRevision: 2021.3.11f1 (0a5ca18544bf)
m_EditorVersion: 2022.3.4f1
m_EditorVersionWithRevision: 2022.3.4f1 (35713cd46cd7)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
// version 1.3.0
// version 1.6.1
// from Assets/ML-Agents/Examples/PushBlockWithInput/PushBlockActions.inputactions
//
// Changes to this file may cause incorrect behavior and will be lost if
Expand All @@ -15,7 +15,7 @@
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Utilities;

public partial class @PushBlockActions : IInputActionCollection2, IDisposable
public partial class @PushBlockActions: IInputActionCollection2, IDisposable
{
public InputActionAsset asset { get; }
public @PushBlockActions()
Expand Down Expand Up @@ -250,20 +250,22 @@ public void Disable()
{
asset.Disable();
}

public IEnumerable<InputBinding> bindings => asset.bindings;

public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
{
return asset.FindAction(actionNameOrId, throwIfNotFound);
}

public int FindBinding(InputBinding bindingMask, out InputAction action)
{
return asset.FindBinding(bindingMask, out action);
}

// Movement
private readonly InputActionMap m_Movement;
private IMovementActions m_MovementActionsCallbackInterface;
private List<IMovementActions> m_MovementActionsCallbackInterfaces = new List<IMovementActions>();
private readonly InputAction m_Movement_movement;
private readonly InputAction m_Movement_jump;
public struct MovementActions
Expand All @@ -277,27 +279,40 @@ public struct MovementActions
public void Disable() { Get().Disable(); }
public bool enabled => Get().enabled;
public static implicit operator InputActionMap(MovementActions set) { return set.Get(); }
public void AddCallbacks(IMovementActions instance)
{
if (instance == null || m_Wrapper.m_MovementActionsCallbackInterfaces.Contains(instance)) return;
m_Wrapper.m_MovementActionsCallbackInterfaces.Add(instance);
@movement.started += instance.OnMovement;
@movement.performed += instance.OnMovement;
@movement.canceled += instance.OnMovement;
@jump.started += instance.OnJump;
@jump.performed += instance.OnJump;
@jump.canceled += instance.OnJump;
}

private void UnregisterCallbacks(IMovementActions instance)
{
@movement.started -= instance.OnMovement;
@movement.performed -= instance.OnMovement;
@movement.canceled -= instance.OnMovement;
@jump.started -= instance.OnJump;
@jump.performed -= instance.OnJump;
@jump.canceled -= instance.OnJump;
}

public void RemoveCallbacks(IMovementActions instance)
{
if (m_Wrapper.m_MovementActionsCallbackInterfaces.Remove(instance))
UnregisterCallbacks(instance);
}

public void SetCallbacks(IMovementActions instance)
{
if (m_Wrapper.m_MovementActionsCallbackInterface != null)
{
@movement.started -= m_Wrapper.m_MovementActionsCallbackInterface.OnMovement;
@movement.performed -= m_Wrapper.m_MovementActionsCallbackInterface.OnMovement;
@movement.canceled -= m_Wrapper.m_MovementActionsCallbackInterface.OnMovement;
@jump.started -= m_Wrapper.m_MovementActionsCallbackInterface.OnJump;
@jump.performed -= m_Wrapper.m_MovementActionsCallbackInterface.OnJump;
@jump.canceled -= m_Wrapper.m_MovementActionsCallbackInterface.OnJump;
}
m_Wrapper.m_MovementActionsCallbackInterface = instance;
if (instance != null)
{
@movement.started += instance.OnMovement;
@movement.performed += instance.OnMovement;
@movement.canceled += instance.OnMovement;
@jump.started += instance.OnJump;
@jump.performed += instance.OnJump;
@jump.canceled += instance.OnJump;
}
foreach (var item in m_Wrapper.m_MovementActionsCallbackInterfaces)
UnregisterCallbacks(item);
m_Wrapper.m_MovementActionsCallbackInterfaces.Clear();
AddCallbacks(instance);
}
}
public MovementActions @Movement => new MovementActions(this);
Expand Down

0 comments on commit 4ea8995

Please sign in to comment.