News: 11 March 2016 - Forum Rules

Author Topic: [NDS] Ghost Trick "NG+ Mode" (Warning: Game Spoilers Discussed)  (Read 2192 times)

ArcanaXIX

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
This is my first ROMHack but it's been a lot of fun while also extremely frustrating. My primary goal is to replace all instances of a particular character's talk sprites (both the full-scale talk sprites and the smaller mini talk-sprites that accompany thought bubbles, etc), but this game is pretty un-documented from what I've found. So I've been mostly working from scratch. My "I'm dreaming" vision for a "complete" version of this would somehow implement a button or something that lets you turn this on/off (revert to the original as desired), but my primary focus is just getting it to work to start with.

Specifically, I want to play as the cat the whole time.  ;)

After a lot of trial and error, I recently made some tangible progress - I've found a kind of "master list" of the sprites in cpac_3d.bin (note: I found an ancient thread somewhere in my initial research that implied cpac_2d.bin was where I might find these, but that was not correct, all talk sprite data is in cpac_3d.bin. cpac_2d.bin appears to mostly contain background assets), around memory address 04ED4280. They are of the following format:

## ## ## 00 ## ## 00 80

(I found them while poking around in CrystalTile's tile viewer because the 00 80 created these distinct black and salmon bars viewed with tile form GBA 8bpp. I may get into this later but that tile form is what you are going to want if you ever want to look at the background assets in cpac_2d.bin.)

Basically I found that if you copy the hex code of whatever sprite/asset you want and paste it over the hex code of the asset you want to replace, every single instance of that asset in the game will be replaced.

I actually have a full list of the hex codes pointing to all of the talk sprites. I can post a list later if there is interest. What concerns ME, are the protagonist's talk sprites, values listed here:

9C4003007C190080neutral smirk
185A030044190080neutral frown/serious
5C730300E4180080hand on chin/thinking
408C0300F8180080concerned/shocked/sweating
38A50300501A0080the angular gag “shocked” face
18D90300BC090080ghost with sunglasses
D4E20300D81B0080shrug with one palm out
ACFE0300CC190080mouth slightly open/gape/slight surprise
7818040098180080Facing down, flat line lips, serious and melancholy
103104009C180080angry/emotional yelling

And the code for the cat, which I want to use to replace all of these, is:

AC 49 04 00 54 10 00 80

(In addition for these full-size sprites, I also wanted to replace the mini-talk sprites, but thankfully that was easy. I replaced 502A0D00E4020080 at memory address 04ED45E8, with 342D0D0064020080.)

The good news is that I playtested the first 14 chapters of the game and confirmed that this works perfectly.





The bad news is, as anyone who has played this game knows (and this is unfortunately impossible to discuss without game spoilers so I apologize)... there is another character who uses those same sprites from chapter 15 onward, and well, I have unfortunately confirmed that this janky way of doing it turns him into a cat too:



Moreover, both characters - protagonist and this guy - use almost the full range of sprites in the chapter, too. There is virtually no easy way about this as it currently stands.

My other problem is that I had hoped to eventually give the cat a full range of original emotions/reactions to replace the originals, but that is going to be extremely difficult because the source images are in a format I can't make heads or tails of. All of the data in this game does not seem accessible using any of the NDS tools I've tried - they all find the main containers (e.g. cpac_3d.bin, cpac_2d.bin, etc...) but not the individual files within, likely because the format is unrecognized. I've been able to get as far as I have mostly by blacking out random blocks of hex code/tiles and loading the ROM to see what changes. Unfortunately, I'm hitting the limits of what I can do with that approach. For example, I narrowed down that the location for the sprite of the protagonist "thinking" is from ~04F0D340 - 04F0EC40, because when i messed with the data in that portion the sprite got messed up; but I have no idea how to actually make sense of it as a file and CrystalTile doesn't see any individual files within cpac_3d.bin.

At any rate, since I am probably going to need to look at the code for the specific scenes where BOTH characters are present, I have started looking at all the bits in this ROM with names like "st01/st01_game000_Expand.xml.lz". First of all, these are all compressed, so in order to read them I needed to export them from CrystalTile and decompress them with Batch77 and then re-compress them to re-insert and check my changes. I'm still digging through these, but so far, this is what I can gather on their format--

  • They appear to be separated by location. st01 referring to the junkyard, st02 the supervisor's office basement, st05 Lynne's apartment, st14 submarine, etc. The stages that exist as labeled in the ROM are 01, 02, 03, 04, (04_01?), 05, 06, 07, 09, 11, 13, 14, and 15.
  • Modifying the first legible line in decompressed "st01/st01_root.xml" from "st01/st01_game000_Expand.xml" to anything else (for example, "st14/st14_game050_Expand.xml") will cause whatever that scene is to be loaded when you select "New Game," which is a thankfully pretty easy way to test late game stuff without a completed game file.
  • Lines of text appear to be referred to in these scenes in the format "m##_####." The first two digits match the stage level in most cases. For example, if it is found in a st01 file, it will likely be of format m01_####.
  • The "demo" files refer to animated cutscenes, such as the "watch so-and-so get murdered" sequences. These are sometimes called from within a game file on a different stage (for example a st01 demo file might be called from an st14 game file), in which case any associated dialogue will have an m## digit matching the game stage as opposed to the demo stage.
  • For reasons I have not yet been able to determine, it does not appear to be possible to call an m##_#### that does not exist already in the scene. For example, if I try changing m01_0090 to m01_2000 or another value that is not already present in that scene, it will load the protagonist saying "Will I really be able to find the truth before dawn...?" It loads that same text regardless of the scene. I have no idea what causes this.
  • At the bottom of these files is what appears to be a directory of sorts that I thought were instructions on where the referred to items (models, text, etc) are drawn. However, blocking out this entire portion of code and re-inserting into the ROM does absolutely nothing.
  • The reference "m##_####" refers to a specific line of dialogue AND TALK SPRITE. If I swap one with another in the same scene, the text changes as WELL as the sprite.

What I really need to understand is where these "m##_####" variables(?) are defined, and if I can figure that out, what part of that tells it what sprite to use. My assumption is that they must be defined in the specific stage .xml files because otherwise there should be no reason they can't load outside the ones already included. I've been trying to mess around with other bits and pieces of these files outside of the legible text but so far I haven't narrowed it down that far, and more often than not messing with it too much just causes the ROM to crash before it can load the scene at all.

So this is where I am currently at. Still trying to make heads or tails of how the data in this game works so I can try and figure out how to make it do what I want. Incredible how a simple fix that works for 70% of the game has turned into such a headache for the last few chapters.

Will certainly post updates here if I manage to find anything out that leads me toward a breakthrough. I know this is a very very niche mod for a very very niche game, but I am determined to figure this out. Any input is welcome also for other tools that may help, since as I mentioned this is my first attempt at ROMHacking and I'm learning as I go. :)
« Last Edit: June 06, 2021, 12:09:15 am by ArcanaXIX »

ArcanaXIX

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: [NDS] Ghost Trick "NG+ Mode" (Warning: Game Spoilers Discussed)
« Reply #1 on: June 13, 2021, 12:29:53 am »
It's been about a week and I have made significant progress! I found what I've been looking for and have been able to implement it for most of chapter 1 and am confident it will work for the remainder of the game. It's going to take a while to actually DO the remainder of the game, and I still have extra/additional features I want to work on after I get that much done, but this is still huge.

The big breakthrough: "m##_####" variables, which I correctly realized indicate both dialogue AND associated talk sprite, are defined uniquely for every specific localization.

By which I mean that the talk sprite for any given line of dialogue is separately hard-coded for English, French, German, Spanish, and Italian on a case-by-case basis. There is nothing in the greater game###.xml file for each stage that can change this, you must edit the individual language .xml file(s) (e.g. en.xml, sp.xml, it.xml, fr.xml...). So I can change every single talk sprite in English and French will still look like normal.

(As such I am going to focus on just implementing this in English for now. I make no guarantees for any other languages down the line, but I'll try to provide some clear documentation so others could replicate this if desired.)

Once I realized this I was able to narrow down my search and have identified the following properties of talk sprites in the localization files (st##/st##_game###_Expand.en.xml, specifically):

  • Full-length talk sprites are associated with a 2-digit hexadecimal number. For example, the protagonist's default smirk is 27 (left) and 28 (right). I'll list a full table of the relevant ones below.
  • As implied by above; each sprite has 2 entries that correspond to whether it is pulled up as the "left" character or "right" character in a conversation.
  • Mini talk sprites are also associated with a 2-digit hex number (one per character). The protagonist's default being 01.
  • The full-lengh talk sprites - as far as my testing has revealed at any rate - will be called by one of two hex code patterns: 08 FF ## 00, or 19 FF ## 00 (## corresponding to the code for an individual sprite)
  • The mini talk sprites - again, based on testing thus far - are indicated with the hex code pattern 1B FF ## 00

The hex codes relevant to my project that point to Sissel's various sprites are as follows:

[26 - no sprite]
27 - default smirk (left)
28 - default smirk (right)
29 - default neutral/frown (left)
2a - default neutral/frown (right)
2b - thinking hand on chin (left)
2c - thinking hand on chin (right)
2d - sweating (left)
2e - sweating (right)
2f - angular “shocked” gag face (left)
30 - angular “shocked” gag face (right)
31 - ghost with sunglasses (left)
32 - ghost with sunglasses (right)
[33 - no sprite]
34 - shrugging with palm up (left)
35 - shrugging with palm up (right)
36 - mouth agape, slight shock (left)
37 - mouth agape, slight shock (right)
38 - thin line mouth, looking down, melancholy (left)
39 - thin line mouth, looking down, melancholy (right)
3a - angry emotional yelling (left)
3b - angry emotional yelling (right)
3c - cat (left)
3d - cat (right)

(As for the mini talk sprites, the default - as mentioned above - is 01, whereas the cat's is 08. I forget the sunglasses ghost one, I believe it is one of 0d or 0f but will need to double check when I get that far.)

This has given me a very straightforward method of replacing talk sprites that I've implemented for st01/game000, game001, game010, game011, game012, and game013 so far.

  • (Obvious, but should be stated) Extract the en.xml.lz file from the ROM, decompress it with BatchLZ77, and open it in CrystalTile2.
  • Determine whether left-facing, right-facing, and/or mini talk sprites need to be replaced. In many cases just left + mini will do it but this will get more complicated in later scenes.
  • Ctrl+R to pull up the find and replace dialogue in CrystalTile2, and run "replace all" for the relevant codes (see below)
  • Save the file, re-compress it with BatchLZ77, and re-insert it into the ROM over the original.

The specifics for what to find and replace are as follows:

For Mini Talk Sprites


* In cases where Sissel is using Yomiel's face (i.e. most of the game), simply FIND 1BFF0100 and REPLACE WITH 1BFF0800.
* In cases where Sissel is using the ghost with sunglasses, FIND 1BFF0D?00 and REPLACE WITH 1BFF0800. (I will come back and edit this when I remember what the actual code is, it may not be 0D.
* If there are any cases where Sissel and Yomiel both use this in the same scene it will need to be manually vetted.


For Full Talk Sprites (Left)


* In cases where Sissel is using Yomiel's face:

FINDREPLACE
08FF270008FF3C00
08FF290008FF3C00
08FF2B0008FF3C00
08FF2D0008FF3C00
08FF2F0008FF3C00
08FF340008FF3C00
08FF360008FF3C00
08FF380008FF3C00
08FF3A0008FF3C00

And:

FINDREPLACE
19FF270019FF3C00
19FF290019FF3C00
19FF2B0019FF3C00
19FF2D0019FF3C00
19FF2F0019FF3C00
19FF340019FF3C00
19FF360019FF3C00
19FF380019FF3C00
19FF3A0019FF3C00

* In cases where Sissel is using the ghost with sunglasses, FIND 08FF3100 and REPLACE WITH 08FF3C00, and the same with FIND 19FF3100 and REPLACE WITH 19FF3C00.
* In cases where Sissel and Yomiel both appear in the scene, hopefully one will be on the left and the other is on the right so you can just do one or the other, but if not it'll have to be manually vetted.


For Full Talk Sprites (Right)


Same deal as the left, but replacing all the remaining codes and pointing them to 3D instead of 3C.

* In cases where Sissel is using Yomiel's face:

FINDREPLACE
08FF280008FF3D00
08FF2A0008FF3D00
08FF2C0008FF3D00
08FF2E0008FF3D00
08FF300008FF3D00
08FF350008FF3D00
08FF370008FF3D00
08FF390008FF3D00
08FF3B0008FF3D00

And:

FINDREPLACE
19FF280019FF3D00
19FF2A0019FF3D00
19FF2C0019FF3D00
19FF2E0019FF3D00
19FF300019FF3D00
19FF350019FF3D00
19FF370019FF3D00
19FF390019FF3D00
19FF3B0019FF3D00

* In cases where Sissel is using the ghost with sunglasses, FIND 08FF3200 and REPLACE WITH 08FF3D00, and the same with FIND 19FF3200 and REPLACE WITH 19FF3D00.
* In cases where Sissel and Yomiel both appear in the scene, hopefully one will be on the left and the other is on the right so you can just do one or the other, but if not it'll have to be manually vetted.

SO. I know that's a lot but I just wanted to document that for clarity because it's very manual and it needs to be done for all 145 .lang.xml files in the ROM for every language you want the change to be reflected in.

That said; I've confirmed it does exactly what I expect it to in the scenes I've tested so far. The only exceptions are the log book and "rewind time" scenes, which still populate human Sissel (rewind pictured):



Furthermore, you MUST use the 08 and 19 preceding pointers and not just find/replace all instances of FF ## 00 because it will otherwise catch some false positives, resulting in uhhh miscellaneous text getting replaced with the letter "y":



At any rate, this appears to be working for now. I'm going to work through all of the en.xml files, and only when I'm completely finished with those will I try to pin down where the sprite information for the log book and "rewind time" might be if they aren't already covered by then.

The good news is, I am considering implementing this as a mode to select in place of the "language select" screen, since you need to do this one language at a time anyway and sprites appear to be language-independent. That is the next step on the road once I get these all done. :)

ArcanaXIX

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: [NDS] Ghost Trick "NG+ Mode" (Warning: Game Spoilers Discussed)
« Reply #2 on: June 28, 2021, 02:59:58 am »
I'm still working on replacing all of the 08FF##00, 19FF##00, and 1BFF##00 pointers in all of the scene XML files, but I wanted to post an update because I have some unexpected good news! I was afraid that doing this in scenes with both Yomiel and Sissel would replace Yomiel's too, however it seems Yomiel has different associated codes for the same sprites! This means that - at least, as far as I've found - there is no danger of accidentally swapping Yomiel when done this way. I'll of course need to verify this with certainty, but as of right now, it's looking promising that replacing all of the above codes will not influence Yomiel.

(Other good news: with a few exceptions, in most cases Sissel only appears on the left side, so in most cases I just replace the left codes and then double check the scene to see if I missed any rights. Right-Sissel most often comes up in scenes with Missile, as in many of those Missile is on the left and Sissel on the right.)

I still have not found where the sprite for the log book on Sissel is defined, nor the "let's rewind time". My current focus is to finish all of the .en.xml files first, create a patch, then playtest that and make sure it doesn't either miss anything, swap any false positives, or cause unexpected crashes. Once I've done that much, I'll try to figure out where those two might be hiding. I believe it is likely still in the same format as the other m##_#### files, but that could be incorrect.

This also bodes well for the prospect of more unique mods down the line. If Yomiel has a different "palette" than Sissel even for the same sprites, then if I can find where that is defined, it might make it easy to swap all of them at once instead of this hands-on process, AND it might potentially pave the way to point Sissel's to a whole new rainbow of cat talk sprites. That would be much harder because I still haven't been able to figure out what format the sprites are in to begin with, but it would make it theoretically possible.

So, at the moment, no further progress to share, but I have a slightly better understanding of the ROM and hopefully will have a working release relatively soon.  8)

ArcanaXIX

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: [NDS] Ghost Trick "NG+ Mode" (Warning: Game Spoilers Discussed)
« Reply #3 on: July 08, 2021, 10:07:41 pm »
I figured out how to automate the hex code edits so I was able to finish all of these changes. I'll go into the steps below for documenting purposes but first an overview of where I'm at:

  • I've re-pointed all of 19FF##00, 08FF##00, and 1BFF##00 codes for Sissel's sprites and indicated the cat instead, in all .en.xml files.
  • From testing, it seems that the talk sprites for Sissel in all scene dialogue have been properly redirected. I am still in the process of playtesting to look for any missed scenes or instances of Yomiel swaps, but so far it's looking good.
  • However, there are so far 3 "scenes" that pull sprites from elsewhere that have not been edited. These are the record book profile for Sissel, the "let's try that again" rewind scene, and the "phone line down" scene.

My first priority is to finish playtesting and verify that all of the gameplay talk sprites appear as expected. Once that's finished, I will look more into where these 3 exceptions may be pulled from. I am considering releasing an initial version without these if it takes too much longer to find, but if possible I'd really like to have a more complete initial version up before putting it out there.

These are the 3 problem screens:







I'm hoping they're indicated per-localization as well (since the rest of the game sprites are, I can't see why they wouldn't be, but... well, I've learned not to take anything for granted), so that eventually I can implement "Cat Mode" as a selection to opt out of for certain scenes if desired. We'll see.

As for the process! I was able to largely automate it, but I am playtesting because of course nothing is ever 100% easy and straightforward.

The Good News:

For the vast majority of the game, Sissel and Yomiel have different hex code pointers indicating their sprites, so running a script to replace all of Sissel's will leave Yomiel as-is.

The Bad News:

In some endgame scenes (specifically, it appears the ones where Sissel has taken on the ghost form and no longer uses Yomiel's sprites), Yomiel uses the hex code pointers that had previously been reserved for Sissel. So the script will turn Yomiel into a cat at the end.

The Workaround:

  • Ran a script to replace all of Sissel's human sprites and point them to the cat for all .en.xml files. Looked at all of the files and inserted any of them that were modified by this script.
  • Ran a different script (on a different copy of the original files) that only replaces Sissel's ghost sprite. Looked at all of the files, any that were modified by this script got overwritten with this version. In most cases this restores Yomiel and only impacts Sissel.
  • st14_game050 Is the only scene in the game where Sissel uses both human sprites and the ghost, and luckily Yomiel uses the robot sprites here. For this scene I ran both scripts and then inserted.
  • st13_game022 was a false positive in the initial script (it transforms Yomiel) but does not feature Sissel so was not caught by the ghost reversion. In this case just reverted to original file. I believe this is the only such example but am playtesting to confirm.

TL;DR - first turn all Human Sissels into Cat, then turn all Ghost Sissels into Cat, then look for examples where Yomiel was coded as Human Sissels and revert those as needed.

The tool that made this possible was XVI32: http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm

First I made individual scripts for "replace human" and "replace ghost". "ADR 0" between each replacement tells it to go back to the beginning of the file for each pattern to make sure it gets all of them.

Replace Human:

ADR 0
REPLACEALL 08 FF 27 00 BY 08 FF 3C 00
ADR 0
REPLACEALL 08 FF 29 00 BY 08 FF 3C 00
ADR 0
REPLACEALL 08 FF 2B 00 BY 08 FF 3C 00
ADR 0
REPLACEALL 08 FF 2D 00 BY 08 FF 3C 00
ADR 0
REPLACEALL 08 FF 2F 00 BY 08 FF 3C 00
ADR 0
REPLACEALL 08 FF 34 00 BY 08 FF 3C 00
ADR 0
REPLACEALL 08 FF 36 00 BY 08 FF 3C 00
ADR 0
REPLACEALL 08 FF 38 00 BY 08 FF 3C 00
ADR 0
REPLACEALL 08 FF 3A 00 BY 08 FF 3C 00
ADR 0
REPLACEALL 08 FF 28 00 BY 08 FF 3D 00
ADR 0
REPLACEALL 08 FF 2A 00 BY 08 FF 3D 00
ADR 0
REPLACEALL 08 FF 2C 00 BY 08 FF 3D 00
ADR 0
REPLACEALL 08 FF 2E 00 BY 08 FF 3D 00
ADR 0
REPLACEALL 08 FF 30 00 BY 08 FF 3D 00
ADR 0
REPLACEALL 08 FF 35 00 BY 08 FF 3D 00
ADR 0
REPLACEALL 08 FF 37 00 BY 08 FF 3D 00
ADR 0
REPLACEALL 08 FF 39 00 BY 08 FF 3D 00
ADR 0
REPLACEALL 08 FF 3B 00 BY 08 FF 3D 00
ADR 0
REPLACEALL 19 FF 27 00 BY 19 FF 3C 00
ADR 0
REPLACEALL 19 FF 29 00 BY 19 FF 3C 00
ADR 0
REPLACEALL 19 FF 2B 00 BY 19 FF 3C 00
ADR 0
REPLACEALL 19 FF 2D 00 BY 19 FF 3C 00
ADR 0
REPLACEALL 19 FF 2F 00 BY 19 FF 3C 00
ADR 0
REPLACEALL 19 FF 34 00 BY 19 FF 3C 00
ADR 0
REPLACEALL 19 FF 36 00 BY 19 FF 3C 00
ADR 0
REPLACEALL 19 FF 38 00 BY 19 FF 3C 00
ADR 0
REPLACEALL 19 FF 3A 00 BY 19 FF 3C 00
ADR 0
REPLACEALL 19 FF 28 00 BY 19 FF 3D 00
ADR 0
REPLACEALL 19 FF 2A 00 BY 19 FF 3D 00
ADR 0
REPLACEALL 19 FF 2C 00 BY 19 FF 3D 00
ADR 0
REPLACEALL 19 FF 2E 00 BY 19 FF 3D 00
ADR 0
REPLACEALL 19 FF 30 00 BY 19 FF 3D 00
ADR 0
REPLACEALL 19 FF 35 00 BY 19 FF 3D 00
ADR 0
REPLACEALL 19 FF 37 00 BY 19 FF 3D 00
ADR 0
REPLACEALL 19 FF 39 00 BY 19 FF 3D 00
ADR 0
REPLACEALL 19 FF 3B 00 BY 19 FF 3D 00
ADR 0
REPLACEALL 1B FF 01 00 BY 1B FF 08 00

Replace Ghost:

ADR 0
REPLACEALL 08 FF 31 00 BY 08 FF 3C 00
ADR 0
REPLACEALL 08 FF 32 00 BY 08 FF 3D 00
ADR 0
REPLACEALL 19 FF 31 00 BY 19 FF 3C 00
ADR 0
REPLACEALL 19 FF 32 00 BY 19 FF 3D 00
ADR 0
REPLACEALL 1B FF 0D 00 BY 1B FF 08 00

Then I was able to run these on every single .en.xml file that I had exported from CrystalTile2 and decompressed with BatchLZ77. I did it the lazy way by dumping all the .decompressed files in the same folder as the scripts and the XVI32 executable, so that all I had to do was open that folder in an elevated command prompt, and run:

FOR %f IN (*.decompressed) DO START /W xvi32.exe %f /S=scriptname.xsc

I did this once for the human swaps, moved the edited files to a specific folder, then did it again for the ghost swaps and moved them to a different folder to then re-compress and re-insert.

Where I'm currently at:

  • Hope to finish playtesting this week, love the game and love playing it but I'm trying to be thorough and check all failed-to-save dialogues and missable cutscenes etc.
  • Once that's done, either celebrate if all dialogue works as expected, or perform hopefully minor replacements and fixes on any problem scenes.
  • Next step after that: try to discern where the 3 missing scenes are being pulled from. Depending on how difficult this is, determine whether or not to release an initial version without these replacements just to get something out there.

I have a lot more down-the-line items but I'll flesh those out once the basic idea is confirmed working. We're getting there!

fmlatghor

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
    • fm'latghor
Re: [NDS] Ghost Trick "NG+ Mode" (Warning: Game Spoilers Discussed)
« Reply #4 on: July 10, 2021, 11:51:49 pm »
Nice to know that people are still writing hacks for gt. I have some information I have gathered about cpacs that might be useful.

The cpac format is used in other nds games by Capcom such as Apollo justice and Resident Evil: Deadly Silence for the same purpose as gt, to store graphical data. There are scripts to extract the data files contained within the cpac files...notably for gt there is a script (requires quickbms: https://aluigi.altervista.org/quickbms.htm ): http://aluigi.altervista.org/bms/ghost_trick.bms. You may also find related tools in https://github.com/Missingmew/phoenixtools (e.g. apollo-cpac). Well, once you extract the data files I'm not exactly sure what you do with them.

I assuming this is the "ancient thread": https://www.vg-resource.com/thread-16501.html ? From what you're saying, I'd assume the "cpac_2d.bin" "cpac_3d.bin" names are just conventions used by Capcom -- because if you've ever read some interviews with Shu Takumi and Hironobu Takeshita(?), the 3d graphics were actually rendered in 2d....so it'd be odd if the ROM even contained 3d data. (See https://www.siliconera.com/ghost-trick-director-explains-why-he-made-the-lead-character-a-ghost/ )


And I cannot thank you enough for writing this. It really told me a lot about gt. I have been struggling to figure this game out as well.
fm

ArcanaXIX

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: [NDS] Ghost Trick "NG+ Mode" (Warning: Game Spoilers Discussed)
« Reply #5 on: August 02, 2021, 06:04:10 pm »
Hey, apologies I meant to respond earlier to acknowledge this reply but I wanted to wait until I also had more progress to report. Unfortunately I haven't made that much progress so I've decided to just reply anyway and acknowledge what you've said!

(I'm attending grad school this fall so life has gotten busier and I've had less time to muck around in the Ghost Trick ROM. The project is not abandoned, I will keep coming back to it, but I haven't finished my playtest run-through which I want to finish before I try to figure out what's up with the couple exception screens.)

Thanks for linking those resources! I think I had previously tried using one of the cpac extraction tools, but at the time I was using it on cpac_2d.bin because I thought that's where the talk sprites were and also couldn't make heads or tails of the data. Now that I have a better understanding of the ROM and where everything lives in it, it might be worth giving that another go and seeing if I can make some more progress.

Again, really appreciate the resources and input, and apologies for taking so long to follow up! I wanted to have more to show for it but, alas, life happens. I'm not giving up though!  ;)

CrazyMLC

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: [NDS] Ghost Trick "NG+ Mode" (Warning: Game Spoilers Discussed)
« Reply #6 on: August 02, 2021, 08:55:30 pm »
I've actually recently been looking at the ROM for Ghost Trick, toying with the idea of fixing some of the formatting and typo errors. Piggy-backed off of a GitHub project I found called ghost-tripper, and have been fixing up and finishing the text decoder. Ended up coming up with the same idea of a NG+ starting off with your memories/identity intact.

Maybe we can compare notes?

fmlatghor

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
    • fm'latghor
Re: [NDS] Ghost Trick "NG+ Mode" (Warning: Game Spoilers Discussed)
« Reply #7 on: August 03, 2021, 02:41:55 pm »
I've actually recently been looking at the ROM for Ghost Trick, toying with the idea of fixing some of the formatting and typo errors. Piggy-backed off of a GitHub project I found called ghost-tripper, and have been fixing up and finishing the text decoder. Ended up coming up with the same idea of a NG+ starting off with your memories/identity intact.

Maybe we can compare notes?

Please share anything you've found. I actually know of that project, too. It has multiple tools (some are ones written by others - nlzss), including one to extract the sprites -- though I have not given it a good look. And speaking of text encoding that'd be useful because there is someone I am working with who would like to translate the game to Dutch.

Hey, apologies I meant to respond earlier to acknowledge this reply but I wanted to wait until I also had more progress to report. Unfortunately I haven't made that much progress so I've decided to just reply anyway and acknowledge what you've said!
My motto is "it's never too late!".
fm

ArcanaXIX

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: [NDS] Ghost Trick "NG+ Mode" (Warning: Game Spoilers Discussed)
« Reply #8 on: August 04, 2021, 12:59:22 am »
I've actually recently been looking at the ROM for Ghost Trick, toying with the idea of fixing some of the formatting and typo errors. Piggy-backed off of a GitHub project I found called ghost-tripper, and have been fixing up and finishing the text decoder. Ended up coming up with the same idea of a NG+ starting off with your memories/identity intact.

Maybe we can compare notes?

Oooh yes! I've tried to document everything I've found in here but it's probably a bit stream-of-consciousness, I would definitely appreciate any resources or things you've found.

I've done a lot of digging around but mostly aimed at finding talk sprite pointers etc., but I've stumbled across plenty of adjacent knowledge on my journey. Is there anything in particular that would be helpful for you? I have a lot of probably incomprehensible .txt files on my computer but I could try to clean up a few and make them more legible. I uploaded two documents but they're pretty focused on sprites/images, but as they are written by a noob perhaps you might find more useful information in them than I realize: https://www.romhacking.net/?page=documents&game=2439

Let me know if there's anything in particular that might be useful for you. I have a lot of notes but most of it's just repetitive testing crap.

For my part, right now my biggest question is where the "let's try that again/rewind time" scene is defined in the game's code as well as where the sprite pointer for the entries in the "people" book are, and finally the "looks like this phone's dead" scene. Those are the only 3 scenes left where my sloppy sprite pointer re-write didn't successfully cat-ify Sissel (I'm pretty sure at least - still need to finish playtesting to be certain).

CrazyMLC

  • Jr. Member
  • **
  • Posts: 6
    • View Profile
Re: [NDS] Ghost Trick "NG+ Mode" (Warning: Game Spoilers Discussed)
« Reply #9 on: August 04, 2021, 06:02:39 pm »
Most of my work has gone into understanding the contents of the "st##" folders, specifically the language files. For one thing, I think "st" stands for "stage" as the folders tend to be for certain areas. I've also identified a large number of the functions; I can print out many of the .en files without any hex codes present.
You can see my progress here.

Ultimately my plan is to be able to convert any of these files into a human-readable script, edit that, and then be able to reencode them into a form the game can use.
That way it'd be feasible to write up new dialogue for a NG+ mode. (or write a dutch translation for example)

For my part, right now my biggest question is where the "let's try that again/rewind time" scene is defined in the game's code as well as where the sprite pointer for the entries in the "people" book are, and finally the "looks like this phone's dead" scene. Those are the only 3 scenes left where my sloppy sprite pointer re-write didn't successfully cat-ify Sissel (I'm pretty sure at least - still need to finish playtesting to be certain).
I'm not sure where some of the scenes you're mentioning are, but the st## files can be a bit frustrating. They aren't always laid out consecutively, and can have scenes strewn about in seemingly random files.

From what I'm seeing, the most intriguing possibility is that if there's any Sissel sprites that Yomiel doesn't use, those could be replaced to make new expressions for our feline friend.

edit: I think you can find the phone/rewind scenes in the system folder. Both system_0000.en.msg.xml.bin and system_0000.en.msg.xml.lz contain them. (game probably uses the .lz, but I don't know why there's redundancy for it)
The "people" book sprite is probably in the database_000_Expand files, (that's where the text for it is, and it has some scripting in there too) but it's hard to tell where exactly it is without more work decoding the scripting language.
« Last Edit: August 09, 2021, 07:05:20 am by CrazyMLC »

ArcanaXIX

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: [NDS] Ghost Trick "NG+ Mode" (Warning: Game Spoilers Discussed)
« Reply #10 on: August 13, 2021, 10:26:18 pm »
From what I'm seeing, the most intriguing possibility is that if there's any Sissel sprites that Yomiel doesn't use, those could be replaced to make new expressions for our feline friend.

I had this thought as well.... unfortunately, Yomiel uses the full range. There were a couple other sprites that I wanted to check and see if they were redundant (young Lynne has 2 crying sprites iirc and I think Amelie has a couple similar sprites? but I didn't check to see if they are truly the same or slightly different)-- otherwise would need to understand how to define a new pointer somehow, if that's even possible; OR potentially if there's one that Yomiel doesn't use /THAT/ much maybe replace those instances with another one before using that slot for a kitty expression.

Quote
edit: I think you can find the phone/rewind scenes in the system folder. Both system_0000.en.msg.xml.bin and system_0000.en.msg.xml.lz contain them. (game probably uses the .lz, but I don't know why there's redundancy for it)
The "people" book sprite is probably in the database_000_Expand files, (that's where the text for it is, and it has some scripting in there too) but it's hard to tell where exactly it is without more work decoding the scripting language.

Oh, fantastic, thank you for this tip! Going to take another look at these and see if I can find them.

fmlatghor

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
    • fm'latghor
Re: [NDS] Ghost Trick "NG+ Mode" (Warning: Game Spoilers Discussed)
« Reply #11 on: September 06, 2021, 04:25:58 pm »
Hello! CrazyMLC and I have gathered in #gt on the GBATemp IRC network. Feel free to join us ArcanaXIX, or anyone else that wants to join!

irc.gbatemp.net
plain text - 6667
TLS/SSL - 6697

More info: https://wiki.gbatemp.net/wiki/IRC
fm