Author Topic: Labyrinth of Touhou 19F  (Read 305958 times)

0 Members and 1 Guest are viewing this topic.

Thurler

  • Go slow to go fast
    • Twitch
    • Twitter
    • Github
  • Gender: Male
Re: Labyrinth of Touhou 19F
« Reply #60 on: May 27, 2020, 04:59:47 AM »
Actually, Thurler just found out the hit rate formula today, it's (ACC*100)/(EVA+100)%, with ACC being the user's Accuracy plus the spell's Accuracy modifier. So at base 100 ACC with no modifiers you'd have a 50% chance of hitting a target with 100 EVA.

To expand a bit on this, if a move has 10000 ACC or higher, the game treats the target's EVA stat as if it were 0, effectively giving the move 10000% chance to hit! :cirnotan:

Messing around a bit further with damage and evasion calculation also helped me isolate where in the code damage variance comes into the damage calculation, and properly patch it out so damage is consistent. This should help with testing out spell formulas or whether some things scale additively or multiplicatively, just in case there's still something we don't know. It also acts as a ground truth if you're planning out how much damage you'll do to a boss.

The game basically takes the exact damage value, multiplies it by (1000 + X), then divides it by 1000. X here is an integer from (what I assume to be) -100 to +100, giving the 10% variance we know should exist. What the patch below does is change the division to also be (1000 + X), effectively negating the damage variance. This might make Marisa's Sudden Impulse skill useless, depending on how the game calculates the bonuses from that, I haven't tested that out. To patch your game:
  • Open your game exe on any hex editor
  • Look for the following hex sequence: E8 B4 98 FD FF 6A 00 68 E8 03 00 00 (should be at offset 0x36C4A)
  • Replace it with the following hex sequence: E8 B4 98 FD FF 6A 00 51 90 90 90 90
Obviously you should backup your exe in case something goes wrong. This changes the last 5 bytes in the sequence from a "push 1000" instruction to a "push ecx" instruction followed by 4 NOPs. This is what hijacks the fixed 1000 value from before with the same random number used for the multiplication. In the unlikely event we get another patch, I've kinda documented the procudure I used to find that hex sequence in the video linked below, so that the same steps can be used to determine the new offset (the sequence includes a "call" instruction, which is likely to change in a new patch/build). There's also one for the accuracy/evasion formula, if anyone is interested in how these were found in some detail.

Patching out damage variance: https://www.youtube.com/watch?v=sNufZRu2fSE
Figuring out the ACC/EVA formula: https://www.youtube.com/watch?v=TBXjbTsJLJE

Re: Labyrinth of Touhou 19F
« Reply #61 on: May 28, 2020, 09:56:16 PM »
Nice find Thurler, i've seen your segmented run, good stuff.

Does any1 know how to start new game+ with plus disk characters unlocked?
I swear i saw someone do that, but i can't find it anymore.
The only thing left is

Spoiler:
Full Power Dragon God
 
because the enhanced stuff isn't for me lol, and IC is kinda lame.

Re: Labyrinth of Touhou 19F
« Reply #62 on: May 30, 2020, 11:36:18 AM »
Oh, here I was thinking the old Forum was just dead, but apprently it moved, huh...

Glad to see the translations finished, thanks for that.

And to chime in a bit on the hex edits: on the newest translated version, going to 0006F0E0 and changing
"C7 41 28 00 00 00 00" to "C7 41 28 64 00 00 00" disables spell animations.

Will be doing the "transition screen" between battles later as well I think, but that is going to break the music as well so I probably won't post it unless requested.

Re: Labyrinth of Touhou 19F
« Reply #63 on: May 30, 2020, 03:00:41 PM »
As a precaution (I haven't tested it, but I wouldn't be surprised if it was an issue), later versions of the first Labyrinth of Touhou had an option to disable spell animations, and it broke a few secondary effects, such as Flandre's self-damage/party-wide ATB loss and I think also Kaguya and Okuu's self-boosts. LoT2 is a different game but from what I've seen, it's still a mess code-wise.



In other news, LoT2 will be heading to Switch and PS4 this summer:

https://www.cubetype.com/works/tohoLaby/

