Houston we have a problem............

It's always good to question one's assumptions.
The mystery data is used in the game to control
shading and texturing rendering. Because I couldn't
get the excised file to load I wrote a Python script
to zero out the mystery data but leave the file otherwise
as is. It loads and plays but the graphical results
are disappointing. The unit (hard-coded to feudal_knights,
my favorite test case) flickers in and out of sunlight in
a custom battle and the unit colors also render oddly.

I'm sending an attachment to GOM and Casuir to test
but we need a better answer to what the mystery data
is. I've been working on the .ms3d format and there
doesn't seem to be anywhere to place more data (shader
or whatever this is).

Not to worry, this isn't a showstopper but we need to know
what this is and how to deal with it.

Here's the code if anyone else wants to experiment:
(The getters and putters are from my main script
for converting mesh files, I don't use all of them here.)

Code:
import struct

global bytecount
global ms3dbytecount

# -----------------------------------------------------------------------------------
def getbyte( fidin ) :
    global bytecount
    (thebyte,)             = struct.unpack( 'b', fidin.read(1) )
    bytecount              = bytecount + 1
    return thebyte

# -----------------------------------------------------------------------------------
def getubyte( fidin ) :
    global bytecount
    (thebyte,)             = struct.unpack( 'B', fidin.read(1) )
    bytecount              = bytecount + 1
    return thebyte

# -----------------------------------------------------------------------------------
def getshort( fidin ) :
    global bytecount
    (theshort,)            = struct.unpack( 'h', fidin.read(2) )
    bytecount              = bytecount + 2
    return theshort

# -----------------------------------------------------------------------------------
def getushort( fidin ) :
    global bytecount
    (theshort,)            = struct.unpack( 'H', fidin.read(2) )
    bytecount              = bytecount + 2
    return theshort

# -----------------------------------------------------------------------------------
def getint( fidin ) :
    global bytecount
    (theint,)              = struct.unpack( 'i', fidin.read(4) )
    bytecount              = bytecount + 4
    return theint

# -----------------------------------------------------------------------------------
def getuint( fidin ) :
    global bytecount
    (theint,)              = struct.unpack( 'I', fidin.read(4) )
    bytecount              = bytecount + 4
    return theint

# -----------------------------------------------------------------------------------
def getfloat( fidin ) :
    global bytecount
    (thefloat,)            = struct.unpack( 'f', fidin.read(4) )
    bytecount              = bytecount + 4
    return thefloat

# -----------------------------------------------------------------------------------
def putbyte( thebyte, fidout ) :
    global ms3dbytecount
    fidout.write( struct.pack( 'b', thebyte ) )
    ms3dbytecount          = ms3dbytecount + 1
    return  

# -----------------------------------------------------------------------------------
def putubyte( thebyte, fidout ) :
    global ms3dbytecount
    fidout.write( struct.pack( 'B', thebyte ) )
    ms3dbytecount          = ms3dbytecount + 1
    return  

# -----------------------------------------------------------------------------------
def putshort( theshort, fidout ) :
    global ms3dbytecount
    fidout.write( struct.pack( 'h', theshort ) )
    ms3dbytecount          = ms3dbytecount + 2
    return  

# -----------------------------------------------------------------------------------
def putushort( theshort, fidout ) :
    global ms3dbytecount
    fidout.write( struct.pack( 'H', theshort ) )
    ms3dbytecount          = ms3dbytecount + 2
    return  

# -----------------------------------------------------------------------------------
def putint( theint, fidout ) :
    global ms3dbytecount
    fidout.write( struct.pack( 'i', theint ) )
    ms3dbytecount          = ms3dbytecount + 4
    return  

# -----------------------------------------------------------------------------------
def putuint( theint, fidout ) :
    global ms3dbytecount
    fidout.write( struct.pack( 'I', theint ) )
    ms3dbytecount          = ms3dbytecount + 4
    return  

# -----------------------------------------------------------------------------------
def putfloat( thefloat, fidout ) :
    global ms3dbytecount
    fidout.write( struct.pack( 'f', thefloat ) )
    ms3dbytecount          = ms3dbytecount + 4
    return  

# -----------------------------------------------------------------------------------
def putzerobytes( n, fidout ) :
    global ms3dbytecount
    for ii in range(n) :
        putubyte( 0, fidout )
        ms3dbytecount      = ms3dbytecount + 1
    return  


# Main.

global bytecount
global ms3dbytecount
bytecount                  = 0
ms3dbytecount              = 0

fnin                       = 'feudal_knights_lod0_test.mesh'
fnout                      = 'feudal_knights_lod0_testchop.mesh'
fidin                      = open( fnin, 'rb' )
fidout                     = open( fnout, 'wb' )

for ii in range(2*175) :
    fidout.write( fidin.read(500) )

fidout.write( fidin.read(477) )

# We're at the mystery blocks.
nvert                      = getuint( fidin )
putuint( nvert, fidout )
print 'nvert = ' + str( nvert )

for ii in range( nvert ) :
    sdummy                 = getushort( fidin )
    sdummy                 = getushort( fidin )
    putushort( 0, fidout )
    putushort( 0, fidout )

nheaderfooter              = 26
for ii in range( nheaderfooter ) :
    thebyte                = getubyte( fidin )
    putubyte( thebyte, fidout )

# 2nd mystery block.
nvert                      = getuint( fidin )
putuint( nvert, fidout )
print 'nvert = ' + str( nvert )

for ii in range( nvert ) :
    sdummy                 = getushort( fidin )
    sdummy                 = getushort( fidin )
    putushort( 0, fidout )
    putushort( 0, fidout )

nheaderfooter              = 26
for ii in range( nheaderfooter ) :
    thebyte                = getubyte( fidin )
    putubyte( thebyte, fidout )

# 3rd mystery block.
nvert                      = getuint( fidin )
putuint( nvert, fidout )
print 'nvert = ' + str( nvert )

for ii in range( nvert ) :
    sdummy                 = getushort( fidin )
    sdummy                 = getushort( fidin )
    putushort( 0, fidout )
    putushort( 0, fidout )

#fidin.seek( 229468, 0 )

fidout.write( fidin.read(500) )
fidout.write( fidin.read(600) )

fidin.close()
fidout.close()