Game Prototype: FORM

FORM is an idea I had for a quick-paced game in which you simply jump around on platforms with an Xbox 360 controller. Cool idea, huh?

Anyway, I’ve always wanted to make a game that incorporates some jumping physics I learned from doing Gymnastics, so this game focuses entirely on running and jumping. The main idea is that you can change the angle in which you jump from the surface you’re on by using the right stick. Also, if you aim away from the direction you’re moving, it translates some of that momentum into movement away from the surface you’re jumping off of.

You can’t change the direction you’re moving while in the air, so you have to plan out a little which direction you’re jumping and how fast you want to move. “But Mr. Caruso, how can I plan out which direction I’m jumping if I’m moving quickly?” Well, so-and-so, that’s where the jump arrow comes into play. The jump arrow shows exactly which direction you’ll go if you jump, incorporating your momentum, the direction you’re pressing the right stick, the angle of the surface you’re on, etc.

Another thing to increase your precision is the slowdown trigger. If you hold down the left trigger, it slows down the entire game. This can give you a little moment before you leap so you can get as precise of a jump as possible. However, the reason you wouldn’t hold down this trigger all the time is because this game is (eventually going to be) a timed game, so you want to get to the end of the level before your time is up. If you slow down using the trigger, the timer keeps going at normal speed.

But at this point, it’s still pretty buggy. The obstacles aren’t colliding with the whole player yet, and the direction you jump in by default has some inconsistency issue (maybe caused by a floating point error). I know this isn’t polished in any sense, but I figured I’d post what I have for now.

Posted in My games | Tagged , , , | Leave a comment

The Dot Product Is Awesome: Adventures in Collision

For those of you who are unaware of the dot product, it’s a quick little operation that can find how close any two vectors (direction + magnitude) are in pointing in the same direction. Assuming the vectors’ lengths are both 1, if they are pointing in the exact same direction, their dot product will result in 1. A dot product of opposite-facing vectors will return a -1.  Finally, if two vectors are perpendicular, their dot product will give back a 0.

So, while on my quest to find out how to do proper collision detection and response, I was given a link (http://www.blackpawn.com/texts/pointinpoly/default.html) that explained the concept that any edge of a convex object divides the world in two halves: one in which the entire object lies, and one in which it… doesn’t.

If that’s the case, I figured that if I use the dot product between any point relative to the edge and a vector perpendicular to the edge facing outward (a normal), I can determine in which half of the world the point lies. We do this by comparing the dot product’s result to zero; if it’s less than zero, it’s on the side with the object, and if it’s greater than zero, it isn’t.

If the point is on the side that the object lies, it could be colliding with it. To determine if it really is, we simply do this check on all the other edges. If they all indicate that the point is on the side the object is on, that means the point is inside the object. We have collision!

Now comes the trickier part. Once I had detected the point had collided, I had to figure out how I wanted to respond to that collision. One way that came to mind was to find out which edge the point is closest to and push it outward until it’s touching that edge.

So, how do we find what the closest edge is? Well, I figured that since we used the dot product to find which side of the edge the point was on, I could use it again to compare how close it was to the edge itself. The edge is perpendicular to the normal, so whichever edge’s dot product with the point is closest to 0 will be the edge the point is closest to.

Finally, I wanted to push the point out in the direction of the edge’s normal until it was on edge. Once again, I turned to my trusty dusty dot product for inspiration. Suddenly, I had remembered another application of the dot product: component. Basically, if you dot a 1-lengthed vector with a non-1-lengthed vector, you get the amount that the non-1-lengthed vector goes in the direction of the 1-lengthed vector. That was a disgusting sentence.

So, we multiply the component of how far along the edge that the point was (from one of the edge’s ends) by the direction of one of the edge’s ends to the other (the 1-lengthed vector). The result is a vector pointing from one edge to the other with the amount that the point was offset in the edge’s direction. All we need to do is set the point’s position to that result, and bam! It’s on the edge now.

Hopefully you followed most of that. I just wanted to share this with you guys because I feel pretty proud that I came up with this mostly on my own and I felt like bragging about it to someone.

Posted in Uncategorized | Tagged , , , , , | 1 Comment

RHITHMS

This is a game that my fellow Game Dev students and I worked on for roughly a month and a half (2 months if you count making a simplified version in Unity). It’s a rhythm-based scrolling combat game; your actions are enhanced if you perform them to the beat of the music playing, and enemies move and attack to the beat to try and stop you from getting to the end of the level.

I was the one who originally suggested the rhythm-based combat (gloat gloat).

I primarily programmed:

  • The rhythm strip (the line of beats scrolling towards the player)
  • The tile system
  • Collision detection and response between all objects
  • Our beat editor tool
  • A few AIs such as the sine-wave-moving enemy and final boss

I also manually recorded nearly all the rhythm strips because my friends and I like to think I have a good sense of rhythm after 14 years of piano lessons.

Download it here.

(Yes, it’s on MediaFire because I’m not in the mood to pay to be able to share my files online just yet. Have a few ads.)

Also, if you have an Xbox 360 controller, I recommend using that to play this game because they were totally meant to be together.

Posted in My games | Tagged , , , | 1 Comment

Test

This is me testing the posting system.

I’d put some kind of welcome message here, but it’d look exactly like the About page, so you don’t get one.

Posted in Uncategorized | 2 Comments