Friday, May 27, 2011

Animating Avatars

I've started on a side project to create a tool to make it easy to create animations for avatars (whew, what a string of infinitives!).  Once I'm done with it, I may release it as an open-source tool for the community, assuming the community doesn't already have something better!

After that, I'll be tackling XACT.

Wednesday, May 18, 2011

Monetization

I don't think (m)any people read this blog yet, but I've gone ahead and added AdSense advertising to the layout.

So.  Despite your best intentions, please do not click the ads unless you're genuinely interested in the advertised product.  If AdSense has any reason to suspect click fraud, I could have my account suspended.

Thanks!

Apparently, 12,000 Vertices is a Lot

I discovered that the slowdown had nothing to do with my camera class, and possibly everything to do with something called predicated tiling.  In short, the Xbox has but 10 MB of high-speed video RAM (a major WTF factor for many developers, although clearly a well-designed game can make do).  When rendering in 1080p resolution, that means there's a good bit of memory shuffle going on in order to get everything drawn.  When "everything" is 12,000+ vertices, that means a LOT of shuffle, and draw cycles don't complete on time.

So, for now, I've dropped back to rendering at 720p.  I don't like the loss of resolution, but it eliminates the problem.  Later I will start to investigate mechanisms for only drawing subgroups of vertices that have a high probability of being visible.

For now, I think I am going to focus on gameplay.  I have three or four main modes of play in mind, each of which shouldn't present an insurmountable challenge, and together should make for a game with plenty of replay value and should sell pretty well.

Monday, May 16, 2011

Falloff and Avatars

