Page 2 of 2

Re: PSP2i modding

PostPosted: Sat Jun 04, 2016 11:27 pm
by Agrajag
Alright, so. It turns out the item stats are in one of the files in media.fpb, in the old NBL format.

This is Sword:
0000 0014 2BC0 1110 00 4C 8700 150020 FE 0150 0A 78 5200 8014 00 05 00 00 00 00 00 05

I haven't figured everything out on it yet, but... here's a rough skeleton (if it's not labeled, I don't know, and can't even guarantee the data size):
00: Unknown (PSU had a couple things here, not sure which ones are being used here--I notice the )
00: Model number
00: Visual effect (e.g Crimson's flames)
2BC0: top 2 bits set (mystery) + 0x2B: probably minimum ATP for variance (43; 43-71 ATP seems reasonable?)
1110: Lower 12 bits are (weapon ATP - 3) / 4; 0x11 * 4 = 68 + 3 = 71 ATP. Next three bits (the "1" in 10) are SE level (runs 1-5, although technically you can set it up to 7), not sure what the top bit is.
004C8700: First 11 bits unknown. Next 12 bits extend ATA bonus. Next 9 bits unknown.
150020: First 13 bits are ATA (unremarkable). Next 5 bits are SE number. Not sure what remaining 6 bits are.
FE: This is consistent, whatever it is.
01: Level requirement
50: Level requirement (extended)
0A: This one's related to PP costs/PA damage multipliers (it may be an index rather than a multiplier; Yohmei has 9, Tenora has 0xB, which matches both percentages, but kubaras can have 1, 8, C, various other values)
78: Second extension level requirement (120).
00: Set? Agito Repca has 31,
00 05 00 00 00 00 00 05: Base stat bonuses, 1 byte each (Sword gives +5 DFP and +5 MST; presumably this is ATP/DFP/ATA/EVP/LCK/STA/TP/MST)

This is very different from the PSU format.

On the other hand, though, the unit format stayed exactly the same.

Including attack/tech speed bonuses.

I wonder if they work?

EDIT: Alright, so. On head units, all 3 modifiers (tech speed, tech range, tech PP cost) will still display when assigned to a unit. On arm units, "melee speed" has been removed, but the other 6 ("Auto Damage", firearm range/speed/PP cost, and striking range/PP cost) still display. Auto Damage (this was a damage over time), striking PP cost, and tech range/PP cost/cast speed don't seem to work any more; I'd assume the remaining other ones do not, either. I kinda expected this, but on some level, I'm still a bit disappointed.

EDIT AGAIN: Looks like the same data is at the end of the 0_ITMi14064013.unr file (forgot which weapon this was):
01 03 2A12 9600 32B0 90B1 24 00 462019 FD 0150 09 08 9301 1A 82 00 00 00 00 00 00 00 1E

Presumably the model number works differently seeing how the weapon carries its own with it. That said, in theory, if I didn't read it wrong...
0x96 min ATP, 0x32 * 4 + 3 = 203 ATP (in theory--I feel like the control data for this _must_ be somewhere), 0xB & 7 = level 3 SE, 0x46 ATA, SE 9(?--this'd be Confuse), level 1 requirement, +0x1E (=30) MST.

Looks like I was... surprisingly close! According to the wiki, it should be
(unknown min ATP--it's never displayed in game), 200 ATP, level 3 SE, 70 (=0x46) ATA, confusion, +30 MST.


EDIT again: The "3" on Sword comes from the top 2 bits of the minimum ATP. On Sword, that's 2BC0, so it's 3. Yes, this means the entire thing is probably ONE GIGANTIC BITFIELD, the things falling on byte boundaries (except at the end) are just a coincidence.

EDIT again (again): Filled in a few more values. Looks like the actual extend ATP bonus and SE are stored in one of the other files:
00000101 45020000 96000000 21000000
00000101: Sword's item ID (01010000) in the wrong endian.
45020000: First extension ATP bonus.
96000000: Second extension ATP bonus.
21000000: Bitmask for valid added SEs.

Re: PSP2i modding

PostPosted: Tue Jun 07, 2016 1:04 pm
by scriptkiddie
i ripped it.

It's not too bad to break the DLC apart but I actually haven't worked out the .pac file encryption yet so I wouldn't be able to modify the file sizes in the header if the .nbl contents were bigger than before.

that should help...

Re: PSP2i modding

PostPosted: Tue Jun 07, 2016 8:15 pm
by JamRules
Agrajag wrote:Alright, so. It turns out the item stats are in one of the files in media.fpb, in the old NBL format.

Interesting, sounds like a real pain with the values spread across bytes.
Hopefully this research will come in handy.

scriptkiddie wrote:i ripped it.

It's not too bad to break the DLC apart but I actually haven't worked out the .pac file encryption yet so I wouldn't be able to modify the file sizes in the header if the .nbl contents were bigger than before.

that should help...

Thanks, you might be onto something with the initial pack keys

Re: PSP2i modding

PostPosted: Sun Jun 12, 2016 11:45 pm
by Agrajag
Alright, I give up for now. This is as far as I've got swords broken down right now (make sure you read it in something that doesn't do word wrap).

It's missing weapon rank (this may be a derived value), range, element bonus, and it's got a bunch of extra unidentified data. Still, it's got most of the significant stuff.

(Can do this for the rest of the files, but I'm not sure how useful it'd actually be.)

EDIT: Forgot to explain the labels.
Visual: Visual effects (crimson's flames, etc)
model: Model number (global across a weapon category--the first yohmei model is conventionally 1 above the last of the original GRM models)
sound: Attack sound effect (I'm not sure on this one, it's too annoying to chase down)
first two ATP fields: variance. On hit, the primary stat (ATP or TP) is randomly rolled between these two values and used to calculate the actual damage.
SElv: Status effect level; used for both the built-in status effect and the one you get from extend codes.
F-ele: Fixed element (I think the element is actually on the "(hex)" field)
ex2ATA: ATA bonus for second extension (added to the first extension total ATA)
ex1ATA: ATA bonus for first extension (added to base ATA)
targs: Target count. On swords, this is a bonus (swords default to 4 targets; if one of these is set to 1, that sword hits 5); on sabers, it's an actual number ("Saber" has it at 1 and hits 1 target; Crea Saber has it at 2 and hits 2 targets).
ATA: ATA (...ayup)
lvl: Base level requirement.
ex1lv: Level requirement at extend level 1.
PAmul: PA/PP cost multiplier (I mentioned this before; if it's 9, 10, or 11, it's 90%/90%, 100%/100%, or 110%/110%, but other values are different and unmapped)
Set: ID for the set containing this weapon (set 6 is Gigush/Gigush Line, set 46 is GRM A-rank sword + Bugei-senba)
ATP/DFP/ATA/EVP/STA/CHR/TP/MST: Base stat bonuses (swords give bonuses to DFP and MST). These are signed, but I output them raw here (so if a value's above 127, it's actually that value minus 256).

Re: PSP2i modding

PostPosted: Sun Jun 26, 2016 11:35 pm
by Agrajag
AotI offline contained a couple missions intended for testing, two for each of the AotI bosses (one at level 1, one at level 30).

PSP2i contains 19 test missions. I've made PPSSPP savestates for them, you can get those here. They're using a level 25 default human male braver with crappy gear, so bear that in mind...
The missions are as follows:
mission number-internal name: description
2708900-kaigan_map_0_0: One beach block ("kaigan" means "beach"). Has a couple Finjer R/G/B spawns. Beach music.
2709000-hakobune_map_0_0: One Crowley (sky) block ("hakobune" means "ark", give or take). Has a couple Svaltia/Variaran/Garanz spawns. Kugu Desert music.

"Enemy Check" missions:
All of these take place in one room of RELICS (sleeping). Objective is to defeat the leader of the SEED forms, but as you can see, most of these aren't actually SEED-related. Each has one of each listed enemy at level 11.
2709100-Test_ChaosBringer: Chaos Bringer
2709101-Test_Gyaranzo: Garanz ("gyaranzo" is how it's written in Japanese--this was a weird translation)
2709102-Test_Finjer: Finjer R/G/B
2709103-Test_Stateria: Variaran
2709104-Test_StateriaBerserk: Nargevahl
2709105-Test_StateriaFighter: Ivarlus
2709106-Test_HeavnsMother: Heaven's Mother
2709107-Test_BladeMother: Blade Mother
2709108-Test_ShootMother: Sho(o)t Mother
2709109-Test_ForceMoter: Force Mother

These two are "object test" missions. They're essentially one block, with rows of each object type (e.g boxes, turrets, barricades, etc).
2709120-HakobuneObjTest: Crowley (plays Kugu Desert music). Also has a hallway with Tylor, Curtz, Nagisa, Flowen, Rico, two NPCs I don't recognize (both lying on the ground), Do Vol (dancing), No Vol (dancing), and Hiru Vol (dancing).
2709121-KaiganObjTest: Beach. Also has a pier with Ursula, Ursula (again), Emilia, Kraz (sitting), Chelsea (sitting), Tonnio, Yut, Liina, and a bunch of characters I don't recognize (including I think a couple default characters)

These two are weird. They're single-block, single-enemy missions, but they have doors, boxes (with actual drops), and minimap arrows to guide your way. Their map titles are the same as the enemy name.
2710100-Pub_ChaosBringer: Ruins, Chaos Bringer.
2710101-Pub_Gyaranzo: Mines, Garanz.

2710110-BoostEnemyTest: Blocks numbered like in real missions. Takes place in Raffon Meadow. No doors or boxes.
Block 1: Level 1 Badira.
Block 2: Yellow-boosted level 1 Badira.
Block 3: Red-boosted level 1 Badira.
Block 4: Takes place in fire-contaminated Raffon Meadow. Contains a white-boosted level 1 Badira, followed by a king white-boosted level 1 Badira and a lightning-contaminated white-boosted level 1 Badira

3702390-AtkCollisionTest: Takes place in the same map/room as the enemy check missions. Contains one turret trap (fires bullets that inflict 10% of your max HP). Unlike the enemy check missions, there's no music, and the exit doesn't work.

Re: PSP2i modding

PostPosted: Tue Jul 05, 2016 7:41 pm
by JamRules
Great, thanks for sharing.
Guessing you have to do some messing about in RAM to get the missions to load?
Plenty of things to look at if I ever manage to finish the translation patch

Its also interesting that the files were left in the final game build


On a seperate note PPSSPP now has initial texture replacement support,
how large are the costume textures in PSU?
I think Infinity uses 128x128, if PSU use higher it could be quite cool to try it out

Re: PSP2i modding

PostPosted: Thu Jul 07, 2016 4:01 am
by Agrajag
When you're in a counter and select a mission (as in, when "do you want to select this mission? yes/no" is onscreen), there's a value that stores which mission you have selected. If you set it to a different mission, upon choosing to start the mission, you'll get the mission whose ID you input rather than the one you selected (even if you don't meet the requirements for it). Would've tried to make a cwcheat code for this, but the value moves around in memory, and it'd be a fair chunk of effort to learn how cwcheat works enough to actually chase the pointer chain.

The test map looks like it's still in Infinity, too, but sega's love of using map 0 for various menus makes it obnoxious to reach.

It looks like the textures in the Portable games are generally about half the resolution (on each dimension) as PSU's. I don't remember how big the "combined" texture is, but looking at a random set, face is 128x128, hair is 128x128, upper is 128x256, lower is 128x196 (yes), shoes are 256x72, ears are 72x48, forgot what eyes are. They may work a way different from how I remember, it's been ages since I looked at them.

Re: PSP2i modding

PostPosted: Sat Jul 09, 2016 10:22 pm
by JamRules
Thanks for the extra detail, I was guessing it would be something along those lines,
great work discovering how to get into the missions.

Sounds like your right, that the combined textures will double in width and height.
Not sure how much difference it will make in practice but I'll like to give it a try when I can find the time.
Someone also suggested waifu2x for generating upscaled images.
Either way would probably take ages to prepare a set of images with the right filenames for PPSSPP,
one of those things that would be nice to do but I'll have to park it until I get everything else sorted for the translation patch.