Skip to content

Commit

Permalink
Random changes from forever ago
Browse files Browse the repository at this point in the history
Don't use matchmakingMode (likely invalid), just report Unknown
Max out DistanceCurve / SkillScalarOverTimeCurve for Very Hard cop class
Remove old HeavyOffRoad hack for cop RoutingType
Remove old MaxAiVisibilityDistance hack
Add support for adjusting SideSlam, but don't actually commit it yet
  • Loading branch information
alexstrout committed Sep 2, 2020
1 parent 86c7195 commit d6da961
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 23 deletions.
2 changes: 1 addition & 1 deletion NFS14DifficultyTool/DifficultyForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void SetStatus(string text = "Ready...", bool preserveStatusList = false)
try {
Invoke(new SetStatusCallback(SetStatus), new object[] { text, preserveStatusList });
}
catch (ObjectDisposedException) {
catch (Exception) {
//May happen as threads are aborting, don't care
}
}
Expand Down
33 changes: 11 additions & 22 deletions NFS14DifficultyTool/DifficultyFormWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public MatchmakingModeEnum GetMatchmakingMode() {
NFSObject ProfileOptions;
if (!TryGetObject("ProfileOptions", out ProfileOptions))
return;
MatchmakingModeEnum matchmakingMode = (MatchmakingModeEnum)ProfileOptions.FieldList["MatchmakingMode"].Field;
MatchmakingModeEnum matchmakingMode = MatchmakingModeEnum.Unknown; //(MatchmakingModeEnum)ProfileOptions.FieldList["MatchmakingMode"].Field;
string status;
switch (matchmakingMode) {
case MatchmakingModeEnum.Public:
Expand Down Expand Up @@ -373,32 +373,20 @@ public void UpdateCopClass(int index, bool eqWeapUse) {
PersonaLibraryPrefab.FieldList[s + " - WeaponSkillVsAIRacer"].Field = skillVsRacer;
}

//Don't use SideSlam, it's kinda buggy
//foreach (string s in copPersonalityList)
// PersonaLibraryPrefab.FieldList[s + " - SideSlam-Chance"].Field = 0f;

//Adjust PacingPursuitScheduleHard to tougher values to make a Very Hard class
NFSObject PacingPursuitScheduleHard;
if (!TryGetObject("PacingPursuitScheduleHard", out PacingPursuitScheduleHard))
return;
if ((ClassEnum)index == ClassEnum.AroundTheWorld) {
PacingPursuitScheduleHard.FieldList["DistanceCurve-1-X"].Field = 5000f;
PacingPursuitScheduleHard.FieldList["SkillScalarOverTimeCurve-1-X"].Field = 4800f;
PacingPursuitScheduleHard.FieldList["DistanceCurve-1-X"].Field = 999999f;
PacingPursuitScheduleHard.FieldList["SkillScalarOverTimeCurve-1-X"].Field = 999999f;
}
else
PacingPursuitScheduleHard.ResetFieldsToDefault(); //Safe as these are the only things we change

//Finally change RoutingType to more efficient HeavyOffRoad (like Racers use)
if ((ClassEnum)index >= ClassEnum.Hard) {
foreach (string s in copPersonalityList) {
PersonaLibraryPrefab.FieldList[s + " - RoutingType"].Field = NFSObjectPersonaLibraryPrefab.RoutingType.RoutingType_HeavyOffRoad;
PersonaLibraryPrefab.FieldList[s + " - RoutingRoadBiasMin"].Field = 1f;
PersonaLibraryPrefab.FieldList[s + " - RoutingRoadBiasMax"].Field = 1f;
}
}
else {
foreach (string s in copPersonalityList) {
PersonaLibraryPrefab.FieldList[s + " - RoutingType"].Field = PersonaLibraryPrefab.FieldList[s + " - RoutingType"].FieldDefault;
PersonaLibraryPrefab.FieldList[s + " - RoutingRoadBiasMin"].Field = PersonaLibraryPrefab.FieldList[s + " - RoutingRoadBiasMin"].FieldDefault;
PersonaLibraryPrefab.FieldList[s + " - RoutingRoadBiasMax"].Field = PersonaLibraryPrefab.FieldList[s + " - RoutingRoadBiasMax"].FieldDefault;
}
}
});
}

