Wednesday 30 November 2011

Success! Well, kind of? :)

The month is over and while I am far from having what would be called a complete (as in publishable) game, I am gonna declare NaGaDeMon won (at least more than lost ;))

All the basic features for core game play is done: The player is controlled by rotating the device (sometimes violently), there is a goal that needs to be reached before time runs out, there are enemies that eat some of your remaining time, and boosts that give you more time. The player also dies if losing control and bumping the head against the ground.

I have successfully deployed and played my game from start to end today, all five levels, dying sometimes, winning sometimes. Success!

But the main reason it's such a raging success is that I managed to do this, without spending insane amounts of time, and still: there's a big part of a game done, I've learnt a new environment and a new platform, I've re-learnt a lot of horrible trigonometry, made new friends and most importantly: remembered how fun it is to make games! There will be more.


Here, have some screenshots, and then I'm gonna talk a bit about what more there is and what is missing:

Super simple intro level, meant to teach the absolute basics.

Suddenly, the goal is... where?

And tricksier still.

So, like I said, all the core features are there and it works. So what needs to be added?

Graphics


Obviously! All of it is ugly placeholder graphics, with programmer's animations. The player needs to be interesting and make cool moves, and everything else needs an artist's touch.

Sound


Also placeholders, though I start to like what Dennis has done for the soundtrack (the sound effects is all my fault!)

Fail


The game needs to taunt the failing player and there needs to be a death screen.

Win and Highscores


The game is designed so that you are supposed  reach the goal with as much time left as possible, meaning that avoiding the enemies and collecting a strategic amount of candles at the same time as reaching the goal will net you bigger scores. This should also be tied to a server, of course!

For the obsessive-compulsive player, a big hit! ;)

Levels!


These are just placeholders, although the first two-three levels now are at least sketches on how to ease a player that don't know what to expect into how to play the game (hopefully). The level editing works so the process is fast, but it still would take quite some tweaking and testing to make good levels, as usual.

Level select


Select level screen, and unlock levels.

Replays


Haven't tried this, but should be possible to save each game and have replays, thanks to Box2D being deterministic, meaning that the physics will repeat the same things given the same input - which is current gravity each frame. They could be played on the start screen, they could be replayed from a menu - and other players could download and watch your speed runs! (Much like N does it).

Tweak and optimize


Make everything better and faster. :) There should be a lot to do on that front.

Other polish


Such as a help screen, menu system, real splash screen, fonts and so on.

Conclusion


I think this could very well be turned into a real game, but then I would need to enlist some help with graphics and sound. I'd also say that taking some time making maybe 15 good levels with nice rounded corners is very doable. So, am I? Definitely maybe. ;) I'd like to see this game in a completed form, and at the very least I'm going to spend some more time tying it together.

Thank you NaGaDeMon! And thank you Bjarne for making me do it... See you again next year!

Tuesday 22 November 2011

Terrible pace

I've had such a terribly slow progress lately that this blog looks like it belongs to Stoffe. So terrible in fact that I just had to post for the most minuscule of triumphs. After battling with the Bitmap class for way too long and finally realizing that I was a terrible programmer, not that the Bitmap class was terribly implemented: I finally managed to create the pixel-upscale that I wanted.
The tiles in the image here are 16*16 with a pixel-size of 5*5. It is a bit too big naturally, but I thought it would make a better screenshot. I guess a typical pixel size for the final game would probably be 3*3 on a mid range screen.
The image is a bit crushed in this post, so click it to see the original if you want to see a more realistic view of the scaling in action.

Monday 21 November 2011

Refactor, bugfix, implement, blog, rinse, repeat

New version: http://dl.dropbox.com/u/14713777/GhoulsnWheels.apk

See below for info on what's new.

A fair bit of Sunday's hacking went into restructuring poorly thought through structure. Not perfect now, but better, and a bit easier to work with.

Also got my first real bug report, Mr BZR (if that is indeed your real name) discovered that a part of the world was invisible but still had collision. Since the visuals and collisions are drawn from the same dataset, there should be something wrong in my code... a quick look in Inkscape confirmed that the collisions were correct, so something about the level drawing code then...

Sure enough, and thankfully easy to find (this time). An Obi-Wan error causing the code to ignore the second point in each polygon was a bit odd though, but oh well. :) Slipped past me earlier because most edges are pretty short and so doesn't affect the layout much. Good catch there!

