#Game crashes when singular mod is enabled despite lack of changes between previous launches

338 messages Β· Page 1 of 1 (latest)

fading saddle
#

So when is it actually crashing? Does the game actually load or is it before that?

hybrid gulch
#

it loads slightly

#

never gets to the loading icon though

#

but it loads some files

fading saddle
#

So it gets to a black window for a second?

hybrid gulch
#

yeah yeah

#

my working theory is that its dying on init_free.bin or some other init.bin file

fading saddle
#

Possibly

hybrid gulch
#

the annoying thing is that it appears to be working fine for moddaman and brawler soooooooo

fading saddle
#

I just noticeed the log has P5R Library loading

hybrid gulch
#

oh is that not normal

fading saddle
#

I doubt it's the problem but could you try and make it not do that

#

Well this is p3p so idk why you'd load p5r lib

#

Is it a bgme thing or something?

hybrid gulch
#

i feel like its always done that

#

maybe

#

might be because of persona essentials

#

one second

fading saddle
#

Nah, it's not a dependency of persona essentials

hybrid gulch
#

this is my entire enabled mod list so i'm not sure what else it could be

fading saddle
#

I'm pretty sure it'd be bgme

hybrid gulch
fading saddle
#

Like I said it's most likely not a problem but it's worth checking just in case

#

I assume that means it still crashed?

hybrid gulch
#

yup πŸ˜”

fading saddle
#

alright

hybrid gulch
#

it only stops crashing when i disable ESM

fading saddle
#

does the game produce a crash dump?

hybrid gulch
#

it should....

#

where are those again?

#

in the game folder?

fading saddle
#

Yeah

#

crashdat/bd/reports

hybrid gulch
fading saddle
#

nice

#

Oh cool, it crashes for me as well

#

That should make things easier

hybrid gulch
#

:OOOOO

#

ITS NOT A BONQ ISSUE

fading saddle
#

It is dying trying to load some file, I think it's probably init_free.bin

#

This might be the same issue as before that I just never fixed

hybrid gulch
#

oh wow

#

so it's related to the pac merging bug

#

because fixing that would be uber cool too 😎

#

can't add Auto Heal to ESM without it

fading saddle
#

Yeah it's definitely a problem with init_free.bin

hybrid gulch
#

man so question

#

the fact that its working for brawler and moddaman is because of them not clearing their cache, yeah?

fading saddle
#

Maybe naotoshrug

#

Could we get them to clear the cache and try

hybrid gulch
#

@serene sage hey pookie, come clear your cache

fading saddle
#

πŸ™ƒ

serene sage
#

made sure I pulled the latest changes from the repo, built the mod and made sure my cache was cleared and it just worked for me 🫠

fading saddle
#

That's weird but at least it's crashing for me, it would be a real pain if it wasn't

woeful stream
#

i have not tested in a while. i will take a look soon(TM)

#

i need to pull the latest changes and rebuild

fading saddle
#

I think I've found the problem, it seems some extra 0s need to be appended to the end of a pak file

#

Basically it seems like the game tries to read the header of the next entry but dies because that memory isn't initialised

hybrid gulch
#

wasnt that the solution moddaman said about the dng_init.pac thing

serene sage
#

^^

fading saddle
#

If I am correct about that then it's pure luck that any emulated pak file works at all

#

Oh was it?

hybrid gulch
#

yeah like

fading saddle
#

lol

#

I don't remember

hybrid gulch
#

they told you back in mid march 😭

#

maybe earlier.....

velvet mantleBOT
#

didn't seem to be the issue in P3P PC from my testing

literally all i did was just:

  • enable PAK Dumping in PAK EMU
  • test loading it through the CPK folder to see if the file itself is bad (it was)
  • add 0x100 padding bytes at the end of the dumped file
  • re-test loading it to see if that fixed anything (which it did; i literally didn't touch any of the other bytes, so if the version number is different on p3p pc that doesn't seem to actually matter funny enough)
Jump

