BLaZeKiLL / VloxyEngine

Performance oriented voxel engine for unity.
MIT License
100 stars 9 forks source link

The external API is too blurry #126

Open dexsper opened 6 months ago

dexsper commented 6 months ago

There are a lot of difficulties in using the library without rewriting the source code for concrete projects For example, ChunkManager does not always have up-to-date information, public methods such as IsChunkLoaded do not guarantee that the chunk currently has a collider or is visible on the scene

There is constant confusion whether the local coordinates of the chunks are used or the world coordinates, for example, I would like to cache positions through int3 so as not to clog up memory and access blocks through it, but Worlutils does not provide the ability to generate coordinates from local back to world

Why, for example, couldn't ChunkAccessor also be made public for an external API It would be great to have a single point of storage for information about the chunk, the state of its mesh, collider and blocks

BLaZeKiLL commented 5 months ago

I agree that the API needs some thought on how things should be exposed. Going down on the history of the project, there was a version with a lot of customizability and extension support using generics and function pointers, but it all came at the cost of performance, which led me to the decision to remove all of that and expect the User to make source level changes to achieve customizability. However, that requires good docs and a consistent API, which will be my focus after implementing more crucial systems.