# Problems with game data files changing

**URL:** <https://forum.castle-engine.io/t/problems-with-game-data-files-changing/2092>\
**Category:** Uncategorized\
**Created:** [January 31, 2026, 10:43am UTC](https://forum.castle-engine.io/t/problems-with-game-data-files-changing/2092 "2026-01-31T10:43:46Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Noscow](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/noscow/32/964_2.png) [@Noscow](https://forum.castle-engine.io/u/Noscow)\
**Post date:** [January 31, 2026, 10:43am UTC](https://forum.castle-engine.io/t/problems-with-game-data-files-changing/2092/1 "2026-01-31T10:43:46Z")

</div>

Good day! I have a little problem with files in the data folder.  
Sometimes, when I change some sprite to another, old sprite returns. Or, when I change folders names, files inside mixes…  
Can I fix this thing?

---

<div class="post-metadata">

**Author:** ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)\
**Post date:** [January 31, 2026, 11:19am UTC](https://forum.castle-engine.io/t/problems-with-game-data-files-changing/2092/2 "2026-01-31T11:19:34Z")

</div>

Hm, none of what you describe should happen 🙂 Once a new sprite has been loaded, new one should not return. Note that we have hot-reloading in editor by default (but not in game), so new sprite should be even loaded automatically. Although we have a cache that may sometimes interfere, but it doesn’t explain any of the 2 things you report.

Can you provide a reproduction, I would certainly like to fix it?

- Either a project with data to reproduce, and exact steps (and do you see problems in editor or at runtime).
- Or a video recording your project, when do the sprite return – this may be good enough here too, as I will see the steps you do and possibly guess the reason.

Thank you!

---

<div class="post-metadata">

**Author:** ![Noscow](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/noscow/32/964_2.png) [@Noscow](https://forum.castle-engine.io/u/Noscow)\
**Post date:** [January 31, 2026, 12:16pm UTC](https://forum.castle-engine.io/t/problems-with-game-data-files-changing/2092/3 "2026-01-31T12:16:21Z")

</div>

This is a little weird thing 🙃

Maybe problem not with CGE settings, but I can’t remember this bug/feature in another scenarios.

(I use Linux Mint Debian Edition distro)

---

<div class="post-metadata">

**Author:** ![Noscow](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/noscow/32/964_2.png) [@Noscow](https://forum.castle-engine.io/u/Noscow)\
**Post date:** [January 31, 2026, 12:18pm UTC](https://forum.castle-engine.io/t/problems-with-game-data-files-changing/2092/4 "2026-01-31T12:18:29Z")

</div>

(In this video I just trying to fix mistake with sprites naming)

---

<div class="post-metadata">

**Author:** ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)\
**Post date:** [February 4, 2026, 1:28pm UTC](https://forum.castle-engine.io/t/problems-with-game-data-files-changing/2092/5 "2026-02-04T13:28:52Z")

</div>

From a quick look at the video, the files change many times, due to copy+rename. What you observe may be a consequence of Linux-specific bug with our auto-refreshing, see

[https://github.com/castle-engine/castle-engine/blob/c0c45159e9b4aa1284f33393c1288ffdc99fab43/tools/castle-editor/code/formproject.pas#L1301](https://github.com/castle-engine/castle-engine/blob/c0c45159e9b4aa1284f33393c1288ffdc99fab43/tools/castle-editor/code/formproject.pas#L1301)

```delphi
procedure TProjectForm.ApplicationProperties1Activate(Sender: TObject);
begin
  { TODO: At least on Linux, GTK2 backend, this is *not* reliably
    run always when we switch back to CGE editor with Alt+Tab.
    This in turn means we don't always auto-reload scenes, images etc.
    when their content changed.
  WritelnLog('TProjectForm.ApplicationProperties1Activate ' + FormatDateTime('yyyy"-"mm"-"dd" "tt', Now));
  }

  { Refresh contents of selected dir, and tree of subdirectories,
    in case user created some files/directories in other applications. }
  RefreshFiles(rfEverything);
  FileMonitor.CheckChanges;
end;

```

To be clear, I understand that once you Alt+Tab to the Castle Game Engine editor, it shows the wrong version of the file?

Give me a few days, I’ll see whether we can solve it better 🙂

---

<div class="post-metadata">

**Author:** ![Noscow](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/noscow/32/964_2.png) [@Noscow](https://forum.castle-engine.io/u/Noscow)\
**Post date:** [February 12, 2026, 8:27am UTC](https://forum.castle-engine.io/t/problems-with-game-data-files-changing/2092/6 "2026-02-12T08:27:02Z")

</div>

> [@michalis](#):
>
> To be clear, I understand that once you Alt+Tab to the Castle Game Engine editor, it shows the wrong version of the file?

For now I work only from IDE, without editor. So, project just upload “wrong” files in runtime. It may help, if I will try to change them from CGE editor.

After all, this behavior really seems more as OS problem…

---

<div class="post-metadata">

**Author:** ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)\
**Post date:** [February 12, 2026, 9:19am UTC](https://forum.castle-engine.io/t/problems-with-game-data-files-changing/2092/7 "2026-02-12T09:19:14Z")

</div>

> [@Noscow](#):
>
> For now I work only from IDE, without editor. So, project just upload “wrong” files in runtime.

Oh! Hm, if you’re not using editor, then I misdiagnosed the problem. What exactly happens, do we load wrong file versions at runtime? Can you record a larger movie that shows the whole process with the bug – so when you play with renaming/copying data files, then build and run the game, and the game (as I understand) loads wrong files?

This is weird because such bugs should be impossible:) We don’t do anything fancy at runtime – we just load the files from your data as they exist on your disk, period. We also use cache for them, but this is build at runtime in memory, not depending on anything preprocessed. So if your files are saved with given state, and then you run the game → it’s really guaranteed we load such files.

And I didn’t observe disk / OS bugs that would even change it:) I mean, even disk errors would likely exhibit different problem, crashes at reading etc. It is weird is your file manager shows one thing, and our engine loads another.

So, I likely still don’t understand the problem, sorry! 🙂 Please record a longer movie (and/or post detailed explain how to reproduce), I should be able then to help better.

---

<div class="post-metadata">

**Author:** ![Noscow](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/noscow/32/964_2.png) [@Noscow](https://forum.castle-engine.io/u/Noscow)\
**Post date:** [February 12, 2026, 10:37am UTC](https://forum.castle-engine.io/t/problems-with-game-data-files-changing/2092/8 "2026-02-12T10:37:03Z")

</div>

Oh, no, I think I confused you a little 🙃 Sprites changes to the another into the folder, but it happens before I compile and run project.

1. I want to change the sprite (for example, the current image is quite ugly)
2. I delete old `name.png`
3. And add new `name.png`
4. I left and back to the folder and see old `name.png` on his own place and new is lost. Or, if I immediately run project, old file was loaded anyway (I think, he don’t leave his place really 🙂 )

So, maybe this is a sign from above it’s finally time to start use sprite atlas…

---

<div class="post-metadata">

**Author:** ![Noscow](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/noscow/32/964_2.png) [@Noscow](https://forum.castle-engine.io/u/Noscow)\
**Post date:** [February 12, 2026, 10:39am UTC](https://forum.castle-engine.io/t/problems-with-game-data-files-changing/2092/9 "2026-02-12T10:39:53Z")

</div>

I will try testing this in different ways in the near time.

---

<div class="post-metadata">

**Author:** ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)\
**Post date:** [February 12, 2026, 3:37pm UTC](https://forum.castle-engine.io/t/problems-with-game-data-files-changing/2092/10 "2026-02-12T15:37:58Z")

</div>

> [@Noscow](#):
>
> - I want to change the sprite (for example, the current image is quite ugly)
> - I delete old `name.png`
> - And add new `name.png`
> - I left and back to the folder and see old `name.png` on his own place and new is lost. Or, if I immediately run project, old file was loaded anyway (I think, he don’t leave his place really 🙂 )

Huh. That’s weird, and indicates to some “shenanigans” indeed at OS or file manager level.

Do you maybe have some anti-virus running and moving files around there? Can you disable it?

Do you maybe have some auto-synchronization of disk folders? Like this is a network drive, or it’s auto-synchronized using applications like Dropbox, Nextcloud, Proton Drive? Naturally they should not do anything such weird (and I used personally Proton Drive and Nextcloud and they rock!), but at least that would be something I would look into, and try if disabling them → solves the issue.

---

<div class="post-metadata">

**Author:** ![Noscow](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/noscow/32/964_2.png) [@Noscow](https://forum.castle-engine.io/u/Noscow)\
**Post date:** [February 15, 2026, 8:40pm UTC](https://forum.castle-engine.io/t/problems-with-game-data-files-changing/2092/11 "2026-02-15T20:40:29Z")

</div>

I remembered I install Lazarus into the local environment (because 4.0.0 from official site has some problems with `apt upgrade`). And I think it can was a reason of the my problems.  
I uninstall and clear all, and install Lazarus 2.2.6 from the Debian repository. For now it’s ok and project folder is stable. If problem will happen again I will say.

So, at 99% it’s was a problem with Lazarus 4.0.0 installed into local environment… And 99% anybody else never will face this problem again 🙃