Expand Down Expand Up @@ -515,6 +503,10 @@ public void UpdateRacerClass(int index, bool eqWeapUse) {
PersonaLibraryPrefab.FieldList[s + " - WeaponSkillVsAICop"].Field = skillVsCop;
PersonaLibraryPrefab.FieldList[s + " - WeaponSkillVsAIRacer"].Field = skillVsRacer;
}

//Don't use SideSlam, it's kinda buggy
//foreach (string s in racerPersonalityList)
// PersonaLibraryPrefab.FieldList[s + " - SideSlam-Chance"].Field = 0f;
});
}

Expand Down Expand Up @@ -645,9 +637,6 @@ public void UpdateCopHeatIntensity(int index) {
AiDirectorEntityData.FieldList["Heat" + i + " - TimeIntervalAfterSuccessfulEscapeBeforeTryingToSpawnCop"].Field = AiDirectorEntityData.FieldList["Heat" + i + " - TimeIntervalAfterSuccessfulEscapeBeforeTryingToSpawnCop"].FieldDefault;
}

//This is just always this to at least match ClientViewCullRadius - not really sure where this should go
AiDirectorEntityData.FieldList["MaxAiVisibilityDistance"].Field = 500f;

//Now do specific overrides by heat intensity
int count, lastCount;
switch ((HeatEnum)index) {
Expand Down
24 changes: 24 additions & 0 deletions NFS14DifficultyTool/FieldDefaults.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,13 @@
"ChaserCopPersonality - RoutingRoadBiasMax" 1.25f
"RacerTutorialCop - RoutingRoadBiasMax" 1.25f
"CopTutorialCop - RoutingRoadBiasMax" 1.25f
"AggressorCopPersonality - SideSlam-Chance" 0.01f
"BruteCopPersonality - SideSlam-Chance" 0.01f
"BasicCopPersonality - SideSlam-Chance" 0.01f
"AdvAggressorCopPersonality - SideSlam-Chance" 0.01f
"ChaserCopPersonality - SideSlam-Chance" 0.01f
"RacerTutorialCop - SideSlam-Chance" 0.01f
"CopTutorialCop - SideSlam-Chance" 0.01f
"AggressorCopPersonality - PacingSkill" 0.7f
"BruteCopPersonality - PacingSkill" 0.7f
"BasicCopPersonality - PacingSkill" 0.5f
Expand Down Expand Up @@ -381,6 +388,23 @@
"CopTutorialRacer - RoutingRoadBiasMax" 1.1f
"CautiousRacer - RoutingRoadBiasMax" 2f
"ViolentRacer - RoutingRoadBiasMax" 1.2f
"Tier1WeaponRacer - SideSlam-Chance" 0.003f
"RecklessRacer - SideSlam-Chance" 0.003f
"Tier2CautiousRacer - SideSlam-Chance" 0.003f
"Tier1ViolentRacer - SideSlam-Chance" 0.01f
"Tier1RecklessRacer - SideSlam-Chance" 0.003f
"Tier1CautiousRacer - SideSlam-Chance" 0.003f
"RacerTutorialRacer - SideSlam-Chance" 0.003f
"CleanRacer - SideSlam-Chance" 0f
"Tier2WeaponRacer - SideSlam-Chance" 0.003f
"Tier1CleanRacer - SideSlam-Chance" 0f
"Tier2ViolentRacer - SideSlam-Chance" 0.01f
"Tier2RecklessRacer - SideSlam-Chance" 0.003f
"Tier2CleanRacer - SideSlam-Chance" 0f
"WeaponRacer - SideSlam-Chance" 0.003f
"CopTutorialRacer - SideSlam-Chance" 0.003f
"CautiousRacer - SideSlam-Chance" 0.003f
"ViolentRacer - SideSlam-Chance" 0.01f
"Tier1WeaponRacer - PacingSkill" 0.5f
"RecklessRacer - PacingSkill" 0.5f
"Tier2CautiousRacer - PacingSkill" 0.5f
Expand Down
24 changes: 24 additions & 0 deletions NFS14DifficultyTool/NFSObjectPersonaLibraryPrefab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ public NFSObjectPersonaLibraryPrefab(MemoryManager memManager)
FieldList.Add("ChaserCopPersonality - RoutingRoadBiasMax", new NFSFieldFloat(this, "6C+87A0"));
FieldList.Add("RacerTutorialCop - RoutingRoadBiasMax", new NFSFieldFloat(this, "6C+8DE0"));
FieldList.Add("CopTutorialCop - RoutingRoadBiasMax", new NFSFieldFloat(this, "6C+8EA8"));
FieldList.Add("AggressorCopPersonality - SideSlam-Chance", new NFSFieldFloat(this, "88+7FD0"));
FieldList.Add("BruteCopPersonality - SideSlam-Chance", new NFSFieldFloat(this, "88+8160"));
FieldList.Add("BasicCopPersonality - SideSlam-Chance", new NFSFieldFloat(this, "88+83B8"));
FieldList.Add("AdvAggressorCopPersonality - SideSlam-Chance", new NFSFieldFloat(this, "88+8610"));
FieldList.Add("ChaserCopPersonality - SideSlam-Chance", new NFSFieldFloat(this, "88+87A0"));
FieldList.Add("RacerTutorialCop - SideSlam-Chance", new NFSFieldFloat(this, "88+8DE0"));
FieldList.Add("CopTutorialCop - SideSlam-Chance", new NFSFieldFloat(this, "88+8EA8"));
FieldList.Add("AggressorCopPersonality - PacingSkill", new NFSFieldFloat(this, "74+7FD0"));
FieldList.Add("BruteCopPersonality - PacingSkill", new NFSFieldFloat(this, "74+8160"));
FieldList.Add("BasicCopPersonality - PacingSkill", new NFSFieldFloat(this, "74+83B8"));
Expand Down Expand Up @@ -201,6 +208,23 @@ public NFSObjectPersonaLibraryPrefab(MemoryManager memManager)
FieldList.Add("CopTutorialRacer - RoutingRoadBiasMax", new NFSFieldFloat(this, "6C+9038"));
FieldList.Add("CautiousRacer - RoutingRoadBiasMax", new NFSFieldFloat(this, "6C+9100"));
FieldList.Add("ViolentRacer - RoutingRoadBiasMax", new NFSFieldFloat(this, "6C+91C8"));
FieldList.Add("Tier1WeaponRacer - SideSlam-Chance", new NFSFieldFloat(this, "88+8098"));
FieldList.Add("RecklessRacer - SideSlam-Chance", new NFSFieldFloat(this, "88+8228"));
FieldList.Add("Tier2CautiousRacer - SideSlam-Chance", new NFSFieldFloat(this, "88+82F0"));
FieldList.Add("Tier1ViolentRacer - SideSlam-Chance", new NFSFieldFloat(this, "88+8480"));
FieldList.Add("Tier1RecklessRacer - SideSlam-Chance", new NFSFieldFloat(this, "88+8548"));
FieldList.Add("Tier1CautiousRacer - SideSlam-Chance", new NFSFieldFloat(this, "88+86D8"));
FieldList.Add("RacerTutorialRacer - SideSlam-Chance", new NFSFieldFloat(this, "88+8868"));
FieldList.Add("CleanRacer - SideSlam-Chance", new NFSFieldFloat(this, "88+8930"));
FieldList.Add("Tier2WeaponRacer - SideSlam-Chance", new NFSFieldFloat(this, "88+89F8"));
FieldList.Add("Tier1CleanRacer - SideSlam-Chance", new NFSFieldFloat(this, "88+8AC0"));
FieldList.Add("Tier2ViolentRacer - SideSlam-Chance", new NFSFieldFloat(this, "88+8B88"));
FieldList.Add("Tier2RecklessRacer - SideSlam-Chance", new NFSFieldFloat(this, "88+8C50"));
FieldList.Add("Tier2CleanRacer - SideSlam-Chance", new NFSFieldFloat(this, "88+8D18"));
FieldList.Add("WeaponRacer - SideSlam-Chance", new NFSFieldFloat(this, "88+8F70"));
FieldList.Add("CopTutorialRacer - SideSlam-Chance", new NFSFieldFloat(this, "88+9038"));
FieldList.Add("CautiousRacer - SideSlam-Chance", new NFSFieldFloat(this, "88+9100"));
FieldList.Add("ViolentRacer - SideSlam-Chance", new NFSFieldFloat(this, "88+91C8"));
FieldList.Add("Tier1WeaponRacer - PacingSkill", new NFSFieldFloat(this, "74+8098"));
FieldList.Add("RecklessRacer - PacingSkill", new NFSFieldFloat(this, "74+8228"));
FieldList.Add("Tier2CautiousRacer - PacingSkill", new NFSFieldFloat(this, "74+82F0"));
Expand Down

0 comments on commit d6da961

Please sign in to comment.