The tracks were never built from one model
A map record is an Entity::MakeMessage (MUNGA/ENTITY3.h): classToCreate, owningPlayerID, resourceID, instanceFlags, localOrigin. The origin ends the 76-byte case, which puts classToCreate at +28, resourceID at +40 and instanceFlags at +44. I had been reading +44. That is instanceFlags, and it is 524 on every scenery record - and 524 happens to be cn3's GaugeImage. So every track resolved to cn3 repeated a few hundred times, consistently and wrongly, and every conclusion drawn from that followed: the "one wall bar with a gate", the ticks, the claim that the LOD machinery is never exercised. The id at +40 varies per placement. The tracks use cn1, cn3, cn4, cn5, cn7, br1, br3, ft1, cq1, cq2, md3, md4, the pits, and the score zones sc50/sc50a/sc500a that gave the amber boxes at each end. A record names the model's Model List; the GaugeImage is filed under the same model name, so the name is the join - and models with no gauge image (oao, snAwork, pz1) are skipped here exactly as DrawStatic skips them. Found by following the map loader: InterestManager::LoadMapStream reads the stream as MakeMessages and names the map entity classes, one of which is 95 in these records - CulturalIconClassID.
This commit is contained in:
@@ -97,6 +97,10 @@ xml = open(ROOT + '/tools/console-config/RPConfig.xml', encoding='utf-8-sig').re
|
||||
for m in re.finditer(r'<map\s+key="([^"]+)"\s+name="([^"]+)"', xml):
|
||||
CONSOLE[m.group(1)] = m.group(2)
|
||||
|
||||
# A record names the model's Model List; its GaugeImage is filed under the
|
||||
# same model name. navmap.gauge_lookup does that join.
|
||||
LOOKUP = {k: v for k, v in navmap.gauge_lookup(TABLE).items() if v in images}
|
||||
|
||||
tracks = []
|
||||
for rid, r in sorted(TABLE.items()):
|
||||
m = re.match(r'^(\w+): Map stream of (\d+) instances$', r['desc'])
|
||||
@@ -105,9 +109,9 @@ for rid, r in sorted(TABLE.items()):
|
||||
key, count = m.group(1), int(m.group(2))
|
||||
placed, noart = [], 0
|
||||
for gid, pos, q in navmap.instances(RES, r['addr'], r['size'], count,
|
||||
set(images)):
|
||||
LOOKUP):
|
||||
if gid is None:
|
||||
noart += 1 # the map screen skips these
|
||||
noart += 1 # no gauge image: the map skips these too
|
||||
continue
|
||||
placed.append([gid,
|
||||
round(pos[0], 2), round(pos[1], 2), round(pos[2], 2),
|
||||
|
||||
Reference in New Issue
Block a user