Friday, March 30, 2012

New Post, new strategy

Hello everyone,

I'm going to be trying a new strategy to the blog, it will mean my posts are more frequent, but possibly that makes them less interesting.  Aside from my "usual content" I will be posting "engine maintenance" content, just a log, essentially, detailing the changes made to Princess throughout the course of a day.  This is mostly to help me (how selfish of me) keep track of everything that I've done, to what file and why, because future Kevin is going to want to know what in the world past Kevin was thinking, guaranteed.

So what have I done today?  I've tightened up Kinect a little bit.

"But Kevin," you ask, "You've been saying that for months! How much tightening can possibly be left?!"

Let's just say I'm the personal trainer of a morbidly overweight technology.  There's a whole lot more tightening that can be going on here!

But I did do work, so to speak.  I've kind-of-sort-of-maybe finally adopted a new method of looking at my hand "point cloud" that seems to work well enough for my needs.  Taking (slight) inspiration from calculus, I changed my method of storing my cloud points as elements of the X-axis (each x-axis spot has a small list of Y-axis positions)

From there its quite simple, I split the cloud into bottom-max values and top-max values (Y-axis) I check for valleys and peaks (derivatives, anyone?) and If I get a certain amount of peaks and valleys in my point cloud I assume this is "fingers" and then  my problem is solved.

What if the person has the hand to the side?  And their fingers didn't point up or down?  I also check the number of points on the given Y axis, any more than four (at least one gap) then I, again, declare the hand to be "open"

Again, are there are ways to do this better, but I want it done FAST, so if I can hit all of this in just one or two passes, I am a happy man, and I can devote my time elsewhere to gameplay programming.  Had a friend of mine, Ozzy, test the game rather unplanned, which confirmed to me that: The hand opening/closing is "good enough"

It needs more work, but it's good where it is at.  Will I work on it more? You bet, I'm a perfectionist when it comes to, well, random things, but this Kinect is one of the areas I always feel I need to improve at.  And so I shall, but it's now officially on the back burner of the project.

Ozzy also showed me a degenerate strategy I'll have to talk with Brian about.  One of the coolest parts of our game is the "smashing" feature, it's simple, but fun, if you have guys in your hand and then bring your hands together, they get crushed and blood spews everywhere, it's an insta-kill.  However, it's also entirely possible to pick guys up and clap your hands together rapidly, just hovering guys above the ground and as such simply kill attackers left and right without rhyme or reason.

So that must be remedied, but overall we need to reign in the number of our attackers.  Too many guys on the screen doesn't make for what feels like good gameplay, just really hectic arm-waving.  Brian and I talked it over, we're going to try to lower the enemy count but raise the health and see if that helps maintain the difficulty but makes the game more about having fun smacking guys around a lot.

I'm also thinking about bringing back the "close hand to grab" functionality, at least temporarily to see if, now that Kinect is a little bit nicer, it brought anything to the gameplay.

I also implemented a quick pausing system that pauses the game if you are "interrupted" or step out of frame it pauses the game and allows you to step back in, quit or resume the game.  It's not perfect, for some reason the draw order for the pause is out of whack, but it works and it's something that I had been meaning to do for a while.

The next few things I want to nail down is a more efficient system for the numbers popping up every time you hit enemies, it really can slow the game down for a bit if there are a lot of enemies on screen, and.. dang it, I just forgot.  Well, I'm sure it will come to me in time.

I actually have a lot left to do.

- Background displays village and enemies leaving village (think the "what's coming next" indicator in Tetris)

- Kinect Wide-gestures (earthquakes, etc)

- Finish up scoring sytstem/hit tracking/combo recognition (base system is in place, I want the visualization to be there)

- Tweak Kinect every so slightly if time permits.

- Add catapult men.  (Sssh! it's a secret!)

- Add more sounds and some music

- Many more things I am forgetting right now.

That doesn't seem like a lot, even to me, but I know things will be much harder than they seem, and I am missing a number of different tasks.

We also need some awesome intro cutscenes or something similar.  We are re-working elements of the story to be a little more cohesive with what we've got.  We shall see how that goes, we have to be very careful now, the difference between an okay game, a good game, and a great game is how it all comes together.  We've got the art, we've got the design, I'm holding the program together with staples and superglue, it's good.  We need it to be great.

Okay, that was my Coach-Carter moment.

Elsewhere in the world I finished my Delaunay Triangulator by complete accident.  Well, not entirely, I scrapped all of my old code that I had because it was just not working and I couldn't figure out why.  I re-did the code in a much cleaner and simpler fashion... and it still didn't work.

Then I changed the order of the vertex creation in new triangles and... lo and behold it worked.  A seemingly random and insignificant matter as the specified order of vertices in a new triangle makes or breaks the algorithm... yet I followed it to the T, and there was no mention of vertex-dependent order?  Did I still do something wrong?  I have no idea, but boy am I glad there are only 3 verts in a triangle or I would have never figured it out by moving random stuff around.  Which is how I come to a find many a solution in my code.  It means I'm always 98% right and 2% wrong... but being 2% wrong still means you are wrong in programming and logic... and math.  Most especially math.

Can't be wrong, must improve.

Must maths, must programs, must logics, must succeeds.

No comments:

Post a Comment