Controlled Doses of Exceptional Blather

Monday, March 30, 2009

A Great Darkness Looming on the Horizon

There are stirrings about. Rumors of war... with... gray blobby things! *gasp* Yeah, I don't really know what I'm talking about either... I started working on the enemies for my game and my first enemy test sprite is... well.. a gray blobby UFO looking thing. It's scary, lemme tell you!

Progress
I was able to work on my game a wee bit this weekend. Only a few hours on one of the nights, but hey it's work, and progress was made! I mentioned the desire to complete my camera and control work so that I would have an enclosed playground to play around in. Well, my desires have come to fruition!
I was able to restrict the camera to within the map boundaries pretty easily. It took longer than it should have, because the landscape I was drawing to the screen was not positioned properly, and I took that as a flaw with the camera focusing, but I tracked it down before I spent too much time barking up the wrong tree.
I also managed to restrict the ship's movement to within the map boundaries. I'd originally messed with reversing the ship when it hit the boundary, but I found the resulting bounce-back somewhat undesirable. Ended up setting it up as if it were a wall. The ship will simply stop moving forward at the edges. Nice!
That stuff aside, I was finally able to start digging into the Enemy code... woo! I... actually made some substantial progress in a really short time. I've got a ship that appears on the screen and will try and patrol along predefined paths. More importantly, I've got some serious state and behavior management integrated already. The enemy will decide whether it should be Attacking, Guarding, Patrolling, Hiding, Fleeing, etc. Deeper still, he will decide when he's Patrolling (the only behavior I've addressed so far - want to get it working before proceeding), how he will patrol. Where will he go? How fast will he get there? What will he do when he arrives at each waypoint? Will he turn back when he reaches the end, or circle around back to the beginning? I've made all these variables... well, variables, so that I can make any number of enemies that might patrol differently quite easily.

The Rigamorole
I have several issues facing me immediately and they actually present quite a challenge. For instance, I set up a Queue of actions I want my ship to take... like correct it's angle, change it's speed, etc. The problem I see is, what if I want to change it's angle and accelerate at the same time? A single depth queue could make this quite difficult. Also, if I were to queue up multiple things at once, do I perform the entirety of the queue at once, or do one action, then the next when the first completes? I'll want the enemy to be capable of moving and firing at the same time, for example, so I need to figure out a way to achieve this. How will I prioritize some things over others? Hrm. Yeah, I don't know either. Perhaps some research on AI would shed some light on things. I'll see what I can find. Anyways... immediate goal: get my enemy ship to patrol properly... right now he doesn't change angle and slowly accelerates to the right off the screen forever. Smart guy...

Wednesday, March 25, 2009

Keep 'Em Coming!!

Wow, this is easily the most consecutive updating I've done to this thing since I started it a year or more ago. Crazy! I'll take that as a sign that my plan to simplify my goals was a success, and also that my plan for a simpler overall game design was a success. I'm progressing with far more tangible result than I was at a much greater rate of return. :D

Progress
Last night I got off work early, so I had a chance to dig into my code a bit. First, I tackled the scaling of the camera, and with a little effort I managed to get it to cooperate with me. A little tuning, and it behaved much like I wanted... when the player increases speed the camera slowly pans out to reveal more of their surroundings. I'm quite pleased with the result, though it will probably require some fine tuning down the line so that it feels a bit more "tight".
My scaling work wasn't without trouble though... I found that there was a discrepancy with the way the ship itself was being scaled. The problem was... it wasn't. When the camera would scale the ship would remain the same. It took a bit of doing, but I was able to streamline the bridge between them and it works as intended now.
Finally, I addressed the parallax scrolling of the map. It was irksome before that my stars in the background scrolled along with the mock landscape I made when I wanted them to be a static background. Well, I managed to resolve this also, where background layers with a scroll value of 0 would no longer pan with the camera, and the result of this was also quite pleasing. :)
As one last thing (see, I accomplished a lot for one night :P) I began looking into restricting the camera within the map boundaries, and I came close to it working properly. With little effort tonight I should have it squared away.

