Cherreads

Chapter 26 - Chapter 26: Procedural Asset Test

Richard sat hunched over his keyboard, eyes locked on his screen, his hands moving as if possessed. For hours, he wrestled with shaders, trying to get them to compile without errors.

Red text flooded his console.

"Vertex attributes, uniform variables, texture samplers… every single declaration has to be precise." He gritted his teeth. "One mistake, and the whole rendering pipeline collapses."

Every bug he fixed led to another. Missing semicolons, incorrect variable types, precision mismatches between vertex and fragment shaders—it was a delicate balancing act.

Finally, after what felt like an eternity, the shaders compiled without a single error.

Richard leaned back, exhaling. One hurdle down.

Now came textures.

He opened a new file and started defining the CreateTexture() method.

"Loading images, creating texture objects, setting texture parameters… it's about getting pixels from the disk to the GPU."

But OpenGL was unforgiving.

3 Days later.

Artifacts appeared—textures stretching in weird ways, colors mismatched, weird shimmering effects.

"Texture filtering, mipmapping, texture wrapping… OpenGL gives you a million ways to sample textures, and every choice affects performance."

Some settings made textures crisp, others blurred them into mush. Some choices caused flickering, others ate up memory.

Richard tested, tweaked, recompiled—over and over.

Then, on the third night, it finally clicked.

The game world now had flawless textures, detailed and sharp, without a single artifact.

Richard barely had time to celebrate before moving onto the next challenge: the render loop.

"Clearing the screen, setting up the viewport, binding buffers, binding shaders, binding textures, drawing primitives… it's a complex sequence of operations."

He defined the Render() method, carefully organizing every step. Each function had to work together seamlessly.

But the performance was rough. Too many draw calls, too many state changes.

Richard clenched his fists. "I need to optimize this."

Another day passed—this time, focusing on minimizing overhead.

Instanced rendering—to draw multiple objects efficiently.

Indirect rendering—to reduce CPU-GPU interaction.

Multi-draw indirect—for handling large numbers of objects in a single call.

Each method came with its own quirks and complications. But Richard adapted.

By the end of five days, the rendering pipeline was stable, efficient, and ready for more complex features.

He leaned back in his chair, rubbing his temples. His gaze drifted to the ByteBull Studios signage on the wall.

The office was complete now—RGB lighting strips softly pulsing, speakers lining the walls, the dim glow of the monitors reflecting off polished desks.

It finally felt real.

But Richard knew this was only the beginning.

He exhaled, cracking his knuckles.

"Next up—the boss of the entire engine."

A grin spread across his face.

"The Manus. The father of the abyss. The hardest phase. Get through it, and everything else is smooth sailing."

This was where the AI of the VectorCore Engine would be born.

"The phoenix resting inside the egg."

Richard's fingers hovered over the keyboard.

Richard cracked his knuckles, his fingers hovering over the keyboard.

"Procedural generation next."

He opened a new file, labeling it ProceduralGenerator—the core of VectorCore's world-generation system.

"The heart of the engine. Terrain, textures, models… everything starts here."

This section would consume weeks of work.

He started with noise functions—the foundation of terrain generation.

Perlin noise. Simplex noise.

"These are the building blocks. I need them to be fast, efficient, and versatile."

He wrote the NoiseFunction class, creating different algorithms for generating randomness that looked organic.

Days blurred together.

Richard kept tweaking, running tests. Some noise patterns looked too repetitive, others were too chaotic. He optimized until the generation felt natural, unpredictable, yet controlled.

Then, he moved on to fractal algorithms.

Fractal Brownian motion (fBm)—for layering noise and creating realistic landscapes.

Multi-fractal noise—for adding intricate variations in terrain.

"These will add depth and complexity… but they're computationally expensive. I need to optimize."

More days passed.

Every tweak led to a new problem. Some terrains looked like alien planets, others were too flat. Balancing detail and performance was a constant battle.

Richard sighed, rubbing his eyes.

"Style presets."

He needed a way to apply predefined artistic styles to the generated environments.

A data-driven system. Configurations, parameters, post-processing effects.

"If I do this right, artists won't have to touch the code. They'll just tweak sliders and get the look they want."

Richard built a modular framework, allowing terrain generation, texture generation, and model generation to be handled separately but cohesively.

Every part needed its own rules and parameters.

Every part took days to refine.

Then, he took a deep breath.

The physics engine.

He opened a new file.

"Procedural physics… the real challenge. How do I make a system that generates realistic interactions on the fly?"

This would be one of the longest, most brutal phases.

He created the PhysicsEngine class, the beating heart of VectorCore's simulation system.

Collision detection.

Rigid body dynamics.

Fluid simulations.

"Each part is its own beast. Each part requires weeks of work."

He started with collision detection.

Sphere-sphere collisions—for things like rolling grenades or bouncing projectiles.

Sphere-plane collisions—for detecting when a character or object hit the ground.

AABB (Axis-Aligned Bounding Box) collisions—for detecting when objects overlapped in the world.

"The basics… but essential. After this, I'll have to tackle more complex shapes—convex hulls, mesh collisions. That will take even longer."

The more he wrote, the more the sheer scope of the project weighed on him.

But he kept going.

He moved onto rigid body dynamics, simulating forces, torques, and rotations.

Newton's Laws.

Angular momentum.

Friction models.

"It's all about applying the right equations… and making them stable."

One miscalculation and objects would spin out of control.One tiny mistake and characters would jitter, hover, or clip through the world.

