ata4 / bspsrc

A Source engine map decompiler
Other
700 stars 87 forks source link

Titanfall Map Decompile Error "Couldn't find static prop struct for appId 1454890, version 12, size 84" #161

Open POLY-021 opened 1 year ago

POLY-021 commented 1 year ago

I'm attempting to grab static props from Titanfall 1, and BSPSource does have a "Titanfall" option for the BSP format. However, when I try to export, it doesn't export things properly and spits out a 0 kb file. Any help?

[warning] BspFileReader: Lump LUMP_EDGES is empty
[warning] BspFileReader: Lump LUMP_FACES is empty
[warning] BspFileReader: Lump LUMP_ORIGINALFACES is empty
[warning] BspFileReader: Lump LUMP_SURFEDGES is empty
[warning] BspFileReader: Lump LUMP_OCCLUSION is empty
[warning] BspFileReader: Lump LUMP_TEXINFO is empty
[warning] BspFileReader: An error occurred while trying to read lump LUMP_TEXDATA, caused by java.io.EOFException
    at info.ata4.io.buffer.source.ByteBufferSource.requestRead(ByteBufferSource.java:105)
    at info.ata4.io.DataReader.readInt(DataReader.java:83)
    at info.ata4.bsplib.struct.DTexData.read(DTexData.java:37)
    at info.ata4.bsplib.io.DataReaderUtil.readDStruct(DataReaderUtil.java:60)
    at info.ata4.bsplib.io.lumpreader.DStructChunksLumpReader.readChunk(DStructChunksLumpReader.java:27)
    at info.ata4.bsplib.io.lumpreader.DStructChunksLumpReader.readChunk(DStructChunksLumpReader.java:17)
    at info.ata4.bsplib.io.lumpreader.ChunksLumpReader.read(ChunksLumpReader.java:25)
    at info.ata4.bsplib.io.lumpreader.ChunksLumpReader.read(ChunksLumpReader.java:17)
    at info.ata4.bsplib.BspFileReader.readAbstractLump(BspFileReader.java:728)
    at info.ata4.bsplib.BspFileReader.readLump(BspFileReader.java:682)
    at info.ata4.bsplib.BspFileReader.readDStructChunksLump(BspFileReader.java:630)
    at info.ata4.bsplib.BspFileReader.readDStructChunksLump(BspFileReader.java:609)
    at info.ata4.bsplib.BspFileReader.loadTexData(BspFileReader.java:368)
    at info.ata4.bsplib.BspFileReader.loadAll(BspFileReader.java:85)
    at info.ata4.bspsrc.BspSource.decompile(BspSource.java:127)
    at info.ata4.bspsrc.BspSource.run(BspSource.java:73)
    at info.ata4.bspsrc.gui.BspSourceFrame$4.run(BspSourceFrame.java:372)

[warning] StaticPropLumpReader: Couldn't find static prop struct for appId 1454890, version 12, size 84
[warning] StaticPropLumpReader: Falling back to static prop v4
[warning] StaticPropLumpReader: 8 bytes remaining after reading
[warning] BspFileReader: An error occurred while trying to read lump LUMP_PLANES, caused by java.io.EOFException
    at info.ata4.io.buffer.source.ByteBufferSource.requestRead(ByteBufferSource.java:105)
    at info.ata4.io.DataReader.readFloat(DataReader.java:93)
    at info.ata4.bsplib.vector.Vector3f.read(Vector3f.java:31)
    at info.ata4.bsplib.struct.DPlane.read(DPlane.java:41)
    at info.ata4.bsplib.io.DataReaderUtil.readDStruct(DataReaderUtil.java:60)
    at info.ata4.bsplib.io.lumpreader.DStructChunksLumpReader.readChunk(DStructChunksLumpReader.java:27)
    at info.ata4.bsplib.io.lumpreader.DStructChunksLumpReader.readChunk(DStructChunksLumpReader.java:17)
    at info.ata4.bsplib.io.lumpreader.ChunksLumpReader.read(ChunksLumpReader.java:25)
    at info.ata4.bsplib.io.lumpreader.ChunksLumpReader.read(ChunksLumpReader.java:17)
    at info.ata4.bsplib.BspFileReader.readAbstractLump(BspFileReader.java:728)
    at info.ata4.bsplib.BspFileReader.readLump(BspFileReader.java:682)
    at info.ata4.bsplib.BspFileReader.readDStructChunksLump(BspFileReader.java:630)
    at info.ata4.bsplib.BspFileReader.readDStructChunksLump(BspFileReader.java:609)
    at info.ata4.bsplib.BspFileReader.loadPlanes(BspFileReader.java:110)
    at info.ata4.bsplib.BspFileReader.loadAll(BspFileReader.java:88)
    at info.ata4.bspsrc.BspSource.decompile(BspSource.java:127)
    at info.ata4.bspsrc.BspSource.run(BspSource.java:73)
    at info.ata4.bspsrc.gui.BspSourceFrame$4.run(BspSourceFrame.java:372)

