Zylann / voxelgame

Voxel world prototype made with Godot Engine
Other
513 stars 84 forks source link

ERROR: Cannot get class 'VoxelMesherBlocky' when running exported HelloVoxel.exe #84

Closed portwatcher closed 3 years ago

portwatcher commented 3 years ago

In-editor play button works fine, I can play blockygame in debug mode.

After running HelloVoxel.exe exported from this demo project, I encourtered these errors:

ERROR: Cannot get class 'VoxelMesherBlocky'.
   At: core/class_db.cpp:347
ERROR: Cannot get class 'VoxelMesherBlocky'.
   At: core/class_db.cpp:347
ERROR: Cannot get class 'VoxelMesherBlocky'.
   At: core/class_db.cpp:347
ERROR: Cannot get class 'VoxelLibrary'.
   At: core/class_db.cpp:347
ERROR: Cannot get class 'VoxelLibrary'.
   At: core/class_db.cpp:347
ERROR: Cannot get class 'VoxelLibrary'.
   At: core/class_db.cpp:347
ERROR: Cannot get class 'Voxel'.
   At: core/class_db.cpp:549
ERROR: poll: res://blocky_game/blocks/voxel_library.tres:30 - Parse Error: Can't create sub resource of type: Voxel
   At: scene/resources/resource_format_text.cpp:499
...

I built Godot myself and put voxel module in. I got these errors. Then I tried pre built Godot editor downloaded from https://github.com/Zylann/godot_voxel/actions , I still got these errors.

I downloaded standard export templates (3.3.stable) from Godot official website. I also used them for 3.4.beta editor downloaded from godot_voxel/actions, because I guess there is no breaking changes on export templates.

I'm pretty new to Godot community and pretty new to cpp development. I guess I should have configured some include path, I don't know. Forgive me if this young and naive problem bothers you.

Zylann commented 3 years ago

I downloaded standard export templates (3.3.stable) from Godot official website.

That's why you get this. Export templates are Godot Engine, just compiled without editor and without debug checks. Official export templates don't have the module included. You have to build them.

portwatcher commented 3 years ago

Thank you for your response!

The compile output of the will be a godot.exe command line tool, not a standalone runnable HelloVoxel.exe. How can I get the latter? Can I compile godot with a project embeded in?

I read the docs and it tells me just copy the godot.exe to the project dir and it works fine. Is it the only way we have (let's say we actually completed a sandbox game) to deliver the game to players, the whole dir including project.godot?

Again, I'm pretty new to Godot. You can simply paste links if you don't have much time. to explain I will read and learn.

Zylann commented 3 years ago

I suppose this section would be the one you need https://docs.godotengine.org/en/stable/development/compiling/compiling_for_windows.html#creating-windows-export-templates And this one in general, if you want to use Mono (I dont know much about it): https://docs.godotengine.org/en/stable/development/compiling/compiling_with_mono.html On a longer term, it is hoped that the module could switch to GDNative so none of that compiling is required, assuming the core devs find a way to make it work with C#.

portwatcher commented 3 years ago

Here are the steps:

  1. Compile Godot without editor and with voxel module in the modules dir.
  2. In default Windows export template, click browse button under the Custom Template section.
  3. Choose the godot.exe you just built
  4. Click Export to export HelloVoxel.exe
  5. Remember to copy blocky_game dir (with save dir in it) to the same dir where HelloVoxel.exe is