Unity Game Prototype. Shaders, Realtime Distruction, Procedural Weapons

Опубликовано: 20 Май 2026
на канале: Ark
47
0

Hello everyone! I’m continuing my game development journey and would like to share some of the features I’ve been working on—from a dynamic voxel system to personalized weapon generation.

Dynamic Voxel System
I created an phisics system that manages a voxel grid representing walls, which can change in real time. When bullets (or other projectiles) hit a certain area, the engine “deactivates” the relevant voxels, creating holes in the wall.

To handle this efficiently, I use Greedy Meshing combined with multithreaded jobs and Burst compiler optimizations. This way, the mesh is generated as quickly as possible, considering only the exterior faces of the voxels. Additionally, a BFS algorithm identifies and removes “detached” sections, preventing voxels from hanging in midair.

For debris, I rely on an object pool that reuses existing instances rather than constantly creating and destroying them, thus saving resources. A special Task Manager helps schedule critical operations on the main thread, distributing workloads across frames to maintain a stable frame rate.

Memory Optimization
Each voxel stores its properties in a single byte using bit flags. By applying bit-shift operations and AND, OR, XOR masks, I can quickly check which faces are active and what features each voxel has—no large if statements or excessive memory usage needed.

I also employ unsafe code where fine-grained memory control is needed, alongside a resource pool to minimize allocations. This strategy significantly boosts overall performance and stability.

Weapon Generation With Unique Character
I’ve also built a weapon-generation module that assigns each weapon a unique name and backstory. Stats depend on installed modules and skills; these skills determine damage types and even affect the weapon’s name. It’s more than just random generation—I want each weapon to “tell” its own little story.

While I’ve already implemented basic inventory functionality to store weapons, I haven’t yet completed the UI that would let players read all these details. That’s still in development, but the core inventory saving system is already in place.

Enhanced Shader Effects
On the visual side, I developed my own version of HBAO (Horizon-Based Ambient Occlusion). My variant not only adds volume to shaded areas but also blends nearby colors within those shadows—mimicking the real physical process where reflected light can transfer some color to adjacent surfaces.

I’ve also implemented a straightforward yet effective global illumination setup that doesn’t overload the graphics pipeline but still significantly improves the overall visuals.


This combination of a dynamic voxel engine, careful memory optimization, and a deep weapon generation system helps me achieve:

High performance: Multithreading and smart memory usage keep the game running smoothly.
Interactivity and realism: Walls can be destroyed, weapons have their own character, and lighting looks alive.
Flexibility: The system can be scaled and expanded easily—adding new effects or modules doesn’t require a complete overhaul.
I’m looking forward to introducing even more features to make the game world as vibrant and engaging as possible. Feel free to ask any questions or share ideas—I always appreciate feedback. Thanks for Support! I've just rolled out a huge upgrade to the game’s AI—one that treats every explosion, every door you open, and every new passage you discover as a real opportunity for NPCs to outsmart you. They’re not going to ignore a hole you blasted in the wall; they’ll recalculate their route and might flank you from behind. If your allies see a newly opened corridor, they’ll use it to meet you faster. It all happens on the fly, without freezing your screen.

Real-Time Adapting Grid (NO USE Unity Pathfinding)
When you blow up part of a building, the AI immediately recalculates walkable paths.
If a doorway is suddenly blocked, enemies won’t just stand there; they’ll look for alternative routes or set up an ambush in the next room.
Smooth Movement & Cover System
No more NPCs awkwardly jerking around corners: they ease into turns, hug cover, and keep line of sight in mind.
Allies will split up if it makes sense to flank, but cluster together if they need to defend a critical point.
Dynamic Reactions to Combat
Enemy squads try different tactics based on the environment’s changes. If you’re behind a collapsed pillar, they reposition to drive you out.
Doors, barricades, or collapsed debris can become choke points they’ll guard or break through, depending on your moves.
No Performance Drops
Heavy calculations run in separate threads, so your framerate remains smooth, even when the AI is “thinking” hard.
Tasks are broken down into small chunks, ensuring no big lag spikes when large parts of the map change.