[warning] BspFileReader: Lump LUMP_BRUSHES is empty
[warning] BspFileReader: Lump LUMP_BRUSHSIDES is empty
[warning] BspFileReader: Lump LUMP_AREAPORTALS is empty
[warning] BspFileReader: Lump LUMP_CLIPPORTALVERTS is empty
[warning] BspFileReader: Lump LUMP_DISPINFO is empty
[warning] BspFileReader: Lump LUMP_DISP_VERTS is empty
[warning] BspFileReader: Lump LUMP_DISP_TRIS is empty
[warning] BspFileReader: Lump LUMP_DISP_MULTIBLEND is empty
[warning] BspFileReader: Lump LUMP_NODES is empty
[warning] BspFileReader: Lump LUMP_LEAFS is empty
[warning] BspFileReader: Lump LUMP_LEAFFACES is empty
[warning] BspFileReader: Lump LUMP_LEAFBRUSHES is empty
[warning] BspFileReader: Lump LUMP_OVERLAYS is empty
[warning] BspFileReader: Lump LUMP_OVERLAY_FADES is empty
[warning] BspFileReader: Lump LUMP_OVERLAY_SYSTEM_LEVELS is empty
[warning] BspFileReader: Lump LUMP_MAP_FLAGS is empty
[error] BspSource: Decompiling error, caused by java.lang.IndexOutOfBoundsException: Index: 0
    at java.util.Collections$EmptyList.get(Unknown Source)
    at info.ata4.bspsrc.util.BspTreeStats.walk(BspTreeStats.java:69)
    at info.ata4.bspsrc.modules.geom.BrushSource.assignBrushes(BrushSource.java:133)
    at info.ata4.bspsrc.modules.geom.BrushSource.<init>(BrushSource.java:74)
    at info.ata4.bspsrc.modules.BspDecompiler.<init>(BspDecompiler.java:61)
    at info.ata4.bspsrc.BspSource.decompile(BspSource.java:167)
    at info.ata4.bspsrc.BspSource.run(BspSource.java:73)
    at info.ata4.bspsrc.gui.BspSourceFrame$4.run(BspSourceFrame.java:372)
SC1040-TS2 commented 1 year ago

I can confirm that this failure to write lumps also affects NEOTOKYO maps, and is version-specific to BSPSource 1.4.3. Version 1.4.2 does not fail to do decompilation in this way.

rihi commented 1 year ago

@POLY-021: I don't really now to what degree Titanfall 1 was ever supported. There is code to at least load the bsp files of titanfall, but not really any to handle writing the data to a vmf. I'm not familiar with Titanfall, but I think their map format greatly differs from normal source games, so I'm not sure if the maps could even be convert to vmf files that the normal hammer editor can use. If I have more time on my hand, I will have a closer look at this.

@SC1040-TS2: I don't know NEOTOKYO, but if it's not a game based on Titanfall, your issue will probably be something unrelated to this. Can you share what exact error you're getting with 1.4.3 but not with 1.4.2?

snake-biscuits commented 1 year ago

Afaik Titanfall 1 wasn't ever really supported, iirc ata4 got some info on lump names from cra0 back in 2014.[^btd_tmh] The Titanfall 1 format is significantly different to the rest of the Source Engine's .bsp formats

I've made a .map decompiler (Quake equivalent of .vmf) as part of bsp_tool So it is possible to decompile Titanfall maps, though the only editor for Titanfall .bsp currently uses the .map format[^mrvn] The only Source Engine game I can think off with limits that could handle Titanfall maps is Momentum Mod

Skimming through bspsrc, I can see trying to support Titanfall next to all the other Source Engine formats being a lot of work.

Titanfall 2 isn't too dissimilar to Titanfall 1, but my decompiler currently breaks trying to link brushes to entities. Most of Titanfall 2's geometry is displacements / meshes baked into the .bsp anyway, which we haven't yet reversed.

Apex Legends (mentioned in #59) removes almost all the lumps used when decompiling Titanfall 1 & 2 maps. While MRVN-Radiant can create some basic Apex maps, we've yet to decompile any Apex Legends maps.

I don't know NEOTOKYO

NEOTOKYO[^nt_sp] uses a standard VBSP v20 format, similar to Team Fortress 2 Idk why there would be issues decompiling any NEOTOKYO map

[^btd_tmh]: bsp_tool on GitHub: Timeline of Titanfall modding [^mrvn]: MRVN-Radiant on GitHub [^nt_sp]: NEOTOKYO on Steam

rihi commented 1 year ago

Afaik Titanfall 1 wasn't ever really supported, iirc ata4 got some info on lump names from cra0 back in 2014.1 The Titanfall 1 format is significantly different to the rest of the Source Engine's .bsp formats

I've made a .map decompiler (Quake equivalent of .vmf) as part of bsp_tool So it is possible to decompile Titanfall maps, though the only editor for Titanfall .bsp currently uses the .map format2 The only Source Engine game I can think off with limits that could handle Titanfall maps is Momentum Mod

That's good to know. In that case, I don't really have much motivation to try to add some kind of support. Currently, bspsrc assumes a common ground between all bsps with contains things like brushes, brushsides, texdata, etc. (Basically what's in BspData.java). So trying to support Titanfall in bspsrc current state would indeed probably be a lot of work.

NEOTOKYO uses a standard VBSP v20 format, similar to Team Fortress 2 Idk why there would be issues decompiling any NEOTOKYO map

I already got a suspicion that it has to do something with staticprops not being read correctly. #164 has the same issue. The 'generic' static prop version definitions in bspsrc seem to be incorrect for the majority of games. I really need to get an overview of what kind of engine branches there are and how their staticprop versions are defined.

Thanks for mentioning your bsp_tool though. That's going to be very helpful in cross referencing all the static prop definitions.

Do you perhaps also know how accurate the StaticPropLump_t definition on the BSP File Format Wiki is? Because it doesn't match what bspsrc currently has.

snake-biscuits commented 1 year ago

The VDC wiki definition looks accurate to me, tho it’s been a while since I implemented static prop definitions in bsp_tool Some games differ on a few versions, v7 & v6 are different for a handful of games iirc