And Then
Next time I sit down at the computer, I will fix the camera movement restrictions. As mentioned above, I've got most of it done, so it will be a quick and easy fix. Then, I will restrict the ship's movements to within the map boundary also. This will be a very simple fix and probably require very little time. I need to simple check whether they're within bounds, and if they're not, reverse their direction/angle! Piece of cake!
So... what to work on next? Hmm. With those things done I'll have a nice little enclosed playground to work in. The possibilities are endless! I think what will give me the greatest return at this point will probably be to start working on enemy ships. This will entail drawing one or more, figuring out where to spawn them, figuring out how to control them (really looking forward to AI coding!), and working on the mechanics behind weaponry. Lots of fun stuff ahead, I'm really looking forward to playing around with these toys a bit. :)

Tuesday, March 24, 2009

Hullaballoo

Lookin' like I'll be working alot again. First day of another 3-day work spree... woo! The first one tired me out, but I've had 2 days to recoup. Hopefully, recoup enough so that the next 3 days don't kill me. :P

Progress
Last night I took care of the camera tracking code. It wasn't as simple and straight-forward as I'd anticipated though... I actually ended up trying several approaches with varying complication and was having one heck of a time managing the positioning of the camera, the camera's central pivot, the ship, and the target where I wanted to move the camera to. I was getting all confused because many times the camera would track the opposite direction expected, as if it had inverted X and Y directions, and most times the ship wouldn't even be visible. In the end, the simplest solution worked... it just took me too long (probably due to fatigue) to connect the dots in my brain. :P The end result is close to what I'd wanted, though with playing with it I found it may induce motion sickness if I'm not careful. :P I'll likely tune it more as I go, but the foundation is laid out.

Next Up
As mentioned in my list of things to do previously, after getting the camera tracking down I need to work on the zooming. I also need to work on restricting the camera and ship within the map boundaries. However, I realize with my testing now that the camera is actually panning, that there's another thing I have to do. I need to fix the parallax scrolling. You know, when background layers pan slower than the foreground layers? That's not functional at all now. It needs to be. I will likely work on this prior to my map-boundary restriction tasks, as it's going to be extremely important in the long run.

Monday, March 23, 2009

Comcast Drops The Ball!

Yessir, I've been without Internet access at home for 3 days now, and it's not looking like much will change any time soon. Comcast swore they wouldn't have any problem hooking me up with new service, and that I could go ahead and cancel my existing one... of course when they came out to do so on Friday it didn't take long for the installer to realize it wouldn't be possible. Some major hardware needed to hook up the house was missing, so a crew will have to come fix it before I can consider trying to install the service again... bleh. Anyways... I'm not one to let a bad thing keep me down. I'll be making the most of my time away from Halo 3 multiplayer by coding as much and as quickly as possible, and probably also finishing some games I've had on my plate for far too long... :P Bioshock, Fallout 3, DMC 4, etc.

