Code Monkey home page Code Monkey logo

Comments (8)

Zylann avatar Zylann commented on June 27, 2024 1

The thing is, you would expect any saving to be completed before Godot starts the game... so there shouldn't be file locking issues (but I don't know for sure if Godot actually respects that). The only known issue you might encounter is that if you made unsaved changes and play, Godot won't re-import the saved PNGs until you unfocus/refocus the editor so in the worst case you might just see a slightly out-of-date terrain. But flat-out being unable to load even a PNG from this folder is unexpected and I don't know what could be done to figure out what's really happening.

Maybe as a test, try to comment out all the code in the saver to prevent those files to be eventually written to, to check if it's some weird permissions issue (and restart the editor to make sure the plugin reloads properly), but again if that's the cause, that would mean Godot is wrongly starting the game too early which the plugin can't possibly workaround.

from godot_heightmap_plugin.

Zylann avatar Zylann commented on June 27, 2024

All I can say is that this is somehow a Godot bug. The terrain uses a custom loader here: https://github.com/Zylann/godot_heightmap_plugin/blob/master/addons/zylann.hterrain/hterrain_resource_loader.gd
"no loader found" is a Godot error... as in, no code from that plugin even has a chance to run, it's like Godot is litterally not calling that code and fails earlier for unexplained reasons.

There seems to have been weird heisenbugs with custom savers and loaders for a very long time (notably saving). I suspect all the changes that have been done to GDScript over the years have somehow broken it in very unintuitive ways and nobody has looked into it. I could never do that either because these issues just never reproduced on my end...

Btw I find it extremely weird that on your screenshot Godot goes through NativeCalls.cs, a C# file, and somehow ends up printing an error about failing to load splat.png, which is terrain data file while this plugin is written in GDScript.
(that doesn't mean you can't use C# with a GDScript plugin, but I'm curious why C# gets involved here)

from godot_heightmap_plugin.

Tshmofen avatar Tshmofen commented on June 27, 2024

I see, thanks. Thought you may have any ideas or already saw something similar. Terrain saving and in-editor behavior is all working just fine for me, never had any issues there, only that strange project build/start bug.

Looks like I will have to inspect the original C++ eventually if want to find out the cause 🙂
I will update the issue if I get any mood to do a deep dive in Godot sources and get to find the source of the issue.

Oh, splat.png is on my side, I'm loading it separately (in C#) to determine the textures used on different parts of the terrain and map them to correct steps sounds. But this problem was present before I've added this system. Though, now it looks like the whole data directory is not accessible at this point, strange

from godot_heightmap_plugin.

Zylann avatar Zylann commented on June 27, 2024

And is the data directory actually present? Like, its contents have not been erased or anything?

from godot_heightmap_plugin.

Tshmofen avatar Tshmofen commented on June 27, 2024

I mean not accessible when that issue happens. The directory is obviously always here as I'm able to load the project correctly with restart later

from godot_heightmap_plugin.

Tshmofen avatar Tshmofen commented on June 27, 2024

Just had a thought. Could it be connected to a plugin saving the data on a scene save? When Godot starting/building the project it's always saving the opened scenes; maybe sometimes it doesn't do it fast enough and just started in-game plugin fails to load because the files are still being written to? Maybe you have any functionality connected to that save scene logic?

from godot_heightmap_plugin.

Tshmofen avatar Tshmofen commented on June 27, 2024

Can't test right now, maybe will do it tomorrow. I will let you know in this thread if I happen to found out anything. Thanks a lot

from godot_heightmap_plugin.

Tshmofen avatar Tshmofen commented on June 27, 2024

Ok, I found out the culprit. For some reason Godot sometimes doesn't register yours hterrain_resource_loader.gd after rebuild and nobody can handle *.hterrain resource type in that case, thus terrain doesn't appear.

Previous part is understandable, but it's strange that separately after that my another C# script cannot load the splat.png. It is throwing error 7, which is according to those Godot headers is ERR_FILE_NOT_FOUND. I'm using Godot library to load this file, so something goes wrong inside, because I tried to locate the files with .NET internal library just before it gets accessed by Godot and it seems fine / existing.

Oh, yes, and it is definitely not saving-lock issue, commented your saver to just return Ok without saving, but it have not prevented the issue in any way.

Yea, crazy stuff... :)

from godot_heightmap_plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.