#does anybody know if mementos procedural generation logic has a script or if it's hardcoded

286 messages · Page 1 of 1 (latest)

quaint lodge
#

ive also been wanting this. i have a suspicion its all exe shenanigans from the bits of research ive done

#

(specifically the fare adjustment machines part)

eager bobcat
#

well even if it's exe as long as I can figure out where I should be able to temporarily modify it

eager bobcat
#

because I think DUNGEON.BF might contain some of the logic

quaint lodge
#

where is that

eager bobcat
#

but I haven't confirmed yet

#

it's in FIELD/ETC

quaint lodge
#

i imagine in the base cpk

#

(im still new to p5 modding so im not the most familiar with the game's structure)

eager bobcat
#

but yeah it's possible

quaint lodge
#

oh it is in en.cpk

eager bobcat
#

I'm just not sure if it actually contains mementos logic or not

#

haven't read much into it

#

it's pretty long

quaint lodge
#

i do see mementos specific dialog in the msg data

eager bobcat
#

this seems suspect as well

#

like "Find parts" could mean the parts of the level that get stitched together for the procedural gen

quaint lodge
#

what do you use to properly decompile bf files by the way?

eager bobcat
#

there's also a GUI version made by shrine fox

quaint lodge
#

AT_DNG seems to also be relevant

eager bobcat
eager bobcat
eager bobcat
#

since they're strings

#

programming 101: to make a scripting language work, you have to make the functions unobfuscated in your code usually

#

or at least it's easier to do it if you do

#

you can still use encryption with it, but there's usually not really a point

eager bobcat
#

dll exports are actually similar

#

they also show up unobfuscated

quaint lodge
#

makes sense

eager bobcat
#

p5r doesn't use dlls though so examining the binary can be tough

#

there's community tools to help with that, but I'm a masochist so I'm doing it manually

#

most of the time

quaint lodge
#

i think its funny how it really is just one massive static binary

eager bobcat
#

the bloated size is likely because of denuvo

quaint lodge
#

fuck denuvo Smile

eager bobcat
#

lol

#

makes it take way longer to analyze too

#

Just Cause 3 took 30 minutes

#

P5R took 14 hours

quaint lodge
#

sounds about right

#

thank god theres a pre-analyzed ghidra thing

eager bobcat
#

but at least p5r has a lot of loose files

#

so you can modify a lot about the game

#

I don't mind going through the hard code though

#

I mean, I've been doing it a lot already

#

yeah

#

AT_DNG seems to have a lot of the mementos tutorial stuff

eager bobcat
quaint lodge
#

it sure does

#

in fact

#

universally

eager bobcat
#

higher level optimizations still work, so it's not always denuvo's fault a game runs poorly, but a game will usually run better without denuvo

quaint lodge
#

removing denuvo always will make performance better

#

whether major or minor, its still detectable

eager bobcat
#

only CPU register optimizations are

quaint lodge
#

correct

#

also start times in general

eager bobcat
#

yeah

#

imagine Yandere Simulator with denuvo

quaint lodge
#

that actually probably wouldnt do too much

#

with the way unity works

eager bobcat
#

then it'd have poor high level and low level optimizations lol

quaint lodge
#

god actually

#

there is one way

eager bobcat
quaint lodge
#

id imagine in theory you could "protect" the il2cpp binary

#

its also hilarious because denuvo pretty much always hurts sales more than the risk of piracy without it

#

game like p5r are the exception for me, as 99.9% of the time i just skip games that have it

#

(espescially since games that are hacked to remove denuvo run better without it anyways)

eager bobcat
#

well p5r has enough high level optimizations for denuvo's presence not to really matter

quaint lodge
#

anyways we're getting massively off topic

eager bobcat
#

like

#

the engine was designed for ps3

#

so damaging low level optimizations is balanced out by being played on better hardware

#

user experience isn't hurt that much

#

it mostly affects modders

quaint lodge
#

yeah

eager bobcat
#

either way

#

denuvo is an example of attacking the symptom and not the problem

#

piracy usually doesn't happen "just because", which is the attitude denuvo presumes

#

it happens due to lack of funds or accessibility

quaint lodge
#

its clearly not the solution since indie games lately outperforming AAA games by just being good games AyaJii

eager bobcat
#

so just make your game accessible and don't charge too much, and don't do things consumers don't like, and you won't have to worry about it

#

in fact

#

expensive DLC doesn't really seem to contribute much at all to piracy

eager bobcat
#

people buy games they want to buy

#

who'd have thunk

#

tbh I only pirate abandonware most of the time anyway

#

old games you can't get anymore

#

I've technically pirated 010 but I plan to buy it for real once I get the funds

#

it's a good tool

quaint lodge
#

yeah i did the same with fl studio

#

i had pirated it for years, and now im a proud all plugins pack owner

eager bobcat
#

nice

#

most software I use is free though

quaint lodge
#

black friday sale is INSANE

eager bobcat
#

I actually use Blender for video editing lol

quaint lodge
#

hundreds of dollars off

eager bobcat
#

unironically, it's my go to, and will probably remain as such since I'm familiar with it

quaint lodge
#

and the actual price of it without sale has been going down too

#

its just becoming more afforadble with better features lately

#

its awesome

eager bobcat
#

nice

quaint lodge
#

didnt know that was possible

eager bobcat
#

hey @novel thistle do you have an answer to my question?

eager bobcat
#

or it has VFX features

#

so it can do a lot of what after effects can do

quaint lodge
#

i barely know how to make a simple model in blender lmfao

eager bobcat
#

as a result of that: you can edit with it

#

well...

quaint lodge
#

the most complicated things ive done in blender is creating a path mesh for collision in a (incomplete) btd1 remake and following a tutorial for a sm64 romhack

#

that ive also not finished

eager bobcat
#

I actually think most of my time in blender has been spent on the video sequencer, not actually modeling or animating

#

but I have done models and animations

quaint lodge
#

i really need to learn how to do 3d model stuff, but motivation hard most of the time

eager bobcat
young shellBOT
quaint lodge
#

cute

eager bobcat
#

thanks

novel thistle
eager bobcat
#

AT_DNG might be what I was looking for @quaint lodge

quaint lodge
#

huge

eager bobcat
#

it contains the wall breaking and chests

eager bobcat
#

also has a Sumi Overhaul version

eager bobcat
#

DUNGEON.BF and AT_DNG.BF are both related to dungeons

#

and have some mementos stuff in them

#

but I'm not seeing anything procedural

#

nothing about the ticket machine or whatever either

quaint lodge
#

if this helps at all, the fare adjustment machine's model is M091_201.GMD

#

if you can find what uses it

#

(im not the most sure how the game does stuff like this, but surely having the model name will help in some way)

eager bobcat
#

since the script for that should be related

quaint lodge
#

i wonder how the game determines which pool of items to give you

#

like i know how logically its based on the section you're in

#

but i wonder if theres like a sort of switch statement type of thing somewhere

eager bobcat
#

this is the only thing between both files that has it

#

and it's not there

#

hrm

#

this might be exe

#

actually

#

it could be in a HIT file

quaint lodge
#

HIT?

eager bobcat
#

they tell the game what script index to run based on what trigger you hit

#

chests use them too

quaint lodge
#

oh interesting

eager bobcat
#

the problem is that mementos is procedural so idk what the name of the field files for it would be

#

HIT files are per field

quaint lodge
#

although the way mementos works with field items

#

they arent like chests

eager bobcat
#

yeah not sure

quaint lodge
#

yknow

#

the fare adjustment machine works quite similarly to the steal-able things in palaces

#

it even says "steal" when you go to interact with it

novel thistle
# eager bobcat

thats for will seeds i think?
iirc from poking around flowscript relevant to the seeds

eager bobcat
quaint lodge
#

it could be

eager bobcat
#

that could give me a lead

#

still need the right field file though

quaint lodge
#

it would certainly explain why its hard to pin down

eager bobcat
#

I know it gives you different SP restoring items based on what section of mementos you're in

quaint lodge
#

funnily enough

#

in theory it could be based on the song that's playing

eager bobcat
#

song that's playing is also determined by the section

quaint lodge
#

since that conveniently lines up with the items it gives

eager bobcat
#

they'd just use both

quaint lodge
#

fair

#

but there could be shared logic

eager bobcat
#

I'm gonna look at the FBN files

#

those are basically the map logic files

quaint lodge
#

its still funny to me how overengineered this game is at times

#

all for a simple interaction

#

and then theres the phone images in conversations

eager bobcat
#

sometimes a "simple interaction" can be pretty complex

quaint lodge
#

that are just loose dds files

eager bobcat
#
void UseItem(const uint16_t charaID, Item& item)
{
    uintptr_t* joker = (uintptr_t*)(GetDatUnit(JOKER));
    uintptr_t* character = (uintptr_t*)(GetDatUnit(charaID));

    uint16_t characterHP = *(uint16_t*)(character + 0xC);
    uint16_t characterSP = *(uint16_t*)(character + 0x10);
    
    bool usedItem = false;

    if (item.quantity <= 0)
    {
        inventoryItems.erase(inventoryItems.begin() + displayItem);
        displaySelectionWindow = false;
    }

    if (item.teamRestore)
    {
        for (uint8_t i = 1; i <= 10; i++)
        {
            uintptr_t* unit = (uintptr_t*)(GetDatUnit(i));
            uint16_t unitHP = *(uint16_t*)(character + 0xC);
            uint16_t unitSP = *(uint16_t*)(character + 0x10);

            applyEffect(item.skillID, joker, unit);

            if (unitHP != *(uint16_t*)(unit + 0xC) || unitSP != *(uint16_t*)(unit + 0x10))
                usedItem = true;
        }

        if (usedItem)
        {
            item.quantity--;
            *reinterpret_cast<uint8_t*>(generalItemBaseAddress + item.type) -= 1;
        }

        return;
    }

    applyEffect(item.skillID, joker, character);

    if (characterHP != *(uint16_t*)(character + 0xC) || characterSP != *(uint16_t*)(character + 0x10))
        usedItem = true;

    if (usedItem)
    {
        item.quantity--;
        *reinterpret_cast<uint8_t*>(generalItemBaseAddress + item.type) -= 1;
    }
}```
#

my current code for using an item in my custom inventory

#

despite getting the function for using one I still had to do all this because of how reliant it was on the existing UI

#

I can pretty it up later

#

but for now that's how it works

quaint lodge
#

it doesnt look too bad to me

eager bobcat
quaint lodge
#

lmfao

eager bobcat
#

like sure for my custom inventory elements

#

but for the game too

quaint lodge
#

also gotta say

#

*reinterpret_cast<uint8_t*> is quite hilarious to look at

eager bobcat
#

C++ style casting

quaint lodge
#

mixed with C style casting

eager bobcat
#

but you can just use C style casting still

eager bobcat
quaint lodge
#

mood

#

personally

#

id just make a helper macro

eager bobcat
#

maybe

#

but C style casting works fine for this use case

quaint lodge
#

but then youd have to go and unset it to not conflict with other stuff

eager bobcat
#

I think it was primarily designed for reinterpret anyway

quaint lodge
#

yeah

eager bobcat
#

if I had to use dynamic or static casting it'd be different

#

but I really don't

#

anyway, I wonder if these are for mementos

quaint lodge
#

i wonder what the engine for p6 will look like

#

considering it wont be based on a ps3 game

#

(probably similar to metaphor's now that im saying it out loud)

eager bobcat
#

they updated GFD for metaphor

#

so it'll either be on GFD or on Unreal

#

@quaint lodge this was the right model, right?

quaint lodge
#

yes

eager bobcat
# quaint lodge yes

well this is not very helpful because there's no specific HIT file for mementos

quaint lodge
#

damn

eager bobcat
#

I'll look if there's a generic file for all of mementos

#

because there's no reason stuff like this can't be handled by a singular script

quaint lodge
#

this is atlus we're talking about here

eager bobcat
#

D0 only exists for FBN files?

#

so it's likely that one script is in charge of mementos

#

if not just the exe itself

#

the p5 mementos models in field_tex are also labeled 09

#

just F09

#

instead of D09

#

since they're meant to be loaded dynamically I doubt they have MAP files

#

unlike other palaces

#

nevermind they do

#

they're just labeled 19

#

instead of 09

#

atlus moment

#

which means

#

the mementos HTB files are likely the 190s as well

#

well

#

HTB files don't seem to specify which procedure index to use for that

#

soooo

#

it might be exe?

#

mementos stuff is so confusing

keen ridge
#

AT_DNG is always Mementos whereas regular DNG is Palaces, so if it'd be anywhere, it'd be in something to do with the former. There are some pre-existing Mementos fields, but for the procedurally generated ones... almost certainly an exe thing, but I'd also check to see what logic is attached to the escalator within the Mementos entrance field.

eager bobcat
#

and the HTB

#

probably because it's always consistent

keen ridge
#

Makes sense.

eager bobcat
#

the HTB's script has the logic for exiting

#

but nothing for the SP restoring machine

#

but what's weird is that some mementos FBN files include the machine and some don't

#

so maybe the actual difference is just

#

which one gets loaded

#

I just wish I could find it

#

@keen ridge I'm gonna check the binary

#

is the flowscript command CALL_FIELD?

#

I'm gonna check the references to the function for that

novel thistle
#

is for loading regular fields but yee

eager bobcat
novel thistle
#

shrug

eager bobcat
#

these don't seem right

novel thistle
#

atdng_quest_floor sems like itd be the one where you fight mementos requests

eager bobcat
#

and event floor feels like it's for deviations maybe

#

might just be a DNG command, not ATDNG

#

maybe this?

eager bobcat
#

did a little more investigating and I found this file

#

idk what it's for

#

but I'll just try changing everything to 100 and seeing what happens

#

does not look related

#

there's also FLDATDNGBONUS

#

gonna check that one

#

nope not that one either

eager bobcat
#

yeah I've got no clue what controls this

#

but I fixed the problem in my code

#

so