Skip to content

Update to 1.43#24

Open
AmeliaGL0w0 wants to merge 1 commit intoKylemc1413:masterfrom
AmeliaGL0w0:master
Open

Update to 1.43#24
AmeliaGL0w0 wants to merge 1 commit intoKylemc1413:masterfrom
AmeliaGL0w0:master

Conversation

@AmeliaGL0w0
Copy link
Copy Markdown

No description provided.

@Meivyn
Copy link
Copy Markdown
Collaborator

Meivyn commented May 3, 2026

Appreciate the PR but this is not enough to make it compatible with the new versions. I'd also rather like you to use the available constants and not hardcode anything, and there's no need to bump all dependencies either. The ThrowIfInvalid overload it was using doesn't work since it was removed from SongCore which now uses MonoMod rather than HarmonyX. It's not required anymore anyway as Insert will now throw when it's invalid, unlike before. I also wanted to convert ME to that but I haven't got it it just yet.

@AmeliaGL0w0
Copy link
Copy Markdown
Author

AmeliaGL0w0 commented May 3, 2026

i've removed ThrowIfInvalid() lines and with that the mod still works. however about the constants being hardcoded, id like to defend them one time. my thinking is BeatGames removed the const valued (prob after 1.41 because of the v4 obstacles), and they are static anyway, so technically there would be no harm in that, though i do value your point about hardcoding, its not a good practice and i do understand that, plus if beatgames were to change those values in a new game update (which is unlikely but coud happen), then hardcoded values would be out of date and thus there would be the need to switch between those depending on game version. i can try getting those values by not hardcoding them, however thats the limit for my coding knowledge for now. i am very much new to beat saber modding, and i would have no idea how to switch to monomod from harmonyx (if thats what you meant, to me sounds like a big refactor). if you wont be satisfied with me replacing the hardcoded values and would want to do that switch, feel free to close this PR, otherwise ill try my best to fix my mistakes

@Meivyn
Copy link
Copy Markdown
Collaborator

Meivyn commented May 3, 2026

Yeah unfortunately there's more than just finding the corresponding constants (if any). It's possible that they removed some and that the code must be adjusted in consequence to be able to use them.

I am not expecting you to make the switch to MonoMod, but yeah removing the ThrowIfInvalid is better than trying to use Harmony's nonsense "reason" overload.

I've actually made a couple changes locally to address the new updates but I didn't push anything yet. There's one complex inlining issue and a patch that must be made to address the changes. I recommend you to test any changes made with at least Air, Keep the Rave Alive and Sky. But ideally should also try on V2, V3 and V4 maps.

@AmeliaGL0w0
Copy link
Copy Markdown
Author

[WARNING @ 00:05:25 | UnityEngine] BoxCollider does not support negative scale or size.
[WARNING @ 00:05:25 | UnityEngine] The effective box size has been forced positive and is likely to give unexpected collision geometry.
[WARNING @ 00:05:25 | UnityEngine] If you absolutely need to use negative scaling you can use the convex MeshCollider. Scene hierarchy path "Obstacle(Clone)/ObstacleCore/Collider"

fun.
ill come back to this tommorow, but before i go tell me if my approach is better than pure hardcoding and if i should stick with what im doing
THIS DEFINITELY DOESNT MATCH PREVIOUS VERSION BEHAVIOR, i tried

private static void Postfix(ref float __result, NoteLineLayer lineLayer)
        {
            if (!Plugin.active)
            {
                return;
            }
  >>>  const float delta = StaticBeatmapObjectSpawnMovementData.kBaseLinesYPos + (0.6f*2) - StaticBeatmapObjectSpawnMovementData.kBaseLinesYPos + 0.6f;
            var layer = (int)lineLayer;
            if (layer is >= 1000 or <= -1000)
            {
>>>          __result = StaticBeatmapObjectSpawnMovementData.kBaseLinesYPos + 0.6f - delta - delta + layer * delta / 1000;
            }
            else if (layer is > 2 or < 0)
            {
>>>          __result = StaticBeatmapObjectSpawnMovementData.kBaseLinesYPos + 0.6f - delta + layer * delta;
            }
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants