Here it is Space Aces, my latest game: Match 3 Invaders. Have you ever wondered what it would be like to combine the pulse-pounding, sweaty-palms excitement of the classic Space Invaders arcade game with the relaxing strategy games known as "Match 3?" Now you have the chance to find out! Can you concentrate on lining up color matches while simultaneously dodging enemy fire? Can you endure the excruciating time limit as the aliens descend lower and lower upon your position? Most importantly of all: Can you rack up enough points to enter you name on the hallowed High Score Table?
It's Match 3 Invaders by Matt Barton. Now get in there and start matchin' and poppin' like you mean it!
Special thanks to: Triphamer, clok1966, Salty Pretzels, Eigen, Peter Horvath, Nathaniel Tolbert, and everyone else who beta tested and offered advice.
When I woke up this morning I suddenly understood how to do all my matches with arrays instead of raycasts. There really is something to be said about "sleeping on it" and that your unconscious brain will figure out stuff that just isn't clear to you otherwise. The first breakthrough was realizing that I could create an array to hold all the enemy game objects, then populate each element as I build the fleet. Then I could assign an array column and row number to each enemy. An enemy to the left or right is -1 and +1, top and bottom -6 and +6. I could use the row numbers to eliminate the problem of the leftmost or rightmost columns getting mixed up. Instead of raycasting, I can simply check to see if the element exists and is in the proper row or column. Viola! No more misses!
It's been a long day of working on my game, mostly trying (and failing) to find out why it's still missing the occasional match. For awhile I wondered if it might be an issue with rigidbodies; that was a dead end. I next tried moving bits of code into lateupdate and such trying to see if that would help; nada. Finally I removed two "find" commands in the trigger event function. Since then, I've been unable to duplicate the error after about a half hour of beta testing. Sadly, I could just have gotten lucky, so I'm asking you guys to let me know if you encounter the bug again. I'd be willing to bet ten bucks that I'll get it the very next time I play it...But maybe not. I read on some tech forums that the "find" commands aren't very efficient, so I guess it's possible that they were delaying it just enough to cause the occasional miss.
I interviewed George Sanger ("The Fat Man") last week and he told me a fabulous story about M.U.L.E.. Apparently, Bunten was having a horrible time with a similar-sounding bug that made it very hard to get the mules lined up just right on the house. She finally gave up and explained that mules were ornery. Add a little animation of it running off the screen and suddenly that bug becomes a feature! Ornery mules...So I think it's about time to think about ornery invaders! Or perhaps the occasional dud projectile! Damn those cheap imports!
I'm back today with some bug fixes--thanks to Trip for helping me find the problem with the aliens not respawning after a restart. I also made a few other tweaks and added some new features, namely a brief (perhaps too brief?) period of invincibility after your ship respawns, and three new types of power-ups: extra life, speed boost, bonus points, and of course ever-popular cannon upgrade. I also took another person's advice and added a "color reminder" swatch just below the score. I'm still getting occasional missed matches. I went back through my code today and still don't know why that is happening. It seems to come in spurts; you can play several rounds without a hitch, but then get it two or three times in a row.
Well, here we go again. Today I was working with Blender to try to rig up some basic animations for my alien baddies. After a few false starts, I was able to make some bones and rig the alien. There's probably a better way to do it, but I just made used the forked rigging system to quickly make bones for each of the...tentacles? Teeth? Not really sure what those things are! I did notice a substantial hit to processing power once I implemented the animated versions...Considering the simplicity of the animation, I am concerned about doing anything more sophisticated--it appears that making Unity browser games requires substantial skill in optimizing such things. I clicked the options to reduce keyframes and compress the animations. I got some errors (not show-stopping) about some vertices with unassigned bones (huh?). My ignorance concerning Blender is pretty galling; while I'm able to muddle through and get stuff done, I realize that I'm only scratching the surface. I should probably plan to spend more time with my Blender book and perhaps find a good video tutorial series on using the program more effectively. The problem is that a lot of the Blender material focuses on stuff that isn't really useful for my purposes, such as lighting and shaders and such. All I need really is to create good-looking models, UV maps, rigs, and animation.
I'm back again with an updated version of Match 3 Invaders. This time I added background music (not my own composition, but rather one by a composer named "Data" that was included in the Audiodraft Music pack 1 (free in assets store). It's a really fun, chiptune that seems to fit the mood perfectly. Indeed, it's amazing to me how much more fun the game becomes with the track playing.
I also added a little text pop up to let you know when you score a chain bonus (anything beyond a match 3). That adds some fun, too, since you can't help but try to get the biggest chain possible. While I was fooling around the assets store, I also downloaded a shaders pack. The results aren't as good as I was hoping given the samples, but I still they think they make the game look more polished.
Well, here's the latest version of "Match 3 Invaders," this time with some models created in Blender. I didn't trying to rig or animate anything in Blender yet; I just whipped up a basic invader model and spent the better part of the day trying to get it to work. Rotation issues plagued me throughout. I'm still not sure exactly what's causing the issues, but I have developed workarounds. Apparently, when I bring in the models, they are rotated 270 degrees, which throws off the references in my code to Vector3.right, Vector3.up, and so on. As with the player object, I was able to get around the problem my setting all my references to Space.World instead of Space.Self (global vs. local space).
I'm feeling pretty good about this release; it really feels like the pieces are finally coming together. Pretty much all placeholders here for graphics and such, but I think the gameplay is pretty clear at this point. I've added increasingly difficult levels, a simple power-up to boost your ammo, lives, and of course a high score table. The high score table gave me a lot of trouble; I probably should have just got the one for $25, but free was hard to pass up. I had to modify it extensively to get it to work, and I'm still not very comfortable with it; but it SEEMS to work. Try it out and let me know what you think!
Well, I'm sad and sorry to report that my little Unity project has come to a grinding halt. It's agonizing, but even though I was making huge leaps towards realizing my game design, I've finally hit that wall that I just can't get over by myself. I've been working for two days trying to overcome it, but I sadly just simply lack the skill and the knowledge. I've ended up with a show-stopper glitch that I just don't understand, and the behavior just seems entirely random...It's either get help with this or give it up.
Here's the deal. Although the system works great at first...Occasionally a block will suddenly switch into "orphan" mode. I've stared at my code until I just can't stare at it anymore. I've combed through it, commenting out each component to try to find the culprit...Just can't do it. I've tried, and tried, and tried to no avail. I can't find a pattern in it; it just...does it sometimes. It just seems entirely random!
I can't find any logical reason why it doesn't work, so that leaves me to think it's either a glitch in Unity itself (unlikely) or just really bad optimization on my part. I suspect the issue is unnecessary collision checks and bad update routines--that is, out of ignorance, I'm asking the computer to run so many checks that it's overtaxing the system, resulting in missed collisions. To combat that, I've tried to reduce the updates, but nothing has worked.
Whew...Well, after a few days of coding I have a working prototype of my new game. I'm still calling it "Heavy Metal Metal Blocks," though I suspect that will change as the game evolves. I had a really, really tough time getting the Match 3 stuff worked out; I never dreamed how convoluted the code would get. There's probably a much easier way to do it than what I came up with, but it DOES work, at least as far as I can tell. Have a go and let me know what you think of the basic concept!