Vex | For all of your voxel destruction needs

THE MODEL ITSELF IS OWNED BY MY ALT, NOT THIS MAIN ACCOUNT, FYI

Hello everybody! Recently, I stumbled upon a post of a user who had made a destruction module but it was just not equipped to be used as a community resource, and so I rewrote it, added some features, and without further ado, I present Vex!

Vex is a module created to convert parts to smaller voxel parts, to allow you to make fully destructible buildings and environments, provided they are regular parts.

How to Install and Use It

  1. Grab the model from here: Vex - Roblox
  2. Put it in Replicated Storage.
  3. Read the provided documentation in the post, and begin using it!

Documentation

  • Voxelize - Used to turn a part, or a model consisting of only parts in voxels. Parameters are the model you want to convert.

destructionWrapper.voxelize(game.Workspace.MahHouse)

Pros and Cons of Vex (Current)

  • Pros
  1. Extremely simple to use.
  2. Simplifies destruction.
  3. Is a way to have destruction for nearly anything, with little effort.
  4. Physics-based, meaning stuff adheres to gravity.
  • Cons
  1. Only parts are supported, for now.
  2. It is not optimized for large-scale destruction.
  3. Voxels are only cubes of 1x1x1 for now.

Examples

Here is an open-source place, so that you may see it before you download it, and learn how it is implemented! DestructionTest - Roblox

Quick note + Disclaimer

Currently, Vex is designed to be used on a small scale, so it will lag when used for a lot of voxelization at once or if it is attempting to destroy a ton of voxels at once. For the sake of letting your game run, only voxelize parts that NEED to be destructible, and do it WHEN they need to be destructible and good practice is to just destroy voxels that are being destroyed.

Future Plans

  • Heavy optimization because it is trash currently.
  • A greedy meshing system for the sake of optimization?
    Voxel size that adheres to parts outside of 1 stud increments. (VERSION 1.5)
Would you use it?
  • Yes, I would use this in my game the way it is!
  • Maybe, if it was more developed and polished.
  • No, I would not. (Tell me why in the replies!)

0 voters

I do hope that you enjoy using Vex, please report any bugs you find in the replies, and be sure to let me know what you would like to see in the next version!
If you know of a good way to optimize it, please DM me.

Credit

(Credit goes to @Doglord120 for the overall base idea, and certain parts of the code that were not rewritten.)

30 Likes

What I may do is have it voxelize on the client, and then when the destruction occurs, it replicates it to the server. And per part, so nothing will be voxelized on the server until it has been destroyed or interacted with in some way.

3 Likes

I may attempt to do some feat in which it voxelizes on the client via remoteevents and a localscript (Although it does change it from just being modules to localscripts, remoteevents, etc.) since I think the main issue is that the server is having a lot of stress having to replicate everything to the client, meaning that lag can occur, etc.

2 Likes

I will be working on doing it, as built-in functionality. I may not release it for a while, depending on if I can get greedy meshing to work. Having it do tons of complex client and server interactions make it difficult for people to put it in the game, and use it, so I would like to favor greedy meshing functionality over it.

3 Likes

Here from the other post, gonna go ahead and give it a try!

2 Likes

UPDATE 1.5

Vex will now support parts of any size, meaning that you can convert any build made out of parts, no matter the size, into voxels!

Note: Some odd sized parts may result in weird gaps on the Y-Axis, this is being fixed and may just be an edge case.

@IncoSlay
@lilsquish08

2 Likes

Do you like it, now that you can actually use it, haha!

2 Likes

I don’t know if I am doing it right or not but whenever I want the model to NOT be anchored, you would type this correct?

destructionWrapper.voxelize(game.Workspace.House, false)

Whenever I playtest, the model is still anchored.

Edit: This also happens in the example game.

2 Likes

That should work, perhaps I changed a setting by accident. Give me one moment.

Edit: I simply had to carry a variable through a few functions, but it should work now. The 2nd parameter will actually change whether or not it is anchored now. You need to get the new module version.

2 Likes

Could we get a Github? Viewing the code without needing to go through the hassle of opening studio would be nice

2 Likes

Whilst I don’t really use it, I can set one up soon. Should be on the post within 1-2 hours.

2 Likes

How come nothing happens when you try to bomb the House or Parts in your test place?

2 Likes

My bad! I have published and updated the game with the fix.

1 Like

Any update on this? I don’t see a GitHub link in the post.

2 Likes

Any chance for this module to use a greedy mesher soon?

2 Likes

Soon. I recently remembered this and have been tinkering. I also have plans for some neat features. Expect a GitHub repository, greedy-meshing, and some cool new features in 1-2 months.

5 Likes

Great! That will increase performance a lot especially for bigger scale destructions. Looking forward to it!

2 Likes

Just WOW!

Definitely go for the client side damage and possibly implement some checks to assure the positions and things where from the correct player and ensure they where definitely shooting and then go for greedy meshing and I can’t see why this wouldn’t work amazingly.

I can imagine fully destructible maps for battle royal’s being a thing eventually with something like this optimised in the correct formula.

I cannot view your place it states I do not have permission please fix this as I don’t really like downloading anything off people until I’m assured that the thing provided is as advertised, safe, working and implemented correctly prior to taking a copy for myself.

This looks really good, will there be more updates?

1 Like

is there a way to change the size of the voxel itself?

Any plans on continuing this? Its been quite a while sincs you posted this.

2 Likes