Short conversion out of range

From Valve Developer Community
Jump to: navigation, search

Studiomdl reports this error:

Generating optimized mesh "c:\steam\steamapps\SourceMods\mod\models/your/model.sw.vtx":
ERROR: short conversion out of range XXXXX
ERROR: Aborted Processing on 'your/model.mdl'

Solution

The problem is that studiomdl.exe is trying to write out a triangle strip with more than 32767 vertices, which is more than Source supports (and also more than any model should ever need). You have run into an engine limitation and you need to reduce the complexity of a portion of the model.

As an example, Valve's highest LOD .SMD for dog is only 1.72 MB and contains 17,433 vertices. Which then divides down to a little less than 6,000 polygons. 10,000 polygons is kind of an informal maximum for the Source engine, hence the maximum vertices being roughly 10,000 x 3 (32767).