Abyssal101 / Overstuffed

A minecraft weight gain mod
Other
2 stars 0 forks source link

Crash when saving config from title screen #5

Open Kinzon opened 3 weeks ago

Kinzon commented 3 weeks ago

Testing what causes the value layers to break, got this crash twice.

Steps to reproduce: 1) Run into bug with mod not updating value layer 2) Quit to title 3) Open overstuffed config (used Game Menu Mod Option by morimori0317) 4) Hit save

Attached is crash log crash-2024-11-11_01.48.38-client.txt

Kinzon commented 3 weeks ago

2024-11-11-6.log

This might be useful as well, should encompass multiple attempts (I think)

Abyssal101 commented 3 weeks ago

I bet I know exactly what’s causing the crash, it’s trying to play the animation when you save, however since there is no player object b/c menu. I’ll add a case to prevent that from happening

however for the value layer not saving, are you using 1.19.2 or 1.20.1

Kinzon commented 3 weeks ago

https://discord.com/channels/1019455262484090931/1286398329496014930/1305416146777935923

Issues I ran into with screenshot. Screenshot from 1.19.2, but reproduced in 1.20.1 as well. Latest version of CPM for both, replicated with exported and test models.

Can take video of model setup to help figure out if it's the mod or my model breaking it as well if needed, but I have replicated the issue on multiple models as well.

Abyssal101 commented 2 weeks ago

Can you show me what you meant by the stuffed layer being broken?

Kinzon commented 2 weeks ago

No oversat 2024-11-13_19 36 38 1 dot 2024-11-13_19 36 47 2 dots 2024-11-13_19 37 40 3 dots 2024-11-13_19 37 58 4 dots 2024-11-13_19 38 14

Sanity check as well with animation setup Screenshot 2024-11-13 193951

Kinzon commented 2 weeks ago

Also sharing an error I hadn't seen before but found in multiple logs

[13Nov2024 19:48:30.773] [Render thread/ERROR] [net.minecraftforge.network.NetworkRegistry/NETREGISTRY]: NetworkDirection channel overstuffed:messages already registered.

Editing for even more info:

When overstuffed ui (in game) says Error: Stuffed and Weight layer same after a death, the config has completely cleared those values.

["CPM Config Options"]

Name of CPM Value Layer for Weight.

weight_layer_config_entry = ""
# Name of CPM Value Layer for Stuffed.
stuffed_layer_config_entry = ""

These update with saved values when filled in again, but clear on death.

Also forgot to mention, all testing has been done on the releases from Oct. 9th

Kinzon commented 2 weeks ago

Wait I think I just figured something out I turned off interpolation on both animations, set min and max weight to 0 - 255

Weight value layer max set to 255 weight

Stuffed value layer max set to 127 stuffed

And all scaling works properly in game. Death still clears the values for some reason, but I think the stuffed value layer isn't being properly interpolated between overstuffed and CPM? Something something youtube rabbit hole can't help but think of signed vs unsigned bits with those specific numbers

Abyssal101 commented 2 weeks ago

First of all, you have no idea how much I appreciate how in-detail your being with this. I've cleaning up code for the past 2 hours, and I think I addressed the stuffed layer being reset on death. The network message one is no good, idk how I missed that.

Do you think Weight is also having an issue with the animation? I know it's pretty hard to check b/c of the gradual nature of it.(Implementing a modifier to make it so ops can manually make that faster soon)

Kinzon commented 2 weeks ago

It's been hard to test to be honest, I have had weight break on me before, but always when something else breaks. Not sure how hard it would be, but would it be possible to make a debug menu similar to the belly graphic, but displayed on screen? Or add more to the debug command, like Weight, WeightValue (what cpm receives) and similar for stuffed? Having live numbers (made pretty or not) would be a huge help for testing so I'm not running that cpm command every 5 seconds lol

And yeah of course! I'm no good at programming myself, but I love tinkering, testing, and breaking things, and I try to document when I can for someone who actually can fix it.

Kinzon commented 2 weeks ago

Oop another bug. Was testing a temp fix with setting the overstuffed.toml to read only would force the config to not clear, turns out that crashes the internal server. And creates a 32 mb crash log after 25 seconds. Hmm.

Kinzon commented 2 weeks ago

Ok figured it out, if weight<100 the belly graphic vanishes (the box remains) and throws this error:

[14Nov2024 00:07:17.463] [Render thread/ERROR] [net.minecraftforge.client.gui.overlay.ForgeGui/]: Error rendering overlay 'overstuffed:stuffedbar' java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 5 at net.willsbr.overstuffed.client.HudOverlay.lambda$static$0(HudOverlay.java:128) ~[overstuffed-1.0-1.19.2.jar%23159!/:1.0-1.19.2] at net.minecraftforge.client.gui.overlay.ForgeGui.lambda$render$0(ForgeGui.java:141) ~[forge-1.19.2-43.4.5-universal.jar%23165!/:?] at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:422) ~[guava-31.0.1-jre.jar%23145!/:?] at net.minecraftforge.client.gui.overlay.ForgeGui.m_93030_(ForgeGui.java:136) ~[forge-1.19.2-43.4.5-universal.jar%23165!/:?] at net.minecraft.client.renderer.GameRenderer.m_109093_(GameRenderer.java:876) ~[client-1.19.2-20220805.130853-srg.jar%23160!/:?] at net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1115) ~[client-1.19.2-20220805.130853-srg.jar%23160!/:?] at net.minecraft.client.Minecraft.m_91374_(Minecraft.java:700) ~[client-1.19.2-20220805.130853-srg.jar%23160!/:?] at net.minecraft.client.main.Main.m_239872_(Main.java:212) ~[1.19.2-43.4.5.jar:?] at net.minecraft.client.main.Main.main(Main.java:51) ~[1.19.2-43.4.5.jar:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?] at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:27) ~[fmlloader-1.19.2-43.4.5.jar:?] at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) ~[modlauncher-10.0.8.jar:?] at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) ~[modlauncher-10.0.8.jar:?] at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) ~[modlauncher-10.0.8.jar:?] at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) ~[modlauncher-10.0.8.jar:?] at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) ~[modlauncher-10.0.8.jar:?] at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) ~[modlauncher-10.0.8.jar:?] at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) ~[modlauncher-10.0.8.jar:?] at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) ~[bootstraplauncher-1.1.2.jar:?]

It appears to throw this every frame. I assume you knew this though since weight starts at 100 (or that was stylistic cause who weighs 0 pounds). Either way for testing probably don't want 23 lines of debug logs every .05ms (EDIT: THIS MIGHT BE LOGGED BY "Not Enough Crashes" AND NOT FORGE the belly graphic still vanishes tho regardless. Also shout out Notepad++ cause that log crashes windows notepad)

Kinzon commented 2 weeks ago

Ah last thing for the night, this error I seemed to have missed:

[14Nov2024 00:06:56.008] [main/ERROR] [mixin/]: Mixin config mixinconfig.overstuffed.json does not specify "minVersion" property

Best guess is forge wants to know what the minimum version that mod can run on is?

Kinzon commented 2 weeks ago

Just realized I never replied to this: "I know it's pretty hard to check b/c of the gradual nature of it.(Implementing a modifier to make it so ops can manually make that faster soon)

That plus on screen values would be a tremendous help for finding number weirdness, maybe also a command or dev item that automatically raises the value since food has a limit (I know about always eat, just want to minimize potential causes of issues)

Also planning on moving things to separate issues tomorrow instead of dumping into this thread