Jump to content

Hajimari no Kiseki Mods


S_S_Majin

Recommended Posts

Posted (edited)
6 hours ago, coomi said:

I had this idea of making equippable pubic hair by editing one of the hair attachments. Unfortunately, they are all tied to the head bone and therefore move with the head during animations. The swimming float attachments seem to be tied to the pelvis, so remodeling those might work, but they wouldn't get the correct hair color without lots of extra work.

ed8_ps5_D3D11_ox4DWF70LY.png.05687ee23a46dc8982a22f2823b1a3db.pnged8_ps5_D3D11_JlwzDCmqbr.png.3e3d386746ba354c3232a38b3b7b5637.png

 

That's very ambitious!  I would've done it via texture editing, but this idea would allow for equipping and for 3D hair.  Very cool (and hilarious if you equip with other costumes).

 

Like everything in this engine that drives me crazy, I suspect it has to do with weight transfer.  The engine seems to use weights (vertex groups) to know what parts of the model correspond to what "bones" when moving things around.  I think I've sort of figured out how to transfer weights:

 

1. Using weight paint mode, find the vertex group you want to join your object to.  (Looks like it's 55 for Emma)

 

Spoiler

2018499812_2022-05-2916_14_11-Blender.png.abc69f3107d1b99f9b92b14c3e18a111.png

 

2. Rename the vertex group in your new object to the same number of identified vertex group (so change the group to 55).

3. To fuse the two together: Left click on the new model, Shift-Left click on the target, press Ctrl-J and it'll join your new mesh to the target mesh.

4. If you want them separate, skip step 3 and instead: Move the target to the side (using transform) while keeping the new mesh centered.  Then do step 3, fusing the objects.  Now delete the unwanted target mesh on the side.

 

I've succeeded in transferring weights only once, so I'm very very novice here and there's probably more to it.  You will need to experiment.

Edited by amorrow28
Posted
17 hours ago, ludger166 said:

Done, oh, i went into edit but hmm, iv never marked anything as spoiler before so idk where that option is ? Edit: Ok found it lol

log.txt 722.15 kB · 3 downloads

 

Ok, I figured it out, the VOFAN costume for Alisa shares a pixel shader with the bathing towels.  It won't work if you don't have my compatibility wrapper for @S_S_Majin's nude towels mod installed.  I'll fix it in the next version of the mod; if you don't want to wait, you can for now just install the nude towel mod (it does not conflict with the nude mod from @Switch608 or @coomi in case anyone reading this is wondering).

Posted
2 hours ago, amorrow28 said:

 

Ok, I figured it out, the VOFAN costume for Alisa shares a pixel shader with the bathing towels.  It won't work if you don't have my compatibility wrapper for @S_S_Majin's nude towels mod installed.  I'll fix it in the next version of the mod; if you don't want to wait, you can for now just install the nude towel mod (it does not conflict with the nude mod from @Switch608 or @coomi in case anyone reading this is wondering).

Wow thank you! Yeah I think ill do just that for now as I really like her VOFAN costume and just how showey it is, and your unskirt mod makes it so much better!! :DDD

Posted
2 minutes ago, Switch608 said:

It seems that this thread and the cs4 thread have been active lately.


Does anyone be interested in replacing the characters? Such as replacing male with famale.
For example, replace Rean with Alisa:  

1.jpg.16e630bfe5b4ae648a8c9ceb54c79699.jpg

Yeah the threads have been active again lately as you said, Its absolutely amazing how much more life is being breathed into these threads just wow xD 

 

wtf xDDDD that's..pretty ambitious lol female Rean omg, never thought id actually see that haha, looks pretty good tho I must admit!  

Posted
18 minutes ago, Switch608 said:

It seems that this thread and the cs4 thread have been active lately.


Does anyone be interested in replacing the characters? Such as replacing male with famale.
For example, replace Rean with Alisa:  

1.jpg.16e630bfe5b4ae648a8c9ceb54c79699.jpg


ok I did not expect to see that today ??

 

dunno about male to female, but @Whayameen did ask in the CS4 thread about swapping models so different characters could dance in the CS4 concert scene… so there is definitely interest in model swapping if you’d like to share your knowledge and skills!

Posted
1 hour ago, ludger166 said:

Fking love panties, and amorrow28`s mod ??????????

 

Bless your panties mod good sir~??

  Hide contents

1124743851_THELEGENDOFHEROESHAJIMARINOKISEKIScreenshot2022_05.30-13_49_49_95.png.67521f53f71feee792ec2e1dfe86e15a.png

  Hide contents

1062491744_THELEGENDOFHEROESHAJIMARINOKISEKIScreenshot2022_05.30-13_51_12_20.png.91ed1f079cfbfe7ebb4544e09e5a1eda.png

 


So sad Falcom never gave Laura underwear… she only had a butt in CS4 DLC, not brought forward to Hajimari. ?

Posted

@amorrow28 I played around with the weights for a while but couldn't see any logic in how they work. Everything seems to ultimately move when the head moves, but some vertex groups move less than others. Painting multiple groups at once had no discernable effect. Removing all the weights makes the object disappear, and partially removing the weights makes the mesh stretch towards the map origin for some reason.

 

Either way, I was hoping for an easy, universal way that would work with every character, but that's clearly not possible, so I won't be looking into this any further. 

Posted
55 minutes ago, coomi said:

@amorrow28 I played around with the weights for a while but couldn't see any logic in how they work. Everything seems to ultimately move when the head moves, but some vertex groups move less than others. Painting multiple groups at once had no discernable effect. Removing all the weights makes the object disappear, and partially removing the weights makes the mesh stretch towards the map origin for some reason.

 

Either way, I was hoping for an easy, universal way that would work with every character, but that's clearly not possible, so I won't be looking into this any further. 


You’ve honestly made it much further than I. That stretching to the origin thing has ruined so many of my more ambitious attempts at modding, even for skirt deletes. Some outfits, I literally can’t even remove a single triangle without wrecking the whole mesh.

 

I wonder if it has to do with how the buffers are recreated by blender and injected back into the game? In an earlier version of my vb_split script, it did that to every mesh because I was incorrectly truncating the buffers. (Long story there, I was trying to create byte-identical buffers because I literally had no idea why the blender output always had two extra vertices and I thought I was dealing with some sort of footer… I think most folks on this thread probably don’t know that we’re literally messing with raw video memory when we make these mods.)

Posted
1 hour ago, Switch608 said:

 

?I post it because it's a tedious thing and I'm having trouble, and it would be easier to do it with like-minded people.
Since someone are interested, I will explain the situation.


Character replacement is very simple, just replace the corresponding files, the trouble is how to find the file you want.


The character's model files are stored in the \data\asset\D3D11 folder.You can probably guess from the file name that C_CHR* .pkg is the character, C_MON * .pkg is the monster...


I was looking for the unpack tool for .pkg files and found this, Although there are instructions, I still don't know how to use it.?If anyone knows how to use it please tell me.


So I had to find the file in another way: try to replace the file first, and then go into the game to see what model was replaced.The cumbersomeness of doing so is conceivable.

 

By replacing by now I already know:
C_CHR000* is Rean
C_CHR001* is Alisa
C_CHR*_C02 is bathing towel
C_CHR*_FC1 is face

 

Let me talk about the specific replacement method:


1) Rename the C_CHR000_C02.pkg to C_CHR000_C02.pkg.org, and C_CHR000_FC1.pkg to C_CHR000_FC1.pkg.org
2) Copy the C_CHR001_C02.pkg and rename it C_CHR000_C02.pkg, copy the C_CHR001_FC1.pkg and rename it C_CHR000_FC1.pkg
3) Open the C_CHR000_C02.pkg with the binary editor and edit it as shown below

2.png.a6594f79c11c751deaa84762af80c234.png
4) Open the C_CHR000_FC1.pkg with the binary editor and edit it as shown below

3.png.846184f6b3d6b9843da346b4fd2f5bab.png

 

That's it, if you want to replace another character, you must know the file name corresponding to that character.

It is better to be able to unpack the pkg file.


For CS3/CS4, the situation is more complicated and requires unpacking assets.pka first, which I don't have a clue about.


Hopefully, someone can find a good way to simplify the operation.


I don’t know how much I can help… if this really interests you a lot though I can see if some of these replacements are amenable to automating in python. You’re a legendary contributor and I’d like to help.

 

Looking at the CS3 and CS4 threads, it seems like the model numbers can be looked up and dumped, in CS4 they are apparently in a table at data/text/dat/t_name.tbl 

 

See this thread: https://www.loverslab.com/topic/166239-trails-of-cold-steel-4-mod-request/?do=findComment&comment=3363198

Posted (edited)

@Switch608

 

I've decoded the character asset table, attached here.  It's messy but useable, and I had no idea there were so many models in the game.  Enjoy!

 

New version here: https://www.loverslab.com/topic/175040-hajimari-no-kiseki-mods/?do=findComment&comment=3770673

 

hajimari models.xlsx  - OBSOLETE

 

Fair warning to everyone, don't open this file if you haven't beaten the game - you have been warned.  (In fact, I wish I hadn't opened it.)

Edited by amorrow28
Posted (edited)

@Switch608

 

I wrote a python script that can do exactly what you showed me in the screenshot.  I tested it and it mostly works...

 

2034700180_2022-05-3017_09_16-THELEGENDOFHEROES_HAJIMARINOKISEKI(D3D11)(x64).png.e30af4ffa4169ea48ee00954ac3d03d2.png

 

aa - inject model.py - OBSOLETE / BUGGY.  Latest version always on github.

 

This is on my github, so the latest version will always be here: https://github.com/eArmada8/misc_kiseki (GPL3 license, like all my code)  It only works with CLE Hajimari no Kiseki, since the models are in individual .pkg files.

 

It asks first for the model you want to inject, and then the model you want to replace.

 

1462134417_2022-05-3017_09_53-Window.png.a396989f228f60b9976f4a89ad113319.png

 

Two key notes about the behavior:

1. If there is a backup of the first (donor) model, it will use the backup, not the current file.  This way you don't need to keep track of your swaps, it will always pull the model you expect it to pull.

2. If there is no backup of the second (target) model, it will make a backup.  It should never overwrite the original backup.  This is both to protect the backup, and also so that the backup is what you expect it to be if you use it to inject (see #1).

This way you can literally say "replace A with B" and "replace B with A" and it will swap them.  It will NOT replace A with B and then replace B with B(copied from A).

 

How the byte editing works: if you want to inject C_CHR000_C65 into C_CHR000_C02, python searches the file for <asset symbol="C_CHR000_C65"> and replaces it with <asset symbol="C_CHR000_C02">.

 

One major issue:  I tried replacing C_CHR001 with C_CHR001_C02 and it failed, giving me a crazy error:

1044705088_2022-05-3016_51_04-THELEGENDOFHEROES_HAJIMARINOKISEKI(D3D11)(x64).png.b9b1004fa420f600a61da238a52882e1.png

 

I don't know what the issue is, perhaps the length of the file is no longer correct, I dunno.  So it does not appear that you can use my script to replace default models with non-default models.  If you can tell me what I'm doing wrong, let me know and I'll fix the script.  (You don't need to debug my code, you just need to let me know how to manually replace a C_CHRxxx file with a C_CHRxxx_Cxx file and I will make my code do the same thing.)

 

EDIT:  I tested it, it can replace default models with another default model, so replacing a C_CHRxxx file with another C_CHRxxx file works fine.  This is what happens if I replace C_CHR000 (Rean) with C_CHR001 (Alisa).  Click on it if you dare, it is pure nightmare fuel.

 

Spoiler

1984702882_2022-05-3018_02_15-THELEGENDOFHEROES_HAJIMARINOKISEKI(D3D11)(x64).png.b577e85de2d66b55d95e03f11e585d01.png

 

Edited by amorrow28
Posted

I'm actually not sure what we've unleashed upon the world.  Maybe I should delete this tool before it's used for evil.  Or maybe it's too late.  ?

 

2003725838_2022-05-3019_49_01-THELEGENDOFHEROES_HAJIMARINOKISEKI(D3D11)(x64).png.d00e083b83cc4823e9e44bf38b6fc93c.png

Posted
2 hours ago, Switch608 said:

Thank you so much for your help, it was exactly what I wanted!☺️?

 

I looked everywhere on the Internet, but I forgot to look for it here.?

 

As for the reason why the script went wrong, I think it was caused by changing the file length.
Sewer56 describes the format of the .pkg file here, Although it is for CS3, I looked at it and it should be the same as for hajimari.
According to the instructions, once the length of the xml file inside is changed, the starting position of all the subsequent files inside must be changed accordingly.

660762063_.png.6f79a0e19352568e9cd90a5bb7ee999e.png

 

Yes!  It took me a little while to wrap my head around what you shared here (plus a LOT of web searching on how to manipulate bytes in python), but I have fixed the script, it can now inject into models with differing filename sizes!

 

aa - inject model.py

 

Who needs to actually have the bathing towel costume?  Not you, if you replace the default model with the nude mod!

 

1825615713_2022-05-3022_33_52-THELEGENDOFHEROES_HAJIMARINOKISEKI(D3D11)(x64).png.6f5235c1494b67d17206e32a297dbfb7.png

Posted (edited)
On 5/30/2022 at 3:50 PM, amorrow28 said:


So sad Falcom never gave Laura underwear… she only had a butt in CS4 DLC, not brought forward to Hajimari. ?

That is sad indeed, I'm very pleasantly surprised too see just how much ass there is already on these character models hahahahaha xDDD

Edited by ludger166
Posted (edited)

@Switch608

 

Here is a much cleaned up version of the model index, should be way better to use.

 

hajimari models - better version.xlsx

 

Same disclaimer: There are TONS of spoilers in this document.  Don't open if you haven't beaten the game!

 

EDIT: I thought I'd share the code I wrote to build this table, it's here:  https://github.com/eArmada8/misc_kiseki/blob/main/name_table_decode.py  I've tested it on CS3, CS4 and Hajimari.  Just dump it in the {game}/data/text/dat_en folder and execute, it'll write out a table.csv spreadsheet.

Edited by amorrow28
Posted

Phew, took a nap.  (Ok, I did not.)

 

I had a few ideas, and had to try them out.  Observations:

 

1. Easy: Injecting costumes that we don't have the items for in Hajimari.  (Maybe they're meant to be sold as DLC?  Dunno.  Now you can use them!)

 

Quote

551847047_2022-05-3120_20_41-THELEGENDOFHEROES_HAJIMARINOKISEKI(D3D11)(x64).png.32916e603d603a48a08fa7c6674bf391.png

Here I injected C_CHR001_C64 into C_CHR001_C02

 

208112418_2022-05-3120_21_02-THELEGENDOFHEROES_HAJIMARINOKISEKI(D3D11)(x64).png.ce415c3b10ae588cd0c03f11eabd36d3.png

And here I injected C_CHR003_C64 into C_CHR003_C02

 

2. I can't inject directly into CS3 or CS4 due to package archiving, but I CAN inject into DLC, since those are individually packaged!

 

Quote

2026616607_2022-05-3121_22_09-TheLegendofHeroes-TrailsofColdSteelIII_SteamEnabled_GoGInited.png.d597f04e552cfb7b8e9e0c7dcdac28aa.png

 

3. All three games are fundamentally incompatible with each other.  Also, my tool cannot inject into CS4 as written because the XML files are compressed.  I tried pushing a Hajimari costume into CS4/CS3, CS3 costume into CS4/Hajimari, etc, every attempt to crossport failed.

 

4. I could not inject a non-DLC costume into a DLC file either, I dunno why.  (For example, I tried pushing C_CHR011_C02 (Juna towel) into C_CHR011_C56 (Active Red) and the game crashed.  If you'd like to try to play with the giant asset file, I found a tool that extracts all the assets here: https://github.com/uyjulian/unpackpka/blob/main/src/unpackpka.py

Just put it in your {CS3/CS4 folder}/data/asset/D3D11 folder, go to that folder in the command line, and type in "unpackpka.py assets.pka ." without the quotes (that period at the end is needed).  If you let it run, you'll get all 70gb or so uncompressed!  Costumes dump out first, so just close the window or hit Ctrl-C after a few seconds and you'll have what you need.

 

5. I was hoping that if you put individual asset files in the asset directory, the game might preferentially use them.  Sadly, that did not happen.  So no injecting into non-DLC costumes in CS3 or CS4 for now.

 

So...  at least we can use the magical girl costumes in Hajimari now.  ?

Posted
16 hours ago, Switch608 said:

A few seconds ,haha ??     my poor computer

 

I tried it and it was possible to use it in CS4.

ss1.jpg.43abae1839960aa8adc1072bc37ee859.jpg
Simply rename the file assets.pka after unpacking it, or move it to a different position.
After the program cannot find assets.pka, it will read the unpacked files.


Then we can replace the characters, just like Hajimari.


I didn't try CS3 , it should be the same.

 

 

Correction: No need to change the assets.pka, the program preferentially reads the unpacked files.

 

Well then!

 

I forked the unpacker and modified it.  Here is my version, it will extract only the files you want.

 

extract_pka.py

 

https://github.com/eArmada8/unpackpka/blob/main/extract_pka.py

 

1. Put the script in the {Game folder}/data/asset/D3D11 folder, and execute.

1509146595_2022-06-0115_06_38-Window.png.bb201db5a6528b96624faaba1f5d2375.png

 

2. The first question it asks is what .pka file.  If you are extracting from assets.pka, just press enter.  The second question is what file you want.

1172998007_2022-06-0115_07_09-Window.png.165bd552c08232cc0bf20d979e2cffa3.png

 

3.  Tada!  The single file is extracted.

1013677144_2022-06-0115_07_32-Window.png.c1c547fa71a6c164ae2f0daa946198e0.png

 

4. If you don't type ".pkg" at the end when you specify the file, it will treat it as a search term instead.  CHR001 will match C_CHR001.pkg, FC_CHR001.pkg, F_CHR001_C02.pg, etc etc.

449498087_2022-06-0115_08_03-Window.png.4f6a3c57489534141cc22532288eaff1.png

 

5. Here is the result if you type in "CHR003" without .pkg (from CS3)

2091660507_2022-06-0115_08_35-Window.png.35b4a877360029ce11fb4e765a40e31a.png

 

Note #1:  You can run it from the command line.  If you type "extract.py assets.pka CHR001.pkg" that will work.  Very handy for batch processing as you develop distributable mods.

 

Note #2:  It will not overwrite existing files.

 

Enjoy!

Posted (edited)
49 minutes ago, Zero_Fucks_Given said:

This s#!t is getting interesting!!! So basically someone can take scherazard and replace rean with her? Me want!

 

I'm pretty sure the answer is yes!  I haven't really tried whole character replacement, but I think the theory is to replace all the pieces of a character.  Inject the costume, the face, etc.

 

Schera (CHR087) is only 5 files, so give it a try.  Rean is CHR000.

 

Inject:

C_CHR087 into C_CHR000
C_CHR087_FC1 into C_CHR000_FC1
C_CHR087_EV into C_CHR000_EV
C_CHR087_DF1 into C_CHR000_DF1

FC_CHR998 into FC_CHR000 (This is the eyes I think, look up the correct entry in the Hajimari table I posted above)

 

Replace Rean's .inf file (\data\chr\chr\chr000\chr000.inf) with Schera's (\data\chr\chr\chr087\chr087.inf)

 

Ok, I had to try it.  It does work, but i'm missing something, the standby pose is screwed up.  But...

 

733125745_2022-06-0117_43_14-THELEGENDOFHEROES_HAJIMARINOKISEKI(D3D11)(x64).png.b591eca3df79660f2f541c89947efd21.png

 

------

 

To reverse, inject like this:

 

C_CHR000 into C_CHR000
C_CHR000_FC1 into C_CHR000_FC1
C_CHR000_EV into C_CHR000_EV
C_CHR000_DF1 into C_CHR000_DF1

FC_CHR000 into FC_CHR000

 

My script will inject from its own backups, restoring your files.

Edited by amorrow28
Posted
1 hour ago, amorrow28 said:

 

I'm pretty sure the answer is yes!  I haven't really tried whole character replacement, but I think the theory is to replace all the pieces of a character.  Inject the costume, the face, etc.

 

Schera (CHR087) is only 5 files, so give it a try.  Rean is CHR000.

 

Inject:

C_CHR087 into C_CHR000
C_CHR087_FC1 into C_CHR000_FC1
C_CHR087_EV into C_CHR000_EV
C_CHR087_DF1 into C_CHR000_DF1

FC_CHR998 into FC_CHR000 (This is the eyes I think, look up the correct entry in the Hajimari table I posted above)

 

Replace Rean's .inf file (\data\chr\chr\chr000\chr000.inf) with Schera's (\data\chr\chr\chr087\chr087.inf)

 

Ok, I had to try it.  It does work, but i'm missing something, the standby pose is screwed up.  But...

 

733125745_2022-06-0117_43_14-THELEGENDOFHEROES_HAJIMARINOKISEKI(D3D11)(x64).png.b591eca3df79660f2f541c89947efd21.png

 

------

 

To reverse, inject like this:

 

C_CHR000 into C_CHR000
C_CHR000_FC1 into C_CHR000_FC1
C_CHR000_EV into C_CHR000_EV
C_CHR000_DF1 into C_CHR000_DF1

FC_CHR000 into FC_CHR000

 

My script will inject from its own backups, restoring your files.

Appreciate the tut but I'm no modder I'm happy it can be done I hope someone comes up with a way to distribute model swaps in the future I'm playing fe three houses atm so hopefully someone will be able to by the time I'm done 4 or 5 playthroughs to 100pct it

Posted
19 minutes ago, Whayameen said:

Wow that's looking good! Does she move around just like Rean or is it kinda glitchy? And does this only work for Hajimari?

I tried messing with the extract and inject scripts on CS3&4 but haven't had much success. The extract script didn't work on CS4 (I might be doing something wrong tho), but it did for CS3. I followed the instructions, but sadly there were no changes to the characters. Not sure if it's because you have to replace more files in CS3 or something, but either way I gotta say: great work on making all this progress in such a short amount of time (on top of working the UnSkirt mod too)! You da man @amorrow28  :cool:


@Whayameen, I have no idea how well it works in Hajimari, since I only use the character viewer and have not yet played the game. But it works pretty well in the character viewer (she attacks with Rean’s tachi and everything) so I’m betting it will work in the game. Please do try and report back!
 

CS4 has compressed XML files, so my injector doesn’t work. I haven’t had time to mess with it, but @Switch608 was able to inject into CS4, probably by direct hex editing. I had the result you did with CS3, so my guess is that only Hajimari is working easily for now. (You *can* inject into CS3, but for now only into DLC.) I’m gonna study his screenshots and see if I can achieve working injections in CS4.

 

@Zero_Fucks_Given, give it a try. Just put the script in the folder and double click. It’ll ask for the model, then it’ll ask for the target, then it’ll do the injection (and make all appropriate backups). Just do that five times and you’ll have the exact result I did above. 30 seconds tops.

 

Having said that though, I do intend to modify my script so that it can accept command line arguments. Once I’ve done that, we can write simple batch files and what you see above can literally be one click. ? I’m still not exactly sure what I’m developing these tools for though, I’m waiting to see what @Switch608 wanted to use them for. ?

Posted
2 hours ago, Switch608 said:

Special thanks to @amorrow28 for the tools and xls provided!

Now I can create my Eden in the game--A world that was all Elie.???

1.jpg.dc05e9a0818fbdd20faff05e1d771c8e.jpg

2.jpg.618e957a26677787d86c0fc8b4d333e1.jpg3.jpg.5cb4174a8f93db0db117eeece14efdcd.jpg4.jpg.05049dbf6f6a3c60b386030e9f7f65ad.jpg5.jpg.d93963d960fdf86a86dff207588c617d.jpg6.jpg.0f9d86151aee36ac1ddce66d4a1299ac.jpg

 

 

Looks like paradise! Elie harem! ???? 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...