Skip to content

Commit

Permalink
Resolve merge conflicts, merging behaviourTree into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
lenalinke committed Oct 12, 2024
2 parents a16d11b + eaa5f51 commit 678869e
Show file tree
Hide file tree
Showing 76 changed files with 6,093 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1755,6 +1755,9 @@ PrefabInstance:
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: 26f8cd740528f3b469c4f32fe28b8306, type: 3}
insertIndex: -1
addedObject: {fileID: 4269083640301180635}
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: 26f8cd740528f3b469c4f32fe28b8306, type: 3}
insertIndex: -1
addedObject: {fileID: 2241099583876537163}
m_SourcePrefab: {fileID: 100100000, guid: 26f8cd740528f3b469c4f32fe28b8306, type: 3}
--- !u!1 &212402951927973884 stripped
GameObject:
Expand Down Expand Up @@ -1882,6 +1885,102 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: afa2f315da5127e47a996e328f4ffff3, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!82 &2241099583876537163
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 212402951927973884}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 1
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!4 &447753056685965252 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8645416474800241303, guid: 26f8cd740528f3b469c4f32fe28b8306, type: 3}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1757,6 +1757,9 @@ PrefabInstance:
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: 26f8cd740528f3b469c4f32fe28b8306, type: 3}
insertIndex: -1
addedObject: {fileID: 8327870396362132631}
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: 26f8cd740528f3b469c4f32fe28b8306, type: 3}
insertIndex: -1
addedObject: {fileID: 8651058445503294158}
m_SourcePrefab: {fileID: 100100000, guid: 26f8cd740528f3b469c4f32fe28b8306, type: 3}
--- !u!1 &212402951927973884 stripped
GameObject:
Expand Down Expand Up @@ -1884,6 +1887,102 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: afa2f315da5127e47a996e328f4ffff3, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!82 &8651058445503294158
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 212402951927973884}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 1
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!4 &700674713753034054 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 26f8cd740528f3b469c4f32fe28b8306, type: 3}
Expand Down
3 changes: 3 additions & 0 deletions Assets/Virtual Agents Framework/Runtime/Scripts/Agent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ namespace i5.VirtualAgents
[RequireComponent(typeof(AgentAnimationUpdater))] // Responsible for the avatar's movement
public class Agent : MonoBehaviour
{
/// <summary>
/// The task system which manages the tasks of the agent
/// </summary>
public ITaskSystem TaskSystem { get; private set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@ public class AgentAnimationUpdater : MonoBehaviour
private Animator animator;

// animation Parameter Names
/// <summary>
/// Controls the forward speed.
/// </summary>
[Tooltip("Controls the forward speed.")]
[SerializeField] private string forwardSpeed = "Speed";

/// <summary>
/// Controls the angular speed.
/// </summary>
[Tooltip("Controls the angular speed.")]
[SerializeField] private string angularSpeed = "Turn";

// animation IDs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,39 @@ public class AdaptiveGaze : MonoBehaviour
{
private class AdaptiveGazeTargetInfo
{
/// <summary>
/// The gaze target that is looked at
/// </summary>
public AdaptiveGazeTarget lookAtTarget = null;

/// <summary>
/// Distance to the target
/// </summary>
public float distance = 0;

/// <summary>
/// The importance of the item for the agent. The higher the value, the more liekly it is the agent to look at it. Increases during runtime resets novelty for the agent
/// </summary>
public float importance = 0;

/// <summary>
/// The time the agent looked at the target
/// </summary>
public float timeLookedAt = 0;

/// <summary>
/// The novelty of the target
/// </summary>
public float novelty = 0;

/// <summary>
/// This value is calculated based on the importance, distance, time looked at and novelty
/// </summary>
public float calcValueOfInterest = 0;

/// <summary>
/// Specifies if the target is currently nearby
/// </summary>
public bool isCurrentlyNearby = false;
}
/// <summary>
Expand All @@ -26,36 +53,76 @@ private class AdaptiveGazeTargetInfo
[Tooltip("When this transform is set, the gaze target is overwritten and the agent looks at this transform constantly without interruption (within the boundaries specified by the AimAt Script, e.g. distanceLimit and angleLimit)")]
public Transform OverwriteGazeTarget = null;

/// <summary>
/// The radius in which the agent looks for gaze targets
/// </summary>
[Tooltip("The radius in which the agent looks for gaze targets")]
[SerializeField] private float detectionRadius = 10f;

/// <summary>
/// The maximum number of targets in range that are considered for the gaze
/// </summary>
[Tooltip("The maximum number of targets in range that are considered for the gaze")]
[SerializeField] private int maxNumberOfTargetsInRange = 50;

[Tooltip("The interval in seconds in which the agent looks for new targets when not moving.")]
/// <summary>
/// The interval in seconds in which the agent looks for new targets when not moving
/// </summary>
[Tooltip("The interval in seconds in which the agent looks for new targets when not moving")]
[SerializeField] private float detectionIntervalWhenIdle = 3f;
[Tooltip("The interval in seconds in which the agent looks for new targets when moving.")]

/// <summary>
/// The interval in seconds in which the agent looks for new targets when moving
/// </summary>
[Tooltip("The interval in seconds in which the agent looks for new targets when moving")]
[SerializeField] private float detectionIntervalWhenWalking = 0.5f;

private float detectionInterval = 3f;

// Define the chances for target selection, e.g. chance for the second most interesting target in the list to be looked at
[Tooltip("The chance that the agent looks at the highest ranked target based on the algorithm, see documentation.")]
/// <summary>
/// The chance that the agent looks at the highest ranked target based on the algorithm, see documentation
/// </summary>
[Tooltip("The chance that the agent looks at the highest ranked target based on the algorithm, see documentation")]
[Range(0f, 1f)]
[SerializeField] private float chanceHighestRankedTarget = 0.5f;
[Tooltip("The chance that the agent looks at the second highest ranked target based on the algorithm, see documentation.")]

/// <summary>
/// The chance that the agent looks at the second-highest ranked target based on the algorithm, see documentation
/// </summary>
[Tooltip("The chance that the agent looks at the second-highest ranked target based on the algorithm, see documentation")]
[Range(0f, 1f)]
[SerializeField] private float chanceSecondHighestTarget = 0.1f;
[Tooltip("The chance that the agent looks at the third highest ranked target based on the algorithm, see documentation.")]

/// <summary>
/// The chance that the agent looks at the third highest ranked target based on the algorithm, see documentation
/// </summary>
[Tooltip("The chance that the agent looks at the third highest ranked target based on the algorithm, see documentation")]
[Range(0f, 1f)]
[SerializeField] private float chanceThirdHighestTarget = 0.1f;

/// <summary>
/// The chance that the agent looks at a random target
/// </summary>
[Tooltip("The chance that the agent looks at a random target")]
[Range(0f, 1f)]
[SerializeField] private float chanceRandomTarget = 0.05f;

/// <summary>
/// The chance that the agent does not look at any target and looks ahead
/// </summary>
[Tooltip("The chance that the agent does not look at any target and looks ahead")]
[Range(0f, 1f)]
[SerializeField] private float chanceIdleTarget = 0.25f;

/// <summary>
/// The speed at which the agent looks and switches between targets
/// </summary>
[Tooltip("The speed at which the agent looks and switches between targets")]
[SerializeField] private float lookSpeed = 2f;

private AdaptiveGazeTargetInfo currentTargetOfInterest;

/// <summary>
/// The object layers that are checked for gaze targets, default is everything for the sake of simplicity.
/// It is recommended to set this to a more specific layer mask to improve performance.
Expand Down
Loading

0 comments on commit 678869e

Please sign in to comment.