
I've been doing a bunch of experimentation on the side with this engine, noodling problems and issues we're all pretty familiar with. They all got lumped into one map through various circumstances, and I've decided that even though it isn't a proper map I'll release it anyway. Hopefully people can pick up some ideas from my methods. The map is called 'Strombine,' which I'll explain below.
The first thing I tackled was a realistic setting, including textures. That was just a personal learning process for me, to try and make something other than rusty metal look realistic in diff/norm/spec (and to make the rusty metal look better). I've drooled on sites like opacity.us for years so I finally emulated the ruined factory setting a little more closely. Concrete and brick walls with paint flaking off and showing the material underneath was especially fun, as was gathering tons of photos of rusty dumpsters and shit and building a library of rusty scratch marks to mask off effects on worn metal textures. Plus, paint wall diffuse + brick wall normal = instant painted brick!


I could have done a hell of a lot more here, because the place is still nowhere near as dirty as it could and should be. I considered using models with vertex blends for flat floors to get a much better piles-o-dirt effect than I could with just decals but ultimately didn't bother. That's something for me to remember to try on the next project.
One of the engine issues I tried to tackle was how texture variety kills performance by splitting batches. The idea I wanted to try was to build the map in something slightly more akin to the Geometry Competition process, with fewer larger and more featureless textures to model forms, and liberal use of decals on top (paged for batchiness) to add all those missing stains and seams and construction tells to the brushwork that are normally baked into the textures themselves. The idea is you get a lot of variety instead of repeating the same 128x128 panels all over, and also more freedom with brushwork, because texture application would be much more fluid and receptive, because you place all the welds and edges by hand. The big green machines around the map were built the same way - two big painted-metal pages, put together over a myriad of different machine-looking shapes with some rusty edge-trim applied wherever necessary.
Performance-wise it worked great: the main room of this map has about 160k triangles in the worst corners but runs as if it had a third of that. Visually, though, it's painfully apparent that the map is just some big plain textures with decals all over them. I may simply have just not really taken the best approach with how I balanced one against the other. The very regular and functional architecture in this map was probably really not the way to test the idea but I had it on the brain and couldn't help it. Ultimately it weakened the map by making it look bare and empty. I'm still not fully convinced it's a COMPLETELY terrible idea, and I think it might work better when used in a more gregarious fashion - ie, more obvious 'sweeping' decals rather than fiddly edges, with zany nunuk-esque geometry that actually warrants this kind of liquid approach - and backed up by a little more traditional texturing.
I'd actually originally planned to try this in Lun3DM5 (which I am working on), but the Q3 engine doesn't really necessitate that at all (god, what a workhorse) and it was getting to be kind of laborious to apply all the decals. I always wonder why work in procedural textures is always on purely computer-generated textures when there's seemingly clear advantages to be had in a system that combines some artist-created material content with procedural alteration, affected by the geometry the texture is applied to ... but whatever.

Another issue was the perennial favorite, the lighting. D3/Q4 clearly can't do reflected light very well - bounce lights with shadows are kind of ugly and obvious and also expensive to layer, bounce lights without shadows look ugly and obvious for other reasons, and the ambient (to anyone with at least one eye open) just sucks.
Or does it?


I was poking around the fragment programs the engine uses for light shaders (four image lookups per pass, woo!) and I came to the realization that, if the engine has to split batches per light anyway to set up new light origins for the vector math, it is to your artistic advantage to paint a unique image for every light source. You've gotta design the shapes of your rooms with the light volumes that'll go into them in mind, but if you do that right you can fit one or two ambient light volumes over the room with maps painted to match just the lights and geometry in that room. The ambient usually looks so horrible because it's a consistently even brightness throughout the volume (that and the lack of normal shading in d3, which q4 'fixes'), but by painting light images for them you can get the smooth gradations that you'd need to better simulate scattered light. If you've got brightly colored surfaces in the room you can even fudge in a little colored radiosity ala the Cornell Box.
You can do this for the direct light sources too (which you'll need far fewer of with the improved ambient), adding blurry shadows on the broad axis. I exploited this a bit in Strombine by rotating light volumes and putting them in long hallway-like spaces sideways to put the least-controllable axis of the light (the z) on the most linear axis of the room. Check out the lights in the three side rooms for good examples. Characters and smaller details still cast hard-edged shadows, but character shadows not matching world shadows isn't yet the cardinal sin Doom3 makes it out to be, so I didn't worry.
This worked out a lot better than the texturing thing, and I didn't even take it as far as I could - golden sunlight piercing into a room at an angle and throwing a localized bounce while the rest of the room is lit blue by scatter from the rest of the sky, etc.
An idea I'd like to try next is to ditch the normal shading on the ambient light and instead have the ambient.vfp multiply diffuse by its alpha channel, and paint in custom shading and fuzzy shadowing for each diffuse map in the alpha that would only be applied by that kind of light. Naturally this would only work with all custom textures.
The gameplay is nothing to really scream about. I was having fun in Doomscript trying to pull off some gameplay-related functionality other than scripted sequences you just sit and watch, and I had succeeded in reproducing a few things from HL2:
- the boxes that always have ammo in them when you open them (the marine box and lid with an invisible gui on a patch over the box that triggers the lid and an item spawner)
- big tempting cranks that slowly raise doors while you hold them down (same gui trick with sloppy state-based door and wheel behavior that responds to mouseDown and mouseUp)
- the laser-beam Combine snipers that shoot physics objects when they can't see you (hundreds of lines of terrifying Doomscript AI)


The map has good examples of how all three are implemented - feel free to steal them.
Wanting to try the snipers out in a real map context influenced the design of the main room, which is why it feels so empty and spacious. (Making it a train station instead of a factory would have given the map a lot more reasons to look like it does.) I had an idea for tying the other two things into the same scenario - play it and see

I had to explain visually why there were Strogg in this realistic factory, though, so I busted out the Q4PowerPlant set and added some burrowed-in bunkers that admittedly are also pretty much just like HL2. I acknowledge this with the tongue-in-cheek title "Strombine."
[ Download from lunaran.com (61 MB) ]
Put in a mod folder, run game with +set fs_game (I didn't include whatever random text doohickey you have to have to make it show up in the mods menu), 'map lunaran/strombine' and have fun.