Progress
Little to none... Been too busy working. :( I did debug enough to figure out why my camera isn't panning properly though... My classes are stepping on each other's toes. My keyboard moves my ships sprite. My scene manager also moves my ship's sprite to where it thinks it should be shown relative to the camera's view. And then my game manager moves my camera to where it thinks it should be in relation to the ship's location... so my camera is moving according to the ship, and the ship is moving according to the camera... so yeah, they fly away immediately and it doesn't work very well. I'll fix this tonight. :P

TO-DO
Same as last time. :|


Since I'm without progress today, I will comment on some detail as to the game's content. I think I will start with what I think the beginning of the game will entail.

You sign into your Xbox, select your profile, and select New Pilot. Your pilot will be your link to your ranking, your money, your progress, and what resources and ships you might have available. You will select from one of three ship chassis to begin with... some standard military issue grunt's ships. One will be agile, one will be a heavy weapons platform, and one will specialize in subterfuge and intelligence. Overall, these will be the 3 ship types available as the game progresses. The agile ship will zip all over the place dodging threats and hitting behind enemy lines. The brute force ship will take a beating and take out a small chunk of the galaxy with it. The subterfuge ship will focus on radar systems, cloaking devices, disabling the enemies, and scouting.

New pilots will begin at an air force base on Earth. It will be some time in the late 21st century or early 22nd. From the system colonies, reports of an alien threat have begun to pop up. It seems scouting parties of alien craft have begun to enter the solar system, many even trying to scout Earth and it's moon. The player will take off on a recon assignment and will quickly encounter enemy scouting parties scattered all over the place. They will be very very very high in number, but fortunately they'll only be scouts, so they will be weak. By the time the player has managed to get their first flight out of the way, they will have managed to secure a new rank (rewards keep people happy!) the reward of which will be an upgrade to their cannons allowing for tracers (the "basic" gun will be a nose mounted machine gun. Until the tracers become available it will just come out of the front of the ship and hit whatever's in direct line of sight). Ranking promotions will follow regularly along with other rewards.
The player will be notified that debris was found in the wreckage, and that the need for them to begin salvaging will be of utmost importance. Next flight, they will be equiped with a claw that descends out of the bottom of their ship to collect stuff. In this way, kills may result in any number of "drops" much like WoW or Diablo, varying in rarity and effect. Game will more or less proceed thusly, with the player getting kills, getting money, buying upgrades (scientists will develop new technology based on that which you discover), salvaging drops, and making their ship into a terrible alien killing machine. Threats will get smarter, faster, bigger, and meaner as they go.
The player will eventually go from Earth to the Moon to Jupiter and/or Saturn, the asteroid belt, the Sun itself perhaps, and eventually to the alien home world. When that's all said and done, then multiplayer will give them a whole other mess of stuff to do for fun.

Thursday, March 19, 2009

4 Breakfast Shots to the Gut

Got up early and went up to the Hammond DMV this morning to get my license reinstated before it became suspended. I got a BS speeding ticket a couple months back, was going to defer it, but missed the due date, so they started the whole license suspension process. But that's done and taken care of now... Phew! Ate some BK Breakfast Shots on the way up there and... wow, they kind of turn into rocks in your stomach. Blech.

Progress
Last night I accomplished a number of things... Fixed some issues with the accelerate/decelerate code that remained from the other night. It wasn't behaving properly when I would decelerate to 0% speed and then continue in the backwards direction. But now, it will turn the ship around and head back the other way properly.
I also enabled a switch so that L/R could always mean Accel/Decel regardless of direction facing, or L/R could mean Accel or Decel depending on which way the ship was facing. I had intended the L=Decel/R=Accel scheme to be the default, but upon testing it comes across as a little awkward to me... so it will be available as a control option to the user in the end, but it will not be the default scheme.
Next, I enabled the rotation of the ship with the Up/Down keys. This was very very simple. I also put a switch in so that controls could optionally be Inverted (pilot controls). I will likely make Inverted the default, but, playing Halo often I know many people just can't handle Inverted controls, so an option was necessary.
Then, I took care of the Climb/Dive controls and ship movement. I mentioned there would be fancy math involved with that, but it turned out not to be anything too crazy. It simply rotates the ship with Up/Down and then instead of moving the ship strictly on the X-axis as it was before it uses some Trigonometry to find out what the X and Y coordinates are given a certain speed and a certain angle. Done and done.
Finally, I did some setup of the camera for a tracking system. I got the basis down... the camera will have a GoalPosition to try and track to and will constantly be panning around trying to catch it... I think this will result in some smooth panning regardless of how quickly the ship is flying around. I also set it up to use the same Trig code for linear destination to set the camera GoalPosition to X distance in front of the ship's heading. My first run of it it didn't work perfectly, but that's to be expected for a first run. I will tend to this more next time until it's solid.

The Agenda
Next time I sit down at the PC (I say next time, cause I have to work like 40 hours in the next 3 days and who knows when I will code again) my 1st goal will be to iron out the kinks with the camera tracking system. Once the tracking system is done, the 2nd goal will be to get the camera zoom worked out right... I need to find a sweet spot of zoom depth which will allow the user to see his surroundings well enough to understand where he is, and also set it up to zoom out slowly as the ship's speed increases so that the same relative alertness of the play field is available when flying around. The 3rd goal will be to restrict camera movement to within the borders of the map area. Right now I'm testing with a 5 width by 2 height tile set, but there's nothing keeping the camera there. Once the camera is restricted, the 4th goal will be to restrict the ship's movements to within the map area.

Wednesday, March 18, 2009

Mother do you think they'll drop the bomb?

Coded quite a while last night, interspersed with some acoustical guitar thrashing. ...Been trying to learn some simple songs to play and sing along to, you know so when I go camping this summer I have campfire songs. :P Last night it was Mother by Pink Floyd. Listened to it over and over and over to get it in my head then played it and sang it well first go 'round. ...Ohh yeah, and coded!

Progress
So yesterday I said I would accomplish at least 2 sizable things (correcting input control of acceleration/deceleration of the ship, and also addition of camera tracking) in addition to possibly more. Well, the first thing was much more involved than I anticipated. It took a great deal of planning and testing to get the input to differentiate between being held in a certain direction vs. being tapped in a direction. Then I also had to account for the ship facing left or right and how that would effect movement. Plus, as I mentioned before I had to deal with throttling the ship speed to within certain values. PLUS, I had to put several timers in so that as a button was held it wouldn't activate every 1/60th of a second (it being a 60 fps game). PLUS PLUS, I put in several control schemes for the ship based on it's status. If it's docked or turning, certain controls are possible while others aren't. :)
But that's out of the way now! I can accelerate/decelerate by 1% max speed per 10th of a second. I can tap left or right and it will accelerate/decelerate by 20% of max speed. It will stop at 0 speed. It will stop speeding up at 100% max speed. And all this is displayed on the screen. Plus, I can turn the ship around to face the other direction if I go to 0 speed and continue the other direction. Dandy!

Next On The Agenda
Tonight I will try to accomplish the things I was going to do last night but didn't get to. That's 2 things. The tracking of the camera to follow the ship (actually, following in front of the ship). And coding the controls for climbing and diving. Reconsidering, I think the climb/dive code would be more useful to work on first, since it's related to the control scheme coding I did last night. Might as well finish it before moving on, ehh? Camera control and map panning will come after controls.

'Til next time... You'll always be baby to me.

Tuesday, March 17, 2009

SHOOTS

SHOOOOTS! Yes, Shoots is the "secret project" title for my current game-in-progress. Every secret project has some cryptic name before it finds a real one, and this one is just mine. Shoots!

I thought I'd mention a quick blurb about what I've done and what my current to-do is... a "progress report" if you will.

Progress
Last night I drew my crappy looking player ship in MS Paint... then I redid it with a transparent BG in GIMP cause that whole transparency thing slipped my mind. :P
Next, I had a problem with my keyboard input because the arrow keys weren't moving my ship like I originally intended. They weren't moving anything. That was actually an easy fix...
With my ship moving, I was now able to change the way the ship moved. My intent is to setup the controls thusly... Left/Right: Decelerate/Accelerate, Up/Down: Dive/Climb. So far the ship just panned around the screen though... My last task for the night was to change the Left/Right being forward/backwards to a speed-based accelerate/decelerate system. In no time, my ship was accelerating right off the screen, no sweat! However, there's a lot of work to go...

Short-Term To-Do
First thing I must do is throttle the acceleration of my ship. I don't want it to speed up undefinitely, I want it to stay within the Max speed of the ship. The speed of the ship will range from 0 to MaxSpeed (yes, the ship will be capable of speedless flight or hovering) to the left or right. I will ultimately have a key to change directions in-flight (from left-to-right and visa versa) so that the player will not have to completely decelerate to 0 to begin accelerating the other direction, but I will address that later. The second part to the acceleration is this: as long as you hold L/R you Accel/Decel gradually, but if you only tap L/R and don't hold it, you will Accel/Decel by a large amount. So, one can ultimately Accel/Decel completely within just a moment if they need to. I will likely make deceleration require less overall taps to completely stop, as immediate deceleration is arguably more important than immediate acceleration. Right now I'm thinking 1% Accel/Decel per half second held, and 20% Accel/50% Decel per tap L/R.

Second goal, I must stop my ship from accelerating off the screen!... This will never be possible in the finished game, because the camera will always be following the ship! The map will be scrolling happily away behind the ship as the camera scrolls. So, the camera must do a few fancy things... move when the ship moves, move ahead of the ship so the player can see where they're headed, and zoom out gradually the faster the ship is moving, so more of the approach is visible. With my current camera system this should be quite simple to accomplish, so we'll see how it goes. :)