But Richard thrived in this chaos.

His brain worked like a machine, piecing together physics, math, and logic into something functional, powerful, and groundbreaking.

As the hours stretched into days, the foundation of VectorCore solidified.

But the true boss battle still awaited.

"Manus… the father of the abyss… The AI system."

Richard grinned.

"Once I crack that, everything else will be smooth sailing."

He leaned forward. Fingers poised. Ready to code.

"Here we go."

Richard leaned forward, cracking his fingers.

"The AI system…"

This wasn't just any AI. This was the soul of VectorCore—a procedural asset and script generator.

Not just for one game.Not just for one genre.

This was a universal AI framework, capable of generating entire game worlds, scripting behaviors, and adjusting itself dynamically based on developer-defined parameters.

It wasn't just an AI for a single title—it was an AI for an entire engine.

A system that would create levels, design NPC behaviors, balance gameplay, and even modify itself in response to changes.

A living, breathing template that could be molded into any kind of game.

"This is where everything comes together."

Richard created a new file.

AI_Core.cpp

This was Manus. The Phoenix inside the Egg.

The Foundation of Intelligence

First, the modular structure.

Procedural Generation AI → World-building, asset placement, terrain adaptation.

Behavior AI → NPC logic, enemy movements, squad tactics, and dynamic adaptation.

Scripting AI → Auto-generates game scripts based on input parameters.

The first goal:"Manus must understand and process templates."

He coded a template system, a universal blueprint that allowed developers to define game rules, world parameters, and AI behavior without touching the core code.

The AI would read these templates and generate assets, game logic, and world elements on the fly.

The Procedural AI had to do more than just create random terrain.

"It must generate entire maps based on logic, not just randomness."

Richard built a layered approach to world generation:

Base Layer: Terrain topology—hills, rivers, roads, cities.

Structure Layer: Buildings, bunkers, trenches, foliage.

Interaction Layer: Spawn points, objectives, AI waypoints.

Detail Layer: Props, debris, lighting, weather effects.

Each layer interacted dynamically. If a road cut through a forest, the AI would clear trees logically instead of overlapping objects randomly.

"A true procedural system shouldn't just generate. It should adapt based on context."

The Birth of Dynamic AI Behavior

Richard created a decision-making system based on Finite State Machines (FSM) and Utility AI.

FSM for predictable behaviors. (Patrol, Attack, Flee)

Utility AI for dynamic decision-making.

"If an enemy is losing a battle, should it retreat? Request reinforcements? Try to flank? The AI should decide based on situation, not pre-written scripts."

Enemies would evaluate their situation dynamically:

Health & ammo levels → Should they push or fall back?

Cover availability → Should they hold position or move?

Squad coordination → Should they attack together or spread out?

This AI wouldn't just react—it would predict.

If a player was sniping from a hill, the AI would learn from previous encounters and deploy counter-snipers or use smokescreens.

The goal?

"No predictable NPC behavior. Every match, every fight should feel different."

The final step was the Scripting AI.

"No game developer wants to write thousands of lines of boilerplate code."

Manus would automatically generate scripts based on developer-defined parameters.

Want a stealth-based AI? Manus would write patrol patterns, sight detection, and guard behaviors.

Need a city generator? Manus would script procedural building placements, traffic, and population behaviors.

Designing a multiplayer shooter? Manus would handle spawn logic, respawn mechanics, and objective tracking.

Richard created an AI-driven code generator that could output Lua, C++, and Python scripts depending on developer preference.

Developers could edit the generated scripts if needed, but the goal was simple:

"Let the AI do 80% of the work. Let humans focus on creativity."

Manus was an idea.

Now it needed to become reality.

Richard spent days writing its core logic.

Errors piled up.Memory leaks, segmentation faults, infinite loops.

Every AI decision tree had to be debugged, every generated script had to be tested.

There were nights when the AI would freeze mid-generation—Richard had to tear it down and rebuild it.

Manus wasn't just complex. It was unpredictable.

But step by step, line by line, it started working.

Richard wiped his forehead and ran the first simulation.

He entered a map template:

"Generate a ruined battlefield, mid-1944, European front."

Manus processed the request.

Lines of code flew across the screen.

In under three minutes, the AI generated:

✅ A full war-torn city map.

✅ Destroyed buildings, trenches, barricades.

✅ Dynamic AI paths, spawn zones, and cover points.

✅ Realistic lighting, weather, and destructible terrain.

Richard watched as AI-controlled NPCs deployed into the city, taking cover behind rubble, moving tactically, adapting to the environment.

He sat back in his chair.

"Holy shit."

Jack walked in, rubbing his eyes.

"Bro… I heard you talking to yourself. You good?"

Richard pointed at the screen, grinning.

Jack squinted.

"Wait. You… you didn't build that map by hand, did you?"

Richard smirked.

"Nope. The AI did."

Jack's eyes widened.

"You mean… the AI generated everything?"

Richard nodded.

Jack stared at the screen for a long moment, watching the AI-controlled soldiers navigate the battlefield.

Then he burst into laughter.

"Holy fuck, bro. You made Skynet."

Richard chuckled.

"Nah. Skynet just kills people. This… this is gonna build entire worlds."

Jack shook his head, still in disbelief.

"We're not making a game anymore, are we? We're making something way bigger."

Richard leaned back in his chair, staring at the glowing lines of code on his screen.

"Yeah."

"We are."

More Chapters