Aller au contenu

Photo

Problem with several armor mods - Armors distorted when viewed from far away [WORKAROUND FOUND]


  • Veuillez vous connecter pour répondre
18 réponses à ce sujet

#1
Siham

Siham
  • Members
  • 102 messages
Hello, like the title said, i have a problem with some well-known armor mods and i would like to understand.

For example, with the awesome Mord Sith armors (http://www.dragonage...ile.php?id=1055) or with the Oracle ones (http://www.dragonage...file.php?id=942), the armors are perfectly drawn if i look at the characters who wear them at close or medium distance.

But if i look at them at somewhat great distance, the characters are distorted : the legs are deformed and the arms remain stretched. Always, whatever the location in game.

With the Armor of the Devout (http://www.dragonage...ile.php?id=1018), i don't have this problem, never.

I would like to solve this, because my main character is an archer and therefore in combat, when i am distant to shoot my arrows i always see my melee characters deformed... :blush:

I don't know the toolset at all, that's why i ask to the experts you are ^^. Thanks by advance for your help!

EDIT : The problem is still unsolved, but somebody found a workaround, see my post below.

Modifié par Siham, 29 août 2010 - 09:51 .


#2
DarthParametric

DarthParametric
  • Members
  • 1 409 messages
Sounds like a mesh/rig mis-match when the lower LOD variants kick in. One way to (potentially) solve it would be to replace the LOD2 and LOD3 models with copies of the LOD0 model.

Modifié par DarthParametric, 13 août 2010 - 01:40 .


#3
Siham

Siham
  • Members
  • 102 messages
Thanks for your answer DarthParametric. But what you said is like Chinese for me, could you please explain how i can do this?

What you said make me remember that when i talked to the Mord Sith Armours mod creator about this problem, his answer was : 

"I'm sincerely sorry because I can not help you with that, I don't know what cause that in your game. The only thing I can tell is that the meshes from this mod, also from my Realistic Look and from Natural Bodies have LOD 0 (Level of Detail) only edited, that means when character is far from camera, the original armour reappears, but not that bug with distorsion that you have. It can be something from other mod you have installed or some undeleted files from your override."

I suppose his answer will make sense for you ^_^. For your information I don't have any body mods installed, except "More Hairstyles" and "Pretty Faces" in the override directory. And the only mods i installed as dazips are "Quartermaster Tolby" and "Advanced Tactics" (except of course the armor mods i talked about), so i don't think they are related to the problem.

Is there a solution?

#4
tmp7704

tmp7704
  • Members
  • 11 156 messages
The way game engine works, each (armour) model has "level 0" mesh which is shown when the model is close to the camera, and which uses full skeleton with over 100 bones to animate it.

If the model is farther from camera than certain distance, the game attempts to switch to different mesh, "level 2" one and uses for it much simplified skeleton with ~35 bones or so.

If the custom model is missing this "level 2" mesh prepared for animation with the simplified "level 2" skeleton you'll see the warping you describe, as the information in the mesh which bones should be used to animate it, and the bones in the skeleton itself no longer match.

You don't get this effect with armour of the devout because that particular armour uses existing game models, just reskinned and these default models have all required meshes. But if entirely custom armour only provides "level 0" mesh then the game tries to use it also with the "level 2" skeleton at the distance, and you see the warping due to mentioned mismatch between animation skeleton and the information in the mesh itself.

#5
ladydesire

ladydesire
  • Members
  • 1 928 messages
What is the easiest way to create new LOD meshes? I'm working on a project that is doing all new armors and clothing for the child models and we would like them to be virtually indistinguishable from the adults once added into the game.

#6
-Semper-

-Semper-
  • Members
  • 2 257 messages
mostly all 3d apps have build in poly optimizer. in maya/max it's prooptimizer, in blender it's decimate, in zbrush it's decimation master. they all come with options to lock the uv and the borders to retain the shape. often they produce nice meshes but sometimes it's better to do it manually ;)

there is also an open source solution called mesh lab.

Modifié par -Semper-, 14 août 2010 - 12:03 .


#7
DarthParametric

DarthParametric
  • Members
  • 1 409 messages
As tmp7704 described, there are 3 different levels of detail (LOD) that the game uses for models. Here is an example, in this case Human male heavy armour (variant a):

Posted Image

You’ll see the designation for each model follows the format:

[Main class]_[Model Type]_[Model Sub-Type][Model Variation]_[LOD]

Where, in this example:

Main class = HM, human male
Model Type = ARM, chest/torso armour (as distinct from boots and gloves)
Model Sub-Type = HVY, heavy
Model Variation = A, variant A (1 of 5 variants in this case, A to E)
LOD = 0/2/3, the level of detail

Each individual model is composed of three separate files:

MSH – Mesh, the actual geometry and UV co-ords, normals, etc.
MMH – Model hierarchy, the allocation of bones and materials, etc.
PHY – Model physics, information on collision, etc.

The way variants work is that they each share a common MSH - i.e. they are just texture variants of the same mesh. This is a cheap way of giving the appearance of lots of different models, especially in conjunction with normal maps which fake geometry. In the case of mod custom armour lower LOD distortion, this is an issue because the game believes that the model is just a texture variant of the particular base game mesh that it shares a filename with. When it finds no existing LOD information, it just substitutes the LOD variants for what it believes is the same base mesh.

For example, in the case of the Mord Sith mod (using the “Mord_Sith_Armour_final” file) there are 3 sets of armour included, 1 for Elf females and 2 for Human females (as well as associated gloves and boots). These are ef_arm_lgtz_0, hf_arm_lgtm_0 and hf_arm_lgtx_0. As far as the game is concerned, the Elf armour is just a texture variant of the female Elf light armour mesh and the Human armours are just texture variants of the female Human light armour mesh. I suspect that when the game can’t find the expected LOD information, it is either trying to pair the vanilla low LOD MMHs with the custom MSH or the custom MMHs with the vanilla low LOD MSHs. I’m not sure which it is, but either way is going to result in distortion. Ultimately it doesn’t matter what the cause is, the way to prevent it is to give the game the LOD information it wants. To do that, you’ll have to make some copies of the existing models and edit them. Because the Mord Sith mod is an Addin, there are some additional steps required to access the source files.

To start with, locate the folder where the mod is installed. I believe this should be My Documents\\BioWare\\Dragon Age\\AddIns\\adriangi_mordsith\\. Go to the \\Contents\\packages\\core\\data\\ folder and locate the file adriangi_mordsith_package.erf. You need to open this either with the toolset or the standalone ErfEditor.exe in the toolset directory. Either way, once it is open, in the menu bar go to Edit->Extract All Resources and in the pop-up window choose a temporary folder somewhere and click OK. You’ll get a message telling you the files have been extracted, after which you can close the file. Go to the directory where you extracted the files. Delete all the DDS, MSH and GDA files – you won’t need them. All you want are the MAOs, MMHs and PHYs. Additionally, you can delete the 3 files for w_dgr_dg06m_0, which is a dagger. That should leave you with 21 files (7 of each type) which are comprised of 3 sets of armour, 2 sets of boots, and 2 sets of gloves.

You have two options. Which one you want to use depends on what your system is like. If you have a pretty good rig and run DA smoothly at max settings then you can go with the quickest method and not worry about the MAOs. If your system is a bit older (primarily your video card in this case) and struggles a bit you will probably want to also edit the MAOs. Either way, the first step is to edit the MMHs and PHYs, as this is required for both.

Make a copy of all the MMH/PHYs so that you have two of each. Change the LOD in the filename of the originals from 0 to 2 and change that in the copies to 3. For example, you should go from having a single file named ef_arm_lgtz_0.mmh to two files named ef_arm_lgtz_2.mmh and ef_arm_lgtz_3.mmh. Once this is done you need to open every single file and edit some values. Again, you can use either the toolset or the standalone GffEditor.exe to do this. For the MMH files, at the top change the MMH_NAME field to reflect the new filename (i.e. change _0 to _2 or _3). Repeat this for the PHYs. At this point you have effectively created the required sets of LOD models the game expects. You can just delete the MAOs, dump the MMHs and PHYs in a folder inside your My Documents\\BioWare\\Dragon Age\\packages\\core\\override\\ folder and load up the game. However, if you have a lower-end machine, you may want to add the following additional step.

Make a copy of all the MAOs so that you have two of each. Add _l2 to the end of the filename for one copy and _l3 to the end of the filename of the other. For example, you should go from having a single file named ef_arm_lgtz.mao to two files named ef_arm_lgtz_l2.mao and ef_arm_lgtz_l3.mao. Open each of these files in a text editor. For the previous example, you should see something like the following:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MaterialObject Name="EF_ARM_LGTZ">
    <Material Name="Character.mat"></Material>
    <DefaultSemantic Name="ArmourSkinTint"></DefaultSemantic>
    <Texture Name="mml_tDiffuse" ResName="ef_arm_lgtz_0d.dds"></Texture>
    <Texture Name="mml_tNormalMap" ResName="ef_arm_lgtz_0n.dds"></Texture>
    <Texture Name="mml_tSpecularMask" ResName="ef_arm_lgtz_0s.dds"></Texture>
    <Texture Name="mml_tTintMask" ResName="ef_arm_lgtz_0t.dds"></Texture>
    <Vector4f Name="mml_vFalloffParams" value="0.71 10.23 1.50 1.50"></Vector4f>
    <Float Name="mml_fSpecularReflectionMult" value="1.00"></Float>
</MaterialObject>
In the L2 file, change it to:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MaterialObject Name="EF_ARM_LGTZ_L2">
    <Material Name="Character.mat"></Material>
    <DefaultSemantic Name="ArmourSkinTintL2"></DefaultSemantic>
    <Texture Name="mml_tDiffuse" ResName="ef_arm_lgtz_0d.dds"></Texture>
    <Texture Name="mml_tSpecularMask" ResName="ef_arm_lgtz_0s.dds"></Texture>
    <Texture Name="mml_tTintMask" ResName="ef_arm_lgtz_0t.dds"></Texture>
    <Vector4f Name="mml_vFalloffParams" value="0.60 8.70 1.50 1.50"></Vector4f>
    <Float Name="mml_fSpecularReflectionMult" value="1.00"></Float>
</MaterialObject>
And in the L3 file change it to:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MaterialObject Name="EF_ARM_LGTZ_L3">
    <Material Name="Character.mat"></Material>
    <DefaultSemantic Name="ArmourSkinTintL3"></DefaultSemantic>
    <Texture Name="mml_tDiffuse" ResName="ef_arm_lgtz_0d.dds"></Texture>
    <Texture Name="mml_tSpecularMask" ResName="ef_arm_lgtz_0s.dds"></Texture>
    <Texture Name="mml_tTintMask" ResName="ef_arm_lgtz_0t.dds"></Texture>
    <Vector4f Name="mml_vFalloffParams" value="0.53 7.67 1.50 1.50"></Vector4f>
    <Float Name="mml_fSpecularReflectionMult" value="1.00"></Float>
</MaterialObject>
There are 4 changes. The MaterialObject name was changed to reflect the appropriate filename. The DefaultSemantic (which dictates how the object is rendered) was changed to the appropriate L2/L3 version. The normal map was completely removed. And finally, the falloff parameters were changed to match those from the vanilla game MAOs. Don’t worry too much about the mechanics behind all that, the important point is that we are reducing the load on the video card. Now repeat the same steps for all the other MAOs.

Once that is done, it’s time to edit all the MMHs again. With one open, right click and choose Expand All. Scroll right down to the bottom. In the last node you should see a list of bones. Scroll up just above that and look for a field labelled MMH_MATERIAL_OBJECT. For example, in ef_arm_lgtz_2/3 it should be ef_arm_lgtz. Change this to either ef_arm_lgtz_l2 or ef_arm_lgtz_l3, as appropriate. Repeat for all the MMHs. Now you can move all the MAOs/MMHs/PHYs to the Override folder, as described before.

As and additional point, if you wanted to get really fancy, you could also downscale all the textures. I won’t go into depth with that, but basically textures for the two lower LODs are ¼ the size of the preceding LOD. So for an LOD0 texture of 1024x1024, the LOD2 texture would be 512x512, and the LOD3 texture would be 256x256. Scale them down, save them with appropriate filenames (e.g. ef_arm_lgtz_0dl2.dds and ef_arm_lgtz_0dl3.dds), edit the MAOs to reflect the new filenames, and dump them in the Override folder with everything else. Each LOD would require diffuse, specular and tint maps. Normal maps are only used for LOD0.

Oh and one final addendum. Every time you save a GFF file you'll get a backup copy of it named *.BAK. You can delete those once you are done.

#8
Siham

Siham
  • Members
  • 102 messages
Oh my! :o What an answer, DarthParametric! Awesome, thank you so much. I'm going to do all the steps and i will tell here the result.

Thanks to tmp7704 too for his explanations. You are helpful, guys!

#9
tmp7704

tmp7704
  • Members
  • 11 156 messages

DarthParametric wrote...

I suspect that when the game can’t find the expected LOD information, it is either trying to pair the vanilla low LOD MMHs with the custom MSH or the custom MMHs with the vanilla low LOD MSHs. I’m not sure which it is, but either way is going to result in distortion.

From my experience the bolded one happens, sort of -- to be more precise, if the game cannot find the low level mesh, it doesn't substitute it with defaults but keeps using/drawing the high poly model. It also most likely attempts to still use the high detail associated .mmh which means things could potentially work fine without the low level versions however there's another factor here -- one of the parts (head i think) is treated as "master" version of the .mmh skeleton, in the sense it determines the bone IDs (and possibly causes any bones not present in that master .mmh to be ignored)  So, once the camera pulls away far enough the "master" .mmh gets (also) switched to low level version, and the high level armour mesh no longer matches that information, resulting in warped appearance.

Modifié par tmp7704, 14 août 2010 - 02:41 .


#10
Siham

Siham
  • Members
  • 102 messages
Well, i'm sorry, DarthParametric, but that didn't work.

I followed all the steps you described, except the MAOs part, since i have a pretty good rig. I also did not created the ef files, since the only armors i use are the two human female ones.

I created a "Mord Sith Fix" folder in my override folder, and i put inside the MMHs and PHYs files. I have 8 MMH files (2 for the boots, 2 for the gloves and 4 for the two armors), same for the PHY files. I carefully renamed and edited them with the Gffeditor.exe as you explained.

But in the game i have exactly the same problem.

What i don't understand is why, according the creator of this mod, he doesn't encounter the same issue. If you read what i quoted from him, he says that "when character is far from camera, the original armour reappears, but not that bug with distorsion that you have".

Your explanations about the missing LOD information are logic, so why doesn't everybody have the same issue as me?

I remember the very first version of this mod : it was just an override folder. When the character was far from camera, the vanilla leather armor would suddenly replace the custom one. That's since the dazip version i have the distortion bug.

I have the Steam version of the game but i don't think it's related. As for the rig i have two 8800 GT in SLI mode, with always the latest drivers, and Windows 7 x64.

Anyway thanks again for your great post, even if it didn't solve my problem it has increased my knowledge!

Modifié par Siham, 14 août 2010 - 03:24 .


#11
DarthParametric

DarthParametric
  • Members
  • 1 409 messages
Hrmm...well it could be a conflict with another mod conceivably, especially if you have a lot of other armour and body model mods installed. Leaving the distortion aside, was it previously swapping to vanilla DA models when you got to the appropriate distance?

#12
Siham

Siham
  • Members
  • 102 messages
Like i said before i don't have a lot of mods installed : only the Mord Sith and the Devout armor ones (as dazips), and Pretty faces and More Hairstyles in the override.

When the Mord Sith mod was an override one, the swap to vanilla DA model occured, but not anymore since the dazip version.

The creator, adriangi, said he was using Natural Bodies. So i just tried to install it : it's just an override folder. Interesting enough, in the description the author says :

"When character is far from camera, the underwear reappears. This because I've only created the Level of Detail 0 ( the more detailed, visible when camera is close ) of bodies. LOD 2 and 3 will be fixed if I have time for this ( need to rebuild all the meshes ! )"

Well, i just launched the game, and as stated, when i am close to the character, i see it nude, but when the camera is far, the vanilla underwear appears.

So it is confirmed that when the custom LOD 2 and 3 are not present, the game draws the vanilla ones. My game does effectively this with Natural Bodies, but not with the Mord Sith or the Oracle armors : it still draws the custom armor, but with great distortion. I can't understand why!!

P.S. I don't have any body mods, i tried Natural Bodies just for the purpose of testing

Modifié par Siham, 14 août 2010 - 04:30 .


#13
DarthParametric

DarthParametric
  • Members
  • 1 409 messages
Natural bodies is just an override of vanilla models, which is why it works without issues.



How are you installing DAZip-based mods?

#14
Siham

Siham
  • Members
  • 102 messages

DarthParametric wrote...

How are you installing DAZip-based mods?


With the daupdater.exe provided by Bioware.

And if i want to uninstall one, i just delete the mod folder in Documents\\Bioware\\Dragon Age\\AddIns and the mod_package.erf file in Documents\\Bioware\\Dragon Age\\packages\\core\\data.

#15
tmp7704

tmp7704
  • Members
  • 11 156 messages
Something simple you can try as last-ditch workaround:

* extract a .mmh and .phy files for any of the "level 2" default light armours (doesn't have to be light armour, i just use it as example. Let's say it's hf_arm_lgta_2.mmh and hf_arm_lgta_2.phy  The files are stored in archive "modelhierarchies.erf" in game's main packages/core/data folder.

* rename these files to match the name scheme of custom armour. From reading DarthParametric's post, it seems the names should be like: hf_arm_lgtz_2.mmh and .phy

* open the renamed files with the Toolset, locate the "old" filenames in the content (located near the very top of each file) and change these "old" filenames to the "new" ones. Save your changes.

having these files in packages/core/override/toolsetexport (to ensure they get the highest priority) should give you the armour switching its appearance to vanilla armour at distance, rather than show distorted custom "level 0" model.

#16
alschemid

alschemid
  • Members
  • 477 messages
While working with a custom model using the high detail mesh in the place of the LOD 2 and 3 models I get those distortions too, it appears to happen because the LOD models use less bones than the high detailed meshes and when the game doesn't find the LOD models it tries to load the high detailed one using the skeleton from the LODs.  If you really want to fix this, you will need to redo the bone weight of the high detailed mesh to match  the lower LODs skeletons, for each LOD model.

Becareful with the decimate in Blender once you apply the modifier you lose all the UV map info.

Modifié par alschemid, 14 août 2010 - 06:32 .


#17
tmp7704

tmp7704
  • Members
  • 11 156 messages
Yes, for full fix the low level model can only use the bones included in the low level skeleton for weighting.

#18
Siham

Siham
  • Members
  • 102 messages
Hello, that's me again! I still have this distortion problem with armor mods but there is a workaround! On the Dragon Age Nexus forum, i found this post by oades11 :

"Most, if not all, are already aware of the little graphical glitch that gets players wearing any of the modded armors to be stuck in a 'T' pose if you view them from a distance.
However, I noticed something very strange. If you talk to them at least once first, the graphical glitches do not happen- not from any distance. I've tested this on two different PCs already. I have the archon robe on Morrigan, and she'll look very glitched if I view her from a distance without having talked to her. Once I click on her and choose "I'd like to ask you something", and she says, "oh, full of questions are you" I can just choose "nevermind", and she looks normal after that."

Link of the post : www.thenexusforums.com/index.php

And that works! I just tried with several armor mods (like the Mord Sith one for example) and i just have to talk once with a character to have the distortion glitch disappear on this character. (I never noticed this before because i was installing a mod, checked if there was the glitch at distance, and uninstalled it if it was positive.)

Weird, isn't it? How do you explain that?

Well, i'm glad there is a workaround! :happy:

#19
DarthParametric

DarthParametric
  • Members
  • 1 409 messages
Bizarre. The issue makes less sense to me now than it did before.