Weekend Update : 12-18-10

Hello and welcome to another brand new week here at GBM Productions.

And, as every new week comes, I am bringing you this weeks Weekend Update so everyone knows whats up and what all happened.  And boy, has it been a busy, and exciting, weekend!  Read on, royal reader, read on.

So, lets get this post started right and address the elephant in the room.  Ludum Dare #19….

Sad Kitten is sad.

This is a sad Kitten because Marcin didn't participate in Ludum Dare #19.

It was barely my fault though!!!  The competition started on Friday night, and I wasn’t able to actually start game programming until Sunday morning.  By that point, even though I had an idea for the theme (Discovery) I just didn’t have the actual man hours to get it done.  Plus, Saturday was a very lovely day spent with my Girlfriend which ended in me being sick come Sunday.  So there you have it, sick + not enough time = no Ludum Dare entry this time.  I’ll get the next one around, maybe.  But, we can’t just leave everyone upset without some sort of good thing, so I figure I might as well tell you about my game idea for the contest that never actually got done :

You play a single, colorless sphere.  And you roll around!  Roll Roll Roll.  As you run into other spheres of different colors, you combine into a single sphere you then control.  Pick up a bunch of stuff and become red, then roll roll roll and pick up a bunch of spheres and become blue + red, then so on until its blue + red + green and you become… WHITE!  (for all the colors together make white, I hear).  Then at the end it zooms out and you were playing an explanation of a father to a son about how color works.  Something like that, basically, was my idea.  Add some small platforming, correct color order and add some points, and you got a game about discovery.  I think.  Let me know what you think!

Well then, what did I accomplish this weekend in terms of game programming?  Since I obviously lamed out and didn’t do a Ludum Dare entry as originally planned.  Well, I did some very sweet work on SCO and the good news is, I think I may have figured out how to do what I wanted to!  Kinda.

Lets start at the beginning.  After running into a number of problems with my missile velocity measurement, I decided to just forget that for now and focus on making my little fighter ships using a box and some physics.  Turns out, its really hard to make an object use some sort of AI that only applies forces, rather than actually changing the direction / place of the ship.  So I did everything in parts.  First I added some sort of acceleration, and a take off, and a boost.  So it can get up to speed fast, maintain the speed, and use a speed boost when the actual speed of the object gets low.  THAT part worked pretty well.  Soon I had a box that could go WHOOSH and go flying off in a direction.  After that, I decided to get into the heart of the matter, the most important part of this flying space fighter ship extraordinaire!  Aiming.  Haha…

It turns out, aiming at something using physics is a lot harder than originally anticipated.  Its because unlike the turrets which I can actually just turn toward my target, the space ship needs to do everything with physics or else it won’t look / act very good.  And turning with physics means… torque.  Applying torque across an axis to turn.  I can apply torque left, I can apply torque right.  Up, down, forward, back, every which way.  I can add some torque.  This means… spinning my ship is very easy.  So what happened?  Well, I had a completely sweet box that could turn randomly as it flew in one direction.  NOT QUITE the awesome fighter ship that I had imagined.  The whole acceleration thing once turned and actually turning towards a direction I can work on later, but for now, my main goal was to get it to aim.

So I tried all kinds of things to get it to turn, I found some code online but that didn’t really work as well as I had hoped.  It would turn me toward my target but then just kind of wobble back and forth around it.  Never actually lining up properly.  Not to mention that adding torque one way then another just played havoc on the physics, turning the ship all sideways and weird.  And I think were was some issues with there code where it could turn the back of the ship toward my target and not the front.  Point is, it was all a mess.

But good news!  Sunday night, as I was struggling on making heads over tails (pun, maybe?  for the spinning?) of all of this, I had an idea.  And I tested my idea.  And it worked!  Check it!

If my ship is looking straight ahead, and the target is to the right, I can apply torque moving right.  The problem before was that it would very much overshoot my target as it rotated.  But, I learned a neat trick wherein if I turned off Angular Drag, I could control how much turning my ship could actually do.  So, I can apply a torque to turn right, say, 5 times, and if I applied a torque turning left 5 times, my ship would stop rotating.  And there you have it, thats exactly what I needed.  A way to apply negative force to stop my ship from spinning.  And boy, does it work!  Having added a “stabilize” function to my code, and some very clever variables that keep track of how many times I add torque in a given direction, I am now able to stop my ship from rotating at any given moment.  HUZZAH!  EPIPHANIED!

Well, kinda.  I can turn it left, right and stabilize.  I can turn up, down, and stabilize.  And, I think, between those two things I should be able to aim at any point in space.  Next up on my aiming train : Getting the direction it should be turning as the angle between the ship’s forward, and the up axis and the right axis.  This way, I can use my awesome torque ability to turn it toward the target in one direction, then in the other.  And together, we will have a ship that can look at the enemy.  Thats my plan for the next few days, and once its figured out it should be easy enough to figure out acceleration.  Maybe.  We will see, but for now, thats where we’re at.

Thats all for the weekend update this week folks, I hope you enjoyed my explanation of my problems as much as I did.  I find writing this stuff down really helps me keep track of where I am.  Come this weeks Mid Week Update Time, I’m hoping to have some awesome things for you cats.  Things like a scan of my notebook where I am keeping all of the ideas of what needs to be done.  Also, maybe, an actual playable demo of some part of the game.  We will see.  If anything, there will be screenshots or maybe a video of my space fighter ships in action.  I hope!

Have a good week everyone, we’ll talk again soon.




About Bob5602

Just a dude.
This entry was posted in Games, SCO and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s