If these two goals go well, I will work on restricting ship/camera movement to staying within the borders of the map. I also need to work on the whole dive/climb of the ship and the math involved with that... there will have be some fancy geometry or trig to figure out where the ship is headed when it's angle changes.


More later!! Cheers! Happy St. Patty's Day!

Friday, March 13, 2009

Moon Landing Hoax

What?! Moon landing? Hoax? ...Has what to do with game design? Don't worry, I don't know either. The metaphor I wanted to use as a title for this posting was the term used by NASA that means: to take advantage of the gravity of a large astral body (planet or moon) to boost the trajectory of a space craft. I think it's called sling-shotting... But anyways, when I was Googling and Wikipedia-ing to find that term all I found was Moon Landing Hoax crap, so I ran with it. :P

Anyways.....

Seems I was busy during the time of my last post, huh? Sick too? Huh. I was thinking just the other day that I couldn't remember the last time I was sick... apparently it was September 15th. :P Also I was neck deep in the code that would lead to my fancy arena-based combat game. Well... times change.

The reason for my post title that I wanted - one that implies a sudden change of trajectory - is just that. I've changed trajectory once again. I feel that this change will not slow down my progress toward my main goal at all. In fact, I think it will be a better means to the End. The intent of my trajectory change was with my original specific goal in mind: I aim to complete a game. I aim to release a game. Now, I aim to gather the experience I need to make a full game start to finish. I will never produce my dream game if I don't. It's just too big, too deep, too involved, and I don't have that kind of time or resource.

