Jump to content

Samurai Maiden - Potential Modding


Recommended Posts

2 hours ago, woofhat said:

I'm not really interested in this game either. But I'm interested in how to make mods about it.
As you said, we can't get weights from it with 3dmigoto.
But using AssetStudio (https://github.com/Perfare/AssetStudio) we can get the weights of the model (in fbx format) from the game file package (.bundle).
I was wondering if there is a way for 3dmigoto to inject these weights back into the game?

 

Not to my knowledge.  Based on what I know now, there is no slot for it, and somehow the game engine is sending a draw call to the GPU with either no weights or garbage weights.  If anyone has the skill to interpret HLSL, they could try to see how the engine is feeding weights to the GPU, perhaps through a constant buffer.  This is far beyond my knowledge or skill level.

 

Since there is a working unpacker, can these assets be repacked?

Link to comment
5 hours ago, Now Im Motivated said:

yeah same I dont know if this guy is playing tricks on us or what!?

 

ok i figured it out. the link is supposed to take you to the discord that is linked in the channel of the youtube video people keep posting. if you arent already in that discord though, it doesnt work at all it seems

 

the mod they're using is in that discord though. if you click on the video, then go to their youtube channel, and then go to their about page, you can get a link to the discord which seems to have the mod

 

worth noting that its mostly just a slightly edited version of the mod that was already posted in here

Edited by hilbo75
Link to comment
47 minutes ago, woofhat said:

Thank you for your answer.
I don't feel this is going to work either, just a random question.


There is indeed a way to repack, in fact there is a process to make mods about unity, which requires importing the fbx model into the unity editor and repacking it.

But I failed when I tried this game, I'm not familiar with unity after all.?


I think the unity repacker has the most promise. The only idea I have left for 3DMigoto is to force dump vb2, analyze it with a hex editor, and if the data is useful, then modify it and inject it into the game and see if DirectX uses the data.

 

By the way, I don’t know if anyone is experiencing flickering (modified assets disappearing and reappearing), but this game uses the DrawIndexedInstanced command instead of the DrawIndexed command, similar to Kuro no Kiseki. I saw that in the frame dump log. If it’s an issue, you can use my custom build of 3DMigoto that implements the DrawIndexedInstanced command.

Link to comment
5 hours ago, woofhat said:

Repacker is not that easy, at least for me.
Probably because blender and unity editor handle the fbx format differently (which I can't say for sure), the repacked file doesn't work at all. Obviously the file needs to be modified and processed, but that's completely beyond my capabilities.

 

About force dump vb2, I read your discussion with DarkStarSword. But I don't understand what to do. Where to put the line of code  dump = vb2 buf  ? How does it work?

 

 

In the [ShaderOverride] section.  For example, if a typical 3DMigoto mod might look like this:

 

[TextureOverride_Skirt]
hash = 7eda3a35
handling = skip

[ShaderOverride_Skirt]
hash = b49d7ea1173ff7ad
run = CommandListActivate

 

You can force a dump like this:

 

[TextureOverride_Skirt]
hash = 7eda3a35
handling = skip

[ShaderOverride_Skirt]
hash = b49d7ea1173ff7ad
run = CommandListActivate
dump = vb2

 

Then when you press F8, it will dump vb2 on any hash using that shader.  And of course, injecting vb2 back into VRAM is the same as any other mod.  If you want to specify options, put them before the resource, for example "dump = dump_vb txt vb2" but you can only put one resource per dump command, so "dump = ib vb0 vb1 vb2" doesn't do anything.  Just put multiple dump commands instead.

Link to comment
On 12.12.2022 at 07:40, vanogrando said:

Кто-нибудь знает, где найти мод на полное обнаженное тело, подобный этому?
 



тот, который идет с разрывом одежды, хорош, но я предпочитаю смотреть на их тело без шрамов и грязи

, большое спасибо

https://www.youtube.com/redirect?event=channel_description&redir_token=QUFFLUhqbWtGVWprY3AyWnY0bjdrX0NEZXV3eVBTbFlQUXxBQ3Jtc0tsVVV0VFV6Tk5uTlpieHpOY3JWT1p1eEZydEVDRnNUY3hpV3NlZk5hbGlBNHRyMVR6N1BkNU1pZTIwYXZhU3d2V3ByOV9qUi1iUm11RVB5ek9QV01lR0laY1FXMHc4SmxEaVd0eTVaZHhSZ3UtNzB1NA&q=https%3A%2F%2Fdiscord.gg%2FGzJZwYGDbe 

Link to comment
19 hours ago, woofhat said:

Thanks for the clarification.
I tried it and got 1 sample.
dump.7z
Not totally sure, but it looks like VB2 is the weights!!!

そのウェイトをマージする方法はまだ無い??

テクスチャーの編集のみではSAYOの完全なパンティー化は無理;

 

Still no way to merge those weights?

Texture editing alone is not enough to completely pantyhose the SAYO;.

 

image.jpeg.6cc41ae675841ea1f672ed4a5ce97346.jpeg

 

image.jpeg.dd2491c45a2d6c22366e33b69e5e7d01.jpeg

 

image.jpeg.6df797d208f10077f7c8cc1fec4c6dc9.jpeg

Edited by parapara
Link to comment
5 minutes ago, woofhat said:

@amorrow28

 

I merged vb.buf and looked at it, and vb2 is indeed the weights. merge.7z 175.58 kB · 0 downloads

1.jpg.1e31cc27daa2844cb63785554c21eaf3.jpg
But it is very strange. The model pose I got using 3dmigoto is completely different from the model pose I got from the source file.
On the left is the 3dmigoto one, and on the right is the fbx model I got with AssetStudio. As you can see, not only is the pose different, but the left and right seem to be reversed as well.

2.jpg.bd6184f03dc47004e4701dc73a8cfb13.jpg
 

In my humble understanding, 3dmigoto is dumping data directly from the pixel shader, which is the first step of HLSL and should get the most original model data. In fact, I used to get T pose or A pose models with 3dmigoto, but this is obviously a processed model, which is very strange!

1.jpg

bufのマージ手順は??

 

What is the buf merge procedure?

Link to comment
1 hour ago, woofhat said:

Hello, it's good to see you.
I made up my own little program to merge.
Better
@amorrow28  would be willing to make a merge tool in python.
Of course, if he doesn't have time to do it, I can post my program. But I need a little time to modify it so that others can understand how to use it.

 

こんにちは、お久しぶりです。
マージするための小さなプログラムを自作してみました。
Better @amorrow28さんなら、pythonでマージツールを作ってくれそうです。
もちろん、彼がそれをする時間がない場合は、私は私のプログラムを投稿することができます。しかし、私は他の人が使い方を理解できるように修正するのに少し時間が必要です。

お久しぶりです。
私は貴方となら以前のように、いえ、前以上に良いものが作れると信じています。

 

Long time no see.
I believe that with you we can make something as good as before, or even better than before.

 

Link to comment
4 hours ago, woofhat said:

@amorrow28

 

I merged vb.buf and looked at it, and vb2 is indeed the weights. merge.7z 175.58 kB · 8 downloads

/cdn-cgi/mirage/3aaef5e69f3daf88bb93e8484e6d2081ecc68263c84d56671965381fee192c20/1280/https://static.loverslab.com/uploads/monthly_2022_12/1.jpg.5e07958c7a56921a0dd282e8d24d3b93.jpg
But it is very strange. The model pose I got using 3dmigoto is completely different from the model pose I got from the source file.
On the left is the 3dmigoto one, and on the right is the fbx model I got with AssetStudio. As you can see, not only is the pose different, but the left and right seem to be reversed as well.

/cdn-cgi/mirage/3aaef5e69f3daf88bb93e8484e6d2081ecc68263c84d56671965381fee192c20/1280/https://static.loverslab.com/uploads/monthly_2022_12/2.jpg.bd6184f03dc47004e4701dc73a8cfb13.jpg
 

In my humble understanding, 3dmigoto is dumping data directly from the pixel shader, which is the first step of HLSL and should get the most original model data. In fact, I used to get T pose or A pose models with 3dmigoto, but this is obviously a processed model, which is very strange!

 


I can write a merge script but not for a week unfortunately. Once I have access to my computer I will take a look.

 

Looking at the model on the left though, I agree that it looks posed. I think the model is after the vertex shader but before the pixel shader. When you ripped the model with the dump command, did you use the VS or PS hash? If you used the PS shader, perhaps you will have better luck with VS. I am just guessing though.

Edited by amorrow28
Link to comment
5 hours ago, woofhat said:

Since @amorrow28 can't make a script for now, I'll post the little tool I made.SAMURAI MAIDEN merge split.exe
It's very easy to use. When merging files, first select the 3 *vb*.buf files you want to merge and it will merge them into  merge.vb.
When splitting, select the files to be split and it will split them into 3 files.
As for the ib file, rename the *ib*.buf file.
As for the fmt file, just rename it using this file.1.fmt

 

@amorrow28

I tried using VS with the same result, but I don't think it's a big problem.
The problem now is that the weights are not imported into the game, the vb2 file is not injected into the game.
I'm not sure if I've set it up wrong somewhere.
Maybe I didn't understand the sentence: injecting vb2 back into VRAM is the same as any other mod.
Can you explain a little more clearly how to do this?


I think DarkStarSword is correct and that vb2 is unused. It makes sense, because the model has already been posed. Animations are based off the bind pose, so there is no way to do mesh modifications if the model is not in the bind pose.

 

I need to ask, is everyone taking frame dumps in the equip screen or something? Is the character moving? It seems to me that the model is being posed before the buffer is loaded into VRAM. I can think of two possibilities. One is that the CPU is doing the pose, but that seems very inefficient when the GPU is so much better at it. The only scenario this makes sense is if there is no animation.

 

The other possibility is the one that DarkStarSword suggested, which is that there is information in the constant buffers, and the vertex shader is using those buffers. It would be strange but apparently UE4 does that so I could see that Unity does as well. Try dumping with "dump_cb" in your analyse_frame options and see if there is useful information in there (model in bind pose, weights, etc)!

Link to comment
1 hour ago, woofhat said:

Thank you for the note. Thanks a lot to DarkStarSword and the 3dmigoto team as well. We couldn't have done many things without 3dmigoto.?

 

Although the model's pose is not the standard pose, I dumped it several times and the pose was the same every time I dumped down. According to my understanding, if vb2 is not used, each dump should dump to the model's pose at that time, not a specific pose.

 

As far as I know, if we use 3dmigoto to make UE4 mods, it works fine, and some of the Final Fantasy VII Remake mods made with 3dmigoto are examples.

 

I don't know anything about "dump_cb" or anything like that, so I'll learn it first.?

 

This is the state of my mod, not sure if others are in the same situation.

 

 

 


 

I am still learning, so forgive me if any of this is wrong.

 

Constant buffers are just memory streams like index buffers and vertex buffers. Vertex buffers are restricted to vertices and index buffers are restricted to polygons, but constant buffers can hold anything.

 

For example, I am pretty sure that skeleton nodes and animation frames are sent to the GPU via constant buffers.

 

Vertex information should be sent with vertex buffers, and formats like glTF enforce vertex information being sent with vertex buffers. But game engines can do anything they want, because DirectX does not enforce this. So game engines can put vertex information in constant buffers if they want.

 

All we know so far is that the game does have a vertex buffer with weights in it, but that buffer is not read by the draw command. So it would make sense if the information is also in another buffer, which would have to be a constant buffer.

Link to comment
9 hours ago, woofhat said:

Sorry, I was wrong. The pose of the model is the pose when sampled, and it's different every time.


I can't get anything from the cb file. It looks like this.
cb1[0].x: 0.906737804
cb1[0].y: 0
cb1[0].z: 0.421694875
cb1[0].w: 0
cb1[1].x: 0
cb1[1].y: 1
cb1[1].z: 0
cb1[1].w: 0
cb1[2].x: -0.421694875
cb1[2].y: 0
cb1[2].z: 0.906737804
cb1[2].w: 0
cb1[3].x: 194.042053
cb1[3].y: 9.00999928
cb1[3].z: 3.51142192
cb1[3].w: 1
cb1[4].x: 0.906737804
cb1[4].y: 0
cb1[4].z: -0.421694875
cb1[4].w: 0

cb.7z
I think you are right, VB2 is not being used.?


 

Hmm, all I can tell is that it is a 4 component vector, and the last component is 0 or 1 based on the four values in your post (I can't open the archive right now, I can look at the end of the week). So I do not think that it is skeleton (should be a matrix or translation-rotation-scale and there are not enough numbers per component) or animation (there is no easily identifiable time stamp).

 

It's a float, signed and not normalized, so it cannot be tangent, uv, weights or bone indices, and I don't think it can be normal either. Is the stream the same length as the number as the number of vertices? Perhaps it is position and the 4th number is unused. If it does not change with pose, it might be the untransformed position. You could always try substituting those numbers in for position and seeing if you get the bind pose.

 

The other thing you could try is just randomly changing some numbers and injecting the buffer back into the game. Maybe seeing what changes can give you a clue for what it is used for. Perhaps it is something we do not know about, like colors or outlines.

Link to comment
54 minutes ago, woofhat said:

I don't think it's necessary to study the data, if you open the buf files you'll find they could be anything, just not what we want them to be.

 

As you and  DarkStarSword said, because of the way the unity engine works,3dmigoto can't modify the model of unity's game, the only way is to unpack/repack the original file.


I think it might be possible, but you are right, it will be a lot of trial and error and perhaps in the end will fail. It is not worth it. ?

Link to comment
9 hours ago, woofhat said:

I don't think it's necessary to study the data, if you open the buf files you'll find they could be anything, just not what we want them to be.

 

As you and  DarkStarSword said, because of the way the unity engine works,3dmigoto can't modify the model of unity's game, the only way is to unpack/repack the original file.

それは残念な知らせですね;
テクスチャーで出来る事はコレくらいですね・・・

 

That's unfortunate news.
This is about all I can do with the textures...

 

 

制服の切り替え機能あり

Ability to switch uniforms.

image.jpeg.d1375a885ee1b1c80a12c446ae0e655b.jpeg

 

image.jpeg.2f47082b71832120025d37573c9d7a2a.jpeg

 

SAYOはウェスト部分がないのでスカートが外せない;

SAYO has no waist section, so the skirt cannot be removed; and

image.jpeg.312495170b72bf9f1a27d631c554855f.jpeg

 

image.jpeg.7cb835f0a4053ea4ce65ecd86c09d126.jpeg

 

ブラの切り替え機能あり

Bra switching function available

image.jpeg.d68ee22976610fb54e3c119d3649d807.jpeg

 

SAYOの水着からパレオを外す

Removing the pareo from SAYO's swimsuit

image.jpeg.03484770edaa0a19454d49551424a714.jpeg

Link to comment

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
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use