Reun-Media / godot-levelblock

Testing and developing of LevelBlock Godot addon
MIT License
103 stars 11 forks source link

Using a resource for block faces #1

Open OneginIII opened 2 years ago

OneginIII commented 2 years ago

My idea is that instead of having the _directionface values directly on the node, the data would be stored in a resource instead. This resource could then be swapped out to update the look of the block, and could be copied over to other blocks too. The node could even contain an array of style resources that could be changed in code. The resource could also contain the material, texture and texture size to be used, acting as a sort of a "theme" for the block.

Pros:

Cons:

dcrawl commented 1 year ago

How about having a second level block that extends the first one to add in these features? With the idea of being able to customize the textures, what about being able to customize the mesh by applying resources? The block would probably have to assume that the mesh is the correct size and its center point is defined properly in the model and then just rotate it into place. It would allow you to create wall buttons, torches and so on.

OneginIII commented 1 year ago

Working on more features for the plugin is probably on hold until the plugin is ported for Godot 4 at some point. Making a separate advanced version of the node seems like something I might look into too. I would want to maintain at least the option of a simple data structure for the block.

As for the custom model suggestion. It would complicate things quite a bit. The models would have to have a specific UV layout, which would need to be modified for the mapping of different textures to work. Right now the block node just generates simple square UV's to be used for the blocks faces. I feel like using custom meshes would work better by just creating your own nodes for buttons, doors and other objects mixed in with level blocks. This way you could easily add in more complex behaviors, like animations and interacting. Other option would be to use some kind of voxel plugin for Godot.

I unfortunately don't have time to work on this plugin more right now. Thanks for your suggestions anyway!