Wednesday, May 27, 2009

Protonaut Progress

Greg posted a few things around town and got my name onto Offworld. Awesome. Here's a link to the article.

And here's a preview of the latest game art:

Since my last update I haven't done a whole ton of work. I had an entire week of insomnia and subsequently got hooked on the old game Mass Effect. I ended up beating it - I have to say my complaints about it are exactly the same as my complaints about Knights of the Old Republic. If you play a non-aggressive character, you get put into forced fighting situations that suddenly become very difficult.

At least they don't make you fight the final boss alone.

Anyway, I've done some updates to (working titles) Protonaut / Chemistry; here are my thoughts on the latest:
  • Spacebar now triggers the "pause time" effect. I took a while to get it looking just right - time slows down and speeds up before the pausing takes effect. It's actually quite complex - I have to store force vectors and turn objects into "static scenery" on the fly, which causes some hard locks in certain situations. I think I squashed all those bugs, and I think this resultant effect looks wicked cool.

    Imagine a cool "fwwoooosh" sound effect as the time is adjusting, and maybe a matching animation to explain the jerkiness of the character while it happens. It'll get there eventually.
  • The "platforming" controls seem a lot more advanced;
  • I'm actually adjusting the friction of the player object on the fly - when you are in the air, your friction is zero, so you slide down walls quickly. When you are holding down movement keys, your friction is halved. When at a standstill, your friction ramps up to 95%. This gives your character a bit of a natural deceleration feel, but is tuned a bit extreme to keep it responsive for us humans playing it.
  • Your motion is now capped to a specific top speed. You can always move faster than that speed through natural causes (falling, being pushed by flying objects, etc.) but you can't get over a certain speed on your own momentum.
  • You now have some air control - 25% of your regular force. Seemed like a nice number.
  • Jumping could still use some work - jumping height/force isn't static and it can be frustrating not knowing how high you will go. You can also end up jumping very very fast upwards if you get a slope that's just right...
  • Friction makes running up shallow slopes difficult. I'll have to toy with the values a bit more to make that work better.
Right now Greg is focusing on getting some interface art up and running, so the Level Editor is actually useable instead of a secret set of keys only I know about. I am proud to say, though, that the level editor is fully operational and I haven't touched my level XML in ages.


That's the level editor as it is now. It's functional enough - it has copying and resizing abilities and full creation tools. It makes it a breeze to make things now (I still shudder when I think of hardcoding all these objects in). I can't wait to see what Greg turns it into.

And I'm really starting to like the name Protonaut...

Tuesday, May 19, 2009

Mid-Mortem: Space Squid

Mid-Mortem time!

I don't like using the term post-mortem with things are still going on, but I thought I'd talk about April's game-of-the-month, Space Squid.

As this is my first foray into the business that is Flash game development, I wanted to get a nice scientific baseline sample for what kind of interest self-generates around a game.

I wanted to use a few tools and just let it stew for a while and see what happens.

So here's exactly what I did:
  • Throughout April: Blogged about the game, right here. I also posted the occasional link to IRC chatrooms and IMs to get some feedback from trusted sources. The occasional twitter and facebook status update.
  • April 18th: Posted the game to FlashGameLicense.com, clearly marked as "under construction and unfinished" in several places. I decided to post it early - just in case a publisher saw it and said "Hey, turn it into a SpacePenis and you have a deal!" - and I'd still have time to make some development changes before my May 1st deadline.
  • May 1st: Finalized the game and marked it "Complete" on FGL; filled in a game submission form at AddictingGames.com, and emailed all my favorite 10 indie-related blogs announcing the release in a very low-key way (and even offered an open invitation for an interview about rapid prototyping, indie development, and all that other nice stuff). I also made a forum post at The Independant Gaming Source (TIG).
  • May 2nd: Attempted to upload the game to GameJacketWhirled, and Kongregate, but failed - GJ does not support games written in Flex at this time, and Whirled/Kongregate had some sort of malfunction once uploaded. Probably something like direct stage references; surely fixable if I put more time into it.
  • May 3rd: Submitted game to JayIsGames as a review request. They did such a great service for Fantastic Contraption I wanted them to have first stab at it.
