CHAPTER 126: The New Engine and the Children That Grow (Patreon)
Content
CHAPTER 126: The New Engine and the Children That Grow
Daniel looked at the source code of NGN one Monday in February and said something George didn't expect:
"The engine is old."
"It's three years old, Daniel."
"In game engine years, three years is thirty." Daniel turned his monitor screen so George could see what he was seeing: the guts of the renderer, the lighting functions they had written together in 2005, the lines of code that had made Los Santos possible and that now looked like relics of an earlier era. "NGN was designed for PS2, Xbox, and PCs of 2005. The PS2 had 32 megabytes of RAM. The PS3 has 256. The Xbox had 64 megs. The 360 has 512. The PC graphics cards of 2008 have more power than the whole PS2 combined. The engine works on next-gen but it doesn't take advantage of next-gen. It's like putting a Civic engine in a Ferrari: it moves, but it doesn't run."
George knew Daniel was right. NGN had been designed with the modularity that allowed modules to be replaced without rewriting everything. That was the point of the original design, the foresight George had had in 2005 because he knew, with the certainty of someone who remembered the future, that the engine was going to need to grow. But replacing modules wasn't the same as updating: some of the core modules, especially the renderer, were built on hardware assumptions that were no longer valid.
The NGN renderer used forward rendering: each object was drawn completely with its lighting before moving on to the next. It worked well with few lights. With many lights, the cost multiplied exponentially. In Los Santos, George had limited the lights to 8 simultaneous on PS2 and 32 on PC. In The Witcher, a tavern could have 15 candles, a fireplace, and the moonlight coming through the window. In Dark Souls, a dark zone with torches could have 20 light sources in a corridor. Forward rendering wasn't going to handle that.
"We need deferred rendering," Daniel said.
"I know," George said. "It's the first thing on the list."
* * *
Deferred rendering was the technique George had seen define the engines of the next generation.
The idea was elegant in its simplicity. Instead of calculating the lighting of each object as it was drawn, the engine drew all the geometry first into several buffers, position, normal, color, material, and then calculated the lighting in a separate pass over the buffers. The advantage was that the cost of the lighting didn't depend on the number of objects but on the number of pixels on screen. A thousand objects with 50 lights cost the same as 10 objects with 50 lights. The lighting was calculated once per pixel, a single time instead of once per object per light.
Daniel led the rewrite of the renderer with a team of three programmers. George contributed the architecture: he had seen deferred renderers in 2024 and knew exactly which buffers to use, how to organize the lighting passes, and which were the traps that cost months if you didn't avoid them from the start. The biggest trap was transparency. Transparent objects, glass, water, particles, smoke, didn't work with deferred rendering because the geometry buffer only stored the nearest surface. A pane of glass that let you see a wall behind it didn't fit in a system that only remembered one surface per pixel.
George's solution was a hybrid system: render the opaque objects with deferred and the transparent ones with forward in a second pass. It added complexity but it solved the problem and preserved both the lighting and the transparency.
"It's elegant," Daniel said when he saw the architecture.
"It's the standard solution in five years," George said, and then he corrected himself with the speed of someone who says a truth and needs to disguise it as an opinion: "It's the logical solution if you think about it enough."
Daniel looked at him with the curiosity of an engineer who notices that his director knows things he shouldn't know. Eight years and Daniel kept noticing. Eight years and Daniel still didn't ask more than once. There was something in Daniel George respected deeply: the ability to accept that certain questions didn't have answers one wanted to hear, and that the results mattered more than the explanations.
* * *
The second upgrade of the renderer was ambient occlusion: the effect that the corners, the cracks, and the nooks were darker than the exposed surfaces. In real life, the ambient light bounced off all surfaces, but the corners where two surfaces met received fewer bounces because the surfaces blocked each other. A corner between a wall and the floor was darker than the center of the wall or the center of the floor. The effect was subtle but the brain registered it as depth: without ambient occlusion, a room looked flat. With ambient occlusion, it looked three-dimensional.
George implemented SSAO, Screen-Space Ambient Occlusion, using the depth buffer of the deferred renderer. The cost was 2 milliseconds per frame on PC, 3 on PS3, 2.5 on Xbox 360. It was the price of an effect that made every room, every street, every cave of the game look like a space with volume instead of a space painted on a screen.
Marcus saw the SSAO applied to a test interior, a tavern with tables, chairs, and a fireplace, and stood in front of the monitor for thirty seconds without saying anything. It was a long time for Marcus, who normally processed the visual with the speed of someone who had spent his whole life looking at things and deciding whether they were right or wrong.
"Now it looks like a place," Marcus said.
"It didn't before?"
"Before it looked like an image of a place. Now it looks like I can go in and sit down. The corners have shadow. The chair legs touch the floor with shadow. The wood of the ceiling looks heavy because the junction with the wall is dark. It's millimeters of shadow, George. But the millimeters are the difference between photo and reality."
* * *
The Witcher needed forests. Dark Souls needed caverns with moss and dead trees. Los Santos had had palm trees and grass. But palm trees and grass weren't a forest.
Daniel and George designed a procedural vegetation system for NGN 2.0 that generated trees, bushes, grass, and flowers based on simplified biological rules. Each type of tree had a growth algorithm: a trunk that branched according to parameters of density, angle, and depth. An oak had thick branches with open angles. A pine had thin branches with closed angles. A willow had branches that drooped. The parameters defined the species. The randomness within the parameters defined the individual: each oak was different from every other oak, but all the oaks were recognizable as oaks.
The leaves were billboards: planes with a leaf texture that faced the camera, grouped in clusters of 10-20 that simulated the volume of the foliage. At a distance, a tree with 200 billboards looked like a tree with thousands of leaves. Up close, the individual billboards were visible, but the brain processed them as foliage because the texture and the color were right. It was the same technique as the Los Santos impostors but applied at a microscopic scale, each leaf a small deception the eye accepted without resistance.
The grass was a separate system George implemented as a geometry shader: each blade was a triangle generated directly on the GPU based on the density defined by a texture map. In zones of dense grass, the GPU generated thousands of triangles per square meter. The grass reacted to the wind with a sinusoidal function that swayed it, and to the player: the blades parted when the character touched them. Daniel optimized the grass for the three platforms. PC: maximum density with reaction to the player. Xbox 360: density at 70% with reaction to the player. PS3: density at 50% with no reaction to the player because the Cell processor of the PS3 was powerful but strange, and the geometry shader didn't translate well to its architecture.
"PS3 has grass that doesn't move," Daniel said.
"Is the difference visible?"
"If you run through a field of grass on PC, the blades part at your step like the sea opening. On PS3, you run over a green rug. It's different. But no one who plays only on PS3 is going to know what they're missing."
"Then it's enough."
"For PS3, it's always ‘enough.’ That console is a badly documented engineering miracle."
The physics module was updated with limited environmental destruction: small objects, crates, barrels, furniture, ceramics, that broke when the player or the enemies hit them, splitting into precalculated fragments that separated with ragdoll on impact. It wasn't total destruction of the environment. But the difference between a fight in a tavern where the tables broke and the jugs flew through the air and a fight where everything was static was the difference between a shootout in a movie and a shootout in a theater.
The streaming was updated for bigger worlds. The chunks of NGN 1.0 were 384x384 meters, designed for Los Santos. Those of NGN 2.0 could be of variable size: 512x512 for the open forests of the Witcher, 128x128 for the dense corridors of Dark Souls, and dynamic for the vertical zones where height mattered more than horizontal extension. And the streaming prediction was improved with a system that anticipated the direction of movement and also read the triggers of the level design: if Elena placed a mission trigger that sent the player north, the system pre-loaded the northern chunks before the player moved. It was narrative prediction: the engine knew where the story was going before the player did.
* * *
NGN 2.0 was completed in April 2008. Three months of work by Daniel and his team of ten programmers.
George compiled the updated engine and opened a test scene he had built over the last week as a showcase of everything new: a forest with procedural trees whose branches swayed with a wind that didn't exist, grass that rippled like a field of green wheat under a sun that cast dynamic shadows, a stream that reflected the trees with the water shader inherited from Los Santos but improved with screen-space reflections, and a cabin with an interior lit by a fireplace and six candles whose flames flickered and whose shadows danced on the walls with the irregularity of something real. An NPC walked down a path with IK that adapted its feet to the irregular terrain, stepping on roots and stones without floating or sinking.
The scene ran at 60 fps on PC, 30 on PS3 and Xbox 360. It was a postcard of a world that didn't exist yet, more than a game. But it proved that NGN 2.0 could render both the forests of the Continent and the caverns of Lordran.
Daniel watched the scene run for a minute. Then he said: "It's a different engine."
"It's the same engine. With new modules. That was the idea from the start: that the modules could be replaced without rewriting the whole. We designed it that way three years ago."
"You designed it that way. I just implemented it."
"I designed it because I knew I was going to need to update it. An engine that can't grow is an engine that dies with its generation."
Daniel nodded. He didn't ask how George had known in 2005 that the engine would need deferred rendering in 2008. Daniel had stopped asking those things years ago. The answers didn't matter. The results did. And the result was an engine that could sustain two worlds simultaneously: one of Slavic swamps and taverns with candles, and another of Gothic ruins and bonfires in the darkness.
* * *
Claire raised the idea of the ports before George.
"We have three games people bought on PS2, Xbox, and PC before the new generation," Claire said in the March meeting, with the whiteboard behind her and the blue marker in her right hand like a natural extension of her body. "There are 25 million PS3s and 28 million Xbox 360s in the world. The players who bought our games on PS2 now have a PS3. The ones who bought on Xbox have a 360. And they can't play our games on those consoles because our games are from the previous generation."
"Are you proposing remasters?" George said.
"I'm proposing sales." Claire wrote the numbers on the whiteboard with the precise handwriting that distinguished her: Castlevania, 9 years. Isaac, 7 years. Hollow Knight, 4 years. "All three keep selling on NG Store in the PC version and in physical format on original PS2 and Xbox. If we port them to PS3 and 360, each game has a new market of millions of players who don't have them. Los Santos has been available on next-gen since the 2007 launch."
George had considered it, for another reason. Claire saw sales. George saw the four games running on NGN 2.0 with the fidelity the original hardware couldn't offer. Castlevania with dynamic lighting over the sprites. Isaac with hundreds of items on screen with no framerate drop. Hollow Knight with the City of Tears reflections in real resolution. Los Santos with no fog at 800 meters.
"We make them," George said. "All three. But they aren't ports. They're upgrades."
* * *
Castlevania: Symphony of the Night had come out in 1999. Nine years earlier. The sprites Marcus had drawn with his left hand in a Fulton Street apartment were 32x48 pixels for the characters and 16x16 for the tiles. On a 480p screen, those sprites looked sharp and detailed. On a 1080p screen, they looked blurry: each pixel was multiplied by four, and the edges that were invisible at 480p became visible staircases at 1080p.
Marcus proposed the solution George hadn't considered.
"We don't redraw the sprites. We don't scale them. We leave them exactly as they are and we change everything around them."
The idea was to keep the original sprites without modifying a single pixel, but render them over high-resolution backgrounds with the dynamic lighting of NGN 2.0. The 16x16 tiles were replaced by 64x64 tiles Marcus redrew with four times more detail. The static backgrounds of the castle were replaced by backgrounds with multi-layer parallax that gave them depth. And the lighting: the castle's torches now emitted light maps that cast shadows of the sprites against the walls. Alucard walked and his shadow walked with him, lengthening and shortening according to the position of the nearest torch.
"The sprites are the same," Marcus said when he presented the next-gen version to the team. "Every pixel of Alucard is the same pixel I drew in 1999. But now Alucard has a shadow. The torches flicker. The backgrounds have depth. It's the same game in a new frame."
The framerate was 60fps locked. George added extra enemies in the zones that needed them, to fill the spaces that in the original version were empty because of hardware limitations, without altering the balance.
Isaac was the technically simplest port and the most transformative visually. The procedural generation was accelerated from 3 seconds per floor to less than half a second. And the items: in the original version, Isaac could have a maximum of 15 simultaneous active items. On next-gen, the limit was raised to 40. The synergies the players had spent seven years theorizing about but never being able to test now worked: 30 stacked items produced an Isaac transformed into an unrecognizable creature that fired 20 projectiles per second in 8 directions. George added 15 new exclusive items that broke the established meta and that the veterans would have to discover from scratch. The Isaac community on NG Store received the news with the intensity of a religious group that discovers a new chapter of its sacred text.
* * *
Hollow Knight was the game that benefited most from the upgrade, because it was the most visual. The watercolors. The rain of City of Tears. The bioluminescence of Greenpath. Each zone had a visual identity that at 480p was suggested and that at 1080p was revealed like a painting someone had kept covered with a veil and that you could now see complete.
Marcus refined every tile: he added veins to the Greenpath leaves that didn't exist in the original version, reflections to the City of Tears raindrops that the PS2 hardware couldn't calculate, surface textures to the Fungal Wastes mushrooms that suggested moisture. The City of Tears rain was the most visible improvement: the drops now created ripples in the puddles, reflections on the surfaces, and a screen-space reflection effect that made the wet ground reflect the buildings and the lanterns like an imperfect mirror.
Lena recomposed the audio: more channels, more stereo separation, more dynamic range. "It's like hearing the album instead of the radio," Lena said. "The same music. But now you can hear every instrument."
The three ports together represented the historical catalog of NGS reaching the new generation. "It's the same game," Daniel said. "But without the crutches. It's Los Santos as it should have been from the start."
* * *
The three ports came out between June and September of 2008. Castlevania: 45,000 copies. Isaac: 38,000. Hollow Knight: 62,000, the best-seller, with the City of Tears reflections turned into the most shared screenshot of the year. Rachel Kim wrote a line George kept: "City of Tears was always beautiful. Now it's devastating."
200,000 copies combined in four months. Development cost: $400,000. Claire calculated the ROI in the October meeting:
"Four hundred thousand of investment. One million eight hundred thousand of revenue in four months. A return of 4.5x. It's the most profitable project we've done."
"More profitable than Los Santos," George said.
"Per unit of investment, yes. Los Santos cost fifteen million and generated two hundred million: a ratio of 13x. The ports cost four hundred thousand and generated one million eight hundred: a ratio of 4.5x."
Claire wrote the numbers on the whiteboard with the contained satisfaction of someone who has proven something she already knew. And the first time NG Store offered upgrade pricing: the players who already had the PC version received a 50% discount. $7.49 instead of $14.99. Claire implemented it as a permanent policy: if you bought an NGS game and an improved version came out, you paid the difference, not the full price.
George didn't respond to the numbers. The math didn't capture what the ports represented beyond the dollars: four games that had defined NGS, updated for a new generation, living on new hardware with the fidelity they deserved. The ports were an act of care. The care of a creator who returns to his previous works and presents them as he always wanted them to be.
But the act of care turned out to be the most profitable project in the history of NGS. And that, George thought as he looked at the numbers on the whiteboard, was the best kind of coincidence: when the right thing and the profitable thing were the same.
NGN 2.0 was ready. The four children had grown. Now it was time to build the two new worlds that waited in the notebooks on the shelf. But first, there was a wedding and a decision about how to organize a studio that was about to double its size.
End of Chapter 126