From 728efc69df6aa7cb03e405b9fe44b40e41113bf9 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Mon, 11 Jul 2022 10:02:06 -0700 Subject: [PATCH 1/5] calculate velocity relative to the reference on anglers --- QSB/Anglerfish/WorldObjects/QSBAngler.cs | 6 ++++-- QSB/Player/RemotePlayerVelocity.cs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/QSB/Anglerfish/WorldObjects/QSBAngler.cs b/QSB/Anglerfish/WorldObjects/QSBAngler.cs index a43ba8c22..b2ff1036b 100644 --- a/QSB/Anglerfish/WorldObjects/QSBAngler.cs +++ b/QSB/Anglerfish/WorldObjects/QSBAngler.cs @@ -28,7 +28,9 @@ public void UpdateTargetVelocity() return; } - TargetVelocity = (TargetTransform.position - _lastTargetPosition) / Time.fixedDeltaTime; - _lastTargetPosition = TargetTransform.position; + var reference = Locator.GetCenterOfTheUniverse().GetStaticReferenceFrame().transform; + var currentRelPosition = reference.InverseTransformPoint(TargetTransform.position); + TargetVelocity = (currentRelPosition - _lastTargetPosition) / Time.fixedDeltaTime; + _lastTargetPosition = currentRelPosition; } } diff --git a/QSB/Player/RemotePlayerVelocity.cs b/QSB/Player/RemotePlayerVelocity.cs index aaeed4f82..5b5c87f00 100644 --- a/QSB/Player/RemotePlayerVelocity.cs +++ b/QSB/Player/RemotePlayerVelocity.cs @@ -13,6 +13,6 @@ public void FixedUpdate() var reference = Locator.GetCenterOfTheUniverse().GetStaticReferenceFrame().transform; var currentRelPosition = reference.InverseTransformPoint(transform.position); Velocity = (currentRelPosition - _prevRelPosition) / Time.fixedDeltaTime; - _prevRelPosition = reference.InverseTransformPoint(transform.position); + _prevRelPosition = currentRelPosition; } } From de9d813a6bb03871cbcac43068107b743e374d2f Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Mon, 11 Jul 2022 10:58:19 -0700 Subject: [PATCH 2/5] i forgot to remove a test method --- QSB/Utility/VariableSync/BaseVariableSyncer.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/QSB/Utility/VariableSync/BaseVariableSyncer.cs b/QSB/Utility/VariableSync/BaseVariableSyncer.cs index 4e8004824..27291a1b8 100644 --- a/QSB/Utility/VariableSync/BaseVariableSyncer.cs +++ b/QSB/Utility/VariableSync/BaseVariableSyncer.cs @@ -12,7 +12,6 @@ public abstract class BaseVariableSyncer : QSBNetworkBehaviour [NonSerialized] public T Value; - public bool Bruh() => HasChanged(); protected override bool HasChanged() => !EqualityComparer.Default.Equals(PrevValue, Value); protected override void UpdatePrevData() => PrevValue = Value; protected override void Serialize(NetworkWriter writer) => writer.Write(Value); From ba635fc0f3eea0b033641f803bb3a5dd8801b7a0 Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Tue, 12 Jul 2022 10:14:28 +0100 Subject: [PATCH 3/5] credit xen lol --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index be56f00eb..a3a4580c4 100644 --- a/README.md +++ b/README.md @@ -182,6 +182,7 @@ The template for this file is this : - [ShoosGun](https://github.com/ShoosGun) - [Chris Yeninas](https://github.com/PhantomGamers) - Help with project files and GitHub workflows. - [Tlya](https://github.com/Tllya) - Russian translation. +- [Xen](https://github.com/xen-42) - French translation. ### Special Thanks - Thanks to Logan Ver Hoef for help with the game code, and for helping make the damn game in the first place. From 10959682d1214033b95418d34db36b498554aa84 Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Tue, 12 Jul 2022 10:28:26 +0100 Subject: [PATCH 4/5] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a3a4580c4..d5fb8052a 100644 --- a/README.md +++ b/README.md @@ -198,6 +198,7 @@ The template for this file is this : - [EpicOnlineTransport](https://github.com/FakeByte/EpicOnlineTransport) - [HarmonyX](https://github.com/BepInEx/HarmonyX) - [UniTask](https://github.com/Cysharp/UniTask) +- Modified code from [Popcron's Gizmos](https://github.com/popcron/gizmos) ## Help / Discuss development / Whatever From a7b98bce071ac561f42e67f238068e01098155a3 Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Thu, 14 Jul 2022 10:33:21 +0100 Subject: [PATCH 5/5] bump versions --- QSB/Menus/MenuManager.cs | 2 +- QSB/QSB.csproj | 2 +- QSB/manifest.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/QSB/Menus/MenuManager.cs b/QSB/Menus/MenuManager.cs index 5fdefd368..0af3dfd18 100644 --- a/QSB/Menus/MenuManager.cs +++ b/QSB/Menus/MenuManager.cs @@ -39,7 +39,7 @@ internal class MenuManager : MonoBehaviour, IAddComponentOnStart private const int _titleButtonIndex = 2; private float _connectPopupOpenTime; - private const string UpdateChangelog = $"QSB Version 0.20.0\r\nThis update brings better ship syncing (including destruction), more things around the village being synced, and general bug fixes."; + private const string UpdateChangelog = $"QSB Version 0.20.1\r\nFixed a velocity calculation bug with some fish."; private Action PopupClose; diff --git a/QSB/QSB.csproj b/QSB/QSB.csproj index 005bfdc7e..0891399ec 100644 --- a/QSB/QSB.csproj +++ b/QSB/QSB.csproj @@ -97,6 +97,6 @@ - + diff --git a/QSB/manifest.json b/QSB/manifest.json index b4ea8e717..6d397662b 100644 --- a/QSB/manifest.json +++ b/QSB/manifest.json @@ -7,8 +7,8 @@ "body": "- Disable *all* other mods. (Can heavily affect performance)\n- Make sure you are not running any other network-intensive applications." }, "uniqueName": "Raicuparta.QuantumSpaceBuddies", - "version": "0.20.0", - "owmlVersion": "2.3.3", + "version": "0.20.1", + "owmlVersion": "2.5.2", "dependencies": [ "_nebula.MenuFramework", "JohnCorby.VanillaFix" ], "pathsToPreserve": [ "debugsettings.json", "storage.json" ] }