That is all. I did not approach any publishers, I did not email-blast everyone in my extended family, I didn't lift a single finger to promote my game other than the above half-hearted effort. I wasn't trying to fail - I was just trying to see what kind of self-support the game would get just existing on it's own.

Here are the results of the above work, as of today (May 19th):
  • Three friends twittered about SpaceSquid.

Let's take a look at what went wrong, shall we?

The first and biggest problem I saw was a complex issue: A misunderstanding I had about how FlashGameLicense worked, a misunderstanding from their users about how it could be worked, and probably a poor design choice in the development of the FGL site. You see, as soon as you post a game as "visible" to the FGL-browsing publishers, it goes right to the top of their list as "fresh" and "new." It does not take into consideration the "incomplete" flag you set on the game, nor does it bump you to the top of the list once you do finish the product.

So what happened was I received 8 pageviews from publishers when the game was only half-done and the graphics largely placeholder. Here's a comparison: Final Build vs. The Build They Saw. It kinda makes me shiver that my biggest opportunities may have been seeing that fateful build. 

I built a lot of data-mining ability into the game, with Google Analytics tracking level-loads and the game itself logging activity. Of those 8 pageviews from publishers - which seems to me to be an embarrasingly small number to start with - only one ever clicked "Play Now" and they closed the window after about 20 seconds. The other 7 never made it past the menu - and considering the state it was in at the time, that is probably excusable.

It has now been 19 days since the game was marked as finalized on FGL. The game has since been viewed twice by publishers, and "Play Now" was never clicked. Of the 10 total views, only one was from a username I recognized - AddictingGames.

On top of that, JayIsGames decided not to review the game (or the review request was lost in the trash - though I did speak to Jay directly about the game and he seemed excited to get to it). My AddictingGames.com submission form likewise did not produce any further communciation. The few people who did played the game enjoyed it, but not at length, and didn't seem to particularly pass it on.

Suffice to say, the game cannot support itself. This is completely counterpoint to the success that Fantastic Contraption enjoyed, and I can't altogether say that I am surprised. Lessons learned:
  • FlashGameLicense does not have many Publishers that use their service;
  • FlashGameLicense punishes you for posting your game before release;
  • The game must suck more than I thought it did, and I thought pretty lowly of it to start with.
Well, even a piece of crap can sell if it has enough marketing behind it. And the power of
 marketing is now within reach to humble folk like myself, thanks to the power of the internets. I guess I'll have to give it a try and see if I can't turn 3 twitter posts into a financial success.

Yes, that wlil be me sitting there casually high-fiving someone over my bluescreened laptop with a briefcase so stuffed full of money it's falling out of the sides. Because that's how I roll.

Anyway, don't want to make a big to-do about it all - I have a new game in the works and I'm making a much bigger effort towards it than I did with SpaceSquid. Maybe that will be my golden goose.

Er, wait, a golden-egg laying goose. A golden goose wouldn't work at all, it can't even float proper! Stupid goose.

The Platformer

OK, here's something I really hate. Coding how a player moves.

It turns out there's a lot of intricate guesswork going on behind the scenes of most platformers. For instance, did you know that many platformers change the amount of friction exerted on the player body depending on the current action?

Or that bodies accelerate nonlinearly?

There's a million factors involved and they're all fairly easy to code - but there's no easy math behind it; no science. I'm just going to have to continuously pull numbers out of a hat until I find something that feels right. It's quite frustrating - why can't it be as easy as just running and jumping?

