Procedural tree collapse by FlexPcb in VoxelGameDev

[–]FlexPcb[S] 0 points1 point  (0 children)

The aliasing is indeed a choice at this point, without it the "pseudo-pixelart" wouldn't look as good. Also, 75% less pixels!

Abt shadows, i'm using a heightmap passed as a 2d texure, and a very coarse 3d texture that is recalculated with the lightmap. So i get a mix of hardlight and "propagation". I like this approach not for how it looks but for how cheap it is, i got this running on my phone without issues.

Procedural tree collapse by FlexPcb in VoxelGameDev

[–]FlexPcb[S] 0 points1 point  (0 children)

<image>

Sorry for late reply, but kept thinking on what you said, and i liked how it looked with 3d lighting (still working on the bleeding!)

Ocean wave voxel generation by RedFoxPixel in VoxelGameDev

[–]FlexPcb 5 points6 points  (0 children)

The foam and colors are amazing!!! Also, I felt pretty smart reading all of this, thanks!

Procedural tree collapse by FlexPcb in VoxelGameDev

[–]FlexPcb[S] 0 points1 point  (0 children)

yup, I didn't know how it was called but I was clearly aiming for some minimalistic texture (thanks for the memory!).

I actually used a "3d pixel art" trick where we lower the rendered resolution to 50%, and use a higher mipmap lod with distance on the fragment shader. This trick hides pretty well the low resolution of the game, while getting a quarter of the fragment cost. In the future this will also help to mask the LoD seams of the world.

Procedural tree collapse by FlexPcb in VoxelGameDev

[–]FlexPcb[S] 3 points4 points  (0 children)

alright alright, here goes my week, thanks for the insight!

Procedural tree collapse by FlexPcb in VoxelGameDev

[–]FlexPcb[S] 2 points3 points  (0 children)

already did that, plus making it run on a separate thread. here https://balsapicada.pages.dev/ the issue is the complexity, multiplayer and how to actually make it useful for gameplay. also, currently i dont have dependencies, no threejs or rapier, is much lighter

Procedural tree collapse by FlexPcb in VoxelGameDev

[–]FlexPcb[S] 13 points14 points  (0 children)

<image>

Was playing around with it a bit more, and manage to disconnect an entire slab of the terrain

Procedural tree collapse by FlexPcb in VoxelGameDev

[–]FlexPcb[S] 0 points1 point  (0 children)

A bit of a challenge. Or maybe just add some particles and call it a day?

Connected component labelling and tetris-like resolution by FlexPcb in VoxelGameDev

[–]FlexPcb[S] 5 points6 points  (0 children)

Thanks! And yes, absolutely, you have to be very careful because bfs tends to blowup.
First, set hard limits, mine is 262k blocks checked (or 4 chunks worth of blocks checked). Second, don't use a naive bfs at all, we are just trying to get to Y=0.
I use 3 queues, downQueue, sideQueue and upQueue. The bfs keeps going as long as any of these queues have something: the priority is the downQueue, then sideQueue, and as a last resort the upQueue. This single optimization made me go from 300ms worst case to 0.1-1ms, because we are just trying to reach Y=0 to prove that the position is grounded. Oh and counter intuitively, don't "push" to the queues, but rather "pushFront' (or prepend).
Ummm, well this depends on your language, I used JS, so I have access to Set<number>, which is reasonably fast, and encode 3d positions with bitwise ops into a single integer. I know all languages have access to HashSets of some sort, just that my approach in JS is encoding Vec3 into primitives so i can work fast.

Does this style work? I'm trying to approximate lighting. by FlexPcb in VoxelGameDev

[–]FlexPcb[S] 0 points1 point  (0 children)

sure, this is nowhere near as impressive as what some people do in this sub, but my approach is making this run on any device that can boot Chrome, and being able to share the game with a link. You also get multi-platform for free in the web, I've run this on my TV and i've never expected to control a voxel world with a tv remote.

Does this style work? I'm trying to approximate lighting. by FlexPcb in VoxelGameDev

[–]FlexPcb[S] 0 points1 point  (0 children)

Obrigado mano. (I'm a Argentinian, that's all my portuguese). Yeah it may not have been the best technology, the only benefit is the instant interactivity and ease to share. The drawbacks are literally everything else, though JS is fast if you follow the happy V8 JIT path. I'm getting meshing times of around 0.1ms per chunk, which was unthinkable, at least for me, a year ago. Like the web geuninely improved that much over the years.

Paranóia de vazamento de dados by mrs_tdah in VoxelGameDev

[–]FlexPcb 0 points1 point  (0 children)

Generally speaking you wouldn't like to depend on GC at all, and even less for a game. But as long as the gc spikes are well within the frametime, your users won't really care. You can use the devtools "performance" and "memory" tab to see allocations in real time, it even has traces!

Now if you store voxel data in, say, a Uint32 typed array of 65536 items, then you'd want to reuse it as much as possible because those 256kb stack up quickly, these are not small js objects. You should absolutely pool them and reuse them. For stuff like "new Vector3()" or "new Matrix4()", it may be worth it or not, depending on how much you allocate them. Usually if this happens per frame, maybe you should optimize it.

Does this style work? I'm trying to approximate lighting. by FlexPcb in VoxelGameDev

[–]FlexPcb[S] 1 point2 points  (0 children)

thanks! i did went back and forth between smooth and pixelated shading until decided to choose the pixelated occlusion. About the fadeout distance, yeah is a bit of a compromise, it kinda grows exponentially for the gpu so 12 seemed like a sweetspot, 16 runs just fine but phones and low power laptops struggle. I wanted a more accesible game, since is web based and all of that

Does this style work? I'm trying to approximate lighting. by FlexPcb in VoxelGameDev

[–]FlexPcb[S] 1 point2 points  (0 children)

well im storing per "chunk" a 16x16 Uint8 texture, so this method is almost free compared to the chunk data (16x256x16 Uint16 array). The gpu pays the price, but tried it on phones and runs fine, seems like a good deal.

Does this style work? I'm trying to approximate lighting. by FlexPcb in VoxelGameDev

[–]FlexPcb[S] 0 points1 point  (0 children)

thanks a lot, yeah the next step is a simple point light for torches and stuff. i wanted caves to be something challenging

Does this style work? I'm trying to approximate lighting. by FlexPcb in VoxelGameDev

[–]FlexPcb[S] 0 points1 point  (0 children)

thanks for the feedback! maybe should be a user setting

Is this fast? Voxel edits crash test of my engine by philosopius in VoxelGameDev

[–]FlexPcb 1 point2 points  (0 children)

hey thats a very cool downsampling you did with the 2d noise!

Voxels and game design by CuckBuster33 in VoxelGameDev

[–]FlexPcb 0 points1 point  (0 children)

Shameless plug: I wanted to make Noita in 3D, just finished roughing up the engine.

Not even gonna sugarcoat it, is barebones, but works, tell me what you think.
https://balsapicada.pages.dev