{"record":{"id":"7449f7bb38b4aede","repo":"babalae/better-genshin-impact","slug":"kpfilepath-7449f7","errorCode":null,"errorMessage":"地图数据加载失败，文件: {kpFilePath}","messagePattern":"地图数据加载失败，文件: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"critical","filePath":"BetterGenshinImpact/GameTask/Common/Map/Maps/Layer/BigMapTeyvat256Layer.cs","lineNumber":29,"sourceCode":"\npublic class BigMapTeyvat256Layer : BaseMapLayer\n{\n    // 大地图使用256  相对 2048 区块的缩放比例  2048/256=8\n    public const int BigMap256ScaleTo2048 = 8;\n\n    private static BigMapTeyvat256Layer? _instance;\n    private static readonly object LockObject = new();\n\n    private readonly Size _mapSize256;\n    private readonly Feature2D _siftMatcher;\n\n    private BigMapTeyvat256Layer(SceneBaseMap baseMap) : base(baseMap)\n    {\n        Floor = 0;\n        var layerDir = Path.Combine(Global.Absolute(@\"Assets\\Map\\\"), baseMap.Type.ToString());\n        var kpFilePath = Path.Combine(layerDir, \"Teyvat_0_256_SIFT.kp.bin\");\n        var matFilePath = Path.Combine(layerDir, \"Teyvat_0_256_SIFT.mat.png\");\n        TrainKeyPoints = FeatureStorageHelper.LoadKeyPointArray(kpFilePath) ?? throw new Exception($\"地图数据加载失败，文件: {kpFilePath}\");\n        TrainDescriptors = FeatureStorageHelper.LoadDescriptorMat(matFilePath) ?? throw new Exception($\"地图数据加载失败，文件: {matFilePath}\");\n\n        _mapSize256 = new Size(baseMap.MapSize.Width / BigMap256ScaleTo2048, baseMap.MapSize.Height / BigMap256ScaleTo2048);\n        SplitBlocks = KeyPointFeatureBlockHelper.SplitFeatures(_mapSize256, TeyvatMap.GameMapRows * 4, TeyvatMap.GameMapCols * 4, TrainKeyPoints, TrainDescriptors);\n\n        _siftMatcher = baseMap.SiftMatcher;\n    }\n\n    public static BigMapTeyvat256Layer GetInstance(SceneBaseMap baseMap)\n    {\n        if (_instance != null)\n        {\n            return _instance;\n        }\n\n        lock (LockObject)\n        {\n            if (_instance == null)","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/Common/Map/Maps/Layer/BigMapTeyvat256Layer.cs#L11-L47","documentation":"Thrown in the BigMapTeyvat256Layer constructor (lazy singleton) when FeatureStorageHelper.LoadKeyPointArray(kpFilePath) returns null for the special 256-scale Teyvat SIFT keypoint file ('Teyvat_0_256_SIFT.kp.bin'). This is the dedicated large-map fast-matching dataset; if the file is absent the singleton cannot be built. Note this exact filename is explicitly excluded from the generic LoadLayers scan, so it is only loaded here.","triggerScenarios":"GetInstance(baseMap) is first called; the private constructor builds kpFilePath = <mapDir>/Teyvat_0_256_SIFT.kp.bin and calls LoadKeyPointArray, which returns null because the file does not exist. The ?? throws.","commonSituations":"The 256-scale Teyvat dataset was not included in the deployment/build; a clean checkout omitted the large binary assets; the file was gitignored or not fetched via LFS; the assets folder was pruned to save space.","solutions":["Confirm Assets\\Map\\Teyvat\\Teyvat_0_256_SIFT.kp.bin exists; restore it from the repo or the asset release.","Ensure binary map assets are tracked (Git LFS or direct) and fetched after clone.","If running a slimmed build that omits 256 data, avoid invoking the big-map 256 matcher or fall back to the 2048 path."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var kpFilePath = Path.Combine(layerDir, \"Teyvat_0_256_SIFT.kp.bin\");\nif (!File.Exists(kpFilePath)) throw new FileNotFoundException($\"缺少提瓦特 256 特征数据: {kpFilePath}\", kpFilePath);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure 256-scale Teyvat assets are fetched (Git LFS / asset release).","Run an asset-presence check before constructing the singleton.","Avoid the 256 big-map matcher in slim builds that omit the dataset."],"tags":["map-data","asset-loading","missing-file","feature-match","singleton"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}