richardbiely / Voxelmetric

An efficient voxel framework for Unity3d

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DLL Architechure Issue

jaspercayne opened this issue · comments

With a fresh import of the repo, I get the usual errors with the Editor folder (maybe it's time to just remove it entirely since it has never been touched) but also a few new complaints from Unity:

Failed to load 'Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Plugins/FastNoise.dll', expected x64 architecture, but was x86 architecture. You must recompile your plugin for x64 architecture.
Voxelmetric.Code.Utilities.Noise.NoiseWrapperSIMD:.ctor(String) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Utilities/Noise/NoiseWrapperSIMD.cs:25)
Voxelmetric.Code.Utilities.Noise.NoiseWrapperSIMD:.ctor(String) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Utilities/Noise/NoiseWrapperSIMD.cs:18)
TerrainLayer:BaseSetUp(LayerConfig, World, TerrainGen) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Configurable/Layers/TerrainLayer.cs:39)
TerrainGen:ProcessConfigs(World, String) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Configurable/TerrainGen.cs:60)
TerrainGen:Init(World, String) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Configurable/TerrainGen.cs:28)
TerrainGen:Create(World, String) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Configurable/TerrainGen.cs:17)
Voxelmetric.Code.Core.World:StartWorld() (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Core/World.cs:102)
Voxelmetric.Code.Core.World:Start() (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Core/World.cs:53)
Failed to load 'Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Plugins/FastNoise.dll', expected x64 architecture, but was x86 architecture. You must recompile your plugin for x64 architecture.
Voxelmetric.Code.Utilities.Noise.FastNoiseSIMD:.ctor(Int32) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Utilities/Noise/FastNoiseSIMD.cs:55)
Voxelmetric.Code.Utilities.Noise.FastNoiseSIMD:.ctor(Int32) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Utilities/Noise/FastNoiseSIMD.cs:54)
Voxelmetric.Code.Utilities.Noise.NoiseWrapperSIMD:.ctor(String) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Utilities/Noise/NoiseWrapperSIMD.cs:18)
TerrainLayer:BaseSetUp(LayerConfig, World, TerrainGen) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Configurable/Layers/TerrainLayer.cs:39)
TerrainGen:ProcessConfigs(World, String) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Configurable/TerrainGen.cs:60)
TerrainGen:Init(World, String) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Configurable/TerrainGen.cs:28)
TerrainGen:Create(World, String) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Configurable/TerrainGen.cs:17)
Voxelmetric.Code.Core.World:StartWorld() (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Core/World.cs:102)
Voxelmetric.Code.Core.World:Start() (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Core/World.cs:53)
DllNotFoundException: FastNoise
Voxelmetric.Code.Utilities.Noise.FastNoiseSIMD..ctor (Int32 seed) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Utilities/Noise/FastNoiseSIMD.cs:54)
Voxelmetric.Code.Utilities.Noise.NoiseWrapperSIMD..ctor (System.String seed) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Utilities/Noise/NoiseWrapperSIMD.cs:18)
TerrainLayer.BaseSetUp (LayerConfig config, Voxelmetric.Code.Core.World world, .TerrainGen terrainGen) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Configurable/Layers/TerrainLayer.cs:39)
TerrainGen.ProcessConfigs (Voxelmetric.Code.Core.World world, System.String layerFolder) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Configurable/TerrainGen.cs:60)
TerrainGen.Init (Voxelmetric.Code.Core.World world, System.String layerFolder) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Configurable/TerrainGen.cs:28)
TerrainGen.Create (Voxelmetric.Code.Core.World world, System.String layerFolder) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Configurable/TerrainGen.cs:17)
Voxelmetric.Code.Core.World.StartWorld () (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Core/World.cs:102)
Voxelmetric.Code.Core.World.Start () (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Core/World.cs:53)