My latest upload (public build #2) disabled movement while you're in the air. This is how I want the game to be, and this is exactly how to make it un-fun, which I guess means my opinion isn't worth anything in this case.

I haven't pulled any of the levers or pushed any buttons yet when it comes to acceleration or friction. The game obviously has a sluggish feel to it here but it take shape over time; patience!

The buid does, however, feature some of Greg's artwork actually applied to the assets in-game. I have to say it turned my game from looking hideous to awesome in a single build. I wouldn't take it as anything near final though - just yesterday we took the game in an entirely new direction (artistically) and the next build I post here will likely be altogether different.

(I think I'll post with more images from now on, because - let's face it - a blog post without pictures is like a whore without makeup)

Sunday, May 17, 2009

I've Got Chemistry

So I have two games I'm simultaneously making right now.
  • A pseudo-educational platformer where you learn about chemical constructs;
  • And a building-destroying platformer where you pause time.
They're both running on the same engine and is nearly a simple reskin between the two. I'm pretty excited to release both of them together and see what performs better. (but we all know what my initial plans turn out to be)

Hey, speaking of re-skinning - I'm collaborating with Greg Wohlwend on this project. He's giving a lot of input and doing the artistic work. You can see my sample level here (first released build of the not-yet-named chemical game) and you can see Greg's version here. Haha Greg, Mine is playable. :P

I've been doing a lot of behind the scenes work on the engine - I've got a level editor up (that is neigh unusable for anyone but me because of the plethora of hidden function keys) and a basic shell of gameplay. It's coming together quite nicely.

The playable level when you click the link above is the chemical formula for Caffeine. I spent all night working on it. :)

Wednesday, May 13, 2009

The Game Commences

I spent nearly the entire day today but I finally did it.

XML saves. XML loads. It all stores in a mySQL database. Check out this 150KB level:


The level editor is functional, but only in the most basest of senses. You can make things; I recommend turning off gravity while you do so. Be sure to read the instruction screens.

Once I get things working a bit more robustly (resizing and rotating objects, object selection, etc.) I'll do up a proper sample level and we'll have a feel for what gameplay should be.

The only undocumented feature in this build is holding down shift will increase your explosive ability. Caps at about 20 seconds worth. :)

Monday, May 11, 2009

FrameWork Ends (For now)

Argh, I'm getting quite frustrated trying to get XML recording going properly. I'm going to have to end up making a completely new custom XML class that uses only in-game previously-defined objects.

That is to say, I can't build a generic version that fits a framework concept at all. 

With that said, I'm done work on my framework for a while! The last build I made was Number 5. I made the arena double-wide and turned on view focus by default; returned the pile of stoves; fixed up the zoom a bit more; and finally... Added a detonator. Just for kicks, press SHIFT to send out a shockwave. :)

I guess that means it's time to start focusing on my next game... Tentative titles: "Sachel Charge," "Time Bomb," and "Save the Day." No idea yet. Hm. What say a month for this one? Maybe 2 weeks? We'll see :)

Four small things

Some things I fixed today:
  • Zooming now moves a bit more slowly and allows you to zoom all the way out
  • Fixed the "Jitter bug" that can happen on level load (also seen in Fantastic Contraption levels where the possible level size is maxed)
  • Semi-fixed the camera following the player object. It "leads" the player a tiny bit seeking the nearest wall - which wasn't my intention, but it seems to work out well for playability's sake. It will probably have to be fixed and smoothed at some point.
  • Added linear and rotational damping - very slight - to simulate atmosphere. I know it's a horrible atmospheric implementation but I'm not sure how else to do it.
I'm going to tackle level design this afternoon, I think. I'm going to start with a basic level editor - one that lets you draw rectangles, and save them to a DB. Should be interesting.

Sunday, May 10, 2009

Progress?

I've made some definite progress since May 1st!
  • I watched the entirety of Jeeves & Wooster for the first time. What a great show.
  • (Now working on the entirety of Black Adder for the first time)
  • Playing some OldSchool Civilization 4 with Aubrey during the evenings. Excellent fun.
