MDL (GoldSrc): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
Line 2: Line 2:
'''MDL''' (sometimes referred to as '''Half-Life MDL''' or '''HLMDL''') is a model format used by {{goldsrc|4}} to store dynamically lit [[models]] which can be animated using [[skeletal animation]], along with their associated [[textures]]. It is a heavily modified version of the [[Quake MDL]] format.
'''MDL''' (sometimes referred to as '''Half-Life MDL''' or '''HLMDL''') is a model format used by {{goldsrc|4}} to store dynamically lit [[models]] which can be animated using [[skeletal animation]], along with their associated [[textures]]. It is a heavily modified version of the [[Quake MDL]] format.


== Technical ==
== Overview ==
=== Limits ===
=== Limits ===
HLMDL has the following limits per input SMD:
HLMDL has the following limits per input SMD:
Line 35: Line 35:
{{modernConfirm|Max textures, max skins, and other limits?}}
{{modernConfirm|Max textures, max skins, and other limits?}}


=== Structs ===
== Flags ==
{{stub}}
=== Model flags ===
{| class="wikitable"
|-
! Bit !! Flag name !! Particle effect? !! Description
|-
| 1 || EF_ROCKET || Yes || Yes || Yes || Yes || Yes || Yes || {{quake|4|nt=0}}      rocket trail particles and dynamic light
|-
| 2 || EF_GRENADE || Yes || {{quake|4|nt=0}}      grenade trail smoke particles
|-
| 4 || EF_GIB || Yes || {{quake|4|nt=0}}      gib blood trail particles
|-
| 8 || EF_ROTATE || No || Rotate this model around its origin, like the weapon pickups in {{quake|4|nt=0}}; requires supported game code.
|-
| 16 || EF_TRACER || Yes || {{quake|4|nt=0}}      skrag spit particles
|-
| 32 || EF_ZOMGIB || Yes || {{quake|4|nt=0}}      zombie blood; like EF_GIB, but darker
|-
| 64 || EF_TRACER2 || Yes || {{quake|4|nt=0}}      death knight slashing particles
|-
| 128 || EF_TRACER3 || Yes || Like EF_GRENADE, but only has one trail
|-
| 256 || EF_NOSHADELIGHT || No || Reduces intensity of shadows on the model, without making the model flat {{modernConfirm|[[Half Lambert]]?}}
|-
| 512 || EF_HITBOXCOLLISIONS || No || Use hitbox for collision instead of bounding box
|-
| 1024 || EF_FORCESKYLIGHT || No || Always use skybox lighting, regardless of model location
|}


== In other engines ==
== In other engines ==

Revision as of 13:48, 27 August 2023

English (en)Translate (Translate)

MDL (sometimes referred to as Half-Life MDL or HLMDL) is a model format used by GoldSrc GoldSrc to store dynamically lit models which can be animated using skeletal animation, along with their associated textures. It is a heavily modified version of the Quake MDL format.

Overview

Limits

HLMDL has the following limits per input SMD:

  • 1 mesh
    • 2048 vertices and vertex normals per mesh
    • 4080 triangles per mesh
  • 1 animation sequence
    • 512 keyframes per sequence
  • 128 bones

Additionally, the following limits apply to the whole MDL:

  • 4 bone attachments
  • 8 bone controllers
  • 32 meshes across all submodels
  • 256 animation sequences.

Textures must:

  • Be 8-bit uncompressed BMP files.
  • Have a resolution which is a multiple of 8 (multiples of 16 are preferred).
  • Have a resolution which does not exceed 512x512 (soft limit; raised to 1024x1024 in Sven Co-op Sven Co-op and other engines like FTE FTE).
  • Have a file name which is not longer than 64 characters (including the .bmp extension).


Icon-Important.pngImportant:Older versions of StudioMDL, including the version found in the Half-Life SDK Half-Life SDK on Steam, do not support tiling UVs, clamping them to the edge of the texture. This is not a limitation of the HLMDL file format; the Sven Co-op StudioMDL can create MDLs compatible with vanilla GoldSrc GoldSrc which have tiled UVs.
Icon-Bug.pngBug:The latest version of the Sven Co-op StudioMDL (from December 2020), as found in the Sven Co-op SDK, has some bugs with bounding boxes; use the version linked above instead (from November 2018).  [todo tested in ?]
Tip.pngTip:To create a model or submodel with more than 4080 tris, split the model into multiple SMD meshes, with a separate $body or $bodygroup entry for each mesh in the QC file. Template:ModernWarning
Confirm:Max textures, max skins, and other limits?

Flags

Model flags

Bit Flag name Particle effect? Description
1 EF_ROCKET Yes Yes Yes Yes Yes Yes Quake Quake I rocket trail particles and dynamic light
2 EF_GRENADE Yes Quake Quake I grenade trail smoke particles
4 EF_GIB Yes Quake Quake I gib blood trail particles
8 EF_ROTATE No Rotate this model around its origin, like the weapon pickups in Quake Quake I; requires supported game code.
16 EF_TRACER Yes Quake Quake I skrag spit particles
32 EF_ZOMGIB Yes Quake Quake I zombie blood; like EF_GIB, but darker
64 EF_TRACER2 Yes Quake Quake I death knight slashing particles
128 EF_TRACER3 Yes Like EF_GRENADE, but only has one trail
256 EF_NOSHADELIGHT No Reduces intensity of shadows on the model, without making the model flat
Confirm:Half Lambert?
512 EF_HITBOXCOLLISIONS No Use hitbox for collision instead of bounding box
1024 EF_FORCESKYLIGHT No Always use skybox lighting, regardless of model location

In other engines

Half-Life MDLs are supported by FTE FTE and the Unity Unity game Codename: Loop Codename: Loop.

External links

References

  1. From the GoldSrc Model Export Tutorial by The303:
    In order to compile models with more than 4080 triangles, you must break up your SMD's into parts and give them their own $body lines for compiling. Also, FOR THE LOVE OF ALL THAT IS HOLY PLEASE DO NOT GO CRAZY ON YOUR TRIANGLE COUNT; remember this is goldsrc, not source engine. Going any higher than 9000 tris is excessive and direct ports from source/other games are inefficent, wasteful, and cause performance issues for the old renderer.
    — The303