Aller au contenu

Photo

[SOLVED] Naming Level of Detail meshes.


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

#1
Nattfodd

Nattfodd
  • Members
  • 321 messages
Hi mates, i have a doubt:
because i want to create a new NPC creature with a new custom mesh, i would like to know, how the game knows which version of the model it have to display when the PC is far away from it.
Someone should have noticed that every model have 3 *.mmh versions: the model_name_0.mmh is the main model, then there are the additional model_name_2.mmh and model_name_3.mmh. These are low poly versions of the main model that the game displays when you are far away from the model for a better performance management.
Do you know if the game use only the name convention based on the number suffix (*_0, *_2, *_3) or there are other rules?

Thanks.

Modifié par Nattfodd, 26 février 2010 - 09:25 .


#2
nezroy

nezroy
  • Members
  • 99 messages
The _0, _2, and _3 naming for the .mmh./.phy files is the only hard rule I know of for LOD. For model naming overall, such as a model named "hf_arm_medd_0.mmh", the part of the name you can control via the item variation mechanism is the "arm_medd" part. The hf_ and the _0/_2/_3 part are automatically added on by the engine or toolset somewhere under the hood. The _0/_2/_3 part for LOD, and the hf_ part based on the gender/race. Also, lots of item types don't do LOD, so those models just need the _0 version (shields for instance).

After that, the name of the MSH file, MAO file, and DDS texture files can technically be anything you want, since the MAO and MSH names are specified in the MMH file, and the DDS texture names are specified in the MAO.

The wiki on ItemVariations.xls describes exactly how the name of the MMH file to look for is derived from the fields in the item variation 2DAs. Generally you're safest if you stick to string lengths that roughly match what exists already, or else you can run into trouble with things not being found. This gets kind of annoying because if you were to follow the model naming convention you would quickly run into conflicts/run out of unique names, since under that convention you are allowed only a 1 or 2 character MODELVARIATION field to make your item name unique among all mods everywhere.

Instead I typically use a MODELTYPE of "nez" for all my projects, and then a 2 character MODELSUBTYPE (kt for kite shield, gl for gloves, etc.) and a 2 character MODELVARIATION based on the specific mod/item I'm working on.

Partly this is limited by the fact that I'm using all pre-existing MMH files for existing models, and there's no reliable way to change the length of the MSH/MAO strings in those, so to keep everything consistent I just use that naming scheme across the board so my MSH, MAO, and DDS file names are all consistent with my MMH/PHY names. If you are exporting your own MMH/MSH files then you could probably loosen up your naming scheme a bit, but I'm not really familiar with any of the tools for doing that.

Sorry, probably way more info than you wanted :)

#3
nezroy

nezroy
  • Members
  • 99 messages
Whoops, double post.

Modifié par nezroy, 26 février 2010 - 05:27 .


#4
Nattfodd

Nattfodd
  • Members
  • 321 messages
I noticed you talked mostly about items, while i need informations on creatures base model, but maybe it works quite the same way.

So, to create a new appearance, if i want to be sure it will works in game, i have to name its model, following the "race_gender" rule for the prefix and number of lod for suffix, and typing whatever i want in between?
Example: i create a human female appearance, so i have to name my .mmh file HF_mymodel_0.mmh. Then, the game engine knows that the creature is human, is female and the model is called mymodel, and search for the proper LOD model using the letter H, the letter F and the number in an automatic way? Is that right?

Modifié par Nattfodd, 26 février 2010 - 06:28 .


#5
Eshme

Eshme
  • Members
  • 756 messages
Human models are Items in terms of all Cloth worn is Items.

ah um except nude meshes, dont know

Modifié par Eshme, 26 février 2010 - 06:43 .


#6
nezroy

nezroy
  • Members
  • 99 messages
Yeah I was thinking of humanoid NPCs that would be wearing armor/cloth items, etc. For creatures it's even simpler; you just extend the APR_Base.xls with a new appearance type set to a "simple" model type, and the base model name is a single field defined in there. Then it just does the same auto-determination of the LOD suffix (_0, _2, _3) as it does elsewhere. Base appearances defined with a simple model type (as is the case for most existing creatures) don't do the auto-prefix thing of hf/pf/etc; that only happens for base appearances with a type of "parts", which is only really used for the humanoid armor-wearing weapon-wielding types.

As an aside, the nude meshes for humanoids work essentially the same as the rest of the item/armor variations, and seem to be defined in the "nude_variation" 2da. Though there's clearly a little bit of magic going on there as it somehow knows which slot each item in the nude_variation list should go into (torso/gloves/feet). I don't know if it's determining that based on row ID or the label, or if it's possible to add additional nude variations (doubtful, since I don't know of any place where you'd be able to select it anyway), but regardless, it's treating the nude model specification in roughly the same as any armor variation would work.

Modifié par nezroy, 26 février 2010 - 07:57 .


#7
Nattfodd

Nattfodd
  • Members
  • 321 messages
Ok solved,



the model must be named with the suffix _0, _2 and _3.

However the low poly .mmh have a different bones definition. So you can't use the same .mmh you generate for the high poly model, or you will see distortions on your custom mesh when you go far away from it.



Thanks.