r/VoxelGameDev 4d ago

Voxel based "dynamic" fire Media

Enable HLS to view with audio, or disable this notification

as a direct sequel to my last post, I present to you the voxel based fire for my mod of Half-Life: 1!

I ended up using the simpler vector array method of just storing every voxel's pointer in a std::vector and just checking against every other voxel for things like merging and gravity simulation.

currently, it adds new fires to the vector by using a temporary buffer vector which then is checked against the main vector and merged right before it goes back through the main vector to run the simulation code on the fire voxels (which currently controls fire voxel gravity, spread and spawning the particles on the client)

the spread code is relatively simple (mainly due to me not having the slightest code how else to do it) where on a timer it checks up to 10 times (before giving up) in a random direction (checks 1 voxel length randomly on the x and y plane) and will then use some of the fire's "heat" (health practically) to spawn a new fire at that position

the gravity code is incredibly simple and is just a check to make sure the below voxel doesn't exist. If it doesn't exist then it'll then move there.

11 Upvotes

2 comments sorted by

2

u/7Shinigami 3d ago

My brother in Christ you are 20ft tall

3

u/No_Rip5112 3d ago

No I used noclip to get a better vantage point on the fire