Skip to content

Commit

Permalink
Finished player movement (for now) and made town learning only happen…
Browse files Browse the repository at this point in the history
… once
  • Loading branch information
bruskajp committed Sep 21, 2021
1 parent 62e2000 commit 12c76a2
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 22 deletions.
20 changes: 10 additions & 10 deletions Assets/Scenes/MainGame.unity
Original file line number Diff line number Diff line change
Expand Up @@ -190015,7 +190015,7 @@ BoxCollider:
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 15, y: 10, z: 100}
m_Size: {x: 15, y: 10, z: 120}
m_Center: {x: 0, y: 0, z: 0}
--- !u!54 &647240208
Rigidbody:
Expand Down Expand Up @@ -199110,7 +199110,7 @@ BoxCollider:
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 15, y: 10, z: 100}
m_Size: {x: 15, y: 10, z: 120}
m_Center: {x: 0, y: 0, z: 0}
--- !u!54 &676288429
Rigidbody:
Expand Down Expand Up @@ -458550,12 +458550,12 @@ MonoBehaviour:
- {fileID: 0}
- {fileID: 0}
musicVideos:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 32900000, guid: 3a711a043a4d648e288603f4910d4d90, type: 3}
- {fileID: 32900000, guid: 8c3f7dc90c89542399903860a4239a8f, type: 3}
- {fileID: 32900000, guid: 2fa9635a51d694bbe8d0942e23b4ac90, type: 3}
- {fileID: 32900000, guid: 642a4b74572ef44db89cc7e1834f81ea, type: 3}
- {fileID: 32900000, guid: 4b01d129769a544569e2f5452f0fd198, type: 3}
- {fileID: 32900000, guid: 6c163858e514840ba87b73f8bd90f2f2, type: 3}
--- !u!328 &1556425424 stripped
VideoPlayer:
m_PrefabParentObject: {fileID: 328937643129792720, guid: 941b5dccbc0da4585a324a844ffff8a8,
Expand Down Expand Up @@ -470234,7 +470234,7 @@ BoxCollider:
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 15, y: 10, z: 100}
m_Size: {x: 15, y: 10, z: 120}
m_Center: {x: 0, y: 0, z: 0}
--- !u!54 &1590112248
Rigidbody:
Expand Down Expand Up @@ -499366,7 +499366,7 @@ BoxCollider:
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 15, y: 10, z: 100}
m_Size: {x: 15, y: 10, z: 120}
m_Center: {x: 0, y: 0, z: 0}
--- !u!54 &1685887062
Rigidbody:
Expand Down
10 changes: 6 additions & 4 deletions Assets/Scripts/DeliveryExperiment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class DeliveryExperiment : CoroutineExperiment
// JPB: TODO: Make these configuration variables
private const bool NICLS_COURIER = true;

private const string COURIER_VERSION = "v5.1.0";
private const string COURIER_VERSION = "v5.1.1";
private const string RECALL_TEXT = "*******"; // JPB: TODO: Remove this and use display system
// Constants moved to the Config File
//private const int DELIVERIES_PER_TRIAL = LESS_DELIVERIES ? 3 : (NICLS_COURIER ? 16 : 13);
Expand All @@ -39,8 +39,8 @@ public class DeliveryExperiment : CoroutineExperiment
//private const int TRIALS_PER_SESSION_DOUBLE_TOWN_LEARNING = LESS_TRIALS ? 1 : 3;
private const int EFR_PRACTICE_TRIAL_NUM = 1;
private const int NUM_READ_ONLY_TRIALS = 1;
private const int SINGLE_TOWN_LEARNING_SESSIONS = 0;
private const int DOUBLE_TOWN_LEARNING_SESSIONS = 1;
private const int SINGLE_TOWN_LEARNING_SESSIONS = 1;
private const int DOUBLE_TOWN_LEARNING_SESSIONS = 0;
private const int POINTING_INDICATOR_DELAY = NICLS_COURIER ? 12 : 40;
private const int EFR_KEYPRESS_PRACTICES = 10;
private const float MIN_FAMILIARIZATION_ISI = 0.4f;
Expand Down Expand Up @@ -914,7 +914,9 @@ private List<List<int>> GenMusicVideoOrder()
var reliableRandom = new System.Random(UnityEPL.GetParticipants()[0].GetHashCode());
foreach (int i in Enumerable.Range(0, (continuousSessionNumber / 2) + 1))
{
var twoSessions = Enumerable.Range(0, NUM_MUSIC_VIDEOS).ToList().Shuffle(reliableRandom).ToList();
// TODO: JPB: Temp fix for NICLS Round 2 video reduction (6 -> 4 vids)
//var twoSessions = Enumerable.Range(0, NUM_MUSIC_VIDEOS).ToList().Shuffle(reliableRandom).ToList();
var twoSessions = new List<int>(){0,1,3,4}.Shuffle(reliableRandom).ToList();
videoOrder.Add(twoSessions.GetRange(0, NUM_MUSIC_VIDEOS_PER_SESSION).ToList());
videoOrder.Add(twoSessions.GetRange(NUM_MUSIC_VIDEOS_PER_SESSION, NUM_MUSIC_VIDEOS_PER_SESSION).ToList());
}
Expand Down
11 changes: 6 additions & 5 deletions Assets/Scripts/PlayerMovement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class PlayerMovement : MonoBehaviour
private const bool NICLS_COURIER = true;
private const bool SHOW_FPS = false;

