Tales of the Rampant Coyote
Ye Olde Archives. Visit the new blog at http://www.rampantgames.com/blog/ - and use the following feed: http://rampantgames.com/blog/wp-rss2.php


(  RSS Feed! | Games! | Forums! )

Sunday, July 10, 2005
 
Raising a Barn!
So I've moved on to something new. Same game, just a new aspect of it. The opening cutscene is far from finished, but I'm now convinced that there's no significant technical risk to doing it in Torque, and I've learned way more than I wanted to about how the Torque camera operates. I've also learned a little more about animation - the tools, and how it operates in the Torque engine.

Next, I'm developing a very simple level for gameplay to happen. Part of my second "technical assessment" is to have an indoor environment. And I really want to take a crack at level building. Develop latent talents or something. Or at least be able to converse with level designers and not sound completely ignorant. So I crack my knuckles and get going.

Well, not quite. I'm actually a little terrified - I'm not entirely certain where to start. I have dabbled slightly in Quark - I used it to create the roads in the cutscene, and a few months ago I built something resembling an empty concrete bunker, but without so much detail. I created a cube, elongated it, hollowed it out, and then used another brush to subtract out a doorway. Woot. I decided that my first project is going to be a barn, since that's relatively simple, and if I do a sloppy job of it, it'll just make the level appear more "rustic" or "authentic," so it'll all be good. Maybe.

I started by scouring the Internet for photographs of barns. A Google image search gave me roughly 20,000 pictures. There is also a dillapidated barn I see on my way to work every day. One wall is half-rotted away, so I can catch some glimpse of what the interior looks like. I also watched the DVD of an old TV show with a nice barn set design. If there is such a thing as a "typical" barn design, I haven't discovered it - they are a million different variations. I think the Amish have it down to a science with their weekly barn-raisings, but I don't think they ever had computer games in mind.

Anyway, after way more research into barn design than any human being who doesn't have a degree in Agricultural Management should ever have to go through, I begin building my barn, from the ground up. My default texture is concrete. I'm really going for that bunker-look again. When I'm done, I change a couple of textures around, making liberal use of Mayang's Free Textures, the GIMP, and the Seamless Texture Generator. My initial results, an hour or so later, show promise - but once again I have something that's more of a concrete bunker than a barn.

My next step is to retexture things, and fix some undue penetration of brushes. I'm still learning this stuff from the ground up, and I'm not entirely certain what features are supported by Torque's Map2Dif exporter. So I am keeping it really basic. More playing with textures follows, as I try to disguise where the polygons are actually joined together.





After I get the textures looking something slightly less like an unstocked bomb shelter, I begin adding some detail. The barn really needs some support beams in place, so I work on those. The initial effort to throw those into Quark, kinda-sorta lined up with the walls and roof they are supposed to be holding up, take very little time. I feel inspired about how quickly I'm getting the hang of this stuff. It's the last time I feel like I'm making great progress.

When I export all this to Torque, I fly around my newly-modified CinemaCam (now with smooth human control!) and note that all is not well in the barnyard. There are two problems, really. The first is that I'm getting ambient light from outside in my barn. That's not a big deal, except I explicitly set my portal so that it wouldn't transmit ambient light. The second is that some of my support beams, which were so nicely and seamlessly joined together in QuarK and its OpenGL 3D view, have been cruelly separated - and are, in fact, sinking into polygons that there were supposed to only barely touch. Something is not right!
Things get wiggy when they are at non-ninety-degree angles, which makes me think (as a programmer) that there's some kind of precision problem going on. I don't really solve the problem - I just make it go away (temporarily) by snapping things to grid. You guys who know QuARK & Map2Dif, please give me a hand to know how to solve this, because it's rearing it's ugly head in some other areas. (In fact, I can just use some general advice across the board, because I'm making lots of newbie mistakes and I'd like to learn the ins and outs of this the easy way if I can - but the documentation is sparse).

The ambient light thing is a bigger problem, but it turned out to have a similar solution. I first started playing with the portal - toggling it's ambient-light-blocking flag on and off. No dice. I checked the "Search for Holes in map" function in Quark to see if I'd left any gaping holes in my structure, but Quark reported no holes found. So if there WERE holes, they existed only in the DIF file (or Quark was being buggy). To make sure I could tell the difference between ambient light and none, I turned up the sunlight outside, and I made the interior light a very simple point light. I'm using John Kabus's excellent Synapse Lighting Pack, which just makes the lights in Torque just [i]SHINE[/i] (pardon the pun). My starkly-lit barn is now extremely obvious if it's properly unlit from the outside. And my crappy modeling looks so much better in the dark.

The next thing I did was a trick I learned from watching too many Gangster movies - I encased my problem in concrete. Since I'm so good at modeling big, boring, concrete [b]blocks[/b], I just created a whole bunch of them to hole up my barn inside a concrete "dock". The nice, rectilnear shell effectively blocked out all ambient light. The concrete blocks engulfed the edges and corners of my barn, and sure enough, the barn was now dark except for the rafters. Except for Fluffy the Orc, who glowed in the dark.

My trick was to move, reshape, or delete the concrete blocks to expose a limited area of the barn at a time, and see if it remained dark. If not, I knew my problem children lay within the exposed area, so I could focus my search. I also played with the positioning and angles of the concrete blocks a little bit, to see what conditions would cause them to let the outside ambient light in. Yes, I'm thirty-six years old, and I'm playing with blocks. It's good to be a game developer!

My technique works, though maybe not as quickly as some tried-and-true techniques the experts can now inform me about while they mock my newbie-ness. I find that while having brushes that are flush against each other works fine if they are at nice, neat, 90-degree angles, things get sloppy when they are angled a little less cleanly - probably due to some loss of precision in their transition through Map2Dif or Torque. Whatever the case, it pays to be a little sloppy in return, to make up for the precision-loss, and have the brushed interpentrate a little. There's probably some terrific tool in QuARk for making sure brushes are perfectly aligned within a group without the dangers of precision loss, eliminating unused faces, etc. And I'll figure that one out right after I post this blog and enshrine my ignorance for all to see. But for now, that was my trick to making it work.

The end results? Well, I'm not done yet - there's a LOT of detail work left to do, and the barn is missing things like stalls, hay bails, etc. But I think it's looking pretty nice for now. It's not going to make people cancel their Unreal Tournament 2007 pre-orders or anything, but I think it's a good start for a guy for whom the term "Programmer Art" is actually complimentary.

Jay Barnson
Rampant Games
http://www.rampantgames.com



Did you enjoy this post? Feel free to share it: del.icio.us | Digg it | Furl | reddit | Yahoo MyWeb

Comments:
When I'm trying to learn how to do something, I find that it is a lot quicker to just try to do something, no matter how badly. Someone else will always be willing to comment on how wrong I was and will likely tell me how to do it correctly. Asking for assistance before trying to do anything usually results in silence. It happens whether it is with programming, artwork, or apparently sometimes driving. B-)

Besides the experience you gain by doing it, other people seem to prefer to tell you what you're doing wrong rather than tell you where to go to find out what you need to do right.
 
I think you are right. Although I *did* go out and check out some tutorials first... I like to have at least some SMALL idea of the road I'm about to go down.

The barn is looking much better today, and it's pretty much "prototype ready" - not quite good enough for Alpha, but good enough as a test level for the gameplay prototype I'm putting together.
 
Post a Comment

Links to this post:

Create a Link



<< Home

Powered by Blogger