Thursday, July 30, 2009

Lazy camera


Arrow keys for movement, 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. Click on the game to start interacting with it


Just a quick post

I was thinking that the gravity shifts maybe don't have enough of an impact, and that they would be cooler if the camera doesn't correct itself so quickly. Here's the same game as last time but with a slower camera. What do you think? Should I keep it like that?

Personally, I think it's awesome.

straddling is fun


Arrow keys for movement, 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. Click on the game to start interacting with it


Yeah, so gravity shifts are obviously out of this world and wonderful and I can be incredibly proud of myself. That said, in the previous post, one crappy bit was the nonsense that would happen around gravity rifts - I went a little crazy with crossing over collision lines and other such nonsense to keep Dreg from losing his cool and shifting into an alternative reality.

As I mentioned in the previous post, I wanted to create special collision lines that straddle multiple gravity fields, including floors which Dreg could run along without the collision detection giving up and stomping off in a huff as soon as he hit a gravity rift. This meant making funky collision lines that would return different values depending on which gravity zone Dreg was in. I also had to integrate it all into the chaos that is my "level-editor".

Hopefully the rather non-fun demo at the top of this post should demonstrate that it works!

The exercise also allowed me to do lots of tweaking on the collision detection itself, and Dreg is now even less likely to casually walk through walls, though I wouldn't like to claim it's impossible. I've tried to minimise the need to limit the actual level design possiblities, but there are a couple of things I have to keep in mind- if I try to make a floor behave as a wall it gets upset with me.

That aside, I now feel I have a system which is flexible enough for me to make the kind of levels I want to make, so look out for the next post - it's going to be fantastic.

I'm sure you, my avid fans, were a bit upset about how long it took me to get this update up and running. The reason? Well, this project was my topmost priority for a week, and I was seriously riding a wave of enthusiasm. The enthusiasm has dissipated a little, so now it's a case of trying to maintain a certain level of discipline and making sure that I keep on working. My having finally started playing GTA4 hasn't helped either.

Oh and I've finally caved in and made Dreg move with the arrow keys!

Friday, July 24, 2009

Yup. Now it's getting serious.


A and D for movement (ok, ok, I'll change it to arrow keys soon), spacebar to jump. Use A and D 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. Click on the game to start interacting with it



The game now has gravity shifts, and it is awesome.

I've actually done quite a lot of work behind the scenes. The gravity shifts are clearly the very incarnation of amazing, but the seriously cool thing I did was a simple way to quickly create, and more importantly, tweak the collision lines (hence their rather scrappy appearance). There's still a couple of issues with dodgy collision detection as Dreg passes through a gravity rift, but I think I've found the solution, which I'll talk about here, but if you don't care about geeky nonsense, ignore the following section:

< geekfest >
Each gravity Zone is actually a separate Sprite within Flash, and all the gravity calculations are done within the sprite's local space. Passing through a gravity rift, which is just a modified collision line, will the removeDreg from his current gravity zone, then add him to the next. Some calculations are required to put him in the right position, rotation, and velocity, but it's all pretty simple stuff.

All the collision detection is done within the local space of the sprite Dreg is currently occupying. But I think certain objects, namely walls around a gravity rift, should be detected globally, regardless of which gravity zone Dreg is in. This'll be a bit more expensive, but I've got lots of nice ideas to keep it fast.
</ geekfest >

Another problem is that at the moment I can't have Dreg experience a gravity shift while running on the ground - the solution is the same as for the previous problem.

In any case, give it a go. If you start by running to the right, it's easier than if you start by going up (the latter option requires a lot of wall jumping).

On another note, it's been very interesting to see how non-gamers interact with this - I've tried to make the swinging and wall jumping a bit more instinctive, but retaining some challenge. If anyone's having trouble wall jumping, remember you have to hit the spacebar again to jump off the wall...

See if you can complete the circuit in both directions.

Tuesday, July 21, 2009

Swingtasticism tweaked


New and improved! You can now easily jump from one pole to the next, and I've tweaked several other issues as well


Ok, I was a little premature in my celebration of swing. You see, I'm really impatient to get into the nitty gritty of gravity shifts, but I also have a bunch of acrobatic abilities for Dreg to have at his disposal. I thought I get swinging out of the way, do the gravity fun, then get back to his moves. Mainly I want the following moves:

- crouching and associated moves (crawling and doing a kind of low, evasive jump)
- wall running (running up a wall so as to be able to jump off of it)
- double jump (a totally unrealistic ability to boost your jump with a second one in mid-air. Unrealistic yet somehow satisfying)

These are all video game staples. There's not an ounce of originality in my game design for this game - it's more an amalgamation of ideas from different games that I like...

Anyway, so the swinging. Well, I thought I could do it quickly by just making a swing animation which plays automatically when he jumps on a pole, then a default jump from said swing. The problem was that the animation was crap. Have a look:


Yup, pretty crap


And besides, it looked stupid, him just swinging and swinging. I liked the idea of the player being able to control the swing, and of the swing just diminishing if not encouraged, but that would mean using maths and stuff, and maths makes my brain hurt. But indeed I did resort to maths, and I think it turned out much better, don't you?

I'm sure most of you have guessed that for his movements while swinging I just made 90 frames of animation of him leaning backwards and forwards, then had the maths control the actual rotation, the angle determining which frame to display. I'm sure that made sense to at least one of you.

Anyway, I then went crazy with maths. Maths will do that to you. It eats into you, and suddenly you want absolutely everything to be determined by ratios, fractions and the more sine you can stick in there the better. Then we had what I uploaded yesterday, where the particular angle, speed and general disposition of Dreg would determine how he jumped.

This sucked for several reasons. One - you'd often end up with weird looking restults, and it was very hard for me to predict what would happen. This made it very difficult for the player to have Dreg jump from one pole to the next accurately.

So I ended up with a compromise - keeping the funky mathematically inspired spinning, but a much more predictable way of jumping. So long as Dreg is spinning sufficiently fast (not very fast) he'll do a standard jump, and it doesn't matter which way he's facing. This makes it much easier to have him jump from pole to pole, and will make life easier for player and level designer (me) alike.

I want Dreg's acrobatics to be relatively easy to pull off. It should feel fluid and intuitive, like in Prince of Persia Sands of Time (which as far as I'm concerned set the bar for video game acrobatics). Tell me if you think it's worked out that way...

