Flat-Badger-1971 / ArchiveHelper

0 stars 1 forks source link

Gw target marker does not stay on #5

Closed Stemuweb closed 5 months ago

Stemuweb commented 5 months ago

https://github.com/Flat-Badger-1971/ArchiveHelper/blob/a08bfae85494a786f46bca944cf5fdf7031740a6/misc/markers.lua#L76-L82

Tested in french (duo & solo) and english (solo). Reproductibility: 100%

In every stage 3, where Gw the pilferer is present, if you move the reticle on him, the marker target will be set. The second time, the reticle will move on him, the target will be removed. It repeats activating/deactivating the target on Gw every time it enters the reticle.

Cause: both tests on Fabled and Gw are active at the same time. One call to the function markerCheck will set the marker because it tracks the string "Gw the pilferer". When the player targets for the second times Gw and it has a marker, the sanity check will remove the marker because it does not detect the string "Fabled".

The comment in doChecks says: "possible fabled due to one boss, no marauders or shards". Does it happens after arc 6? I never encountered a fabled during a boss stage.

Possible solutions:

Stemuweb commented 5 months ago

Not tested yet but there's also probably a similar issue after [Arc 4 Cycle 3], when Fabled and Shards need to be detected during the same Phase. So having two target names passed to markerCheck() could be the best approach.

Flat-Badger-1971 commented 5 months ago

I think a lot of this is down to a recent change I made to reuse code - I've just reverted that change to the original logic and implemented that for gw too. Hopefully that will resolve the problems.

And yes, there is one boss that can summon Fabled mobs, but I can't remember which one it is at the moment.

Stemuweb commented 5 months ago

I'll get your code and test it right away.

Stemuweb commented 5 months ago

It's not fixed. Do you allow me to create a new branch and rewrite the function markerCheck? I have a easy solution (not optimized for the moment). I'm not good at lua but my code will be so simple that an AI assistant will be able to help me write it....

Flat-Badger-1971 commented 5 months ago

Feel free - saves me spending even more hours in the infinite archive :-)

Stemuweb commented 5 months ago

I swear Gw is on vacation today and the clerk's wing is closed for repairs.

Flat-Badger-1971 commented 5 months ago

Yeah, you would not believe how many times I've reset the Archive trying to find the right things

Stemuweb commented 5 months ago

My change is commited.

Can you test my file? Feel free to rename, reorganize or optimize as you see fit. I'll remove the testing code after that.

To make testing easier, in the first levels before Gw and the Fableds, any target whose name contains "p" or "f" will be marked. You can change these patterns as you wish.

I'll do more testing tonight and tomorrow in the latter arcs.

Stemuweb commented 5 months ago

Testing was ok yesterday but I did not reach end of arc 4 so could not test the case fabled+shard

As for optimisation: if doing several string.find (with exact matching) could pose a performance problem, it should be possible to take advantage of the pattern matching in this case and detect all enemy types at once.

~It would be possible to compact the target names in a pattern that looks something like this: "(fabled|gw the pilferer)" and use (string.match(text, pattern) = nil)~

I have no idea whether the callbacks linked to the reticle need to be super-optimised or not. If you don't find any problems with my version of markerCheck(), and want me to optimise it, let me know

Edit: scrap this optimization idea. After a search on the net, , I've learned that ZOS uses a version of lua with very light pattern recognition. The OR operator is not managed in the patterns.

Stemuweb commented 5 months ago

Also, I noticed my chat debug message were never displayed in the very first phase. I think it could be linked to how AH.InsideArchive is computed but I didn't look any further. It's no biggie. Just go to at least the 2nd phase of the run, to check if target markers are applied correctly on multiple enemy types.

Stemuweb commented 5 months ago

Method to reproduce more quickly and test easily:

1) either go to stage 3 if GW is present, move reticle on and off Gw. Effect: GWCheck marks(), FabledCheck() unmarks

2) Activate shards (as trash mobs) detection from arc 1. Go to cycle 4 when fableds appear, move reticle on and off fabled. Effect: FabledCheck() marks, ShardCheck() unmarks