twinstar6980 / Twinning

https://github.com/twinstar6980/Twinning.Documentation
GNU General Public License v3.0
58 stars 12 forks source link

RTON Decode Bug #5

Closed Haruma-VN closed 1 year ago

Haruma-VN commented 1 year ago

So I was decoding RTON using TwinStar.ToolKit ~ Cli core 26 script 30 shell 26 and this happen, it appear that there is some unknown charset in the RTON file. Here is that RTON file: https://msconfigs-my.sharepoint.com/:u:/g/personal/harumavn963_365_sfc_edu_vn/Ecj6Bdv4j0lCrERwZS08bksB1otdNyUMvUMOfZfzJ0uVzQ?e=aZ5Apq

It seem like this is the bug with the tool decoding system, the game still working normally with this.

image

twinstar6980 commented 1 year ago

This RTON has an implicit RTID logic error, and the tool does have something that should be modified. Where does it come from? Below is the file I decoded. PLANTTYPES.zip

Haruma-VN commented 1 year ago

It come from this RSB: https://drive.google.com/drive/folders/135ybF7p_azg1TcncLesBcf2XDZVqGBUZ

There are some PAMs are broken in the RSB too if I remember correctly, here is one example: https://msconfigs-my.sharepoint.com/:u:/g/personal/harumavn963_365_sfc_edu_vn/ESYEbX0v7-pEur2EJsJJQOkBlwDG8pC7_7wGTkQHlmDo6g?e=I2yEai

image

twinstar6980 commented 1 year ago

this is official's rsb, or not ?

Haruma-VN commented 1 year ago

this is modified rsb from a mod, you should repair it first, it was corrupted by Taiji Disturb.

twinstar6980 commented 1 year ago

There is no error in pam in rsb. The failure to decode the pam provided by you is caused by a structure error. The game can run normally because it has a certain fault tolerance, but the tool strictly throws an exception for any error. This behavior will not Change.

Haruma-VN commented 1 year ago

Thank you for that explaination, will you fix the RTON Decode?

twinstar6980 commented 1 year ago

Perhaps, the fix for this possibly wrong logic needs some testing to let me judge that this is indeed a bug, but I don't have time to test it at the moment, please keep this issue open, I will finish the test or fix it then close.

twinstar6980 commented 1 year ago

Before I decide whether to solve this problem, you can modify and compile Core/core/tool/popcap/rton/encode.hpp yourself to solve the decoding error at runtime. Snipaste_23-02-17_19-44-47

twinstar6980 commented 1 year ago

The current version update has fixed the RTON codec logic error related to this issue, but this fix will not allow your RTON to be decoded, because there is a logic error in RTON (the byte count of the utf8 string is recorded with the string's actual bytes are not equal), tools will strictly treat it as exception RTON and throw an error. The core logic of the tool only processes correct files, including RTON, PAM, RSB, etc. Any abnormal data will be regarded as an error and the processing of the program will be terminated, even if the game itself is fault-tolerant. This is the expected behavior of the tool and will not change in the future. If you need to decode the RTON you provided, you should fix the exception structure first. The tool may provide a script to repair RTON in the future.

twinstar6980 commented 1 year ago

The new version has provided additional RTON lenient decoding function.

Haruma-VN commented 1 year ago

Do I have to use JS Evaluate on it? Or just simply drag the RTON file directly to the tool?

twinstar6980 commented 1 year ago

the latter