#Csharp Geometry Libraries in Unity (Geom3Sharp)

1 messages · Page 1 of 1 (latest)

small scarab
#

Heyo, i just now found out about this set of Csharp Geometric Librarys (Geom3Sharp) that would probably work well for mesh manipulation, but i wanted to ask about the drawbacks from using something like this. does unity meshes work well with these types of meshes? seems like there would be way more overhead because if you wanted to edit a mesh, you would cast it to this library, change it, and cast it backwards, or always keep a second version of the mesh to change it.

Heres the Unity specific one i was looking at: https://github.com/ViRGIS-Team/ViRGiS-Geometry

For my use case I'm implementing a tree chopping mechanic that a game is based on, and it allows the player freedom in where to chop it. for both editor and runtime purposes, i need to be able to fill the holes in a tree mesh, but am having trouble defining what holes are using meshes without the probuilder treatment. (editor is because i want to create collision meshes, but the algorithm i use requires closed meshes)
I could probably find extra uses in editing the mesh, but for now i only need to be able to fill holes.

Are these libraries decent for transforming meshes, or does the differences in a unity mesh vs them cause performance issues with the libraries?

Probuilder is defo a second choice to use to fill holes, but to use it at runtime requires me to have all of the meshes controlled by probuilder with the mono overhead.
Any advice on this is appreciated, or what workflow changes would you suggest to avoid headaches while being able to use these

hot fog
#

these editing meshes are very inefficient to handle at runtime, but its possible.

#

if you want a chopping mechanic, the default approach would be to make the meshes ahead of time, pre-slice them, and then just activate them based on the chopping gameplay.

#

have a look at a tree chopping in zelda breath of the wild: they basically just insta-swap the mesh to the 'chopped' version., same in valheim and many others.

small scarab
#

I get the normal approach of a chopping mechanic, i want the player to be able to chop up the tree more after its sitting on the ground to process it into planks, but I'm just having trouble on figuring out how to implement that type of tree chopping into a game.

hot fog
#

well, you can do all that with pre-sliced meshes

#

see valheim

#

if your game is all about the exact chopping, thats a different story

#

i would say if you need high-fidelity live chopping, your best solution is to make an efficient runtime mesh-chopping thing yourself that optimizes for your exact gameplay. and prototype that gameplay via Geom3Sharp et al

small scarab
#

The gameplay loop would consist of mostly chopping, moving the logs to process, and then transform into planks. i wanted to take inspiration from Lumber Tycoon 2 on roblox, but fit it into a first person experience.
currently for efficiency, i store sdfs of each of the branches, and vertexes of the chopped / split trees store their original index in the tree, and the branch they were from for optimized splitting. The hard part is figuring out data storage for fixing the initial holes so far. just needing to decide if this is truly what i need, and if theres any help i can get without sacrificing a bunch of runtime performance.

hot fog
#

what does your gameplay prototype say that you need?

small scarab
#

i did want to create a unique tree chopping mechanic for my game so i started out on this route. thank you for your expert advice on both the geom library and how my chopping mechanic could work.

#

I'm working solo on this project, but my prototype says "have the user be able to chop trees at any point on mesh, and be able to chop it into pieces that dont go below .1m along the length of a branch."
Its not a very good gameplay prototype specifications. i think i might need to go back and refine the specifications, though i do want the user to have complete freedom in deconstructing trees.

#

the player will need to be able to transport the logs to their base for processing through a mill, and theres no inventory space for logs.

#

If this is idiotic as something to do or impossible to do, then i wont mind feedback bashing the idea, just want to create small games that try to introduce one new mechanic and a gameplay loop based around that unique mechanic in a 3d FP game.

cosmic bolt
#

The answer to your initial question is: try it and see. Even if it might not be extremely optimized, it might be enough in the context of your project, so no one can answer that for you.

#

Another option you have: implement the splicing in your project yourself. You can reference the library algorithm and make it work on Unity meshes directly.