Now that I'm coding pretty much full time, I'm finding I have a strange desire for routine. I'm not the type of guy that likes routine - far from it. I like variety and doing things at a whim. I don't like doing things for rote. But it feels like there's no structure in my life and I'm just kind of freewheeling - and it frequently ends with me just staring at blogs for hours each day.

To make matters worse, my physical condition has deteriorated rapidly in the last few months. Sitting in the same chair all day every day (Except to go to the pub) is really turning my body into a stiff-jointed blubberball. Not to say that I'm getting fat or anything - I'm still the pinacle of human development and women and men alike oggle me - I'm just losing any muscle I had and I'm farther from touching my toes than I have been in years. I haven't even gone to Aikido in ages (I sleep through the morning session and Aubrey works during the evening one).

So in an effort to be kinder to my body, and to put some structure in my life, I'm taking up a Morning Constitutional. I've always loved the term and I have a small (200ft?) mountain right across the street from me. Might as well go exploring, find all the nooks and crannies, and maybe do some ultra-lightweight bouldering. In any case, it's nice to get some fresh air.

I never thought that "walking" was a form of excercise. The body is tuned to walk well and it won't normally expend a lot of energy just moving about in this fashion. I walked to school around 1-2km every day each way as a kid, and I never thought anything of it. I hiked, I climbed, I biked, I kayaked... But last week I walked downtown and I was winded. Brought a small tear to my eye. I must fix this problem.

I'm also going to look into trying to drink 3 litres of water per day. When you mostly sit still and never leave the house I seem to have been getting by on about half a litre, and I don't particularly feel thirsty. Yesterday I choked down my first 3L alotment and it was actually a little difficult for me. Practice makes perfect!

But enough of me whining about my personal life!

But I've also made some progress on my framework. Again, nothing to really look at. I've included a few Box2D overrides (Boundary and Contact Listeners, for example) and added a "Keep camera focused on the player" mode. There's a scaling bug if you zoom in too far on the player but otherwise it works well (toggleable in case you want to visually explore of course).

I've also completely severed all ties from the display model (camera, handling, etc.) to the game world. For some stupid reason I did all the Box2D instantiation and world setup in the same class. That's quite fixed now, and it will open the door to a new cool feature I'll be blogging about in the coming week.

I spent the entire morning today focused on solving an XML importing bug, but it turns out it was just Flash caching a copy of Level3.xml it was supposed to import from my webserver. I'm very happy on one hand, as it proves once and for all that Flash will cache files such as my larger music files and sound effects. It makes me a little sad because I wasted so many hours on a simple "clear your cache" bug. I might want to look into a "clear cache" button or something somewhere. Not even sure if that's possible.

Friday, May 8, 2009

FrameWork Updates--

Framework updates just aren't exciting. A lot of the work is back-end stuff you never see and as such is pretty dull. In an attempt to liven things up I added a lot of objects and started the game zero-g. That's kind of cool for 2 minutes. (Click here to give it a try - framework build 3)

Today I added a full-featured XML-to-Box2D importer, and a server communication library to pull the data from (either SQL via PHP or the direct XML files themselves). 