So, some new stuff as well:

Time - it will run out. There's a countdown going on in the corners and when it's down to zero, well so are you. Would be nice to see how this looks on other devices because I'm pretty certain my values are off and therefore hard-coded to my device at the moment.

My First Enemy - a playset suitable for all ages. Not only will the countdown bring death and destruction, there's also a winged demon loose that steals some time from the player given the chance! (What actually happens will be made more visually clear, right now you need to know it to notice it I think).






Saturday 19 November 2011

Let There Be Rock

Some small updates, same URL as before: http://dl.dropbox.com/u/14713777/GhoulsnWheels.apk (remove old first and install this instead).

Changes in this version:

Programmer. Composer. Lebemann.
Sound

  • an initial sketch of in-game music by the multi-talented Dennis Saarela. If I wanted to have this game made quickly, should have contracted him. ;)
  • kicking off the game with a skateboarding sound
  • death sound, one part inspired by the awesome shattering sound in old Wizball (though mine is nowhere near as shattering) and for the other part I added the Wilhelm Scream for fun (or lulz).
  • winning sound is just a classic sounding victory fanfare
All the sounds temporary/subject to change. Will see if it's reasonable to add some skateboard landing sounds as well, need to take into account time between contacts.

(think I might have had a crash in the sound playing when testing, not debugged yet, so don't be afraid if that happens :))

Can not fall off the world

Spent way too much time trying to have barriers around the world where the player would die if travelling too far away, but wasn't satisfied with gameplay nor how to visualize this. So now instead, the level has its own "gravity" of sorts and will return the player to the playing field if going too far away. Please let me know how this feels, both as concept in itself and the speed/distance etc.

Zoom out

It's now possible to see the whole level by putting two fingers on the screen at the same time (mostly useful on levels the size of the third one or bigger. Need to take into account even bigger levels and make it possible to scroll as well, perhaps. Currently freezes the action, that may well change.


The rest/the next

No changes to graphics or levels (sadly). Need to find someone to do the graphics. And the levels? :)

Next up should be:

  • timer countdown and objects to pick up and gain more time (this will also be the (high)score)
  • enemies, thinking two kinds for now:
    • flying demon that semi-hunts the player (goes in general direction but not homing directy) and that probably do not cause death, but is more annoying by pushing the player (if that works nicely) which in turn may cause death of course
    • gravity-affected objects such as rocks that will cause death, adding to the puzzle since they will roll and fall according to the changed gravity

After that it's time to start tying things together properly with start/death/win screens and also design some actual levels. 11 days to go, hopefully doable. Now it's time for a beak with some drumming and some (many) beers!

Wednesday 16 November 2011

Testing time time time is fall in love time

fall in love time is testing time time

For those with an Android Device, here's a little APK: http://dl.dropbox.com/u/14713777/GhoulsnWheels.apk

Not gonna say much (no preconceptions) other than that if it works, you should be able to play three levels that will then loop.

At this point I'd be interested in hearing ANY and ALL feedback, no matter how obvious it must be that I can see it, no matter how big or small - anything. Please. Thank you!



Tuesday 15 November 2011

Damn you Android pixels!

In a week my progress is this: I can now draw pixels. <tired Monthy Python cheering>Yay</ tired Monthy Python cheering>... Naturally I could draw pixels from square one(arf arf) but the problem is that any attempt to draw into a Bitmap and get a 1:1 relation between the bitmap pixels and the physical screen pixels seemed to be beyond me. OK, I did not work for a week before solving this, it was more like 3 hours but as I had to leave the problem unsolved for a couple of days to get on with life, it kind of felt like a week.

So how hard can it be? Well it was a bit trickier than expected. What I wanted was to load a PNG containing some 16x16 tiles of mountains, lakes, plains and so on and to draw a map. But Android is very helpful and re-sizes stuff automatically to fit your screen size and your screen density. This is normally very helpful unless you want to do the exact thing I wanted. That is: complete control on the pixel level. So after a lot of googling I found that the following 2 things fixed my problems:
  1. In the manifest XML file, add the following:

    <supports-screens android:anyDensity="true" />

    (this is a really bad idea for most apps as it turns off a lot of automagic "under the hood" stuff that is designed to make your life simpler in most cases. Read the anyDensity documentation here)
  2. When loading the PNG (even from the "drawable-nodpi" folder) the Bitmap was scaled after load was completed(24x24 instead of the expected 16x16). To correct this I had to pass in an extra parameter to the BitmapFactory:

    BitmapFactory.Options opts = new BitmapFactory.Options();
    opts.inScaled = false;
    Bitmap tiles = BitmapFactory.decodeResource(res, R.raw.tiles, opts);
