Maidens of the Kaleidoscope

~Hakurei Shrine~ => Rika and Nitori's Garage Experiments => Touhou Projects => Topic started by: EthanSilver on November 29, 2014, 07:19:20 PM

Title: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: EthanSilver on November 29, 2014, 07:19:20 PM
Spellcards / Skills
Name/LinkInfoAuthor
Dummied spellcards (http://textuploader.com/oyd4)List of skills and spellcards which exist in the game but aren't used anywhere.EthanSilver
Skill/spellcard data (http://pastebin.com/pvLKqZDj)The function which sets up all spellcards and skills. Contains the name, description, max lv, and
purchase/upgrade cost.
EthanSilver
Spellcards formulas, (v1.1) (http://180upload.com/hren86ylo7dj)A list of all spellcards' effects and formulas, extracted directly from the game. Does not include certain
 "unique" effects however.
EthanSilver
Spellcard-specific code (http://textuploader.com/obkh)(Incomplete.) The mechanics behind some of the spellcards' more "unique" effects.EthanSilver
Passives and their effects (http://textuploader.com/6s2t)The effects of the passive skills with unclear descriptions/unspecified numbers.EthanSilver

Characters
Name/LinkInfoAuthor
Passive stat boost setup code (http://textuploader.com/oycx)The function which sets up all characters' passive stat boosts.EthanSilver
Character and subclass
 modding  (http://textuploader.com/oyj5)
Explains how to modify character stats and available skills, as well as the skills learnable through all
subclasses. A hex editor, such as XVI32 or HxD, is required.
EthanSilver

Enemies
Name/LinkInfoAuthor
JSON enemy dump (v2) (http://puu.sh/danpH/cd48f20f08.txt)A dump of every enemy's data in JSON format.qazmlpok
Enemy stat viewer
(JS, v2) (http://180upload.com/cvy2jvc2da8n) (HTML, v1) (http://180upload.com/ocd53svxf08k)
Displays qazmlpok's enemy data in HTML format.EthanSilver
Enemy AI listing (http://pastebin.com/YfS9PgCw)A list of all enemies' AI, extracted directly from the game.EthanSilver

Others
Name/LinkInfoAuthor
Hack: 3 commands for Remilia (http://180upload.com/xf9qj41gnoxh)Gives Remilia a 3rd battle command (should be changed to suit your needs; new offsets for her skills are
 06A338, 06A342, 06A34C).
EthanSilver
Event Dump (http://180upload.com/e8grmi1hpb63)A (slightly simplified) list of all events in the game. Doubles as a list of in-game dialog too.EthanSilver

I figured putting this stuff in its own place would be for the best. It has pretty much taken over the thread (https://www.shrinemaiden.org/forum/index.php/topic,17586.180.html) the discussions started in and is leaving little room for gameplay discussion. It will also be easier to maintain an up-to-date list of files and documents produced from the game's data.

The information in this thread is based on LoT2 English-Patched v1.203.
Title: Re: The LoT 2 hacking thread
Post by: EthanSilver on November 29, 2014, 07:19:54 PM
(continued from here (https://www.shrinemaiden.org/forum/index.php/topic,17586.msg1146243.html#msg1146243))

Nightfall X (he has been following the discussions on LoT2 but isn't registered here) tested a few some things in regards to skills and was kind enough to send me his findings via email. Giving a character a duplicate skill will cause the level cap to be ignored, allowing it to level up past the usual maximum. Alternatively, changing the level cap in the skills setup function also works - the data in that function isn't just used for display purposes.

I got some rather sad news by phone last night and stopped working on this for a bit, but I did manage to extract some more info on several spellcards, including Parsee's skills. Quite a few spellcards use extra code to achieve their results (close to 100 of them) but most are enemy skills only. I will try to have them all soon enough but I'll be taking today off from hacking for personal reasons. In the meantime...

Peerless Wind God: spd += lv*2 + 22, max 100
Divine Grandson's Advent: ATB = lv*10000
Sword of Hisou: lv*4+20 chance per buff of reducing it to 0
Ghostly Dream's Butterfly: I THINK it reduces the target's ATB to 2/3, 17/20 against bosses? (or vice-versa?)
Galaxy Stop: All allies (not caster) ATB * 4/5
Shield Bash: Def buff at lv 2+ = ((level - 1) * 3) + 12, max of 100
Umbrella Spin: Set every enemy's ATB to 10000

...As for Parsee, I'm not quite done with her yet but from what I can tell so far Large/Small box bases its damage on a randomly-triggered condition. The odds (a % value) are based on the following factors...
- + 6% / unknown?
- + (100% - unknown?) / 2 (seems to have to do with Parsee's HP/MP?)
- + 8% if there are 2 or more enemies remaining
- + 2% per ailment or debuff per party member
- + 4% per ailment or debuff on the target
Jealousy of Kind and Lovely simply resets the damage targets will take to 0 when TRR isn't inflicted on them. It also resets the TRR parameters for the entire battlefield to 0.

Quote from: ZXNova
I also downloaded the hex editor, so should I do anything with that?
Depends. What are you trying to do?

Quote from: jaxter0987
I have no idea what the variable "this" refers to nor do I understand why the chance of applying a DEF debuff affects the strength of the MND debuff.
Seems more like a bug on my decompiler's end; most likely an unhandled instruction I forgot to report that screwed up the state of a few registers.

Going through the code by hand (and yeah, there's a slightly weird line in there the decompiler most likely choked on, now that I'm looking at it), this is what I'm getting:

XXX.power = XXX.power - (level + abs(level * 2) + 17) ; IOW, -(3 * Lv + 17).

By the way, "If unknown_0008.06EC is greater than or equal to 12" means, "If the caster's position on the battlefield is 12 or higher", or in other words, if the spellcard is being used by an enemy (positions 0-11 are characters, 12-16 are enemies), in case you were wondering about that one.

Quote from: qazmlpok
random(2) should be "generate a random number that is either 0 or 1"
The number is inclusive, as there are instances of random(1) elsewhere in the code. random(2) would generate a number between 0 and 2. Likewise, random(99) would be a % chance thing (0-99, allowing for 100 different results).

(Fake ninja edit: Seems like you figured that out. Nevermind then. :P I will be updating my enemy viewer with the new version of the data you've produced tomorrow.)
Title: Re: The LoT 2 hacking thread
Post by: ZXNova on November 29, 2014, 08:56:36 PM
Well I'm just trying to play around with the skill hacking and such.
Title: Re: The LoT 2 hacking thread
Post by: EthanSilver on November 29, 2014, 09:06:07 PM
Well I'm just trying to play around with the skill hacking and such.
Have a look at the end of the skill hacking document for an example. Basically, it's telling you to change...

(http://i60.tinypic.com/o352b.png)
(note the address right here  ^^^ - it's the one the example is telling you to change)

...to...

(http://i57.tinypic.com/14o589x.png)

(Save, then run the game. Make sure you always work on a copy of the game, and not the original. Just in case things go wrong.)

To change other characters/skills, look up the address listed in the document, go there, and change the value to the ID of the skill you want. The process is the same in every case, just with a different address/ID.
Title: Re: The LoT 2 hacking thread
Post by: Spiffspoo on November 29, 2014, 09:11:51 PM
Most random functions are exclusive, so that if random(2) does go into an int, it will only be 0 or 1.
If it is inclusive, that is a bit strange, I would like to see how it works out with decimals or floats.
Title: Re: The LoT 2 hacking thread
Post by: EthanSilver on November 29, 2014, 09:19:54 PM
Most random functions are exclusive, so that if random(2) does go into an int, it will only be 0 or 1.
If it is inclusive, that is a bit strange, I would like to see how it works out with decimals or floats.
Again, there are instances of random(1), which would serve no purpose with an exclusive random function... As far as I can tell (though I haven't looked too deeply into it), the random function in LoT2 used here is a wrapper around the standard linear congruential RNG which adds 1 to the parameter passed so as to make the result between 0 and it (eg, rand()%(parameter+1)).

This... wouldn't work with floats. Floats and integers have completely different representations in memory/are manipulated with different sets of instructions and a function using one cannot use the other without either converting the parameter beforehand (ex, typecasting in C/C++) or writing a second function to handle the other type (ex, overloading in C/C++ or using a template in C++). I haven't come across instances of non-integer random numbers but it's highly likely the game would just convert an integer result to float (with FILD) and manipulate the resulting value instead of somehow generating a random float.
Title: Re: The LoT 2 hacking thread
Post by: EthanSilver on December 01, 2014, 02:18:31 AM
Well, back from my break. Can't be in mourning forever. I've gotten a good chunk of the "code" portion of the spellcards/commands. Here they are so far.

Spellcard-specific functions (http://textuploader.com/obkh)

I'll have the rest later; most contain stuff I haven't figured out yet (particularly, damage-related code call a function that will take a bit of analysis to work out, and I'm kind of unclear on how HP/MP are handled internally (they're stored across two 32-bit values, the second one apparently keeping track of negative values...? That can't be right, so, I dunno yet.) There's other stuff, too...) but progress is relatively steady.

Often, the spellcard-specific code will be used to increase a buff over the usual cap (50%). Some things seem to be handled by enemy AI code, like "Fly Up" (which only changes the user's image; the AI must keep track of when it's used and immediately use "Flying Press" on the following turn.) Of particular interest is "Shredder", which (unlike most spellcards with a similar effect) affects ailment slots 10-50. These usually only go up to 16 (EVA buff) though one of Mari's spellcards sets one of the later slots, meaning they're used for something and probably not just place-holders. Interesting.

I haven't incorporated qazmlpok's new info in the enemy viewer/static listing yet, but that'll be up later tonight.
Title: Re: The LoT 2 hacking thread
Post by: Spiffspoo on December 01, 2014, 04:11:53 AM
I'll have the rest later; most contain stuff I haven't figured out yet (particularly, damage-related code call a function that will take a bit of analysis to work out, and I'm kind of unclear on how HP/MP are handled internally (they're stored across two 32-bit values, the second one apparently keeping track of negative values...? That can't be right, so, I dunno yet.) There's other stuff, too...) but progress is relatively steady.

Often, the spellcard-specific code will be used to increase a buff over the usual cap (50%). Some things seem to be handled by enemy AI code, like "Fly Up" (which only changes the user's image; the AI must keep track of when it's used and immediately use "Flying Press" on the following turn.) Of particular interest is "Shredder", which (unlike most spellcards with a similar effect) affects ailment slots 10-50. These usually only go up to 16 (EVA buff) though one of Mari's spellcards sets one of the later slots, meaning they're used for something and probably not just place-holders. Interesting.

I haven't incorporated qazmlpok's new info in the enemy viewer/static listing yet, but that'll be up later tonight.

For HP, I know the Shredding Amnesieri reduces MAX health in the battle and Eirin can increase current health to 50% more than the current MAX.
Maybe that has something to do with it?  I am not sure about MP, maybe it was just set up the same way but similar mechanics weren't applied.
You can get "Boosts" of varying percentages, overheat, fighting spirit, magic circuit, ect... that could be affected by Shredder as well, but I didn't pay attention when it happened so I can't say.
Title: Re: The LoT 2 hacking thread
Post by: EthanSilver on December 01, 2014, 08:27:08 PM
Quick little update.
I've updated the enemy stat viewer to use qazmlpok's updated enemy data. The static page still uses the old info because I'm looking into a new format for it to reduce the size (it's... kinda of weight-y and there's a lot of redundant info when multiple enemy "types" come up, so...)

I'm putting the spellcard stuff aside for the moment. I've gotten a decent chunk of info worked out but the rest will require exploring a few other functions. (No worries, I'll come back to it soon.) Right now, I've started tweaking my spellcard disassembler to work with enemy AI scripts and events. There's still plenty of info to work out but it's rather straightforward, for the most part, and I expect good results in a few days at the most. I may have a few other goodies ready later tonight if things go well, too (just stumbled on the "main" setup function, which creates all of the game's data). Look forward to it! :)

Edit: Sample enemy AI... Still got some stuff to work out but it's coming along very well!
Code: [Select]
Kuron Nut
-------------------------
chance = random(99)
If chance is less than 45
have self use Attack level 1 on getTarget(mode 0)
end
If chance is less than 90
have self use NutThrow level 1 on getTarget(mode 0)
end
If chance is less than 100
have self use Harden level 1 on self
end

Edit 2: Annnnnd, done. Just gotta format it a bit and I'll have it posted in a few hours or so.
Title: Re: The LoT 2 hacking thread
Post by: EthanSilver on December 04, 2014, 02:03:59 AM
And here it is.

The full enemy AI listing (http://pastebin.com/YfS9PgCw)

Whew. That took a while. I'll probably tackle a few smaller things first but I think next big thing will be the events. Not that there's a whole lot left to pull out of the game anyway, aside from some combat formulas and such... Interest in this seems to have slowed down anyway, so I'll be getting back to my other projects once that's done (unless I'm forgetting something...? I guess I could pull out the item data too, but I think the wiki already has that anyway. I'm not sure what else is left...)

Anyway. Time to re-modify my decompiler program to work with events!

By the way...
Well I'm just trying to play around with the skill hacking and such.
Did my reply help any? I didn't hear anything from you so I'm kinda curious...
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Ghaleon on December 04, 2014, 07:40:54 AM
I just saw this thread...zomgzomg spellcard formulas! yesss!
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: EthanSilver on December 05, 2014, 01:58:08 PM
Looks like events will take a little while to complete - it'd be so much easier if this game used an easily-extractable scripting system instead of "programming" all of its events...! I figured I'd post a sampler (http://textuploader.com/o3hj) of what I have so far.

I'm done coding my rudimentary decompiling/extracting tool. There's still quite a few functions I haven't worked out and tons of manual formatting to do (here's one of the unformatted events (http://textuploader.com/o3hm) as it looks in my dump file - obviously, I took a few liberties with the formatted version to make it more understandable). Progress is steady though, so it's all good.

I don't know if I'm going to bother to do every event - things mostly got quiet after the spellcard formulas and enemy stats were extracted and I feel like I'm just beating a dead horse at this point - but I'll at least put up what I have done once I decide to put LoT2 aside and return to my other projects. There don't seem to be any "hidden" events like that secret 1F boss in LoT1 anyhow (though I haven't gone over everything yet so, who knows?) but maybe someone will get a kick out of reading this stuff. :)

Edit: ~205 done, ~75  to go. I guess I'll be doing all of the events after all...
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Axel Ryman on December 05, 2014, 02:10:33 PM
Out of curiosity, do a number of passive skills that boost effects(I.E: Increase/Decrease Fire damage and such) have numbers behind them? I know some skills list the % Boosts they provide, but quite a number of them don't.



Regardless all the info you're providing is amazing and useful to me.
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: ZXNova on December 05, 2014, 05:05:14 PM
Yeah it did, I just forgot to reply.
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: EthanSilver on December 07, 2014, 05:30:18 PM
And it's done.

Events (http://180upload.com/e8grmi1hpb63)

I simplified it quite a bit and several lesser "commands" have been removed. I didn't find anything out of the ordinary, sadly.

Well, I guess that's it for me. This thread has drawn very little attention after the spellcard formulas were extracted and I already have a clear enough grasp of the game's code to go and get whatever info I'd need, so it's time I head back to my usual hang-out and return to my other projects. Win-win. :)

Well then... See you when the plus disk gets released, MotK!

Out of curiosity, do a number of passive skills that boost effects(I.E: Increase/Decrease Fire damage and such) have numbers behind them? I know some skills list the % Boosts they provide, but quite a number of them don't.
Passives are scattered throughout the code wherever they're needed, which makes tracking down their effect somewhat time-consuming.  The ones I have on hand are...

Sudden Impulse changes the minimum randomization from 90 to (90 - 5 * level) and the maximum randomization from 110 to (110 + 10 * level).
Enhanced Normal Attack adds 0.30 to the ATK or MAG calculation (eg, 1.00 ATK -> 1.30 ATK).
Area Normal Attack changes the targetting flag to "entire enemy party".

If you're looking for info on any specific skill, feel free to email me and I'll have a look into it; most aren't too hard to track down. I can't pull out a list of every one of them as quickly as I did with spellcard formulas or enemy AI, though...
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: qazmlpok on December 07, 2014, 06:36:09 PM
The enemy stat viewer links are both giving me "not found, deleted, or copyright infringement" errors.
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Ghaleon on December 10, 2014, 01:56:24 AM
So I just took a peek at character spellcards text file and see stuff like:
If level is greater than or equal to 2
      Set multiplier to ((((multiplier * 50) / 1000) * (level - 1)) + multiplier)

Now in the HME thread I see people interpriting it as something like

level 1: Multiplier = 1.5
level 2 = 1.55
3 = 1.60
4 = 1.65, etc.

However I'm seeing that each spellcard level adds 5% power to the multiplier by its own standards.. not by 1.0... so it's really more like
1 = 1.5
2= 1.575
3 = 1.65
4= 1.725

If the base multiplier is 1.0, results are the same, however if the multiplier is 2.0, the difference is double that to what I feel people are reading it as....Overall, spellcard level is still pretty effing underwhelming for damage cards. I think it should at LEAST add 5% BEFORE enemy defense reduction. blah, what a rip.

Also, people are talking about some hidden 9th resistance, and are assuming it's void. That's one reasonable assumption, but I think there is another possibility. IIRC there are certain bosses in the game that take heavily reduced amounts of damage before or after a focus or scripted event, and this event doesn't actually give them a visible buff or debuff (or at least not one that would represent the amount of damage reduction they suddenly gain/lose)...and I don't think it's flat out stat change like 20f boss gets in lot1, because spells that hit for peanuts still do like 4 damage, and really big nukes like 3d cannon suddenly only hit for like 200 (numbers are from the ass here but my point is in a normal sitation where defenses get cranked, weaker spells should hit 0).

Basically I'm thinking the hidden resistance could also be a "universal" resistance, that is applied for these situations, which may or may not include void, I imagine it would.

Last, not important, but I was always upset at how "obsolete" kasen seems to make remilia with the possible exception of how good last fortress is, which I kinda scoff at cuz needing dead people to be worth something is already of questionable ground IMO...But seeing cursed arm have a flat out better formula than remi's spear too, DESPITE having a more variable spellcard variety, better overall stats (factoring easier leveling), etc... Man Remi really fell hard this time..

Overall it seems like the variance between spellcards this time around is less pronounced, that base stats are more significant. I imagine part of it is due to the fact that enemies generally have far far higher defenses this time around, and even slight increases in pre-mitigated multipliers to spellcards are more significant, but still...I mean just look at the difference between magic missle and master spark. Magic missle is already surprisingly effective at piercing defenses for such a cheap entry level spell this time around, and master spark only has 0.4mag more as opposed to 4-7x or whatever lot1's was, the multiplier is only double too. Basically, a magic missle after a single 30% concentrate will pierce defenses better than a master spark at base!
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Axel Ryman on December 10, 2014, 02:03:59 AM

Also, people are talking about some hidden 9th resistance, and are assuming it's void. That's one reasonable assumption, but I think there is another possibility. IIRC there are certain bosses in the game that take heavily reduced amounts of damage before or after a focus or scripted event, and this event doesn't actually give them a visible buff or debuff (or at least not one that would represent the amount of damage reduction they suddenly gain/lose)...and I don't think it's flat out stat change like 20f boss gets in lot1, because spells that hit for peanuts still do like 4 damage, and really big nukes like 3d cannon suddenly only hit for like 200 (numbers are from the ass here but my point is in a normal sitation where defenses get cranked, weaker spells should hit 0).

It's Void, all enemies have the stat set to 100.



Quote
If you're looking for info on any specific skill, feel free to email me and I'll have a look into it; most aren't too hard to track down. I can't pull out a list of every one of them as quickly as I did with spellcard formulas or enemy AI, though...

I'll need to look through my notes to see which ones I need specifically, but it shouldn't be too many. I hope.
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Ghaleon on December 10, 2014, 03:03:12 AM
It's Void, all enemies have the stat set to 100.

Err I haven't said otherwise, I'm merely pointing out other possibilities, but your example of evidence isn't any use at all...Think about it.. if it was a universal resistance that only gets jacked up during certain phases where you are meant to do virtually no damage without stat modification, you'd leave that same stat at 100 to every enemy's base value too...In fact I kinda think your example proves my alternative possibility more since that's kind of how such a feature WOULD be implemented.

Having 100 set to everything simply for void resistance  is a completely pointless and unnecessary complication when the coder could have much more easily and efficiently simply have left out the affinity part of the equation for that spellcard. Naturally, sometimes programming isn't always sensible or efficient, but I can't imagine how your example provides any logical evidence towards how void resistance is a more likely scenario than universal resistance.
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: qazmlpok on December 10, 2014, 03:33:15 AM
Not all enemies. Second sun has 200. Therefore, this is easy to test.

His mnd and def are also known. Someone just has to use Mari's void skills on him and see if he takes half the expected damage. If so, it is absolutely void.



or I could just hack a kedama, give him 1000000 void res, and do it that way.

http://i.imgur.com/RScudbW.png
...ok, well this isn't what I expected.
She doesn't have any skills that negate resistance, so it should've been 50,000  * 100 / 16,000,000, i.e. less than 1. It was definitely a strong element, given the coloring, but how'd it do that much damage?
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Axel Ryman on December 10, 2014, 04:19:00 AM
Having 100 set to everything simply for void resistance  is a completely pointless and unnecessary complication when the coder could have much more easily and efficiently simply have left out the affinity part of the equation for that spellcard. Naturally, sometimes programming isn't always sensible or efficient, but I can't imagine how your example provides any logical evidence towards how void resistance is a more likely scenario than universal resistance.

Note the actual Spellcard formulas. Note the lack of Affinity modifiers listed in them. This is because Affinities are factored after the formulas themselves. Ethan posted it once when I asked him, but the number is X/100, where X is the amount of affinity that character/enemy has. The full formula is ((ATK * CommandATK% + MAG * CommandMAG%) - (DEF * CommandDEF% + MND * CommandMND%)) / (Affinity/100). Could they have just made it so the spellcard didn't factor it in? Maybe, but they didn't, hence why they created the Void element, an element which, in-game, states it is not affected by elemental resistances. Except for the 1 boss listed below.

If it really was a universal resistance applied during scripted events, then this would be listed in the Enemy's AI. You would need to provide examples of such events, which so far you haven't.



Not all enemies. Second sun has 200. Therefore, this is easy to test.

His mnd and def are also known. Someone just has to use Mari's void skills on him and see if he takes half the expected damage. If so, it is absolutely void.



or I could just hack a kedama, give him 1000000 void res, and do it that way.

http://i.imgur.com/RScudbW.png
...ok, well this isn't what I expected.
She doesn't have any skills that negate resistance, so it should've been 50,000  * 100 / 16,000,000, i.e. less than 1. It was definitely a strong element, given the coloring, but how'd it do that much damage?

Formula wise, it'd be (128% MAG - 50% MND(36 MND in this case)) / 10000, which, depending on your stats, could/would be...over at least 3. Considering something like 0 in ATK/MAG causes the enemy to be healed, yet 1 causes it to deal 0 damage, I'm guessing going over the 500 limit caused the game to not know what to do and give such weird results. I say try with 1000. If the numbers are still/seem weird, try 500, then do 600 and see how much of a difference.
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Ghaleon on December 10, 2014, 04:33:16 AM
why not just 200?

In any case simply nuking such a creature with maribel's void nuke wouldn't actually prove anything, you have to use her nuke AND another nuke of a different element that has a normal resistance of 100.. if it's universal and can affect void too, of course her damage will be reduced if you crank it up.

As for an example, I wasn't making claims, just trying to give people food for thought, this isn't an argument, merely a possibility that I see no evidence of being truly proven wrong yet, not saying it wont be. But IIRC EIKI was such a fight where you do pitiful damage to her between focus and last judgement or something. Maybe it was just her getting a 100% def/mnd buff but I don't tHINK she did.. bear in mind I haven't played for some time so I can't give a best example sorry.
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Axel Ryman on December 10, 2014, 04:47:40 AM
As for an example, I wasn't making claims, just trying to give people food for thought, this isn't an argument, merely a possibility that I see no evidence of being truly proven wrong yet, not saying it wont be. But IIRC EIKI was such a fight where you do pitiful damage to her between focus and last judgement or something. Maybe it was just her getting a 100% def/mnd buff but I don't tHINK she did.. bear in mind I haven't played for some time so I can't give a best example sorry.

Shiki's is listed in the AI

Quote
Once, If HP <= 90%:
                Target Self with L.1 Concentrate
                mnd     = 40000
                def     = 40000
                spd     = 88

To note, her default DEF and MND are 12,000 each. She's also pretty slow during this segment, so her speed goes from 250 to 88. For comparison purposes, here's a video of the boss fight. https://www.youtube.com/watch?v=rjL_jpJY1MM#t=63

I have it set to start at 1:00, but you only need to watch up to around 2:00 to notice her speed drops.
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Ghaleon on December 10, 2014, 05:09:45 AM
Well then, I can't think of other examples but I can't imagine the dude would code in a stat change in an event if they could just tweak a resistance thing. I can't think of any other good possibilities other than void resistance either. But I'm keeping my mind open that it can be something else I haven't thought of, maybe even something silly like resistance to resistance reduction (like from arm twisting or something), I doubt it's that yeah.

of course if someone shows damage getting halfed after using maribel's nuke and not halfed otherwise, I'd say that's pretty solid evidence... I should figure out how to hack the game myself next time I start playing again.

By the way, I didn't notice the multiplier thing in your extended formula, any reason why? I seem to recall some affinities seeming to occur before defense reduction, and some affinities occurring after (or the multiplier is what I'm getting at). I assume this is just due to confusion as to forgetting about passives like marisas and rumias and such, but I do recall being really confused about it. Affinity worked in a very predictable fashion in lot1 but assuming lot2 works the same way, I still find myself going "huh?!" sometimes.
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Axel Ryman on December 10, 2014, 05:25:48 AM
By the way, I didn't notice the multiplier thing in your extended formula, any reason why? I seem to recall some affinities seeming to occur before defense reduction, and some affinities occurring after (or the multiplier is what I'm getting at). I assume this is just due to confusion as to forgetting about passives like marisas and rumias and such, but I do recall being really confused about it. Affinity worked in a very predictable fashion in lot1 but assuming lot2 works the same way, I still find myself going "huh?!" sometimes.

Not sure as to why, but it is available on the Wiki at least.
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Starxsword on December 10, 2014, 11:52:17 AM
Quote
http://i.imgur.com/RScudbW.png
...ok, well this isn't what I expected.
She doesn't have any skills that negate resistance, so it should've been 50,000  * 100 / 16,000,000, i.e. less than 1. It was definitely a strong element, given the coloring, but how'd it do that much damage?

I think you should use more reasonable numbers. Is there any kind of cap or diminishing return on resistance calculation?

Quote
By the way, I didn't notice the multiplier thing in your extended formula, any reason why? I seem to recall some affinities seeming to occur before defense reduction, and some affinities occurring after (or the multiplier is what I'm getting at). I assume this is just due to confusion as to forgetting about passives like marisas and rumias and such, but I do recall being really confused about it. Affinity worked in a very predictable fashion in lot1 but assuming lot2 works the same way, I still find myself going "huh?!" sometimes.

Oh yeah, about this. Is there anything about how much damage reduction each skill does? Like level 1 Robe of Fire Rat reduces 10% fire damage and level 2 reduces 20% fire damage? There's also Tenshi's ability to reduce physical damage and other such abilities. And is this stuff calculated before or after defense reduction? I would assume after. Patchouli's Philospher's Stone reduces up to 70% damage, so know when this stuff occurs is a big deal, especially if you have Yukari and Patchouli in the front line.
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Axel Ryman on December 10, 2014, 12:55:04 PM
Oh yeah, about this. Is there anything about how much damage reduction each skill does? Like level 1 Robe of Fire Rat reduces 10% fire damage and level 2 reduces 20% fire damage? There's also Tenshi's ability to reduce physical damage and other such abilities. And is this stuff calculated before or after defense reduction? I would assume after. Patchouli's Philospher's Stone reduces up to 70% damage, so know when this stuff occurs is a big deal, especially if you have Yukari and Patchouli in the front line.


A number of these abilities were ones I PMed Ethan about last night, so once I receive an answer, I'll post them.


Though I asked for Armored Yin-Yang Orb and Youkai Buster. I'm just guessing they're all the same % reduction/increase.
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: qazmlpok on December 10, 2014, 02:54:57 PM
http://puu.sh/doUpS/9b4b16dba7.jpg   Baseline
http://puu.sh/doUry/6b37f364d1.jpg   and again with a SPI

0x158 offset changed to 0x190 (400.)
http://puu.sh/doUAx/f33d565999.jpg
http://puu.sh/doUBZ/1aa21e32d9.jpg    and Reimu finishes it off.  Roughly the same damage.

value changed to 0x1900 (6400.)
http://puu.sh/doUU8/7074d52fb4.jpg


Someone mentioned an affinity cap. Where'd you hear about that? I've never seen any mention of that, and it's certainly possible to boost your characters affinities past 500.
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Sungho on December 10, 2014, 03:32:39 PM
Being able to boost your affinity over 500 doesn't necessary mean that the game will calculate using exactly that value.
In this case, it's very possible that the game truncates any affinity over a certain value to that certain value(around 400, or something like that).

May I ask how the money cost for upgrading stats in the Library is calculated?
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: RegalStar on December 10, 2014, 10:34:15 PM
For 6F tenshi's FN_58E2s function, I remember reading on the Japanese wiki that if you do not manage to beat her, but do manage to lower her HP to a certain level before she runs away, she will drop a set of reward increasers that she wouldn't have dropped if you didn't lower her HP enough. This is probably what's going on here.
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Phasm on December 14, 2014, 01:52:37 AM
Judging by the thread's title... could you make a fullscreen patch for LOT2?
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Monothemeerp on December 14, 2014, 05:54:44 PM
The links to the enemy stat viewers are busted :<
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: EthanSilver on December 22, 2014, 11:25:21 PM
So I dropped by the forums to post a map viewer for another game and, surprise surprise, I had a handful of PMs waiting for me.

It's my fault, really. I wrote "send me an email" when, in fact, I should have written "send me an email". Silly me. I can understand how that could have been interpreted as "send me a PM on a forum I don't generally post on where I won't see it for what could be months". Sorry about that everyone. I'll try to be more specific next time. I hope there are no hard feelings. :/

As just about every question I've been asked relates to passives, I've decided I'd just dump my notes into a text file and post that instead of replying.

Here it is (http://textuploader.com/6s2t)

I've also reuploaded the enemy viewer. Not sure why it got removed...

Judging by the thread's title... could you make a fullscreen patch for LOT2?
I'm... not sure how that relates to the thread's title. But whatever. In case you didn't know, you can stretch the window to achieve roughly the same effect as having the game full-screen. Hopefully that helps.
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Axel Ryman on December 24, 2014, 08:28:54 AM
The perfect Christmas present! Thank you Ethan!
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Labyrinth Dweller on December 26, 2014, 02:41:31 PM
Spellcards formulas, (v1.1) (http://180upload.com/hren86ylo7dj)A list of all spellcards' effects and formulas, extracted directly from the game. Does not include certain
 "unique" effects however.
EthanSilver
Event Dump (http://180upload.com/e8grmi1hpb63)A (slightly simplified) list of all events in the game. Doubles as a list of in-game dialog too.EthanSilver

Could someone please reupload the above? The links are dead already :(
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: qazmlpok on January 26, 2015, 02:04:16 AM
Ethan, how difficult would it be to remove the damage variance, at least for player attacks? Either doing it yourself, or pointing out the location so I can NOP it myself.
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Ghaleon on January 27, 2015, 06:53:45 AM
Quote
I'm... not sure how that relates to the thread's title. But whatever. In case you didn't know, you can stretch the window to achieve roughly the same effect as having the game full-screen. Hopefully that helps.

Its relation to the title is...uhh...questionable...but the guy DID as a question...it isn't a definitive no IMO. Preventing fullscreen mode CAN be something stupid simple as a boolean that's hardcoded as false instead of true or whatever for all you know...That said, stretching the window is not the same thing. I too want a fullscreen mode, and while I'm not asking for one if it's any work for anyone, I simply wish to explain why it's wanted (for me at least, I imagine I'm not the only one).

Basically if I stretch it manually, the graphics become noticeably more pixely for one, but even if they didn't, or if you think I'm high (I'm not, but nobody believes me), there's also the factor that there somehow is more immersion (even in games where immersion isn't really a big deal, it makes a big deal in this case IMO) in not seeing a window for your game...Seeing borders, or what's behind it (if your monitor aspect ratio is different from the game's base...and if you think you can't see a graphical change if you stretch it to be so, then YOU'RE the one on drugs!). I've pretty much subconsciously trained my eyeballs to treat the contents of my monitor as temporarily "everything" while I enjoy a game, and if anything, even so much as a border of a window is seen at the edge (my monitor's aspect ratio makes me see more), than that feeling is just completely lost...it doesn't ruin the game or anything but it's a cosmetic thing that DOES make a noticeable difference 100% of the time...Imagine it as something like the difference between liking how your main character looks, and thinking he/she looks like dung.. Everything else may look great still, but that main character, you want em to look as good as possible!

Quote
Ethan, how difficult would it be to remove the damage variance, at least for player attacks? Either doing it yourself, or pointing out the location so I can NOP it myself.

...Listen to this dude. If the random thing was gone, everyone else would be able to figure things out and define stuff on their own without pestering you much much easier.
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Genericname on April 16, 2015, 10:09:02 PM
I've been playing around with Cheat Engine a bit, changing the cap on gems, decrease the amount of exp you receive and increase the amount of skill points per level.
I had no idea what kind of awesome things are possible with CE until I took a look at some advanced features it had, hoping to find a way to increase the gem limit.
Well, and just now, I found a way skip attack animations, which is good if you have a slow pc like me.

You'll have to run CE everytime you want any of those enabled obviously, and to be honest I have no idea if they even work on different pcs then mine, considering the pointer mess I encountered while editing various other things. From what I know they should work for everyone though, just make sure that inside the scripts, these kind of lines:"THLabyrinth2_out.exe"+461319:" match the .exe you are using, either change the scripts yourself or rename the .exe.


http://s000.tinyupload.com/index.php?file_id=01129384117308369754

Oh, almost forgot, theres a problem with the 2 skillpoints per level script, because I'm lazy - you only get the points on a level up, meaning if you skill reset, you won't get back the extra amount and have to downlevel at Reimu and level up again.
Title: Re: The Labyrinth of Touhou 2 reverse-engineering thread
Post by: Supreme Gamesmaster on April 19, 2015, 04:31:31 PM
The links on the front page to 180upload all seem to be broken. That actually goes for the LoT Rebirth thread too - the Toolkit link, which was to 180upload, is also broken. Even the tools and data that are up now are incredibly helpful, but just for the record...