Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8,973 changes: 0 additions & 8,973 deletions Assets/Scenes/UserPersonalitySurveyTIPI.unity

This file was deleted.

32 changes: 17 additions & 15 deletions Assets/Scripts/Behavior/AgentComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -638,26 +638,28 @@ public IEnumerator WaitAWhile(int seconds)
//Dont't forget to set started waiting to false before state change
}


public bool IsGoodToBeAttacked(GameObject other, float minDist) {


return (Vector3.Distance(other.transform.position, transform.position) < minDist && CanFight() && other.GetComponent<GeneralStateComponent>().CanFight());

}
///Returns true if a fight conditions are met
public bool IsGoodToFight(GameObject other, float minDist)
{
//dist < 3f seklindeydi
if (Vector3.Distance(other.transform.position, transform.position) < minDist && CanFight() && other.GetComponent<GeneralStateComponent>().CanFight()){
// only fight with real player ?

// if (other == null) {
// Debug.LogError("Opponent is null in fight");
// return false;
// }
if (other.CompareTag("RealPlayer"))
{

public bool IsGoodToAttack(GameObject other, float minDist) {

if(IsGoodToBeAttacked(other, minDist)) {

if(other.CompareTag("RealPlayer") && _appraisal.DoesStandardExist(other, AppDef.Disapproving))

return true;
}


if (other.CompareTag("Player") && (_appraisal.DoesStandardExist(other, AppDef.Disapproving) || _appraisal.DoesStandardExist(other.transform.parent.gameObject, AppDef.Disapproving)))
else if(other.CompareTag("Player") && (_appraisal.DoesStandardExist(other, AppDef.Disapproving) || _appraisal.DoesStandardExist(other.transform.parent.gameObject, AppDef.Disapproving)))
return true;
}


return false;
}

Expand Down
8 changes: 4 additions & 4 deletions Assets/Scripts/Behavior/ShopperBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ void Start()



_navmeshAgent.speed += 0.6f; //faster than usual
//_navmeshAgent.speed += 0.6f; //faster than usual


CurrentObjs = new GameObject("AchievedObjects");
Expand Down Expand Up @@ -202,9 +202,9 @@ void Update()
//Disapproved agents are the ones who achieve my desired object before me
foreach (GameObject c in _agentComponent.CollidingAgents)
{

if(c.CompareTag("RealPlayer")) {
if(!c.GetComponent<HumanComponent>().IsFighting() && _agentComponent.IsGoodToFight(c, 1f)) { //human not fighting yet and close to human
if(!c.GetComponent<HumanComponent>().IsFighting() && _agentComponent.IsGoodToAttack(c, 1f)) { //human not fighting yet and close to human and is disapproving
if(c.GetComponent<HumanShoppingBehavior>().IsWorthFighting()) { //human has ipads
_agentComponent.StartFight(c, true);
c.GetComponent<HumanComponent>().StartFight(this.gameObject, false);
Expand All @@ -217,7 +217,7 @@ void Update()
}
}

else if (c.GetComponent<ShopperBehavior>() != null && _agentComponent.IsGoodToFight(c, 5f)){
else if (c.GetComponent<ShopperBehavior>() != null && _agentComponent.IsGoodToAttack(c, 5f)){
_agentComponent.StartFight(c, true);
c.GetComponent<AgentComponent>().StartFight(this.gameObject, false);

Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/Human/HumanComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void Update()
if(TimeSinceLastFight()>5f) { //don't start a fight immediately
foreach(GameObject c in CollidingAgents) {

if(c.CompareTag("Player") && IsVisible(c, VisibilityAngle) && c.GetComponent<AgentComponent>().IsGoodToFight(this.gameObject, 2f)) {
if(c.CompareTag("Player") && IsVisible(c, VisibilityAngle) && c.GetComponent<AgentComponent>().IsGoodToBeAttacked(this.gameObject, 2f)) {
StartFight(c, true);
c.GetComponent<AgentComponent>().StartFight(this.gameObject, false);
}
Expand Down
7 changes: 7 additions & 0 deletions Assets/Scripts/Human/HumanShoppingBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ void Start() {
float[] persStd = { 0.1f, 0.1f, 0.1f, 0.1f, 0.1f };
UpdatePersonalityAndBehavior(persMean, persStd);
}
else {

float[] persMean = { 0f, 1f, -1f, 1f, -1f };
float[] persStd = { 0.1f, 0.1f, 0.1f, 0.1f, 0.1f };
UpdatePersonalityAndBehavior(persMean, persStd);

}
}

_ipadColliders = new List<Collider>();
Expand Down
6 changes: 4 additions & 2 deletions Assets/Scripts/PersonalityMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ public void PersonalityToSteering()
// float minSpeed = 0.3f;
float maxSpeed = 1.6f;//1.4f;
float minSpeed = 1.0f;// 1.0f;
navMeshAgent.speed = GetComponent<AgentComponent>().WalkingSpeed = ((0.5f* personality[(int)OCEAN.E] + 0.5f) * (maxSpeed - minSpeed) + minSpeed); //Adjusts current speed as well

navMeshAgent.speed = GetComponent<AgentComponent>().WalkingSpeed = ((0.5f* personality[(int)OCEAN.E] + 0.5f) * (maxSpeed - minSpeed) + minSpeed); //Adjusts current speed as well



navMeshAgent.acceleration = 1f;

//Waiting duration [11 21] frames
Expand Down
4 changes: 2 additions & 2 deletions Assets/Scripts/UI/UserDemographicsGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static class UserInfo {
public static int Quality = 0;

public static float[] TIPI = new float[10];
public static int PersonalityDistribution = 1; //0: docile, 1: hostile
public static int PersonalityDistribution = 0; //0: docile, 1: hostile

}

Expand All @@ -43,7 +43,7 @@ public class UserDemographicsGUI : MonoBehaviour {

private void Awake() {

UserInfo.PersonalityDistribution = 1;
UserInfo.PersonalityDistribution = 0;

Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
Expand Down
4 changes: 2 additions & 2 deletions ProjectSettings/EditorBuildSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ EditorBuildSettings:
path: Assets/Scenes/UserPreStudySurvey.unity
guid: 5d1679097771a4bd083f168e41f50fbe
- enabled: 1
path: Assets/Scenes/UserPersonalitySurvey1.unity
guid: 8215412a2584c409cb86f57518a37b87
path: Assets/Scenes/UserPersonalitySurvey.unity
guid: bbd2be098f1064d8ab0fe6876053d54b
- enabled: 1
path: Assets/Scenes/Sales.unity
guid: 3965a05aa2da7483fbb78342ef43a0b5
Expand Down
12 changes: 6 additions & 6 deletions UserSettings/EditorUserSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ EditorUserSettings:
value: 5452525e0102585e0e085a7611775a48414e1c287f7c7161752c1b61b0b56068
flags: 0
RecentlyUsedSceneGuid-4:
value: 5008025304055c5a0c5c08234777074310151a7d747b7262282f4960e3b0366d
value: 56550550520c59025a595b7311775d14464f4b2c7d7e7e3579781b66b2e6363d
flags: 0
RecentlyUsedSceneGuid-5:
value: 56550550520c59025a595b7311775d14464f4b2c7d7e7e3579781b66b2e6363d
value: 01540454550c0d030e595f7a47770c4645151e78292c76367f2f1f64b7e6643a
flags: 0
RecentlyUsedSceneGuid-6:
value: 01540454550c0d030e595f7a47770c4645151e78292c76367f2f1f64b7e6643a
value: 0103565353015e585f5b5f7643770e4145164d7a7e7d22647a784d37e7b76d3b
flags: 0
RecentlyUsedSceneGuid-7:
value: 0103565353015e585f5b5f7643770e4145164d7a7e7d22647a784d37e7b76d3b
value: 5008025304055c5a0c5c08234777074310151a7d747b7262282f4960e3b0366d
flags: 0
RecentlyUsedSceneGuid-8:
value: 015350540750590255085d7246775b481715482c297e7e677b794860e6b5603a
value: 5b03055351045b5a5f5b547613770f491515407c2a7d71657c711c60b5e26c6f
flags: 0
RecentlyUsedSceneGuid-9:
value: 5b03055351045b5a5f5b547613770f491515407c2a7d71657c711c60b5e26c6f
value: 015350540750590255085d7246775b481715482c297e7e677b794860e6b5603a
flags: 0
vcSharedLogLevel:
value: 0d5e400f0650
Expand Down
Loading