And so now my pixels are ending up where they're supposed to.

And before I create the "Pixel re-size" functionality, everything will be reeeeally small(this image on a recent phone is reeeeally small as the DPI is a lot higher than on a laptop/desktop computer).

Halftime updates

15 days down, 15 days to go - pretty happy with progress since stuff is happening even though I haven't stayed at home on weekends or otherwise rescheduled much - meaning I could of course have had a lot more stuff already, but also meaning that I've probably cut down on my pointless internet surfing rather than important/fun stuff. All good?

Managed quite quickly to get a pretty good feel when skating along in all sorts of impossible angles, but could use some more play testing and edge-case tweaking. I'm not entirely happy, but perfect is hard and also the enemy of good. Not having anybody else doing testing is, of course, a really bad idea, so really should prepare some test levels and get some external feedback.

Prompted by some people on the internets who also wanted this tool, I spent this Sunday on cleaning up my level converter tool and releasing it to the world instead of working on the game - on the other hand, it now works generically and does all the things I need, so faster turnaround time for me as well. Plus, good karma? :)







Monday 7 November 2011

Possibly related?

King Radical, being Radical
I'd really like to think so!

See: Dr. McNinja

Come to think of it, that could be an alternative theme... :)

Mobility update

A short update on the RPG: I have a rudimentary tile system set up with a player overlay that I can move on step at a time based on touch events. I guess I'll add direction key(and yes Stoffe: Xperia Play controller support eventually).
That's basically it for now. I guess some form of "no, you can not walk on water" check for the movement is up next.
This is starting to smell a lot like "map editor"...
As for mobility: I'm building a mobile game, I'm posting this from a mobile and I'm entertaining the idea of doing the graphics in the phone as well... nah... many not. I just have one month after all. K.I.S.S.


Control issues

I have them. When it comes to games, at least. Really good controls is what makes a game "perfect", in my opinion. It's for good reasons that every time "best games ever" comes up, games like Super Mario Bros, N and Counter-Strike makes it into my list. These games have very well-honed controls and when learnt, it feels like you have a perfect connection to your avatar, and any mistake made in the game is your fault - exactly as it should be.

It's also about removing obstacles to accomplishing the goals and having effective controls in more ways than that - I couldn't play Warcraft 1 because I happened to play Warcraft 2 first - the controls were that much better in #2 so I just got frustrated.


So, obviously, while not hoping or even aiming for perfection, I need to have good controls in my game. I read somewhere that when Nintendo makes a Super Mario game, they build the character first, then run and jump and play with it until it feels perfect - and then they build the game around this great-feeling character. Whether that's true or not, doesn't matter, sounds like a recipe for greatness!


Also, since there's only a short, short month available for the project, and I'm not cutting down on other fun (well maybe in the end...) effectiveness is key. Nowadays everyone knows about fancy-schmancy terms like Extreme Programming, Agile or SCRUM and those are good tools for working with a customer to get the right things done as quickly as possible, as long as it's done right. But if you want to boil it down for really small teams (like my one-man team) and especially with no actual customer, the principle is to look at the project all the time and think about what is the most important next step for having a playable and fun game? Or, "if I have to turn this in tomorrow, what would make the most impact to do today?"

First step might be to have a program running at all, the next maybe to have a player sprite... then steering it, or maybe having some ground for it to interact with? Depends on the goal, of course.

So, good controls. I need a player, and being able to alter gravity to steer the player, and I need an example level to get the good feeling from. If I nail that, level design and goals can come later.

I'm using 2D-physics from Box2D and I've decided to use a simple ball rolling around + lots of smoke and mirrors to make it look like a skateboarding experience instead. But how to setup the test level? First, I was going to plot a level using squares and rectangles at different angles, forming slopes and slides and so on for collisions. But, how to put them on the level and update them? Enter lots of numbers by hand? Build a level editor (DANGER! DANGER!)? Seemed that way, I'd spend a lot of time not focusing on the game. Also, ideally, I would like to be able to be liberal in how the levels should look, preferably hand drawn by good designers.

