Wednesday, March 24, 2010

More stuff to buy!

Press Q to use the health dispenser (once you've bought it!). Arrow keys for movement and crouching, spacebar to jump. Use arrow keys while swinging to increase his spin. Hold down spacebar to make the jump last longer. Hit spacebar again when holding on to a wall to wall jump. A is for punch and D for kick. Press S to hold a grenade, the release S to throw it (be careful - hold it too much and you'll blow up!


I know! After four months of nothing Dreg is a hive of activity once more!

Actually, this update is not such a huge advance - mainly it's tweaks to the shop and combat and a new object to purchase...

The thing is, I just want to say thanks to everybody who has given me advice and criticism - it's all been so helpful. For this particular post, you'll see I've dealt with the comments by Todorus from the previous post (thanks todorus!). As for the difficulty, you start now with more health and money that should hopefully help the beginners among my fans (the new object should help too - more on that later).

Also, on the NewGrounds forum (in which most the posts are mine!), some guy called AdmittingZero wrote the following:

I don't understand how to buy anything in the shop or make him shut up.

Also I can just keep beating on the guys (when they're all standing on top of eachother), my punches hit all of them and none of them have a chance to fight back. The fighting needs to be a little bit more complex.

Ouch - he doesn't like snotty sam, and the combat, which I spent so long working on, isn't any good!

But the thing is, I went and tried what he was talking about, and he was right - you could just spam the A button over and over, and you'd eventually kill the thugs. It would take a long time, but it worked, because they could never hit back!

See, I'd originally thought that by having them block if you do the same move too often, players would be encouraged to vary their fighting. But that wasn't enough!

So now what I've done is that whenever a Thug blocks, there's a chance he'll do a quick counter. That way, if you keep spamming the same move you'll just get punched in the face. Haha!

It's also led to the nice emergent behaviour of apparent arguments between Thugs. If you've got two thugs in front of you and you kick, you tend to hit both. Now imagine both of them block. Then imagine that the one behind the first one does the quick counter, but just ends up hitting the one in front of him. Then the front one blocks and counters too, and it looks like they're just pissing each other off. It's hilarious and I love it. Wheeeee!

Anyway, it all goes to show the value of getting criticism.

Other changes include constantly visible instructions for the shop, and keeping health visible as you make your purchases - this is particularly important now with the addition of the Health dispenser! Yay, a new object!

Press Q to use the Health Dispenser, and it will replenish some of your health. You can upgrade the health dispenser both in the number of doses it can carry, and the amount of health it replenishes with each dose. To get the upgrades you need to leave the shop then enter again.

I went through a similar process in the design of the health dispenser as I had with Snotty Sam and the Holotec armour - the final version is much simpler (and better) than what I started out with.

I'm still not happy with the holotec armour but I really can't be bothered anymore!

Obviously, in the actual game there will be no shop like Snotty Sam's - different upgrades to armour and equipment will be found in different shops that the player will have to find.

Anyway, I'm ever closer to actually starting the game. There are still several tasks I need to deal with:

- More enemies! Argh! That'll be a fair amount of work, but I have to do it. That'll probably be my next task, to be honest - no point designing levels if I can't populate them.

- Getting lots of artwork done: I want to have a whole bunch of buildings, objects, and people to litter the world with to make it feel lived in, but also to make the background design faster (in the background I did a long time ago, I just drew each house individually, but that took too much time - I could still do that for some buildings, but it's best just to have a bunch of building blocks I can stick into the level)

- Figuring out scene-specifics like cut-scenes and boss battles

- Sorting out the ability to save. I've already got quite a lot of ideas how to do this and I think I'll be able to get it sorted pretty quickly, with small save files.

And I guess I also need to think about all the sound effects.

It still feels like there's a lot of work to do, but at the same time the light at the end is definitely getting bigger.


Monday, March 22, 2010

Money talks

Arrow keys for movement and crouching, spacebar to jump. Use arrow keys while swinging to increase his spin. Hold down spacebar to make the jump last longer. Hit spacebar again when holding on to a wall to wall jump. A is for punch and D for kick. Press S to hold a grenade, the release S to throw it (be careful - hold it too much and you'll blow up!

It’s a big update today!

Thing is, I don’t think anybody reads this actual blog post anymore (apart form you, Xenelement, thanks!) so I’m going to take this opportunity just to waffle on for ages, stream-of-consciousness style.

Oh and don’t worry – I removed the sounds because it was taking up too much time to test the movie. Can anybody explain how to compress MP3s to be directly used in Flash? No matter what I do, it wants to convert them as it compiles, apart from one mp3 which I downloaded from a site and which allows flash to “use imported MP3 settings”. How can I other MP3s that also get to use their own imported settings?

This was another one of those updates that saw disparate parts of the project coming together. I imagine you’ve noticed that there’s now a shop, and money to be earned! How do you earn it? You beat it out of your enemies, that’s how.

Everything is extra cheap at the shop so that you can buy stuff!

Now some of you might not have realised that there is a bigger map than the mini-map. Press M to access it. Do you remember that post oh-so-long ago where I first introduced the map? Yeah, it was horrendously ugly.

A couple of posts ago I updated it to have a lot of it drawn automatically for me, so that I don’t have to worry about drawing a map as well as designing a level. But it was still ugly.

The mini map is what did it for me – I decided to make the mini-map’s big brother share the same aesthetic, and here it is in all its glory:

I know it says “press s to set flag”, but ignore that for now, please!

This was plagued by a common problem I have while working on this project – wasting time on stupid nonsense. Specifically I wasted time on:

- making the screen to the right show the correct values for x and y (they are in metres by the way)

- adding rotation (what on Earth could be the point?). That took me ages to get right.

I also worked a pretty long time on the shop. It makes sense, though – I imagine in the future (and there will be plenty more games in the future) it’ll be useful for me to have a shop, and what with the flexibility of object orientated programming, a lot of what I’m doing now can be re-used again in the future.

With the shop, the biggest obstacles were actually graphic-design related, as opposed to programming. The two main issues were the holotec armour suit and Snotty Sam.

I started with the holotec armour, a blatant rip-off of the sort of energy field armour in the tremendously fantastic Mass Effect 2 (I don’t think you could actually see the energy armour in the first installment, which was also wonderful).

So I happily drew highly intricate, shiny energy armour for Dreg, which looked great, but when I loaded up the game, it was all so small that is was just a nasty mess (to be honest, it’s still a bit of a nasty mess, but whatever, I have to make this damn game!).

By the way – the armour does actually work – if you’ve got all of the holotec armour you’ll receive only 55% of the damage dealt to you…

Anyway, I quickly discovered that to make something visually appealing, I had to make it big, fun and simple. Hence the huge shoulder-pads and silly helmet. Now the armour adds to dreg’s silhouette considerably, in a way it has to, so as to compensate for its transparency. Then came drawing the shop, and giving it a salesman.

The thing is, Snotty Sam has been a character in Disarea for aaaages (when I was 18 I wrote a crappy sci-fi book set in the world – I write more about this in my ancient university-era site, which also has the comic).

The thing is, I’d always known Snotty Sam was an amalgamation of alien bits and bobs, due to an unpleasant experience in the badlands (he hints at this if you let him chat with you in the shop).

This was fine in the book, because that was all I needed to do – write that he’d been patched up with alien pieces, and that was it. Having to draw the bugger, on the other hand, posed a whole other problem.

The thing is, I’d never taken the time to properly visualise what Snotty Sam looked like, and I tried to draw him anyway. The stupid thing is, I already knew that this was a stupid idea (again, I wrote about this five years ago!), but I had so many things I needed to do in the game that I wanted to rush it. Obviously, this only meant more time-wasting.

So finally I gathered up the self-discipline to figure out what I wanted him to look like. Then Suddenly it was there, and here he is!

Again, simple, big silhouette, minimal alien modifications but a drastic change from his original form – though in the book it was fine to have him be a complex, amorphic mass of alien organs, it just doesn’t work visually (at least, not within my limited abilities!)

I went through a similar process with the currency – should I use coins? Symbols? AAARGH! Then I thought I’d just rip off Zelda. That was a solution I was happy with. Tell me what you think!

Friday, March 12, 2010

Minimaps, hidden areas and stupid armour

Arrow keys for movement and crouching, spacebar to jump. Use arrow keys while swinging to increase his spin. Hold down spacebar to make the jump last longer. Hit spacebar again when holding on to a wall to wall jump. A is for punch and D for kick. Press S to hold a grenade, the release S to throw it (be careful - hold it too much and you'll blow up!

Wahey! Look! A mini-map! It is excellent.

Anyway, this is an update of pleasant surprises, in the form of small touches that make a big difference (to me, anyway!)

So I was working on getting an easy system to have parts of the background seem to be in front of Dreg - this is important for things like when he's hanging off of corners (so that the lower part of his body is hidden by the floor... urgh, can't explain!!!)

I wanted to do this to allow Dreg to pass through windows (he is in front of the wall most of the time, but as he walks through a window, the part of the wall between the window frame and the foreground needs to be in front of Dreg. Again, can't explain. My Brain!)

Anyway, I suddenly realised that the same mechanic I use to have the grenade explosion reveal a part of the level could also be used to reveal hidden areas Dreg accesses. As you go through the window (in the part of the level to the left) the room is revealed as you enter it. The nice thing about this is that it was done entirely through my "level editor" - no additional coding was needed. That was nice.

The other nice surprise was how cool I find the simple addition of a gradient to the mini-map to give it volume. Observe:



See? Now it looks like a compass or something! You might think it sucks, but I think it's wonderful, and so simple!

Then there's the armour. Again, you probably think it looks stupid, but I'm totally ok with that. In fact, I want to go further with the stupidness - I think I'll have three different suits of armour, and you obtain them part by part (helmet, torso, arms and legs), either by buying or finding them. Each part will increase your armour score, so it always makes sense to have the best version of each part equipped. My hope is that you'll end up with a horribly matched Dreg, which at the very least will make me laugh. Yipeeee!

Next up, shops, money, and the other suits of armour.

Tuesday, March 9, 2010

Happiness is a procedurally generated explosion

Arrow keys for movement and crouching, spacebar to jump. Use arrow keys while swinging to increase his spin. Hold down spacebar to make the jump last longer. Hit spacebar again when holding on to a wall to wall jump. A is for punch and D for kick. Press S to hold a grenade, the release S to throw it (be careful - hold it too much and you'll blow up!

Dreg goes Boom now!

Well, sort of - he throws grenades! To make it work, hold S start holding a grenade, then release S to throw it (I did it this way so that you can hold a grenade and wait until just before it explodes to throw it at an unsuspecting enemy who won't have time to run away). Or you could simply not release S then get blown up. As you wish.

This was a big ol' undertaking! It required a bit of work everywhere - I needed to make the grenades respond to the gravity shifts, and seeing as I'd been a bit stupid this meant fiddling around with things that I'd done badly, but hey, I'm used to that by now.

So yeah, it meant working on collision and physics for the grenade, on computer AI to make the thugs run away, on graphics for the explosions, on level set-up to have walls that can be blown away and on player input.

To give the player a decent amount of control over how Dreg throws grenades, I decided to have the arrow keys dictate a fair amount of how the grenade is thrown, as well as Dreg's movement at the time of the throw. Notice that if you throw the grenade while Dreg is crouched, he'll just drop it in front of him.

It also caused unexpected headaches, more on which later!

Anyway, I now have all the major items for Dreg to find within the game. By major item I mean those things that allow him to access new areas. At the beginning of the game, Dreg will have no objects and will only be able to wall jump once at a time. As he progresses he'll get these (probably in this order):

- triple wall jump
- whip (can latch on to poles and damage enemies - can be upgraded)
- double jump
- grenades (deadly against enemies, and smash through weak walls to reveal new areas)

If the list seems a little small, bare in mind this is only the beginning - I think I mentioned in an earlier post that I want to make a couple of "chapters" for Dreg. This is nice because it justifies all this work on the game engine (if more than one game will come of it), and it allows me to make the aims for the first game more realistic. In later games I can have additions like guns, grappling hooks, instant transportation devices etc.

Also, there'll be other items to get, such as better armor and offensive stuff (but focusing on unarmed combat). There'll also be stuff like the ability to have unlimited wall jump, but it won't be vital to complete the game.

It all feels so close now! we might see this game completed yet!

Anyway, if you're interested in the nitty-gritty of the grenade-a-thon of last week, read on!

< geekanisation >

So the reason I had to do a lot of fiddling is that I had foolishly focused on the Character class (Dreg and the thugs are extended from Character) when a lot of the functionality (such as collision detection and resolution) should have been in the parent class, MovingObject. Grenades, obviously, are moving objects, but not characters. So that was boring

But the really weird problem was the issue I had with having Dreg hold the grenade in his hand before throwing it. I thought this would be necessary to give the player control over when the grenade blows up after being thrown, but the issue was that I wanted the grenade visible before it got thrown.

I obviously didn't want to animate a run, jump, skid etc. cycle for Dreg with him holding a grenade, so I thought I could simply add an image of a grenade to Dreg's hand and be done with it.

The issue is that Dreg and his various components are scaled to different degrees, and the grenade would fiendishly change shape depending on what animation loop Dreg was in. I had a problem: I needed to have the grenade appear behind his hand, at the same position and rotation as the hand, but maintaining the grenade's original scale.

The solution involved a hell of a lot more involvement with transformation matrices than I would ever have liked to experience. That said, I feel super smart now.

Easiest of all, surprisingly enough, were the explosions. I had a clear idea of what I wanted, and it worked pretty quickly!

The most annoying part was making the map screen aware of walls being blasted away. It was all very hacky. At least it seems to work now!

< geekanisation />