Thursday, April 05, 2007

The wonderful headaches of precision sprite animation.

Well, I was hoping to have already been working on the demo for the comic book convention by this point for Barricade, but time flows a lot faster then I would like in a day, or at least it'd be nice to

A. Have enough wealth so I wouldn't have to work to earn a pay check for the rest of my life, I could dedicate my time to that which I wanted(I'm working towards this one.)

B.Had more hours in a day.

C. Could manipulate time with my mind so that I could get more accomplished.(I'm working on this one also)

So, I'm not really that far behind schedule all things considered. Only a couple of weeks of what I was shooting for to get done in the month of march, but now I'm running into some other issues, that I recently had to solve, and are in the process of now being resolved.

The main issue, had to do with animations for my sprite class. I have no idea how other people handle this in their code. I haven't bothered to ask or do research, but the way I've been handling it is simply loading a sprite sheet into memory as one texture and then mapping the sections with the individual frames to be shown at the appropriate time.

Some pseudo code might look like
----------------------------------------------------------------------------------
LoadTexture
Sprite->Animate

Call to Animate Looks like

advance function hit count
get active frame

if enough hits have taken place advance the active frame number


MapTexture
for frame one show these texture coordinates

for frame two show these coordinates

ect..
---------------------------------------------------------------------------------

My actual codes a lot better structured and is organized object orientedly and works great. The problem is that when I go to manually map my textures in my current editor
(I'm concurrently building a new editor as these issues and the demo are being built)
I have to go in and manually manipulate the textures for the frames to show up correctly on the quads. This is where I'm sure it isn't the best approach, but I don't really know another one, (Aside from having the graphics artist create the sprite sheets very precisely, which seems to be as much trouble as I'm having on my end anyways.)There are slight shifts in the textures do to slight shifts in the textures when I'm going in to map them, and while the anomalies are small and would even possibly be unnoticeable to someone playing the game, they are pretty damn obvious to me.

The solution I've come up with thus far is to increase the precision of movement for mapping the textures and also come up with a more precise grid for aligning the texture on the quad. I'll be trying this out in the next couple of days when I have a little bit of time this weekend.

If anyone out there can make some suggestions or offer any similar experiences up, I would be thankful, although I'm not sure if anyone ever reads this anyways, but if you do thanks in advance for the comments.

Sunday, April 01, 2007

An April Fool is better then an Idiot in general.

The title of this post has nothing to do with anything specific. I just couldn't come up with an idea for a general direction for the content of this post, and thus no appropriate title, which kind of makes the title appropriate.

So.. it's another Sunday and it has been a while since my last update. I've been extremely busy the past few weeks with work and family and have gotten small amounts done on T3D. It's been hard for me to be motivated the few hours I have each day to do anything other then relax, but some days I have managed to push myself to get things done. This weekend has been the first weekend I've had free to work on things for almost a month, unfortunately today has been the only day that I've actually sat down to accomplish anything. At least there is today though.

So, I've finished up the animation class and sprite classes today as well as went back and fixed a few things in a few locations that needed to be cleaned up. I am hoping to get started on an external editor today for levels as well as completing some additional classes for the editor itself. These include a generic mouse event handler, a generic game state manager (ie.. menu's, levels, credits, ect..), and possibly a few other things that need to be done. Actual production of the game Demo should start by the end of this week if all things go well. I am essentially awaiting the arrival of a design doc and other resources for the demo, which is supposed to be completed by mid June, and if not started soon I have a feeling that deadline won't be met.

I really wish I had more time to work on the engine and the upcoming game, but that just doesn't seem like it's something that going to change for a long time. So I'm really going to have focus on time management again.

I am going to have to write another demo to test the sprite class out sometime this week, and when that's completed I'll upload a video of it. Until then, remember that the challenge isn't knowing what you think you want, but challenging what you want to think. That even though you may feel that you're doing all that you can, that there is usually a part that feels you can do all that you feel.