[Go to message!](#p3-modding-chat message)

fading saddle
#

Did I try doing that?

hybrid gulch
#

LATE JANUARY

fading saddle
#

Sorry...

#

Well I've independently come to the same conclusion by reverse engineering some of the pak loading code 🫠

serene sage
#

It's alright man we all forget to get around to things sometimes haha πŸ˜…

#

And hey since you did some RE on the actual code you probably have a better idea of how it's supposed to work anyways (hopefully lol)

fading saddle
#

It is just meant to be a bunch of 0s at the end it seems. I think what you said back then is exactly right

hybrid gulch
#

i can add auto healing now 😭

#

bob bless

fading saddle
#

Well at least it should be an easy fix

hybrid gulch
#

still doesn't explain why it works why it works fine for moddaman naothink

fading saddle
#

Pure luck

hybrid gulch
#

he's got that anti bonq curse

fading saddle
#

The memory after the file just happens to be allocated with something

#

The fact that any emulated pak file worked is complete luck

hybrid gulch
#

its crazy that it just decided to break on me now

serene sage
#

Honestly that would explain that from what i remember even files that did cause crashes in the past could still have a small chance of working rarely; if it's just pure luck eventually the memory will just happen to align correctly πŸ˜…

hybrid gulch
#

crazy that out of all the mods i ever made

#

this one finally broke it

#

well besides FER

fading saddle
# velvet mantle

Looking back at my reply to this it seems like I really should've fixed the problem. I guess I just never tried appending the padding for some reason

woeful stream
#

well it's good that this has been fixed. i was about to go take a look and see if it crashed for me but it seems there's no need for me to test rn

hybrid gulch
#

well thank god it got fixed now

#

got a long weekend ahead of me

#

so i can actually devote some time to working on this

fading saddle
#

It's not actually fixed yet, I still have to work out how to add the stuff at the end (the pak emulator code is confusing)

#

There we go, I think I've fixed it

#

With it I no longer crash

hybrid gulch
#

uh did you mean to leave debugging on lol

fading saddle
#

Oh woops

#

You'll need to clear the cache from the previous version so the files actually rebuild

hybrid gulch
#

WERE IN

fading saddle
#

Nice

#

I wonder if this fixes those other crashes with p3p as well

hybrid gulch
#

yeah i probably should test auto healing

fading saddle
#

That still says custom sub menu btw

hybrid gulch
#

im deadass fixing that rn 😭

fading saddle
#

You could've used the name if you wanted but I see you switched to expanded sub menu

hybrid gulch
#

yeah i felt weird copying the name

fading saddle
#

I wouldn't care, it does do essentially the same thing

#

I guess the other people who worked on it might feel different but I kinda doubt it

hybrid gulch
#

ok time to test auto healing before we close this

#

bruh why is it dying on a mod i publicly released

fading saddle
#

What's breaking now?

hybrid gulch
#

something about a stream offset pair

#

the error is like

#

half red and half blue lol

#

goes away when i disable ESM so i probably fuuked something up

#

oh wait

#

i know

#

field.flow shenanigans

#

we gucci

#

testing time

fading saddle
#

Ok good

hybrid gulch
#

also i have to ask

#

sewer mentioned it

#

but it's not normal for the controller to return null in all of my logs?

fading saddle
#

No it shouldn't

#

Idk what that's about

hybrid gulch
#

yeah idk either

fading saddle
#

It's completely unrelated to this though

hybrid gulch
#

hasn't broke anything yet

fading saddle
#

I've seen it in people's logs before but it never seems to actually cause problems so I haven't bothered trying to find the cause

hybrid gulch
#

seems like it didn't fix the dng_init.pac bug πŸ’€

#

either that or party organize is broken

fading saddle
#

What was that bug again? Does it just crash when loading the file?

hybrid gulch
#

yeah randomly

#

not even sure if its when it loads the file

#

seemingly only when it loads "check_party_member"

fading saddle
#

Yeah I vaguely remember it. I don't think I really had any notes on it though

#

I think I came to some kind of conclusion but I don't remember what exactly

hybrid gulch
#

no.....

#

still crashes

#

just went up the stairs and the game crashed

#

do you want the crash dump?

#

that's super weird

fading saddle
#

Sure

hybrid gulch
#

weird stuff

#

moddaman came to that conclusion while fixing auto healing so i'm surprised it isn't working

fading saddle
#

Huh, interesting

#

I'll see if I get the crash as well

#

Seems fine to me

#

What specifically did you do to make it crash?

hybrid gulch
#

climbed stairs after warping from a tartarus guardian floor

#

fought 5 battles

#

climbed stairs again

#

crash

fading saddle
#

Oh I just crashed at the end of a battle

hybrid gulch
#

oh

#

well that too

fading saddle
#

Is that when it's happening?

#

Oh is that different?

hybrid gulch
#

that's how most people reported the issue

#

that it was crashing after battles

fading saddle
#

ok

hybrid gulch
#

but that didn't happen to me just now

#

the auto healing actually worked and healed people

fading saddle
#

I guess I'll see if I can fix that too

hybrid gulch
#

so it's definitely not something about the file being loaded

#

its something to do with a specific procedure

#

i think at least

fading saddle
#

My crash is something to do with starting bgm if I've got this function labelled right. It's dying on that string format

#

I didn't check your crashdump but presumably it's the same

hybrid gulch
#

starting bgm?

#

i don't think my mod touches anything about BGM

#

lemme see

fading saddle
#

That's just where my game is crashing, it could be something unrelated

hybrid gulch
#

i think its the BGM call for checking what music to play depending on the floor lol

#

so probably unrelated

#

weird that it's dying on that though

fading saddle
#

Ok it didn't crash that time

hybrid gulch
#

yeah it's weird that it doesn't crash everytime

#

but it still heals you when you need it to

fading saddle
#

It doesn't want to crash now πŸ˜”

#

Oh wait that did it

#

I think I didn't have your esm stuff enabled yet since I hadn't opened the menu

hybrid gulch
#

wdym

#

like ESM is causing the crash now?

fading saddle
#

Maybe

#

It could be a coincidence though

hybrid gulch
#

it crashed for me when using dungeon party organize

#

so if you want an easy way of switching floors just remove and add a party member

fading saddle
#

Oh I see a problem

#

The bgm id is getting set to a crazy high number

#

0x95A4 (38308)

hybrid gulch
#

😭

#

why?>?????

fading saddle
#

Does your thing change the bgm in some way?

hybrid gulch
#

it shouldn't

#

one sec

#

no it doesn't

fading saddle
#

Well so far it's only happened with esm on

hybrid gulch
#

but

#

it was crashing for people way before ESM

fading saddle
#

Oh ok

hybrid gulch
#

lemme see if i can get a crash dump without ESM

#

i don't think there's any BGM stuff whatsoever in ESM

#

besides mod menu

#

ok it's ESM's fault πŸ˜”

#

climbed 10 floors and no crash

fading saddle
#

You must be changing count 1 somewhere in it since this is where the problem is occuring

#

The value of count 1 is being set as the bgm id

hybrid gulch
#

if we are i can't seem to find it

#

all references to count

fading saddle
#

You could just check for SET_COUNT

#

How'd you do that btw?

hybrid gulch
#

notepad++

#

opened all documents

#

searched all documents

fading saddle
#

Oh

#

That's smart

hybrid gulch
#

set count is only ever used in Mod Menu for the favorites system

#

Search "SET_COUNT" (18 hits in 1 file of 63 searched) [Normal]
C:\Users\airin\OneDrive\Desktop\Mod Making\Temp 2\p3ppc.expandedsubmenu\p3ppc.expandedsubmenu\FEmulator\BF\ModMenu\Utilities.flow (18 hits)
Line 420: case 0: SET_COUNT( 24, SelectNumber(4) ); break;
Line 421: case 1: SET_COUNT( 25, SelectNumber(4) ); break;
Line 422: case 2: SET_COUNT( 26, SelectNumber(4) ); break;
Line 423: case 3: SET_COUNT( 27, SelectNumber(4) ); break;
Line 424: case 4: SET_COUNT( 28, SelectNumber(4) ); break;
Line 425: case 5: SET_COUNT( 29, SelectNumber(4) ); break;
Line 460: case 0: SET_COUNT( 30, SelectNumber(4) ); break;
Line 461: case 1: SET_COUNT( 31, SelectNumber(4) ); break;
Line 462: case 2: SET_COUNT( 32, SelectNumber(4) ); break;
Line 463: case 3: SET_COUNT( 33, SelectNumber(4) ); break;
Line 464: case 4: SET_COUNT( 34, SelectNumber(4) ); break;
Line 465: case 5: SET_COUNT( 35, SelectNumber(4) ); break;
Line 493: case 0: SET_COUNT( 36, SelectNumber(4) ); break;
Line 494: case 1: SET_COUNT( 37, SelectNumber(4) ); break;
Line 495: case 2: SET_COUNT( 38, SelectNumber(4) ); break;
Line 496: case 3: SET_COUNT( 39, SelectNumber(4) ); break;
Line 497: case 4: SET_COUNT( 40, SelectNumber(4) ); break;
Line 498: case 5: SET_COUNT( 41, SelectNumber(4) ); break;

fading saddle
#

Weird

#

Something is changing it

hybrid gulch
#

is the band aid solution rn to set a dependecy on BGME haha

#

nah i'm kidding

#

really weird

#

such a strange number too

fading saddle
#

Ah the number is actually 0x4000. I got that part wrong

#

Still definitely not right though

hybrid gulch
#

yeah no

fading saddle
#

I just watched it happen, when the esm menu opens up for the first time that count does change

#

I'll record it so you can see exactly when it case it might help

hybrid gulch
#

oh for real?

#

so it's part of the firsttimesetup.flow then huh

fading saddle
#

I would guess so

#

This is in FindAFriend.flow

#

I don't think that'd be it though

hybrid gulch
#

weird that it'd be doing that in the dungeon

fading saddle
#

That makes no sense

hybrid gulch
#

i just fixed that though

fading saddle
#

That shouldn't be the problem anyway

hybrid gulch
#

yeah two different numbers

fading saddle
#

no way that code is getting called

#

that too

hybrid gulch
fading saddle
#

What bf would the code that's being called be in?

hybrid gulch
#

so just field.flow and all it's imports

#

or actually

#

but nothing in ESM modifies that second one

fading saddle
#

Can you try decompiling the dumped bf

hybrid gulch
fading saddle
#

I wanted to but my script compiler is broken for some reason and idk where you can get the latest build

#

(Without having to actually search for it, I'm sure I could find it)

hybrid gulch
#

wait that one doesn't have ESM compiled into it, one sec

#

206 kb gaw damn

#

C:\Program Files (x86)\Steam\steamapps\common\P3P\FEmulator-Dumps\BFEmulator\init_free.bin\field\script\field.dmp.bf.flow (17 hits)
Line 213: SET_COUNT( 1, 0 );
Line 801: if ( GET_COUNT( 1 ) == 0 )
Line 805: else if ( GET_COUNT( 1 ) == 102 )
Line 809: else if ( GET_COUNT( 1 ) == 103 )
Line 813: else if ( GET_COUNT( 1 ) == 104 )
Line 817: else if ( GET_COUNT( 1 ) == 105 )
Line 841: SET_COUNT( 1, 102 );
Line 846: SET_COUNT( 1, 103 );
Line 851: SET_COUNT( 1, 104 );
Line 856: SET_COUNT( 1, 105 );
Line 873: SET_COUNT( 1, 0 );
Line 976: SET_COUNT( 1, 0 );
Line 1310: SET_COUNT( 1, 0 );
Line 2299: var38 = GET_COUNT( 12 );
Line 3292: SET_COUNT( 12, var38 );
Line 3355: SET_COUNT( 1, 0 );
Line 3437: SET_COUNT( 1, 0 );

fading saddle
#

Still nothing in there that would be changing it

#

I wonder if it's an out of bounds bit instead...

hybrid gulch
#

is that within my control 😭

fading saddle
#

I mean you might be using a bit that is actually referencing that count

hybrid gulch
#

oh that would make sense

#

i have uh

#

a lot of bit flags

#

i can send you the list of bit flags i use lol

fading saddle
#

No need, I should be able to work out which one it is myself if any

hybrid gulch
#

ok

#

well if you need em lemme know

#

i would start with the turn on recommended ones if that helps

#

since those are enabled by default when you press the square button

fading saddle
#

I was right

hybrid gulch
#

ohhhhhh

#

how fuuked am i

fading saddle
#

I'm not sure, I need to work out what bit it actually is

#

I set a break point and it gets changed inside of the BitSet function

#

0x162e (5678)

#

You're actually editing a lot of counts lol

hybrid gulch
#

oh am i

fading saddle
#

There are quite a few higher than that

hybrid gulch
#

First Time Setup
6320

Mod Menu
6321

Quick Travel plus
6322

View Calendar
6323

Dungeon Options
6324

Find a Friend
6325

Find a friend spoiler free mode
5678

Save Anywhere
6326

Save Everyday
6327

Filler Events
6328

Remove Lunchtime Invites
6340

ENABLE OPTION
6329

DUNGEON
Call the Clock
6330

Auto Healing
6331

Change Party
6332

Change Floor
6333

Use Traesto Gems
6334

Default Direct Commands
6335

Game Over Skip
6336

CALL CLOCK USES TRAESTO
6360

#

flag list

#

5679 - 6360 an unsafe range lmaooooo

fading saddle
#

Changing any of those is editing counts

hybrid gulch
#

DDD:

#

its a miracle this shit worked

fading saddle
#

Does mod menu not have something for editing counts?

hybrid gulch
#

no it does not

#

but it probably could be added

fading saddle
#

πŸ˜”

serene sage
hybrid gulch
#

oh well that's not fun

serene sage
#

I was actually worried about this from the start tbh but I just figured that if it was working then maybe there wouldn't be any issues, guess not unfortunately

hybrid gulch
#

do you want me to draft up a count editor swine

#

shouldn't be too hard

fading saddle
#

That would be nice but I don't really need it. I'm confident that I'm right

fading saddle
#

(That xor turns to 0x15FF/5631)

serene sage
#

Makes sense why it's not there since itd be odd to include a debugger of some sort with the release but obviously that uhhh is an issue for us since that makes it easy to do OOB memory writes without realizing you're doing that since it just works lol

hybrid gulch
#

totally didn't just copy paste this from time travel

fading saddle
#

lol

#

nice

hybrid gulch
#

so i have to find a chunk of unused bit flags

#

where 2% of the game bit flags are documented......

serene sage
fading saddle
#

That could be easily done

#

I feel like it might end up spamming the console though, there are a lot of these (2661 calls to it)

#

I guess it'd be interesting to see

serene sage
fading saddle
#

I mean it's not just for out of bounds bits, it's anything they decided to use it for and seemingly that's a lot of places.

#

Although what you're saying does make sense. Presumably stuff shouldn't break during normal gameplay

#

That's from opening esm for the first time πŸ˜„

#

It passes in some number to the function that I assume is some kind of error code. Idk if there's any strings to relate them to though

#

Neat, there's one when the game tries to load the nonsense bgm and dies too

[ERROR] 707 at d:\projects\p3p-pc\p3p_steam\p3p\sdk\src\sound\sdksnd.c
#

Actually maybe that number could be a line number

#

Not that it would be of any use without the source

#

Well anyway I think it's safe to call this problem fixed. I'll make a pr with the fix soon and hopefully everything will be good then

serene sage
#

~~inb4 things break even more bc of the fix troll_smile ~~

#

But yeah does seem like everything's good to go on this basically πŸ‘