protected float maxTurnSpeed = NICLS_COURIER ? 50f : 45f;
protected float maxTurnSpeed = NICLS_COURIER ? 55f : 45f;
protected float maxForwardSpeed = 10f;
protected float maxBackwardSpeed = 4f;

Expand All @@ -25,6 +25,7 @@ public class PlayerMovement : MonoBehaviour
protected float maxHandlebarRotationX = 20f;
protected float maxHandlebarRotationY = 15f;


private float deltaTime;
private float fixedDeltaTime;

Expand All @@ -40,6 +41,8 @@ void Update()
deltaTime += (Time.unscaledDeltaTime - deltaTime) * 0.1f;
}

float lastRotation = 0f;

void FixedUpdate ()
{
fixedDeltaTime = Time.fixedDeltaTime;
Expand All @@ -52,15 +55,13 @@ void FixedUpdate ()
{
Quaternion deltaRotation = Quaternion.Euler(Vector3.up * horizontalInput * maxTurnSpeed * Time.fixedDeltaTime);
playerBody.MoveRotation(playerBody.rotation * deltaRotation);
}
else
{
playerBody.rotation = playerBody.rotation;
//playerBody.AddRelativeTorque();
}

// Move the player
if (verticalInput > joystickDeadZone)
playerBody.velocity = Vector3.ClampMagnitude(playerBody.transform.forward * verticalInput * maxForwardSpeed, maxForwardSpeed);
//playerBody.velocity = Vector3.ClampMagnitude(playerBody.transform.forward * (verticalInput - Mathf.Abs(horizontalInput) * 0.2f) * maxForwardSpeed, maxForwardSpeed);
else if (verticalInput < -joystickDeadZone)
playerBody.velocity = Vector3.ClampMagnitude(playerBody.transform.forward * verticalInput * maxBackwardSpeed, maxBackwardSpeed);
else
Expand Down
2 changes: 1 addition & 1 deletion ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ PlayerSettings:
m_BuildTargetGraphicsAPIs:
- m_BuildTarget: MacStandaloneSupport
m_APIs: 1100000010000000
m_Automatic: 0
m_Automatic: 1
m_BuildTargetVRSettings:
- m_BuildTarget: Android
m_Enabled: 0
Expand Down
2 changes: 1 addition & 1 deletion configs/NiclsCourierClosedLoop.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"counterBalanceCorrectIncorrectButton": false,

"trialsPerSession": 5,
"trialsPerSessionSingleTownLearning": 5,
"trialsPerSessionSingleTownLearning": 2,
"trialsPerSessionDoubleTownLearning": 2,
"deliveriesPerPracticeTrial": 16,
"deliveriesPerTrial":16
Expand Down
2 changes: 1 addition & 1 deletion configs/NiclsCourierReadOnly.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"counterBalanceCorrectIncorrectButton": false,

"trialsPerSession": 5,
"trialsPerSessionSingleTownLearning": 5,
"trialsPerSessionSingleTownLearning": 2,
"trialsPerSessionDoubleTownLearning": 2,
"deliveriesPerPracticeTrial": 16,
"deliveriesPerTrial":16,
Expand Down

0 comments on commit 12c76a2

Please sign in to comment.