FyroxEngine/Fyrox · error

Tile set load failed! Reason

Error message

Tile set load failed! Reason: {e:?}

What it means

TileBrush::block_until_tile_set_is_loaded blocks on the tile set resource future; if the resource itself fails to load (Err from block_on), it logs the reason and reports the brush as not loaded (returns false). This signals an async resource load failure.

Solutions

  1. Read the logged `Reason: {e:?}` for the underlying load error and fix it (usually file-not-found or format error).
  2. Verify the tile set resource path embedded in the brush exists relative to the project.
  3. Re-assign a valid TileSet resource to the brush in the editor.
  4. Ensure the resource manager's file system watching root includes the tile set's location.

Example fix

// before
brush.set_tile_set(TileSetResource::load("missing.tileset"));
// after
let ts = TileSetResource::load("tileset.tileset");
ts.state().use_asset_data(|_, _| {}); // or otherwise verify it loads
brush.set_tile_set(ts);
Defensive patterns

Strategy: fallback

Validate before calling

// verify resource loads before assigning
let ts = TileSetResource::load(path);
assert!(ts.state().is_load_ok() || matches!(ts.state(), ResourceState::Pending(_)));

Try / catch

if !brush.block_until_tile_set_is_loaded() {
    Log::warn("tile set failed to load; check logged Reason and resource path");
    return;
}

Prevention

When it happens

Trigger: Calling block_until_tile_set_is_loaded when the brush's tile_set resource failed to load (missing file, bad format, IO error).

Common situations: Tile set resource moved/deleted after the brush was saved; a typo in the tile set resource path; resource state corruption in the resource manager.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of FyroxEngine/Fyrox@76c91aad8e (2026-09-10). Data as JSON: /api/errors/49710106fd486307. Report an issue: GitHub.

Appendix: source

Thrown at fyrox-impl/src/scene/tilemap/brush.rs:277

    pub macros: BrushMacroInstanceList,
    /// A record of whether the brush has changed since last time it was saved.
    #[reflect(hidden)]
    #[visit(skip)]
    pub change_flag: ChangeFlag,
}

impl TileMapBrush {
    /// Return true after blocking to wait for the brush's tile set to load,
    /// if the tile set loads successfully, or if the tile set has no brush.
    /// Return false if any error occurs while trying to load the tile set.
    pub fn block_until_tile_set_is_loaded(&self) -> bool {
        let Some(tile_set) = self.tile_set.as_ref() else {
            return true;
        };
        let tile_set = match block_on(tile_set.clone()) {
            Ok(tile_set) => tile_set,
            Err(e) => {
                Log::err(format!("Tile set load failed! Reason: {e:?}"));
                return false;
            }
        };
        if tile_set.is_ok() {
            true
        } else {
            Log::err("Tile set load failed!");
            false
        }
    }
    /// Return the tile set for this brush, blocking if the tile set is not yet
    /// loaded. None is returned if this brush has no tile set or the tile set fails to load.
    pub fn tile_set(&self) -> Option<TileSetResource> {
        let tile_set = self.tile_set.as_ref()?;
        let tile_set = match block_on(tile_set.clone()) {
            Ok(tile_set) => tile_set,
            Err(e) => {
                Log::err(format!("Tile set load failed! Reason: {e:?}"));

View on GitHub (pinned to 76c91aad8e)