problems with custom .w2mesh

+
problems with custom .w2mesh

@TheZnosko or @DanForever

@KNGRSM (KNGenious) worked out a way to make our own "dlc" and add new entities to the game without replacing the old ones (which is great).

The problem we have is that the .w2ent call the original .w2mesh files, and if we try to call our custom .w2mesh files (even if its a direct copy of an original .w2mesh file with just the different path in the "new dlc") then they just dont load (invisible)

pics:
this works:


this doesnt:
'
-this is done with the great Mod Editor by @Sarcen

the paths to the meshes are correct

to be precise, this is in the "Uncooked\characters\models\monsters\gryphon"
t_01__gryphon.w2mesh -body
t_01__gryphon.w2ent
i_01__gryphon.w2mesh - feathers
i_01__gryphon.w2ent

Anyone got any bright ideas? :)
 
You left out the "Gryphon" part of the path? Which may not be a problem... but might be.

Also you changed the 'identifier' leading character from t_ to custom_t_ which *might* cause a problem if the engine uses file names to identify channel assignments or other usage variations, which I have it feeling it may do. Try it as t_..._custom.w2mesh etc.

I have no idea whether this would help, but if there isn't a good reason for changing the naming convention it is probably better to stick to what is already in place where possible if only for maintenance reasons.
 
You left out the "Gryphon" part of the path? Which may not be a problem... but might be.

Also you changed the 'identifier' leading character from t_ to custom_t_ which *might* cause a problem if the engine uses file names to identify channel assignments or other usage variations, which I have it feeling it may do. Try it as t_..._custom.w2mesh etc.

I have no idea whether this would help, but if there isn't a good reason for changing the naming convention it is probably better to stick to what is already in place where possible if only for maintenance reasons.

I definitely used my own path \ names for everything custom and had no real problem with that. The fact that @erxv forgot to add the "gryphon" to the path might actually be the cause why this .w2ent is not loaded correctly.

all modified .w2ents, .w2mesh, .redfur I added (with custom names) definitely loaded from the main .w2ent that holds the appearance Templates.

a modifed .w2mesh though where I just copied the original and then changed some vars.

He's actually trying to replace the models texture with a custom one. Which should work, but then I have no clue how you properly cook a new texture and add the whole texture.cache part to the DLC, but looking at the default DLCs the texture.cache file should go into DLC\erxvdlc\content\
 
Last edited:
the path where the w2mesh are located in is: dlc\erxvdlc\monsters\model\ no gryphon or anything
 
The original dlc have:

dlc\<dlc_name>\data\characters\models\ (and I assume the whole path could/should(?) be:
dlc\dlc_erxv\data\characters\models\monsters\model\gryphon\<customfiles>

While you are using only
dlc\erxvdlc\monsters\model\<custom-files>

Unless you have an excellent reason and for modifying CDPR's file pathing, and an understanding of what the engine expects to see and where I really wouldn't do it.
 
in the original game, the path to some .w2ents are as follows:
Uncooked\characters\models\monsters\gryphon\

in there are i_01_gryphon.w2ent and so on

in our "new dlc" we got the path:

dlc\erxvdlc\monsters\
where the copies of the

i_01_gryphon.w2ent are....
and those we can load fine, so why shouldnt the meshes?

we can load everything apart from meshes from completely custom paths, and they work.. (just not meshes)
 
Ok, we solved the problem. Fuck me, who would have known this. But be advised!

.w2mesh's extracted with QuickBMS are broken!

you have to use the .w2mesh's that you UNCOOK with wcc_lite.
 
Note also that you may need to uncook with targetdir to get full versions for those which are towards the end of the uncook of the whole game...

(I was getting sub 500kb meshes with the full uncook, but the files were only partial and exports failed... With the targetdir uncook the same files had the full (although small/simple models) 3-4MB size.
 
.w2mesh's extracted with QuickBMS are broken!

This is not true, but the ones uncooked ones have the buffer files merged into the .w2mesh files. So you would need to include the buffers too if you do it with my tool or quickbms.
 
This is not true, but the ones uncooked ones have the buffer files merged into the .w2mesh files. So you would need to include the buffers too if you do it with my tool or quickbms.

ok, so they are not broken but how would we know that. nobodoy of us ever did anything related to textures or meshes. We tried to add a new texture, but had no success. cooking the .tga and creating a texture.cache seemed to be working, but after changing the path to new texture in the .w2mesh it would always result in some weird texture glitches, I guess we either broke the .w2mesh, or did something wrong creating the texture.cache.

btw does a .w2mesh also have to be cooked with the diffuse texture and everything?

no one of us has ever done anything like that before...

the current status is:

we can load a custom .w2ent that loads custom .w2ents appearance templates which load a custom .w2mesh, but as soon as we change anything about the .w2mesh, like adding a the path to a diffuse.xbm that's included with the DLC the mesh doesn't load anymore. so who knows, we tried everything and actually have no fucking clue about texture.cache and the like whatsoever.
 
we can load a custom .w2ent that loads custom .w2ents appearance templates which load a custom .w2mesh, but as soon as we change anything about the .w2mesh, like adding a the path to a diffuse.xbm that's included with the DLC the mesh doesn't load anymore. so who knows, we tried everything and actually have no fucking clue about texture.cache and the like whatsoever.

I've had really weird loading issues when I tried it myself (although that was before 1.10, so it might have changed). But to me it seemed like the game didn't search the directories properly. If I named my DLC folder (inside the bundle not the actual folder, that one doesn't matter) DLC99 it would load fine, if I named it DLC100 or anything that diverted from the naming convention completely it failed to load.
 
Hello there! I'm new here.
I think, I've discovered something worth sharing.

I am not a modder or anything related, I just love to mess with stuffs.

I have been trying to make unique npcs for weeks now. I've tried different methods to name and organize my folders and files in my custom DLC folder.
It seems to me it doesn't matter how you do it until every custom file is inside your custom DLC's dlc folder. For example, I could make unique eye materials for triss with this path: dlc / triss/ materials / eye / triss_blue... .w2mi Note: For some reason, the loading before you interact with Triss is slow.

Unfortunately, my experimentings show me that as of right now there are some attributes what cannot be changed with Sacren's Mod Editor (Anyway, Thank you for this awesome utility) When I created a custom body went for Triss I'd changed the main .w2ent which contains the main appearances. It's loading fine but the custom body went was still linked with the original body w2mesh. When you check an edited custom .w2ent with the Witcher 2 Converter, you can see that it shows the original .w2mesh next to the new one as well. So I come to the conclusion, there has to be something that is causing this. I don't know a lot about hex editing but when you check any appearance .w2ent CEntity #2 unknownBytes in the Mod Editor's Hex Viewer you should see that in the 09 column there is the old mesh regardless if you edited the CMeshComponent #3's lightChannels Mesh or not.

For instance, I've changed Triss naked body appearance .w2ent in the main triss.w2ent file to a custom new one. In this custom .w2ent, I've changed the .w2mesh under the lightChannels to a new one. However, the old body mesh is still linked to it and in the hex viewer you can see that there is a string called CSoft which value is still showing the old body mesh. You can check this in the attachment.

So as I reckon, we are not able to create unique npc till someone look into it and reverse engineer more the .w2ent files or CDPR update their MODKIT.

Maybe someone among you is a highly skilled HEX editor and could do in his/her spare time? :)


I hope it helps!






 

Attachments

  • 01.JPG
    01.JPG
    87.4 KB · Views: 78
  • 02.JPG
    02.JPG
    93.1 KB · Views: 88
Last edited:
the Mod Editor's Hex Viewer you should see that in the 09 column there is the old mesh regardless if you edited the CMeshComponent #3's lightChannels Mesh or not.

Keep in mind that the hex viewer just shows the value at that position interpreted in several ways. It doesn't mean it is a softhandle just because it can parse it as one.
 
I see! Nonetheless, the Wicher 2 Converter shows that the .w2ent is still linked to the old mesh as well regardless you changed it to a new one.
 
Last edited:
I see! Nonetheless, the Witcher 2 Converter shows that the .w2ent is still linked to the old mesh as well regardless you changed it to a new one.

Well I don't know how that converter works, but if it just looks at the handles then it makes sense. Because I do not delete any handles, if you change a reference it will just create a new one and not delete the old one. Until 100% of the file is known it is impossible for me to tell what deleting a reference will do. I could possible make a handle list where you can see and edit the handles. For the purpose of changing one reference to another that would be more accurate since it would change references in unknown bytes too.

Also, some .w2ent files have other files embedded in them, you can't edit them at the moment (well I can but not the version that is uploaded atm...). I'm not entirely sure how they work or what their purpose is but they might be instances of objects and their instance settings. Which might overwrite certain things.
 
Well I don't know how that converter works, but if it just looks at the handles then it makes sense. Because I do not delete any handles, if you change a reference it will just create a new one and not delete the old one. Until 100% of the file is known it is impossible for me to tell what deleting a reference will do. I could possible make a handle list where you can see and edit the handles. For the purpose of changing one reference to another that would be more accurate since it would change references in unknown bytes too.

Also, some .w2ent files have other files embedded in them, you can't edit them at the moment (well I can but not the version that is uploaded atm...). I'm not entirely sure how they work or what their purpose is but they might be instances of objects and their instance settings. Which might overwrite certain things.


I see! Thanks for taking your time to enlighten me! :)
I think it's worth a try. If you have any spare time to look into this then give it a shot.
 
I see! Nonetheless, the Wicher 2 Converter shows that the .w2ent is still linked to the old mesh as well regardless you changed it to a new one.

yes, we encountered that too. but after some research I found that in the .w2ent that holds the .w2mesh there are actually two references to the .w2mesh used. One is in (my example) Chunk #6 CMeshComponent and the other reference is in Chunk #1 CEntityTemplate, in the Properties, find "flatCompiledData", click it and several buttons appear, click on open and a new tab with the flatCompiledData will open. You will find another CMesh Chunk, that acutally has the reference to the second .w2mesh that is loaded.


edit:

Success!

Custom .w2ent with .custom .w2ent appearances with custom .w2mesh and custom .xbm

Filepath structure doesnt seem to matter, at least it didn't for me.



Since I'm a noob at texturing my only texture modification was I painted the gryphon's "beak" white, using MSPAINT and the spray can tool. (highlighted in the image).

Unfortunately doing this in MSPAINT it lost the transparency around the wings, as you can see the transparent stuff became: white. (highlighted in the image).



But still, I got a complete custom entity, with custom mesh and custom xbm mounted as DLC going.

edit2:

another quick texture edit, this time no transparency errors

albino gryphon:

 

Attachments

  • 1YqG7jN.jpg
    1YqG7jN.jpg
    284.3 KB · Views: 104
  • RznQTft.jpg
    RznQTft.jpg
    284 KB · Views: 120
Last edited:
Well I don't know how that converter works, but if it just looks at the handles then it makes sense. Because I do not delete any handles, if you change a reference it will just create a new one and not delete the old one. Until 100% of the file is known it is impossible for me to tell what deleting a reference will do. I could possible make a handle list where you can see and edit the handles. For the purpose of changing one reference to another that would be more accurate since it would change references in unknown bytes too.

Also, some .w2ent files have other files embedded in them, you can't edit them at the moment (well I can but not the version that is uploaded atm...). I'm not entirely sure how they work or what their purpose is but they might be instances of objects and their instance settings. Which might overwrite certain things.



I've downloaded the new Mod Editor. Unfortunately, it seems bugged for me. Whenever I edit a handle, save it and then reopen it the edited handle is missing and sometimes new handles appear in the list as well. I don't know if it's intended or not, but i don't think so. I thought I'd let you know. Anyway, thanks for taking your time improving the MOD Editor.

In addition, I tested a custom .w2ent file with an edited handle and it didn't work.


yes, we encountered that too. but after some research I found that in the .w2ent that holds the .w2mesh there are actually two references to the .w2mesh used. One is in (my example) Chunk #6 CMeshComponent and the other reference is in Chunk #1 CEntityTemplate, in the Properties, find "flatCompiledData", click it and several buttons appear, click on open and a new tab with the flatCompiledData will open. You will find another CMesh Chunk, that acutally has the reference to the second .w2mesh that is loaded.


edit:

Success!

Custom .w2ent with .custom .w2ent appearances with custom .w2mesh and custom .xbm

Filepath structure doesnt seem to matter, at least it didn't for me.



Since I'm a noob at texturing my only texture modification was I painted the gryphon's "beak" white, using MSPAINT and the spray can tool. (highlighted in the image).

Unfortunately doing this in MSPAINT it lost the transparency around the wings, as you can see the transparent stuff became: white. (highlighted in the image).



But still, I got a complete custom entity, with custom mesh and custom xbm mounted as DLC going.

edit2:

another quick texture edit, this time no transparency errors

albino gryphon:


I give it a shot and see what i can do with Triss or Yen for example. Thanks for the help!
 
Last edited:
Top Bottom