So, here's where I may or may not have gotten side-tracked - I'm not actually sure myself. Anyway, I used Inkscape to draw some simple example levels, then wrote a tool to convert those paths to collision meshes and export the image as well. I had great help from some example code I found on a blog, so it didn't take almost any time to get it prototype 1 up and running: running on my phone, I could rotate all the way around to control gravity and thereby steer a ball with pretty good control. On top of that, already a good basis for level editing, Inkscape is already available and there's tons of stuff to extract from the drawings, can probably use it to place enemies and goals etc as well.

Very first level in Inkscape

On phone: down in the pit
On phone: successful escape!

Before I can really get down to nailing the feeling though, I need the ball to look like a skateboarder instead, and oh boy here comes trouble! There's a LOT of things going into creating that illusion:
  • Knowing what surface the skater is on
  • On what side of the surface
  • The angle of the surface
  • Maybe merging angles of multiple surfaces
  • Rotating properly a sprite that is irregular and off-center
This really took a long time to get it all right. For the technically interested, I:
  • Skipped triangulation and just use edge shapes (basically lines with collision)
  •  Make sure that only complete polygons are used for the level shapes, and find out if they are clockwise wound or not - this deals with "which side"
  • Precompute angles for all surfaces in level tool
  • Grab the angles from this when the player collides with a surface and rotates the player, whicle at the same time positioning according to where the ball is
Lots of this seems kinda obvious when you know about it and why, but it took me a couple of days of accomplishing nothing until finally it all fell into place. Had some great help in forums and on Google, once I knew what questions to ask.



On phone, held upside down - a sk8er boi!
So. One week done and gone (not that I've worked on the project all the days...) and I can now start tweaking the feeling and also figure out what the key game elements should be. Probably gonna go with running for time, like N, but am unsure about enemies, puzzles etc. Time will tell!

Wednesday 2 November 2011

Ghouls n Wheels

Not my game.
So, here's my game idea. I've had this idea for maybe a year, springing from thinking about what kind of game would really take advantage of, for instance, being able to measure which way is up on a phone or tablet. A number of possibilities come to mind, of course, but I started thinking about an old, fun, acrobatic/physics game for DOS, called Action SuperCross (or Across, as we called it). The game is about making all kind of insane stunts and tricks navigating near-impossible platform levels, while collecting apples and escaping by picking up a flower (yes, really). Lot's of fun and a good challenge!

Maybe you could control the vehicle by tilting your device instead of using keys? But using a motorcycle or bike like that didn't really make any sense, insomuch as a game has to, but what about if it's a skateboard instead? And also, how about instead of controlling the character, how about you control gravity, so that whichever way the device is held, gravity is always down, and the player uses this to control acceleration and deceleration, as well as which way is currently the floor or ceiling of a level, making it an action puzzler?

Made of AWESOME.
Here's how, as it often is, inspiration strikes in combining more than one idea. A friend of mine, Markus Toivonen, told me about  an idea he had for a movie script some years ago, and he even painted a nice poster of it - he called it Ghouls n Wheels and it's a mixture of... maybe Back to the Future and Army of Darkness? It's about this boy who finds a skateboard, presumably in the same store that sells the mogwais, and told not to ride it after midnight. I don't know. Either way, the skateboard is magic, and takes him straight into HELL! And now, obviously, he needs to escape.

Sounds like a perfect backstory and setting for my game, right? Here's this boy, on his skateboard, and he's in hell and needs to escape. Hell is one weird place, where natural laws don't really apply, but on the other hand, our hero has a magical, inter-dimensional-travelling vehicle at his hands, and can therefore to some extent bend the laws of hell to his will - in this case, apparently decide what is up and down, or depending on how you look at it, ignore any such stupid law and skate on, Escher style.

So anyway, that's my basic premise: action puzzler, set in hell and controlled by rotating the whole world around the player, using a physics simulation to get a good nice feeling from the skateboarding experience. If the simulation is tweaked enough and there's some good level design for the puzzles, I think it could be a fun experience and a good game.

Sounds easy, right? Now on to figure out exactly how this is even possible. Not really taking the easy way out, am I...?

Next up, more about the how, I guess. If I have some how to share. Until then, have a picture of me on an analog skateboard, doing wicked shit apparently.
"Hang what? Lose? Ah, loose! Is this the sign?"