Wednesday, August 27, 2014

The Grind

Well, as of 168 hours ago, the Fall semester at New Mexico State University is underway.

As of now,  I have a weekly schedule that consists of ~20 hours spent at work cleaning storage units, ~19 hours spent on campus, and ~7 legitimate hours of free time.  As you can probably see, these projects are going to slow to a crawl.

On a more positive note, I'll review a few awesome things that have happened with the development of "Depth".  My wife, Rebekah, has officially hopped on the development team and is heading up the art direction of the game.  She's having a blast shooting back ideas back and forth across the living room, and I'm really glad she can share in the joy of this creative process.

I've also ironed out quite a few major bugs.  Now, if the player would "focus" while in the middle of an out of focus block, they will simply drop below it.


It's a small change, but the aim was to force the player to do their best to land on top of the block.  Plus, I'm also very proud because it's the first instance of GML code I tested that worked on the first pass.  Awesome.

As I did mention in the past as well, I wanted to start toying with level design.  And I have been.  I've been keeping all sorts of sketches for creative ways to apply this whole "focus" concept into level design. Although, as much as I like how they are turning out, I do feel like a lot will involve pure in-engine experimentation to see what really works.

So that's about it.  There isn't much to this post, it's just an update and a little reminder to myself to keep going.  I need to remember to make time for this stuff, and not just sink into my couch at the end of the day.

Hopefully I'll get to share some of the creative process in the future, like my level sketches or my wife's pixel art.  We'll see where we go.

Here's to a good Fall season.
-JWest

Thursday, August 21, 2014

"Depth" - Showing Appreciation for the Drag and Drop

The "focus mechanic proved to be much simpler than I thought.  GameMaker Studio has a handy function in it's Drag and Drop U.I. simply titled "Change Instance".

The "Change Instance" function was all I needed to make this mechanic really work.  Using similar platforming control code I've used in past tutorials,  all I needed to do was create a blurred version of the sprite used for the object that the player would be colliding with.  As the "blurred block" isn't mentioned anywhere in the player object code, the player simply doesn't react with it.

I've tied the "Change Instance" action to a key release event, in this case, the letter "Q".  So, once a player presses and releases the Q key, that causes the instance of the blocks to switch.


Now, the problem I am running into is my own lack of coding experience.  As you can see in the above .gif, all of the block I have used are, well, blocks.  There is no "floor" for the player to land on, as once the "focus" key is hit, ALL of the other blocks would go out of focus.

Now I have tried to add a floor object and tie it into the players collision code, but so far, this has been the result:


I sort of though it would be as simple as adding an "or" statement:

if (place_meeting(x+hsp, y, obj_block or obj_floor))
{
    while (!place_meeting(x+sign(hsp), y, obj_block))
    {
        x += sign(hsp);
    }
}
x += hsp;

But that proved to be incorrect, as the player would simply fall through the floor.

Once again, GameMaker's Drag and Drop U.I. has come to the rescue.  I finally figured out that all I needed to do was add a collision event to the player object with the instance of the floor.  Applying that same code this time to the floor object, the only issue I had bumped into was that the player would get stuck in the floor if he/she fell through one of the "blurred" blocks.  This time, I was able to fix it using that same script that was used in the tutorial for "Breakout":

while (place_meeting(x, y, argument0))
{
x += lengthdir_x(1, argument1);
y += lengthdir_y(1, argument1);

}

This keeps the player pushed above the instance of the floor and allows the player to control the character normally.

**On a side note, I'm taking note of the functions used in this script as well as my coding issue with floor collision.  Expect another one of them "Lesson Learned" posts in the future.

I think it is safe to say I have a nice stepping stone for this project.  It may not seem like much to most of you, but I can't explain how exciting it is to actually make progress on something.  Now, I have a lot I still need to learn.  I would very much like to get to a point where I can rely strictly on code and not the drag and drop, but it does really help to push you along if you get stuck.




The nest step I think will require a little more research/tutorials.  What I hope to look at next are:

  1. Creating a finishing line.
  2. Creating a health system/objects that harm or hinder the player.
  3. Overall level design.
So to get an idea of whats coming up for the blog, I will more than likely have a couple of "Lesson Learned" posts as I review some code and dive into a few tutorials relevant to these projects.  Heck maybe I'll even throw in a few Rant/Opinion posts when I have the time...


-JWest

Tuesday, August 19, 2014

Palette Cleanser: Starting a Secondary Project

I think the title says it all.

For the past few days, I've been throwing code at the wall trying to make sense of the physics needed for "Off the Wall" to work.  It's getting kind of monotonous.

I'm not giving up on the game,  I just feel I need to refresh the creative juices.  So, I'm going to get started on another concept I had been planning well before "Off the Wall" popped into my head: "Depth".

See, one of my hobbies for the past few years has been photography.  One of the things that I liked to think about is the focus of objects in a photograph related to the depth of field.  I was trying to figure ways to implement that into a game, at least, a game I knew my entry-level smarts would be able to program with GameMaker.

And so, depth was born.  I had spent a bit of time sketching out mechanics, objects, enemies and the like onto paper:


The basic concept of the game is that it is, at heart, a platformer.  The only main difference will be a "focus" mechanic.  Imagine if we had re-done the original Super Mario, only we added layers.  One layer in front of the main level, and a layer behind.  You would see various blocks and objects that are out of focus and may be different sizes depending on the plane they reside in.  However, the only way you would be able to interact with these objects is by turning your focus away from whats in front of you to whatever is in either the front or back plane.  If you think about it from Mario's perspective,  it would be as if he is looking left and right as opposed to the blocks and Goombas directly in front of him.

Now, I've had a few different ideas of how to apply this mechanic to make a game actually fun:

  1. Timed Runs:  Get to the finish point before the avalanche behind you catches up.  In other words, it imposes a threat that you need to get through each stage as fast as possible and be able to "focus" on the fly.  This could result in the challenge being: identify the proper path of blocks/objects to get you through the course (be it over a gap or over a mountain or something such).
  2. ...actually, now that I have written out the other ideas and deleted them, I don't think they're really worth following up with the first idea.
So, for the time being, it looks like the game will revolve around timed runs.

Since I'm getting the basic code of platforming down, it seems the only really new venture is the mechanic, which I'll imagine will just involve switching from an object without collision to an object with collision and having the corresponding sprites (probably just throw em into gimp and add a gaussian blur...).

So that is the new project.  I'm not giving up on "Off the Wall", merely taking a creative break and refreshing my head.  I'm hoping that a little time away will help me to better figure out the physics code I'm aiming to have for the game.

-JWest