Game Development Community

dev|Pro Game Development Curriculum

Blender-PureLight-Jefferson Starship-ShapeEditor-Prefab-LOD

by Steve Acaster · 08/27/2010 (9:44 pm) · 8 comments

Blender ... scourge of Damocles, liberator of ... er ... I don't know ... stuff ...
Also Jefferson Starship.

As free goes, Blender's awesome, but rather lacking of a working DAE importer (no, I haven't tried 2.5 yet). But it's free - so workarounds should be expected. It's not like you've forked out a shovel full of cash for PS and then have to patch the PNG exporter, can't say freebie Gimp ever suffered from not being able to export a standard format ...

I'd been thinking of ways to (re)build a town (again ... and again - dif lol!) since making various test versions, and had come up the idea of using a few stock buldings, repeated through-out the landscape. Basically a detached house, a semi-detached (dual building), a cottage, a large manor house, a church and chapel, a multipurpose large public building with changeable props, and a couple of other things.

And whilst knocking up a detached house in Blender (with 140 collision meshes) I cam across a formula. Exterior Mesh - heavily LODed, Interior Mesh - (just the rooms no details) lods out completely at distance and the exterior takes over, and Props - furniture, stairs and details which lod out once the player is a bit outside. Props is the biggy 5500tris of beds, wardrobes, sofas, toilets, stairs, window ledges - uses 3 textures. Interior is a simple 700 tris, but uses 6/7 textures, and the Exterior has a fair few textures, but quickly LODs down to a simplified single texture (by amalgamating all the materials into a single low-res texture) and Interior also does this, so all good for performance there.

Of course there's one problem ... and that's that the unlit interior looks kinda flat, and in Lowest Lighting is just bloody awful.

PureLight Huzzar. So I decided to tonemap the Interior and Props meshes, giving a little depth and interest to the ambient. Nothing fancy, just a light ambient through the windows, something that doesn't look too out of place if you have in-game sunlight coming in as well.

Also Jefferson Starship.

Now in Max or something, you'd reimport your tonemapped meshes and stitch the whole thing into a file ... but Blender ain't gonna do that, so I cranked out the Shape Editor for a test run. I found that it was easy enough to add a new mesh LOD to my Interior (2 meshes remember, same tris but one has only 1 material) and then a dummy LOD of a single triangle to force the mesh to LODout completely. I soon found that sharing a dummy LOD object with another mesh causes issues so each new LOD/Dummy requires it's own individual dummy LOD object (might've helped if I'd renamed them but nah ...).

Anyhow the upshot was :
Exterior - fully Loded, no tonemaps
Interior - Loded with ShapeEditor, tonemaps
Props - single Lod, Lodsout fast, tonemaps

Also placed correctly, the only thing remaining is to zip them up into a prefab, and drop them into a level as I please. RESULT!

And then I found that somethings can affect lightmapping. SubSurface scattering seems to help lightmaps fight off the power of the ambient and preserve their vibrance.

a.imageshack.us/img821/128/lightmapping.jpg
And as you can see from the above pic, various settings alter the way ambient and tonemaps interact ... and boy, does BL look nice now! Not that I'm ever going to be using it personally ... but someone ... somewhere will.

Also Jefferson Starship.

Did I mention Jefferson Starship? (caution:Flash)Clovis Music Festival. Tip the parking attendants, if they speak with a funny accent that includes words like "ee bye gum" they might be my folks - don't ask my dad to explain cricket ... Last year featured my mum holding back a horde of hysterical middle aged women as they tried to rush the stage and tear the clothes of a teenage Richie Vallens impersonator ... the lucky young bastard!

Of course some of us poor buggers aren't retired so it'll be business as usual on the one man -who's not entirely sure what he's doing- game development.

Talking of which, I had a quick test of close range combat against a melee based foe.


Which was geniunely quite panicky - so I was pretty chuffed with myself.

Now ... do I really need to make roads with sidewalks/pavements as models ... if I don't have curbs then I could just use decal roads ... but curbs do give a rather urban feel ...

... decisions, decisions the pressures of command ...

#1
08/28/2010 (9:25 am)
nice lighting Steve, how much for the rent? That place looks roomy! Are you planning on furnishing the place a bit more? Also, what meelee code are you using (resource?) I'm looking to do Ninja sword combat next - need to make it as accurate as possible.

Chunk kerbs with drainage :)
#2
08/28/2010 (10:12 am)
Cracking combat video, reminds me of the last time I accidentally strayed over the border from Lancashire ;-)

Definitely model curbs in an urban environment IMHO.
#3
08/28/2010 (1:44 pm)
No more props in the house, it'll get too crowded and the Ai are likely to bang into things. Every room has got a couple of large pieces of furniture.

As for melee, it's all done with raycasts. Technically it's a 2 metre energy attack. :P

Yeah, I was thinking modeling mesh roads/curbs/urban environment/stuff ... but am going to have to come up with a better way than before - which was all on one flat level, and I rather like hills ... also previously it was all rather hard-edged ... so I'm thinking smoothed mesh for curbs/roads, solid mesh for walls ... and have steps/ramps going down the terrain at the side.
#4
08/28/2010 (2:15 pm)
The video is pretty sweet. I like how you won't see anything while in the shadows of the trees then you only see the glowing purple zip by. Think it will be rocking to keep it all dark while having small indicators on the zombies to give them away. You could really mess with people to have those indictors not always on but maybe pulsing or only on while the zombies move.
#5
08/28/2010 (5:26 pm)
Great read Steve. Didn't know about the sub-surface scattering trick but the way you describe splitting and lod'ing your model is an approach I've found myself falling into lately.

Oh, and love the atmosphere/feel of the video!
#6
08/28/2010 (9:52 pm)
Great read as always Steve and damn I really do need to get pureLight, gotta ut some pennies aside for it.

#7
08/30/2010 (4:29 pm)
Hey Steve,

Looking good! A suggestion on making roads with curbs... you might check out my resource for MeshRoad, www.torquepowered.com/community/resources/view/18807, which allows you to create a custom profile shape that is extruded along both sides of the road. Should allow you to easily create non-flat roads with curbs. The last time I updated it was for T3D 1.1 Alpha, but I think it should still work with Beta 2. If not, it shouldn't take long to port it over.
#8
09/26/2010 (5:00 pm)
When's your next blog Steve? Getting withdrawal :)