https://n-e-studio.com/

https://twitter.com/aaa_3peso/status/1266703130000949248

This is an HD version from what I can gather. The "2" is being dropped from the title as the first game won't be heading to consoles. There should be a patch at some point for the PC version to get the enhancements, and it should be on Steam "eventually". It appears there's some type of delay getting it there ( https://twitter.com/aaa_3peso/status/1266284289605332993 ).

Some specific changes I was able to get out of google translate:
  • HD image quality
  • Revisions to the character portraits by the artist
  • the speed of movement in the dungeon is 1.5 times
  • the amount of bonus experience from special items is doubled, the consecutive battle bonus is increased
« Last Edit: May 30, 2020, 05:34:04 PM by qazmlpok »

Zoomy Tsugumi

  • zoom zoom
Re: Labyrinth of Touhou 19F
« Reply #64 on: May 30, 2020, 03:04:32 PM »
Stat/EXP doubling seems like it'd break the game balance? Unless it's a double boost that only applies into +Disk. Maingame balance is fine as it is it doesn't really need changing.

Anyway it's a real shame that we won't get an enhanced version of LoT1.

Re: Labyrinth of Touhou 19F
« Reply #65 on: May 30, 2020, 04:45:15 PM »
It specifically says that it doubles the effect of the EXP increasing special items, not all special items.

Validon98

  • Utahime says hello!
Re: Labyrinth of Touhou 19F
« Reply #66 on: May 30, 2020, 05:33:16 PM »
A quick looking at the specific phrasing, it's closer to being:

-1.5 times dungeon walk speed
-Double effectiveness of experience increasing special items
-Consecutive battle bonus increased

I did get a bit more confused by the Google Translate but yeah it's not just double XP.

Serela

  • Wait, it's Mafia Time?
  • Time was a mistake.
Re: Labyrinth of Touhou 19F
« Reply #67 on: May 31, 2020, 05:01:19 AM »
You don't have many exp up items for most of maingame, so it's probably fine. Should cut down on the lategame plus grind which is cool. Increased walk speed very handy in general but especially for plumbing through all those dang IC floors. Maybe the eye-straining flashes will be nerfed for IC too finally? (if they were just removed, that'd also really speed up IC)

Re: Labyrinth of Touhou 19F
« Reply #68 on: June 07, 2020, 01:29:39 AM »
1. you can increase your monitors refresh rate to make the game run very very fast
2. you can use hialgoboost too but it sucks having to instlal some stupid tool
3. the buffed movement speed sounds nice in the steam version
4. the "less grind" sounds bad because I already found the game too non-grindy compared to Lot1 so I already had to cheat the game to be more grind-heavy especially with the removed animations and all bla
5. ugh I cannot for the life of me figure out how to increase the stupid movement speed, I wish ethan was still around to reverse engineer the heck out of this game
6. the verification questions are very hard, I havent touched actual original touhou games in several years

Gesh86

  • Supporter of Hina
    • YouTube
  • Gender: Male
Re: Labyrinth of Touhou 19F
« Reply #69 on: June 10, 2020, 08:02:58 AM »
So the remaster/port of Labyrinth of Touhou 2 will just be known as Labyrinth of Touhou. Meanwhile, LoT 3 is already in development...

I can already foresee where this is going: Labyrinth of Touhou 6 will be called so in Japan, but 3 in the west. Then 3peso unifies it again with LoT 7 and Youtubers will have to make videos explaining what happened to 4,5 and 6.  :cirnotan:

Re: Labyrinth of Touhou 19F
« Reply #70 on: June 19, 2020, 12:20:36 AM »
that would be final fantasy all over again...

Re: Labyrinth of Touhou 19F
« Reply #71 on: June 20, 2020, 01:59:49 AM »
---

edited because Im dumb, nevermind
« Last Edit: June 20, 2020, 10:48:04 AM by Moon »

Re: Labyrinth of Touhou 19F
« Reply #72 on: July 10, 2020, 02:39:41 PM »
The release date of the PS4/Switch version has been announced as July 16th: https://twitter.com/aaa_3peso/status/1281498215989170176

Re: Labyrinth of Touhou 19F
« Reply #73 on: July 16, 2020, 12:51:28 AM »
Now that the Switch edition is out, I can say the new HD art is a mixed bag, some notable differences in the portraits I immediatly noticed

Komachi has red eyes
Rumia has a smaller face, making her skull/hair look bigger than before
Remilia's smile was nerfed
Reimu's smile is now more awkward
Marisa has thicker eyebrows, better shaped eyes and a smaller smile
Mokou looks absolutely disgusted at something to the right
Satori found about a thing called makeup, and now looks directly at your soul... and is a bit less smug
Keine is now smiling
Reisen is smiling too, and her mouth is higher than before
Wriggle's eyes look more feminine
Hina is now looking at you instead of looking at her right
Eirin has her mouth open and a more relaxed look

Many of the changes involve opening the mouth for some reason o.O
And so far, only noticed changes in the face layer in the chars, if we don't count the obvious higher resolution of them

Oh and the Switch seems to be locked at 30 fps with slowdowns when you use certain spells (Nitori's damaging spells all cause fps problems, Kasen's Echo of the Nine Forest Gods too, and many more)




Serela

  • Wait, it's Mafia Time?
  • Time was a mistake.
Re: Labyrinth of Touhou 19F
« Reply #74 on: July 16, 2020, 04:12:56 AM »
100% not surprised at the lag issues XD I'm actually surprised I wasn't expecting it. Fujiyama Volcano must really be painful. The series has never been well optimized...

Thurler

  • Go slow to go fast
    • Twitch
    • Twitter
    • Github
  • Gender: Male
Re: Labyrinth of Touhou 19F
« Reply #75 on: July 16, 2020, 05:39:58 AM »
Just to address the fps/lag issue since I've had some time to mess around with the game for a bit now. Firstly, the Switch version is NOT locked to 30 fps, I got confused since the menus were clearly smooth but my capture card kept showing me a 30fps feed so I thought my eyes probably degraded a bit and moved on. After streaming/playing some more I realized my capture card can't handle 1080p60 and drops that to 30fps, which led to the confusion.

However, there is a LOT of framerate issues on the Switch release, that seem to be absent from the PS4 one. It's really about the same as you'd get on a lower end PC, some slowdown on specific spells, lots of it on others, and some noticeable drop in framerate as you fill the map more and more. If you idle after entering the dungeon for the first time, the game stays at 60fps stable, but then after I mapped out all of 1F it seemed to drop to 45-50. It's noticeable when comparing them, but really doesnt get in the way at all when playing. Obviously stuff like Nitori's Extending Arm tanking the fps to 15 as the spell "explodes" is a lot more intrusive.

Again, all of this seems absent on the PS4, making me believe they either prioritized that or didn't test Switch enough in docked mode. Or you know, maybe the PS4 just has a lot more power than the Switch. :meiling:
I'll play some more on portable mode tomorrow to see if it gets any better, but I doubt it.

As far as the Switch version goes, I feel like the game would run much, much better if they targeted 720p60 instead of 1080p60, given the history of poor optimizations going on in the original PC release. And then in portable mode drop some of the particle effects to reduce lag, or maybe even lower the target resolution a bit. Heck, I'd be fine with a stable 30fps, it's not like there's much going on anyway, and it'd be a decent compromise when playing on the go. Which to me is the biggest perk on the Switch release, anyway.

To sum it all up, I'd get the PS4 version if you have the option and don't plan on playing on the go, but tbh waiting for the PC version might be the cheapest and best option in the long run, what with the lower price and possibility of English / misc. patches.

Also I like the new Rumia, she looks cute!  :cirnotan:

Validon98

  • Utahime says hello!
Re: Labyrinth of Touhou 19F
« Reply #76 on: July 16, 2020, 11:19:23 AM »
From playing it a bit myself (because admittedly LoT2 with the ability to actually set it down mid-dungeon if need be is great the way it is for any given EO), so far the lag, while not great, doesn't really slow the game down but instead just does regular frameskipping, so thankfully nothing becomes extremely slow. Just very choppy.

Thurler

  • Go slow to go fast
    • Twitch
    • Twitter
    • Github
  • Gender: Male
Re: Labyrinth of Touhou 19F
« Reply #77 on: July 17, 2020, 03:43:56 AM »
Played a bit more today while in handheld mode and was surprised to see less frame drops. The smaller stuff like moving through the dungeon feels less choppy, even on fully explored areas, and a few spells also seemed to stutter less. The big hits like Nitori's Super Scope still make very noticeable stutters, but they seemed a lot less intrusive on the smaller screen. All of this just makes me believe the game would run pretty much flawlessly when docked if it targetted 720p instead of 1080, since portable mode uses the lower resolution, but hey, enough complaining from me! :p

I was messing around with some team compositions and made a very minimalistic party for the Kraken fight on 5F, nothing fancy, just Kasen+Parsee for TRR stuff, Nitori to Super Scope and Momiji as a tank. As I tried optimizing the fight over and over I realized I was getting all 5 drops every time, which should be kinda rare since the odds for that are 4/81.

I checked on the PC version and with some other fights, apparently the game increases the drop rate for items if your average party level is well under the enemy's level. Poked around in Cheat Engine but couldn't find any formula or by how much it increases, but the empirical data suggests a high enough increase to guarantee the usual 33% or 25% boss drops. I went to B11F with only a Lv1500 Nitori and was consistently getting an item drop from the encounters with a single enemy, almost every time, despite the highest drop rate being 6% with a 60% ish bonus. Could be useful for farming Gems and Jewels, though tbh you're probably getting lots of them regardless if you're grinding for the true final boss.

Validon98

  • Utahime says hello!
Re: Labyrinth of Touhou 19F
« Reply #78 on: July 18, 2020, 11:08:40 PM »
So it was mentioned that the specific QoL changes were to special items that increased XP as well as consecutive battle bonuses, and more specifically, I've tested that the battle bonus is now +3% to everything (from +2% to everything) per battle, still up to a cap of +100% to everything at 34 battles instead of 50 battles. The special items have gone from +1% to their respective bonuses to +2% (from 1.6% to 2% for the drop rate items), capping at 50% bonus at 25 instead of 25% at 25 (40% at 25 for drop rate). So generally speaking, it's a somewhat smaller bonus, but ultimately it does mean that XP/money gain is slightly higher on the whole and that battle chains pay out faster than before. I don't know about the second layer of special items yet since I'm still at 6F and that's not for a long time, but I'll keep an eye on that once I hit plus disk content.

EDIT: Speaking of, since playing Team 9 through this game has forever ruined my ability to stick to playing with a full team of 12, this time around my party is going to be a team of 8, with all five members of the SDM, Minoriko just as a healer on the side, and then MAlice Cannon shenanigans. It's preferable to me just because of how I play this game, and it gives me some additional variety.
« Last Edit: July 21, 2020, 12:51:07 AM by Validon98 »

Validon98

  • Utahime says hello!
Re: Labyrinth of Touhou 19F
« Reply #79 on: July 25, 2020, 11:33:50 AM »
New post to say that patch version 1.106 for PC plus disk version has been put up by 3peso. Can't go pick that up at the moment but figured I'd let people know.

Edit: Here's a reupload since firestorage and axfc are silly as usual:

https://drive.google.com/file/d/1vwSPM2NdWwi2aBJ7U24hoPjT7sJJJPnz/view?usp=sharing
« Last Edit: July 25, 2020, 12:33:42 PM by Validon98 »

Validon98

  • Utahime says hello!
Re: Labyrinth of Touhou 19F
« Reply #80 on: July 25, 2020, 12:35:17 PM »
New post to say that patch version 1.106 for PC plus disk version has been put up by 3peso. Can't go pick that up at the moment but figured I'd let people know.

Edit: Here's a reupload since firestorage and axfc are silly as usual (1.106a):

https://drive.google.com/file/d/1suKOpi2YoAG5Woo-OJPJLTT4M9uXFB7l/view?usp=sharing

Looked through the patch notes, mostly bug fixes but a notable thing beyond the Switch/PS4 version QoL is the following line:

Quote
・地上最上階の聖ボスからの経験値量を従来の6倍に変更
    →地下最深部の雑魚と比べてかなり強いにも関わらず、取得経験値が最深部雑魚戦より低いというアンバランスな状態を是正しました

Looks like... I think this is saying that bosses on 30F give out 6 times their original XP, which means they are now proper grinding material instead of it just being B11F grinding forever?

Another Edit: ...And 1.106a has already been released and I have noticed probably why, monsters were suddenly not giving any money. Welp.

Okay yep another Edit sorry: I've changed the above link to point to the reuploaded 1.106a patch. Looks like the 0 money glitch has been fixed, the only other thing I've noticed is that the consecutive battle bonus does not seem to properly be +3% like it is in the Switch version, it's still +2%. Not sure how to tell 3peso that but, uh. Yeah.

Last edit for now: Alright I've done a stupid and just, replied to his tweet about 1.106a, I don't know if he'll respond or care or whatever, just hoping I was able to get the message across I guess. @.@;
« Last Edit: July 25, 2020, 01:32:23 PM by Validon98 »

Re: Labyrinth of Touhou 19F
« Reply #81 on: July 25, 2020, 03:28:50 PM »
Updated exe to the new patch.

https://drive.google.com/file/d/1giGii10VbJJdcIWLQtTZwu3On6BPv8xZ/view?usp=sharing

There are a lot of missing strings in here, primarily in the items and achievements. I suspect a lot of these are scrubbing out direct references from the various copyrights. I can't read or type out Japanese so I'm not going to try and sort them out myself. I'll post an updated exe when those get sorted out.

Additionally, if you're interested in the new character portraits, I extracted those as well: https://drive.google.com/file/d/1TjaX1g1EqNwurT4sngtRes696CKoFLxZ/view?usp=sharing
This includes the old ones for easy comparison. Anything not in the "New" folder is using the old image. This includes all _SS graphics, so Eirin's Voile portrait still uses her slight smile, while the full-screen version uses her new big goofy smile.

Also there are graphical artifacts on Aya_S.png and Ran_S.png, and yes they do show up in-game.

Thurler

  • Go slow to go fast
    • Twitch
    • Twitter
    • Github
  • Gender: Male
Re: Labyrinth of Touhou 19F
« Reply #82 on: July 26, 2020, 06:35:53 AM »
Looks like... I think this is saying that bosses on 30F give out 6 times their original XP, which means they are now proper grinding material instead of it just being B11F grinding forever?

I did some quick math and if you beat all 56 bosses in one trip you get about 2.1 billion EXP, and each B11F encounter is around 9-12 million EXP, depending on monster count and species. The only concern here is how hard/fast it is to get Appraiser Shou to oneshot all 56 bosses with Radiant Treasure Gun, which is easy on B11F thanks to everything being weak to SPI. It's definitely an option though, you can farm some Metal Kedamas to grind the consecutive battle bonus to 250% (post pillar of light) then go destroy the bosses.

In fact, if there is a way to respawn the bosses without exiting the dungeon, you could farm those 2.1 billion several times in the same streak, making it even more efficient. I don't think there is a way, though...


The patch notes mentioned something about a treasure chest in 9F extra being changed as well, I went to check and the treasure chest that gave you a Tisiphone Edge now gives you a Grand Master Breaker Title. A very welcome change since GMBTs are very useful to fight against post-game pre-PD bosses. Many skills that had minor bugs have been fixed too, and Kokoro's masks now buff/debuff all stats by 12% instead of just ATK (previously other stats were only changed by 10%).



In some reverse engineering news, I've been replaying the game while making saves before every boss battle so I can go back and replay them whenever (also doubles as a way to test stuff for speedrun routing), and now that I've reached Plus Disk I figured I'd take a shot at reverse engineering PD bosses' AI. This is a very manual process so I can't exactly be bothered to do it for every enemy, so I plan to stick to bosses only. I've been using Cheat Engine to find where in the exe the AI for a specific enemy is, and then looking up that part on Ghidra so I can interpret the decompiled function that controls the AI. I've managed to extract the AI for Shadow Kasen, Suika and Yuugi so far: https://pastebin.com/3GpUKQNs

To speed this up I also dumped the internal spell IDs the game uses to identify attacks: https://pastebin.com/5gkMXvUR
Shoutouts to FabulaFares for finding out the starting ID for each spell category long ago when I was poking at enemy AI stuff.

I plan on dumping the AI as I progress through my PD (re)playthrough, though right now with all the patching I'll wait for a stable version before running the Ghidra decompiler again (the patch notes specifically mentioned changing a few boss' AI, so I figured I should use the latest 1.106 exe, have been using 1.105b). Hopefully more news on this soon. :p

Re: Labyrinth of Touhou 19F
« Reply #83 on: July 26, 2020, 01:52:28 PM »
In fact, if there is a way to respawn the bosses without exiting the dungeon, you could farm those 2.1 billion several times in the same streak, making it even more efficient. I don't think there is a way, though...

Just go down to 29F. I just tried that and it respawned the heaven bosses. It's not super quick, but it does maintain the streak.

Validon98

  • Utahime says hello!
Re: Labyrinth of Touhou 19F
« Reply #84 on: August 02, 2020, 04:36:42 PM »
1.107 has been released, with things such as updated minimap that should more properly show what symbols mean what, showing if an attack will hit a weakness or resistance, and other bug fixes (I'm seeing mention of Unnamed Book Reading Youkai specifically, which uh, yep that skill has been bugged for awhile). Mirror is as always below for the patch:

https://drive.google.com/file/d/1WW_gJaBYAqoBmnRIvD4NmVAOHXvhtI3w/view?usp=sharing

EDIT: Oops apparently I had it somehow set to restricted by accident, sorry about that that's fixed now (thank you whoever requested access for drawing my attention to it).
« Last Edit: August 02, 2020, 05:19:35 PM by Validon98 »

Re: Labyrinth of Touhou 19F
« Reply #85 on: August 02, 2020, 05:20:30 PM »
Updated exe and translation files.

https://drive.google.com/file/d/1-l28Tb_hcKdxLdtPo3Y9sBQDtUkug_-R/view?usp=sharing

Nameless Bookworm Youkai's description was changed from 200 affinity to 160 affinity. There were no other text changes.
There's still a bunch of item descriptions that are missing due to the big scrub from 2.106


re: google drive

They changed their system so that when you generate a link, it no longer automatically sets it to viewable by anyone with the link. Super annoying.
« Last Edit: August 02, 2020, 05:37:16 PM by qazmlpok »

Validon98

  • Utahime says hello!
Re: Labyrinth of Touhou 19F
« Reply #86 on: August 02, 2020, 08:42:11 PM »
Oh yeah, further things I'm noticing from the Switch version as I'm going along re: consecutive battle bonus. Looks like in the "main game" (1F-20F, even in the Extra areas) it's +3% per battle. In Plus Disk floors it looks to be +4%, and in the Infinity Corridor it's +5%. I haven't gotten to the point where the bonus is uncapped (I'm still in the 23F-24F stretch of getting the elemental circles), so I don't know if that will change it either. Also, the PC version still seems to be going at +2% per battle regardless of locale. I did mention it to 3peso but otherwise it seems it has not been fixed(?) in 1.107.

Edit: Weird follow-up to the above, I went and fought Diamond Knight on 30F of the corridor and it seems like it has a 3% consecutive battle bonus for beating it? I noticed because I was testing and seeing if I hit the 100% cap in 20 battles (I did), but fighting the Diamond Knight had the bonus count as if I had been fighting with the +3% bonus the whole time. I guess it scales based off whatever value is being assigned to particular fights, and bosses might just be +3%?
« Last Edit: August 02, 2020, 09:12:31 PM by Validon98 »

Thurler

  • Go slow to go fast
    • Twitch
    • Twitter
    • Github
  • Gender: Male
Re: Labyrinth of Touhou 19F
« Reply #87 on: August 04, 2020, 08:29:05 AM »
Updated the pastebin with Plus Disk boss AI up to the B4F Futo fight: https://pastebin.com/3GpUKQNs

A couple interesting notes regarding what I found:
  • Shadow Hina has a chance of casting Curse Removal if you proc a debuff on her (like Cirno's Blizzard Blowout)
  • Shadow Mokou's "All-Regeneration" spell does heal Keine (and herself) for 5% max HP, but a visual bug prevents Keine's heal number from being displayed
  • Shadow Mokou checks a flag to spam Fujiwara Volcano every turn, but such flag is never set anywhere. Maybe she did resurrect at one point but that was cut for balancing?
  • Mamizou will use Full Moon Pompokolin every 5 turns below a specific HP amount, and 10 Transformations Danmaku every 8 turns below another specific HP amount
  • Shadow Shou's Aura of Justice does not remove Bishamonten Wrath's counter, and gains a permanent 5% EX ATK buff per dead enemy every time she casts Bishamonten Wrath
  • Futo's Spirit Mausoleum Desires heals Futo for 4% of her max HP, and buffs all stats by 10% for each cup she has (+1, so she's guaranteed a 4% heal and 10% all buff every 8 turns)
  • Shadow Youmu's and Shadow Yuyuko's fight is completely broken

Youmu is supposed to use Slash Clearing the 6 Senses every 5 turns if Yuyuko is dead. She's also supposed to spam "Loyal? Gardener's Support" between Yuyuko's cast of Concentrate and Saigyouji Flawless Nirvana, which buffs all of her stats by 33% each time it is cast. However, due to a bug, neither of those conditions are ever met, so she's stuck using her regular spells.

Yuyuko is supposed to have a different pattern for when Youmu is alive, but due to a bug, she always thinks Youmu is dead. The "Youmu is alive" pattern removes Storm of Dark Flow and Calming Scent from her AI, but adds Allure of Death and Slack Off (Lv.64). This last one is the key component here, it heals both Youmu and Yuyuko for around 410k HP, and has a 25% chance of being cast.

So basically, the intended dynamic here is: Youmu has very low max HP to compensate for Yuyuko's absurd heal every other turn, and Youmu is the main damage dealer while Yuyuko focuses on being annoying with DTH and ATB delays via Ghostly Dream's Butterfly. When Yuyuko concentrates, Youmu's PAR and SHK resistances drop from 80 to 50, going back to 80 whenever she gets a turn. If Youmu gets one (or more!) turns before Yuyuko fires Saigyouji Flawless Nirvana, she buffs all of her stats by 33%, getting ready to kill whatever survived the SFN.

When Youmu does die, Yuyuko switches to offensive mode, dropping her heal for a zero delay buff and increasing some spells' levels. If you kill Yuyuko first, Youmu will now use Slash Clearing the 6 Senses every 5 turns, making her just a bit more dangerous. I'll include a technical explanation of these bugs in a spoiler since you might not care about the ASM details, and this post is already quite long. :p

Spoiler:
The game keeps track of each party and enemy character through an array of pointers located somewhere in memory. This array has 17 positions, numbered 0 through 16, 0-11 being your 12 characters, and 12-16 being the enemy slots, starting from the front row's left slot. If an enemy AI wants to check if another enemy is still alive, there are 2 main ways to accomplish this: count how many enemy slots are occupied, or check if a particular slot is occupied. Shadow Keine and Shadow Mokou use the first method, if there are 2 or more enemies on the field, they know their partner is alive. Youmu and Yuyuko however check a specific slot. Obviously they need to check the right slot to have it work.

If you have a look at the disassembled code for Youmu checking if Yuyuko is dead:
Code: [Select]
MOV        EAX,dword ptr [EBP + local_c]
MOV        ECX,dword ptr [EAX + 0x10]
MOV        EDX,0x4
IMUL       EAX,EDX,0xf
CMP        dword ptr [ECX + EAX*0x1 + 0x24],0x0

You can see EAX is being loaded with some value, which is then used to load ECX with some other value. Using Cheat Engine while running the game, you can breakpoint those instructions to see which address was loaded into ECX, and it turns out to be an address very close to the character array mentioned. A value of 4 is then loaded into EDX, and EAX becomes the result of EDX times the constant 15. The game then takes ECX, offsets it by the multiplication's result, and adds some constant value to access - you guessed it - slot 15 in the character array. Compare the value in there to 0 to see if it is initialized - empty slots have empty pointers (all zeros), and you have successfully checked if a slot is loaded.

If you know anything about low level programming, you can think of the ASM code above as the C-like code below. Note that since this game uses 32bit addressing, pointers will be 4 bytes long, which ties in with the offset the ASM code uses:
Code: [Select]
struct CHARACTER_INFO;
struct CHARACTER_INFO * charArray[12+5]; // 12 ally characters and 5 enemies
int offset = 15; // Access enemy slot 4
struct CHARACTER_INFO *enemy = charArray[offset];
bool enemyExists = (enemy != NULL);
if (enemyExists) {} // do stuff

Note that array[offset] is the same as *(array+(offset*sizeof(struct CHARACTER_INFO *))), and since pointers will be 4 bytes long, we can simplify that to *(array+(offset*4)), which is exactly what the ASM told us with its own weird syntax. :p

The fix to all this is to replace every instance of IMUL EAX,EDX,0xf in Youmu's AI with IMUL EAX,EDX,0x10, which would properly point to Yuyuko's slot. Similarly, Yuyuko's AI has IMUL EAX,EDX,0xd, checking the empty second slot, so replacing it with IMUL EAX,EDX,0xf would fix it, since it would point to Youmu's slot. Pretty easy fix to do in a hex editor, but idk if anyone cares enough to fix this fight lol.

deice

  • minus mentality
    • 
Re: Labyrinth of Touhou 19F
« Reply #88 on: August 04, 2020, 03:08:52 PM »
  • Shadow Youmu's and Shadow Yuyuko's fight is completely broken

i remember nuking youmu in 3 turns and then just killing yuyuko, thinking i cheesed the fight or something but guess not

these examples of lack of beta-testing make the game seem a bit unpolished imo (e.g. the 19f magatama's heal didn't work until 1.105a iirc). i wonder if any of this is fixed in the console releases

Validon98

  • Utahime says hello!
Re: Labyrinth of Touhou 19F
« Reply #89 on: August 09, 2020, 06:23:02 PM »
So I was curious and did some extremely rudimentary testing regarding levels of bosses and enemies in the Infinity Corridor. Obviously without hacking and such this is probably not as accurate, and I do not know if the scaling remains the same past the first loop, but I have determined at least that bosses definitely scale right now at 34.5 levels per each new boss (this is of course in the version where said scaling leads to Serpent of Chaos being level 575 rather than 600). Enemy scaling I'm a bit more uncertain of, just from messing around on 111F and observing enemy levels, it looks like there is a baseline average level that all encounters are based around, with a level variation of about ~14% (of course I don't know if this changes as the floors increase, and I do know that the scaling gets more intense as you clear floors consecutively, JP wiki says 0.5% per each consecutive floor but I dunno if that's still true). Very, *very* loosely I am currently guessing that the scaling for baseline enemy level is 200+3*currentFloor, but I don't know for certain. The average for 111F is at least 533, which would fit that, and going backwards 1F having an average value of 203 makes sense roughly for how levels are at the start of it, but past that I don't know without actually looking at whatever formulas are used in-game to determine those values.

Meanwhile since I've gotten this far, I guess I've decided on a new team of four of Sealing Club + Mystia and Suika, which uh, it works. It's worked so far, ***WINNER*** has been defeated once and I'm well on my way to being able to beat him a second time.

EDIT: Notably, the bestiary values for levels for corridor bosses match the proper scaling for them. I've determined now that boss level is floor(230+(currentFloor*3.45)), which gives a value of level 612 at 111F (which matches the bestiary).

Further Edit: I actually think I've solved the enemy and boss formula entirely. I noticed that 230 and 3.45 are 15% more than 200 and 3 respectively, and then thought about how Serpent of Chaos was scaled to 600 in older versions. I think the formula ultimately is floor(200+(currentFloor*3)), then for normal enemies an extra 0.5% per consecutive floor cleared on top of that (if the JP wiki is correct), or for bosses just a flat +15%. The older boss scaling must have been +20% (it matches and gives 600 for 100F).
« Last Edit: August 09, 2020, 06:53:35 PM by Validon98 »