So my quest for a game to produce and produce quickly began. I have been thinking intently on this purpose for some time, and I've come to decide that it needs to be simple. It needs to involve a very little effort in coding and still maintain playability, fun, and excitement. I would also like it to involve multiplayer if possible (Okay, so maybe all this crap isn't as simple as simple could be. I'm stupid and stubborn). Ultimately, the genre which came to mind is... a Space Shooter! Wee! Now I'm not the biggest space shooter fan in the world, but I do enjoy them. I like the thrill of dodging incoming bullets (excitement that I mentioned). I think I can easily and quickly make a space shooter above and beyond the norm in various ways:

First, free-flight! I'm sure it's been done before... in fact, one of my first memories of video games involved a flight-based 2D shooter game with what basically boiled down to free-flight. LOOPING! (Great game... HARD game) Also, Defender comes to mind... The one thing that annoys me about the genre is the on-rails approach they almost all take. I understand that it's neat memorizing the patterns of wave after wave of attacks so you can blast through it on your 13th try, but I'm ultimately much more interested in scouting around trying to find areas where you can approach how you want, where you want, and just blow stuff up (the fun that I mentioned above).

Second, growth! You know, this is also something that's been done to death with the genre. You get pickups, you shoot bigger lasers, you get pickups, you get bombs, etc. I'm much more interested in investment... in rewards for efforts made. RPG systems do this excellently, and I don't understand why shooters haven't gone that route sooner. The beauty of RPG systems is, most of the actual growth logic is done statistically - aka adding numbers, boosting stats, earning moneys. It adds infinite depth for very little coding effort (that's the simplicity that I mentioned).

Third, multiplayer! I am unaware of a single space shooter type game where multiplayer is more than just the single player experience with another ship flying around. That's all well and good... actually quite fun, but it boils down to pattern memorization times two. There's no real team work. There's no real accomplishment. It's dated. While this will probably be the most difficult aspect to integrate, and thus probably the last thing I come to, what I'd really like to do is take advantage of the 2D free-roaming mechanics that I setup for the single player game and turn it into a sandbox for all sorts of crazy ship dogfighting. Why not make it 32-player free-for-alls, or team based objective games, or races? HRM? Why indeed? But I'll focus on that later...

For now, just know that things are going well. I've already got the project set up. I've already gotten past several major hurdles, such as an effective input control system, a 2D scene system with parallax scrolling and all that jazz, and a game management system which will allow me to control the game with little effort. This is all stuff I struggled with in past projects, so I'm already making amazing progress here. Stay tuned for more specific ideas, smaller scale goals, pictures, progress, and those such things. WHOOO!