Madness: Premeditation was a bit of an experiment for me. It's been a while since I've tried to do something "new" in flash and building this game was really rewarding because of the hurdles I had to overcome to make the game work properly.
The original concept was quite a bit different from the end result:
http://www.newgrounds.com/dump/item/36 e322a09404ef4656b121c96997db71
As you can see, it was going to be more of a step by step process where you had a choice of what to do every 5 seconds or so, then could watch the replay and see all your planning play out in full-speed. Seeing the "replay" was always a key part of the idea since a lot of the pleasure, I think, of the Madness series is just sitting back and watching the slaughter unfold.
Another big inspiration were all those "gun-fu" movies like "Equilibrium" where the main dude has obviously planned with precision how he'll kill everyone.
.
/* */
In the end, after some discussion with Luis, we decided to simplify the concept from the "choice every 3 seconds" down to distinct phases divided up by action type, so basically: 1. Run the level 2. Aim your guns and 3. Watch it unfold. This, not only made the game simpler to "pick up and play" it also narrowed the scope down to something we could finish in the limited amount of time we had.
My first hurdle was deciding how to show the player's path after having already run it:
http://www.newgrounds.com/dump/item/86 a3ae1c5f6c527eae1a1bfb218fdb47
One of my concerns was trying to reduce the amount of data I was storing to pull off the replay since I wanted it to be share-able in small data packets. I decided to drop a "node" every few frames at the player's x and y position and then use the drawing API to connect the nodes and approximate the path the player followed through the level.
Originally you could only shoot from one of those evenly-spaced nodes:
http://www.newgrounds.com/dump/item/37 74ffac903ea31035b59048ca83e073
Luis suggested I allow the player to place nodes anywhere along the line and I agreed that would be a lot better...but implementing that was another hurdle...
How can you calculate the x position of a variable line given a specific y position (and vice-versa)?
Eventually I remembered my Algebra class and used the point slope formula. I know this is a simple concept for most coders, but when I figured out how to make my move-able node "snap" to my arbitrarily-created line, it was a moment of triumph for me. Here's how it's done for those who might be wondering:
========NERDGASM=======
My line was already broken up into segments since I was dropping nodes at specific intervals, so I could always start with 2 points:
(x1,y1) and (x2,y2)
From these 2 points you can calc the "slope" of the line. ie: rise/run:
m = y1-y2/x1-x2;
Since I know the user's x mouse position, I can automatically center my node there:
finalx = this._xmouse;
Point slope formula is:
y2 - y1 = m(x2 - x1);
To calc the final y position, solve the equation for y2 using one of the line's end-points and your _xmouse to substitute:
finaly = (m*(finalx-x1))+y1;
Then just place the node at the final calculated points:
node._x=finalx;
node._y=finaly;
Now wherever you move your mouse, it will "snap" to the created line. (In the final game I also threw in some logic to calculate the X position based on the _ymouse to make moving along the line smoother when the slope was steep).
=====END NERDGASM========
This is just 1 example of the many hurdles and new thought paths I had to take to get the game where it is now...getting the player's hands to move correctly and maintain the correct gun for Left and Right, laser-sight aiming, restricting 2 handed weapon aiming, removing nodes once they're placed, and saving/loading saved data with the NG API were other learning experiences along the path to getting the game released.
I didn't do it alone, a lot of the best gameplay ideas came from friends, like Luis,Coaly, and Jacksmack who helped refine how the path is displayed to indicate time passage (thick to thin, light to dark) and also displaying the time-stamp as you scroll along the line to allow more exact planning.
Many others have since given great suggestions, like having a timeline to scrub along to make node-placement more exact (and so you don't get inaccurate placement when lines intersect), allowing more sandbox control like level-design and placing your own enemies, projecting enemy paths the same way your own path is projected, restricting node placement based on gun recoil/re-loading, melee attacks, slow motion/bullet time, and throwing your gun when it's out of bullets...maybe in a sequel?!
I know there are still a few bugs, but I'm very happy with this game mainly because I learned so much when addressing the little hiccups that arose in trying to do things I hadn't done before. Sometimes it's easy to stick to the stuff you've been successful with, but when you stretch your skills with something fresh it can really help revive your love for the medium.
GOOD LUCK!
P.S.
http://www.newgrounds.com/dump/item/1b 2e605e26a3059793aea1dc8fb57a23
Originally the game was going to star Sanford and Deimos from Madness Combat 9...with Deimos being the "ghost" or "spirit" (because he died) who planned the level and then Sanford would use Deimos' post-mortal intel to execute the level with deadly accuracy. Someone told us it was too convoluted though, so we stuck with Hank...though on level 2's background Luis snuck in Jouste's poster of Sanford and Deimos :)