My first semblance of a HUD is in place as well and you can see it loading the level and giving status reports on the connection. (If you have a speedy connection you'll probably only ever see "load complete", but trust me it gives you a percentage progress report if things are slow ;)

I still have to implement better error handling, though. If you have no net connection the game just dies horribly because it's relying on external server files in a few places.

Here is a sample of the XML file I used for this level (the stoves anyway). Depending on your browser you might just have to right click and "view source" to see how simple it is. Units are in meters/kg.

Next up is trying to figure out a way to generate new XML so that I can save it. Once that's in place I can start the mind-numbing process of building a basic level editor.

Thursday, May 7, 2009

Framework V2

Just finished adding some shine to my development framework. You can demo version 2 right here!

For those just joining us, this is just a basic shell of a game that incorporates many Box2D and interface elements. Features are:
  • Magic-number-free Box2D world generation. Just flag your SWF with the recommended dimensions and a scaling factor and the rest is done automagically.
  • Full camera controls, including zoom and pan, completely independant of the game world.
  • A Box2D Collision listener class with sample code for measuring load bearing
  • A GameMechanics class that adds objects, tracks health, and destroys objects when they get hurt (and can add "rubble" or "shrapnel" in doing so)
  • A GameWorld class that lets you play with gravity and other physical effects
  • A player character class that has its own keyboard hooks and graphics modelling, with examples on how to update graphics every tick to match the Box2D world
  • A menu system, including flippable instruction pages, a play now button, and a sound mute button. The menu pauses the simulation and pops up overtop of the game without ruining game state.
  • Full music/sound/volume/playback controls, including server-streaming MP3 capability
  • Cookie storage and tracking of user data (including mute status)
  • Pause button
  • Demonstration code for singleton classes
  • Craploads of comments so even Box2D/AS3 newbs can understand what's going on.
Unlike SpaceSquid, I'm trying really hard to get this code running quickly and done right. I'm hoping this framework will end up being the starting point for all of my future Box2D games, and as I learn new tricks I tack them on as modules for extensibility.

I still have some things to do - a server communication module and XML integration, a HUD module, and a few other odds and ends - but that shouldn't take too long, and it's in a very much usable state right now.

I'm still a bit posessive about all my hard work so I don't think I'll be giving it away just yet, but someday... Someday, I'll release the source and let the crowds go wild. I want to see more physics games and I think this is a good way to make it happen faster :)

Tuesday, May 5, 2009

Building a FrameWork

I don't know if "FrameWork" is the right word, but I'm stealing it for my own personal use.

Towards the end of developing SpaceSquid, my poor programming was catching up with me. Writing code quickly != quick running code. I think I iterated through the entire world object list several times per tick...

Anyway, I wanted to sit down and actually write out a nice box of parts I could pull on to make Box2D games quickly and easily. Here's what I've come up with so far.

It's nothing to exciting, in and of itself, but the back end is cool. Some controls:
  • Mouse drag and drop to move the screen
  • Mousewheel for zoom
  • Keyboard arrows for moving the screen
  • Z/X to zoom In/Out
  • <> control the gravity.
The simulation doesn't really have much to it. The 4 objects that appear are representations; from left to right:
  • A cellphone (the minimum Box2D object size, 0.1m)
  • A person (6ft)
  • An office story (12ft)
  • A bus (the maximum Box2D object size, 10m)
For the time being I've given them all the density of water (1000 kg/m^2 [@ 4c]) and the gravity starts out at 9.81 m/s^2, so it's fairly realistic and should behave normally out the door.

To make things more interesting, however, I gave the 4 objects a restitution of 101%, so they actually gain energy anytime they hit something.

If you carefully tap the "<" key you can make it weightless and watch things drift around. Relaxing!

Saturday, May 2, 2009

And thus it ends... And it begins again.

Despite assurances from several different sources, not a single publishing soul has viewed my game since marking it 100% complete on FlashGameLicense.com. Perhaps I haven't given it long enough (24 hours! c'mooooon) but I'm losing hope fast. I won't give up on them completely until next Friday I think.

But that's OK - I sent out a dozen emails and posted the game to a bunch of websites. I've got at least one review in the pipeline and things will hopefully pick up over the next week.

While Space Squid slowly simmers away and attempts to make me a penny, I found myself staring whistfully at my laptop screen and remembering those heady times where it once displayed code. Yep, still got the programmer's itch.

I guess I'm officially announcing my second game! No idea for a timeline on this one (I'm going to take it slow for a few weeks at least, and I still have some Space Squid stuff to deal with) and I'm not positive on the name... I kinda like the feel of "Satchel Charge" but it doesn't exactly roll off the tongue. I'll see what I think up. :)

Build #1 hasn't been made yet but I'll be sure to post as soon as it has.