If I look at line 132 of FastNoiseSIMD where error is originating from, the precompiler is seeing my setup as 32 bit and ignoring the use of the 64 bit DLL. If I just change line 132 to point at "FastNoise_x64" instead, I can enter play mode just fine, but the terrain generator is clearly doing something seriously wrong... http://imgur.com/a/zfh4U
I tried fiddling with the Unity settings for both DLL files, but it looks like this is actually an architecture problem, and I'm unsure if the generator or FastNoise is the issue since I cannot check the DLL that seems to be generating the problematic terrain.

commented

probably not a fresh import at all.. things got changed.. your project folder has old files in it that are being picked up, so do a proper fresh import.

though you'll find there are other problems with the commit log as of 479 still has some other problems... but nothing to do with the dll issue you have.

commented

dunno then.. os?, unity version?
as its working here..
there was a unity 5.6 version that had some issues with .dll files but pretty sure it was fixed for final release

Jaspercayne, you're a problematic one :) I think the reason why the project never works for you out-of-the-box is that you're always a version of Unity3D behind.

As for the SIMD library - don't use it. It's experimental and just for my testing purposes for now. That's why you have to manually enable it by removing DISABLE_FASTSIMD macro.

Even though I can't reproduce your issue, just to be sure, I completely disabled FastNoiseSIMD when running the project without DISABLE_FASTSIMD.

When it comes to configuration, the only project file that should be of a user's interest is Config.cs.

This macro is something set via Unity3D's editor in your player settings and it is there for my personal use only (for now). Therefore, I do not find it important for anybody else to know about it :)

A cheat sheat will be available in time. But the interface has to stabilize first.

Personally, I don't find Voxe(lmetric) that big. Quite the opposite, I find it rather small. I usually don't have trouble orienting myself in a code of this size after a while so I really believe that anybody willing to spend some time with the code should be able to understand it quite well.

So I grabbed a fresh copy of the repository, fired up Unity, and when I hit play I still get the exact same thing. DLL file is not compiled for the correct architecture and DLL not found "FastNoise". If I change that line in FastSIMD again, I once again get the same results of the editor starting the scene, but the terrain is all rotated incorrectly.

DllNotFoundException: FastNoise
Voxelmetric.Code.Utilities.Noise.FastNoiseSIMD..ctor (Int32 seed) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Utilities/Noise/FastNoiseSIMD.cs:54)
Voxelmetric.Code.Utilities.Noise.NoiseWrapperSIMD..ctor (System.String seed) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Utilities/Noise/NoiseWrapperSIMD.cs:18)
TerrainLayer.BaseSetUp (LayerConfig config, Voxelmetric.Code.Core.World world, .TerrainGen terrainGen) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Configurable/Layers/TerrainLayer.cs:39)
TerrainGen.ProcessConfigs (Voxelmetric.Code.Core.World world, System.String layerFolder) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Configurable/TerrainGen.cs:60)
TerrainGen.Init (Voxelmetric.Code.Core.World world, System.String layerFolder) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Configurable/TerrainGen.cs:28)
TerrainGen.Create (Voxelmetric.Code.Core.World world, System.String layerFolder) (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Configurable/TerrainGen.cs:17)
Voxelmetric.Code.Core.World.StartWorld () (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Core/World.cs:132)
Voxelmetric.Code.Core.World.Start () (at Assets/Voxelmetric-alpha_3/VoxeUnity/Assets/Voxelmetric/Code/Core/World.cs:53)

It looks like FastNoiseSIMD is still getting called in TerrainLayer.cs a few times. Once I added the "or UNITY_EDITOR_WIN" check to each precompiler line (16, 25, 38), the scene will load without attempting to call FastNoise. There is still a problem with chunk rotations, but the scene will actually load in a fresh project now.

EDIT: Quick update after fiddling around a bit: There does not appear to be any actual rotation issues going on, things are not being correctly rendered and it is causing chunks to appear out of place. Textures are also being stretched pretty badly in these ghost chunks, but if I can find an area open enough to see what I am doing, the blocks themselves are rendering perfectly.

commented

yeh so I just recently for this dll error while updating my game project to the latest commit...

just needed to go into the player settings and add "DISABLE_FASTSIMD"

I changed !DISABLE_FASTSIMD to ENABLE_FASTSIMD. This should fix the issue: a9268be