Monday, July 20, 2009

It's Swingtastic!


press A and D to run, and spacebar to jump. A and D also help you spin faster while on a pole


Right, I have to go teach a class in a second, but I wanted to stick this up.

I have poles from which Dreg can swing! Wheeee!

By the way, those black circles are the poles in question. As in, they're stuck in the wall behind. foreshortening, ok?

You can make him swing by pressing A and D at the opportune moments. The timing of your jump matters - if you're swinging fast you'll jump further. If you time it right, you can go really far. See if you can get to the tower at the top left, and wall jump all the way up. There's nothing up there of any interest, but it's a challenge, ok?

Here's a hint: start by wall jumping off the right hand wall...

I've also been working on stuff behind the scenes. I think I have all the collision testing sorted, but please tell me if Dreg has the audacity to casually float through some of those lines. He's had a tendency to do that in the past, the bastard.

I've already started working on gravity shifts, and I'm glad to report it's as unsightly a mess as I predicted, but I think I'll be able to muddle my way through...

Saturday, July 18, 2009

First update of the game!


press A and D to run, and spacebar to jump.


WARNING: I’m going to talk about my plans for the project, making references to other games, so if you’re not a gamer (which is probably most of the people reading this) you might not know what I’m talking about. I guess at least wikipedia is there to fill in gaping holes in your gaming knowledge, which obviously you want to fill.

As usual, I’ve decided that the best approach to making the game of my dreams is to be as stupidly unrealistic as possible, and see how far I get. So I’ll talk about my ideal game, though I doubt I’ll get anywhere near it…

Acrobatics: I want to have the acrobatics of the newer Prince of Persia games, complete with wall-jumping, pole swinging etc. but with the added fun of gravity shifts! This is what I’ll start with, so in further detail for this to work I need:

- responsive controls: unlike the first Prince of Persia, this game won’t make sacrifices in control for the sake of protracted animation. I’ll try to keep responses fast, with the jumping feeling more like Mario than Another World.

- Flexible collision detection: The platforms won’t be Axis Aligned Bounding Boxes, but instead line segments of any angle. The angle of the segment relative to local gravity will dictate whether the segment is a ceiling, wall or floor.

- Gravity shifts: I’m hoping I can make this work by simply having all the game mechanics rotate between each zone.

Fighting: I’d like something approaching the fluidity and depth of Bungie’s Oni (an underappreciated game in my opinion). I want to encourage the player to vary his/her style by having enemies increase their ability to block a certain type of attack each time the player uses it. It makes sense in my head, ok? More details when I get to it.

Story: I imagine progression in the game to be like Zelda – relatively controlled, but rewarding exploration. Just like Zelda (or Metroid), as the player progresses they’ll get more objects/abilities allowing them to access new areas in parts of the world they’ve already been in. So a player could just plough through the game’s main story in a relatively short time, or spend time exploring for extras and secrets. Oh, and I also want boss battles.

Anyway, I’ve been working on this game for three days, and thanks to my aborted earlier efforts at making games, progress has been surprisingly fast. I’ve already got most of my first two goals regarding acrobatics done, with gravity shifts hopefully coming soon.

My previous game involved space ships, which was bad for several reasons. A lot of casual gamers have real problems grasping the press-right-or-left-to-turn-and-forward-to-thrust way of controlling things, and also a space ship has considerably less personality than, well, a person.
With Dreg I already know the guy from previous projects, and it also allows me to flex my animation muscles. Throughout my life I’ve been ok at several disciplines (music, drawing / animation, programming, story-telling, programming) but not excellent at any of them. Computer games allows me to bring these skills together and hopefully get a whole greater than the sum of its parts.

Anyway, at the top of this post is the game so far: A and D control movement, and SPACEBAR is to jump. You can wall-jump by jumping against a wall, then pressing spacebar again to jump off it.

Dreg is back!

Dreg is back! If you don’t know who Dreg is, read this. Or go to this site. The film is in some ancient compression that many computers can't play. I'll have to go back and recompress then stick it on youtube or something. Anyway, now he’s back in computer game form!

This blog will be to document my progress and provide little playable demos for people to see how things are going. I’d love to hear feedback/ideas as I go.

This particular game has been in my head for a long time, down to its basic mechanics, and it’s already proving quite easy to develop because of my previous attempts at making games, and because I know exactly what I’m aiming for. More on what that is exactly in my next post…