Yesterday's coding resulted in:
  • Finishing the geometry for all useful maze cells (I decided to skip the completely enclosed cell, as you can't get inside it anyway...)
  • Tweaking the normal map for a texture to make it look more totally awesome
  • Adjusting the shader to implement light falloff (things that are farther away appear dimmer according to the Inverse-Square Law)
  • Making the maze walls "work" (not allowing the player to move through the walls)
  • Putting a You-Are-Here blip on a 2D map view
  • Putting the first NPC avatar into the maze
I also decided to have a little fun, and make the NPC avatar dance when the player enters the same cell.  A sort of "yay, you found me!" dance.

While I was at it, I also discovered that the class I've created to implement a camera with Yaw/Pitch/Roll controls has a bug that I cannot seem to chase down.  Adjusting the Yaw parameter sometimes leads to a slowdown in the game.  Actually, I'm not sure the camera class is to blame yet, but it seems a prime suspect.

I also had some fun with rendering.  I added some code to generate an anaglyph stereo image.  Of course it means the colors get distorted, but the effect is pretty exciting.  Unfortunately, the method I've chosen for actually rendering an anaglyph is very time-consuming (because it involves resolving two render targets, which are expensive operations) and blows the framerate to heck. Ah well, the price of coolness.  I'll figure out a way to optimize it if I decide to put it in the finished version.

Anyway, all of this adds up to one very excited Brian!  Nothing like learning new things and making stuff work to really fuel the fire of determination.

Sunday, May 15, 2011

Progress and Learning!

Today I learned how to use tangent and binormal vectors plus a custom shader to implement normal maps.

I also began work on basic rendering of my maze data in three dimensions.  It's a bit tedious; I've taken the path of generating vertex data dynamically and that means a lot of lines of creating new vertices.  Basically, imagine that a maze is made up of four-walled cells (as visible in the video a few posts back).  If each of four walls can either be open or walled, there are sixteen total possible combinations.  That means sixteen different sets of 32 dynamically-generated vertices (give or take), for a total of 512 hard-coded vertex coordinates.

Now of course, there's a lot of duplication.  I can, for example, generate vertices for a cell with one wall, then rotate it to generate the other three one-wall cells.  Same applies for a cell with two and three neighboring walls. Then there's two parallel walls, which only has two unique forms.  So that cuts down on some of the trouble.  Nevertheless, it remains tedious.  I'll be glad when that part is done.

At any rate, I certainly came away from today's coding with a sense of accomplishment -- normal maps work, and the 3D cells I have completed look awesome on screen.  Maybe some pictures when I get all the cells defined.

Friday, May 13, 2011

Texture Wrapping Trouble

We all have stupid days sometimes.  Tonight I can't figure out why a texture isn't tiling properly.  I've got a thread over at the XNA forums.  Check it out here.  Chime in if you know anything!

Update: Resolved within hours, thanks to the great folks at the XNA forums.  Now my texture is tiling, and the world is once again saved.

Gee Thanks, Blogger...

Dear Blogger,

Please regurgitate the post you gobbled up from my blog.

Sincerely,
Brian.

But seriously folks, I had a post called "Amazing!" that has vanished and I have no idea why.  It's just gone!  It was a nice long post and even had a video, too...

EDIT: See, somewhere Blogger still even thinks it exists:


...How frustrating!

Another update:  It seems this is a known issue.  Here's hoping my entry is restored.

Another update:  Looks like it's back.  Thanks, Google!

Thursday, May 12, 2011

Amazing!

I've started a new, hopefully quick-to-market project since I've watched most of my other main ideas grow into incredibly involved behemoths (that's not a bad thing; just means I need something else quick to make some money in the short term).  So I've come up with a new idea.  I won't go into any specifics yet (industry secrets and all!), but I will mention that it involves randomly-generated rectangular mazes.

So tonight I started the project and, in the course of about four hours, have implemented a maze generator that uses the Recursive division method.  Since this is all very early proof-of-concept code at this point, I added some extra fluff to the generator which allows single-stepping through the generation process (which is reflected by a very simple sprite-based depiction of the maze data).  It may be a very simple algorithm, and it may be a very simple proof of concept, but by golly it's cool to see it work!  In fact, let me not simply say it's cool.  See for yourself!

video

Cool, right?  Right?...okay, so maybe I'm easily entertained.  Nevertheless...  I now have a simple mechanism to generate maze data for me to use in the game.  Now I can move to actually using the maze data for its intended purpose!  (The potential collaborator I mentioned in the previous post?  I've asked him to implement a different generation algorithm known as the Randomized Prim's algorithm.  Different algorithms result in mazes with different "character".  I'll probably wind up using a variety of algorithms in the finished product.)

Tuesday, May 10, 2011

The Team Grows?

Tonight at a meeting of my Dungeons & Dragons group, I mentioned that I am an xbox indie games developer.  One of my friends piped up and asked if I needed another developer.  So I've just sent him a wordy e-mail describing what to expect out of doing work for [undecided] games (as in, don't expect to make any money unless a project sells), and an initial, nicely self-contained first assignment implementing a particular algorithm.  That'll be cool, having a collaborator with whom I can discuss coding issues.  Anyway, we'll see where it leads!  He's getting married in just a few weeks, I think, so it'll probably be a while before he's able to actually do anything productive for me, but that's fine.  I'm no worse off than I already was!

Tuesday, May 3, 2011

This Is Why I Don't Blog...

I never have enough to say.

I did end up getting the Wacom tablet.  I got one of the larger Bamboo models.  It's neat, but I'm afraid it's going to be little more than an expensive toy for me rather than a frequently-used tool, as I'm quickly finding my hand-eye coordination lacking.  In other words, I can't draw for beans.

In other news, I've been playing Fable III a lot.  Pretty decent game, except that it continues in the Fable tradition of having an almost worthless map system.  In fact, Fable III's map system is arguably worse than that of Fable II.  In Fable II, it was essentially impossible to easily view the relations between major map areas, but a given area was mapped fairly accurately, and provided markers for your current location, etc.  By contrast, in Fable III, the layout of the maps doesn't reflect "reality" at all.  Well, that's a bit severe; a few features here and there vaguely resemble the actual layout of the area.  That said, it's not very useful for general navigation.  Perhaps the makers feel that is an important aspect of the game.  I could do without it.