aldelaro5 / LiveSplit.BugFables

Autosplitter component for Bug Fables: The Everlasting Sapling for use in LiveSplit
MIT License
0 stars 2 forks source link

Start split issues #1

Open aldelaro5 opened 3 years ago

aldelaro5 commented 3 years ago

It can happen inconsistently that the start split will not trigger properly.

It's very hard to reproduce and I have personally not been able to, but has been reproduced by people a few times.

To attempt to see what's going on, I put logs in fa33882e9820aa8388918fcc434f913d4d47c208

Cyan got a log that make the music id logic seems suspicious.

After some investigation, I found that the cause was possibly because the old listening to title was reset in a place where it shouldn't have. As an attempt to fix it, I removed this in 31ec4b45edaaf2e6bafdb9440f9d12fb77ee156d but it's not 100% guaranteed to have fixed it.

If this attempt doesn't fix it, the best solution is to remove the music id check altogether which will have the side effect to trigger when someone boots livesplit as a file is loaded in bug fables. There MIGHT be a way to not do anything on the first update or something like that, but it seems the best solution should this not work.

Any further reports of this can be posted here with a corresponding log file and a description of what happened as well as when the log file was captured.

thePlaj commented 3 years ago

Today the start split did not trigger when I attempted to start a new run with the timer running. I grabbed the log right after this happened - see attached. Video: https://www.twitch.tv/videos/1004637278 LiveSplit.BugFables-log.txt

aldelaro5 commented 3 years ago

Today the start split did not trigger when I attempted to start a new run with the timer running. I grabbed the log right after this happened - see attached. Video: https://www.twitch.tv/videos/1004637278 LiveSplit.BugFables-log.txt

this is very weird, but it really seems like I should just do away with the song checks, I will do that tomorrow.

To be sure, what version of the autosplitter you use? you can check in the settings.

thePlaj commented 3 years ago

It’s version 1.2.7

aldelaro5 commented 3 years ago

Yeah so it was up to date

I have a good news: I FINALLY figured out the ACTUAL issue and....I'm a bit puzzled by it.

Basically, there is a random chance that if you reset the game, the base pointer path I have been using to access the MainManager instance (aka p much everything lol) can break and STAY broken for the entirety of the execution. It can fix itself if you load a save and reset again (though I would imagine it could fix by doing language and confirming it since I think that also causes a MainManager.Reset()). What this should mean btw is that not only the start split will never work because it can't read the memory, but EVERY SPLITS would be broken until the path becomes valid.

This is kind of a big deal because it will get worse when I add multiversion support. I will try to investigate a more reliable pointer path.

I will however still remove the song check because I just tested it and I found a very simple hack to prevent LiveSplit from triggering if you open it with a file loaded: just put the default value of the old to true so that it will either stay true, or go to false and nothing will happen. it's only when it goes from false to true that it will do the start split. This means that the logic will be less prone to errors and make it simpler overall.

I will post updates whenever they happen, but we FINALLY know the cause now.

aldelaro5 commented 3 years ago

Ok I just pushed an update (it's live right now) that changes the pointer path to be more reliable and I simplified the start split logic.

This is a relatively dangerous change, but I made sure that the first 2 splits still works which is honestly most of them (because of how abstract the logic is).

How I will operate: since I am relatively confident this will fix the start split issue once and for all, I will leave this issue open for a week. If NO ONE reports a regression or another start split not triggering instance after this week on version 1.2.8, I am closing the issue.