makamys / MAtmos

Minecraft Atmospheric sounds simulator (1.7.10, 1.12.2)
Other
27 stars 5 forks source link

Matmos engine crashes when max block ID is increased #5

Closed floral-qua-floral closed 3 years ago

floral-qua-floral commented 4 years ago

Matmos version 35.1 with Mixin 0.7 Minecraft 1.12.2

I'm getting Matmos crash warnings in the chat when I use Matmos in a very heavily modded environment (about 475 total mods loaded). It isn't crashing the game, just not behaving correctly and producing a lot of warnings in the chat. I've confirmed that this issue does not occur in a clean environment with just Forge and Matmos, however I haven't gone and narrowed it down quite yet.

I'm submitting the issue report now rather than doing more testing first just on the off-chance this might be an issue that can be identified and prevented through the information in the latest.log, which contains data on the Matmos crashes that are occurring. If it would be helpful, though, I can certainly go and work on cutting out mods until I can identify the specific conflict or conflicts causing the errors.

The latest.log file attached below is a log of me launching my modpack including Matmos with the Matmos 2020 Zen pack already enabled, generating & entering a new Default-type world in Creative, and receiving some Matmos crash errors. I then quit to the main menu and close the game. latest.log

The first error seems to be at lines 58077 and 58107, if that's useful information. If you need me to go and test more to identify the specific mod conflicts, let me know and I'll take care of that.

makamys commented 4 years ago

The error is caused because JustEnoughIDs raises the max block ID, whereas MAtmos assumes by default that the max ID is 4096. (#2 was the same problem.) However, this can be changed in the config file (.minecraft/config/matmos/userconfig.cfg), with this option

# The max block ID. This is 4096 normally, but there are mods that raise it. Getting an ArrayIndexOutOfBoundsException is indication that it needs to be raised.
world.maxblockid=4096

In your case blocks with an ID of 5366 are being accessed, so I'd suggest setting it to something like 8000 (or 8192 for extra nerd cred) to be on the safe side.

I should probably change the max block ID to grow dynamically to avoid this problem, but for the time being this is the workaround.

dedo1911 commented 3 years ago

I'm also wondering if there's a way to just specify item/block name (as "modname:item_name") instead of giving also numeric ID.

BBoldt commented 3 years ago

Also happening in 1.7.10, as seen in the issue I just linked. Thanks for posting the solution here.

Could you please make matmos crash only to the log instead of spamming the chat? Even if it's a config option.

Edit: I'm not sure i'm having the same problem, I'll try to get a better log and probably post a separate issue with mine if it's not the NEID thing. My pack does have NEID though.

makamys commented 3 years ago

I'm also wondering if there's a way to just specify item/block name (as "modname:item_name") instead of giving also numeric ID.

What do you mean? You can already use item names in the soundpack JSONs. Or do you mean I should index the blocks by names instead of IDs in MAtmos's block counting code? That would require using a map, which would be poor for performance (keep in mind counting blocks is something that happens every tick).

Could you please make matmos crash only to the log instead of spamming the chat? Even if it's a config option.

Sure, but this should be a separate issue, I created #15 for it.


I'm closing this as a duplicate of #2, take any further discussion about this there.