Tuesday, March 8, 2011

Collision Course

I got collision to work in Paper Zeppelin yesterday, and now when you crash your little dude into the ground it does something. It's kind of cute and it works like I thought it would. Also, I got ground to work, which brought up some interesting things. First of all, making the ground tiles 100 x 100 is way to damn big. I'm thinking that the resolution of PZ levels just got a lot higher. Second, and more importantly, it is really starting to look like a game now. I managed a kind of scrolling by making all the ground move to the left at a constant speed. Enemies move a faster speed, and it gives the impression that the world is scrolling smoothly by. TTT didn't have any scrolling, and this new hotness makes me a very happy panda.
But that's not really what this post is about. It occurred to me that this diary starts quite a bit after I had the initial insight into how collision systems in 2D could work in Thief, and I thought that now would be a good time to tell that story while also exploring the basic concepts of collision in a video game. So yeah, I'm going to get all talky.
Originally, way back in the proverbial day (I would say around diary entry number -25 or so) I had finally managed to get the little Zero character to animate and had worked out the basics for how the levels would be designed. I figured that if I made a series of rectangles, they could represent the level platforms.
For this, Blitz Basic had a cute function that allowed me to check if a sprite was touching a rectangle (technically if it was overlapping). So I threw considerable energy trying to get that to work, and it never did, not really. So it would let Zero stand on top of a rectangle, but it all fell straight to shit as soon as he touched another rectangle. There didn't seem to be a way to get multiple rectangles to work right. He would touch a rectangle and find himself placed on top of it no matter what. So I tried to create a conditional system that asked questions like, "Are you above the rectangle? Okay, are you to the left of it? The right? Underneath?" But then you would hit a corner and I would die a little inside.
Clearly, there was a way to do this. What I eventually came up with is to create a box of rectangles around the player. Then I could check to see if those rectangles were touching the rectangles in the level. Basically, Zero never touched them, but his invisible force field did. Since each rectangle only had a single condition that was either true or not, it became much easier to track the collision of those rectangles. It also allowed multiple things to touch at the same time, which is why in TTT you can run into a wall.
Other parts of Thief were designed to work with pixel collision. Basically with that you take two different pictures (usually with a mask color that the computer ignores) and see if any of the pixels in those pictures are overlapping. This system is how combat kept track of hitting. Again, since the easiest and most basic concept for collision is an on/off proposition, this kind is useful, but limited. Especially if you want to have any kind of static collision like touching a floor.
Getting it back to Paper Zeppelin, I created a function that checks to see if rectangles are overlapping. I plug in 8 variables, representing the X,Y,W and H of each rectangle and then check to see if any of the first set happens to be inside any of the second. Granted, if I have really odd shapes I may get a weird overlap where that isn't technically true (say a really wide but short and a really tall but thin set) but it works well enough for my purposes.

- Today the plan is to finish off the Collision system and add the rest of the ground pieces. The document says that different ground could reset the player in different directions, but now I'm just going have a standard collision set and make all the ground behave the same way. It seems like a better solution really. I am going to keep the different kinds of ground though, since it should be a simple addition and will make the levels look better.
The thinking is that I want a border on the ground that shows the actual boundary. But I really don't want to keep track of that when I'm putting the levels together. So I'm going to add a little to the ground creation function that checks to see what the area around the ground piece looks like. So a piece with ground on three sides will create ground that only has a border on the open side, while a piece that is open on all sides will have a full border.
Admittedly it's a bit of gold plating when the thing isn't even built yet, but since that's what the end product will entail, completely finishing that since I'm building it isn't too bad. Well, almost completely. From a prettiness standpoint I'm also going to build in a randomizer for the colors to create variations of greens. But I can actually wait for that.

Monday, March 7, 2011

PZ Like Sunday Morning

The Big List is together for Paper Zeppelin, and at first blush it seems like a lot. I've made the mistake before of saying something to the effect of, "No problem. I can get this done in like an hour," so I'm not going to let the size of the thing seem like it's not a big deal. There are a lot of things on that list that still need doing, but worse for me there are good number of things that I would need to figure out. To wit, the stuff that goes under the "Classes" section for programming is all pretty basic on a fundamental level. They are all sprites and work the same way within the confines of the structure that I've built already. So adding the Ground for example, shouldn't take to long. Making it work correctly, which also involved a rudimentary collision detection similar to the one employed in TTT is something else altogether. But that's just logic and math, and is do-able by the stretches of most imaginations.
Less so are the things on that list that I need to figure out still, like the String Import Routine, where I'll be able to import text into the PZ engine (I think I'll dub it "The Paper Engine") so I can build my levels using Excel. Otherwise I'm going to end up hard coding all of the levels, which I would rather not do.
The Game Types bit may also take a while, since A) I only have the one controller for my PC and B) I'll need to re-write some chunks of code that are already there.
Of course that doesn't include any of the art or anything, which will always take more time that I think it will.
The thing is, with certain caveats, nothing on this list is too terribly out there. There's nothing in it like there is on the designs that I've written up for The Star Frog EP that would take some kind of extensive programming mojo to be discovered. I can do pretty much everything with what I know, and hopefully will have something up and running and fun to play sooner rather than later, which is always a good thing.

- The plan yesterday was to finish off some stuff and add some options for drawing on the screen. So if we look at the new Big List, the Dive Bombers and their dead versions are finished. Well, more or less. The little bits of code that drive them works, but nothing has been finalized yet in terms of variables. The important thing though is that they work and you can shoot them, and they fall in a big ball of fire and can crash into each other. It's pretty cool.

-Also, I got rotation to work. It sounds really dumb, but it is important. Basically, there is only 1 function that draws stuff on the screen. So when I want to draw a bunch of things using C#, I tell the system to look at the list of sprites, and run the Draw() function. It works great. However, I realized when figuring out how the bloody ground was going to work, that I also need to keep track of some other variables like the rotation, and the color. However there was a bit of a problem, my master Draw() function didn't have variables for these things, and none of the Classes (like Dive Bombers, bullets or players) had to track those variables. So I added them...to everything. It could be worse though, since I could have added this way later to my dozen+ things that the Big List says I should.

-Except for color that is. Different things know what color they are supposed to be, but I can't make it work correctly. Basically, in C# you can draw something and add color to it. In PZ, players will all share the same sprite and animations, but will be colored differently. It's how they used to do it back in the proverbial day.
Using C# it looks like this : Color.White
...assuming that "white" is what you want the color to be (which is to say, don't add any color). So I thought that if I added a variable like this :
String tint = "white"
...then I could do this and it could work.
Color.tint
Except that it doesn't. I built a bit of code that sorta gets around it, but it's incredibly ugly and crazy limited. It does work well enough though, and there are too many things to do to spend time right now.

-Hmm, got a little technical at the end there.

Friday, March 4, 2011

Back in the Saddle

Damn it feels good to be back and working again. I had almost forgotten after so long how downright awesome it can be, on a minute to minute basis, to be in the process of putting together a video game. Even the extra surrounding crap takes on a weird kind of joy, since I know what's going to happen later. Never, let me put that again for emphasis:

NEVER...

...will I let myself think it's a good idea to not be making a bloody video game. When I got on and opened up the code, it took only a minute to remember how everything was put together, and how the C# is structured, and what I was working on last (turns out before I shut it down the level reading part worked, and I had worked out inheritance so that I could make crashing enemies work correctly). The code came quickly, easily, and before I knew what was going on, I had burned through my allotted hours and: updated the bullet speed so it doesn't suck, added the AI logic for the Dive Bomber Kamikaze enemies, make crashing enemies hit each other, and worked out how to make things rotate when I need them to. It was a very good bit of coding that I got done.

Today the plan is to finish off the AI logic for the Dive Bombers and add a color and rotation option to the basic drawing function. I could write a whole lot more right now, but I'd rather take the minutes bring Paper Zeppelin a little closer to the finish line.

Wednesday, March 2, 2011

The Wastes

Today is a funny kind of day. A sad kind of day really, but more because it's less funny in a "Ha Ha" sense and more funny in an off putting way with a kind of underlying anger at myself. It has to do with why this particular diary has so many missing entries. You see, I had thought that while I was without means I should also abstain from working on any of these things. It was a way to focus myself and to provide a kind of built in motivation. I had thought that it was a good idea, and although slow it was paying off.
Until yesterday that is. Yesterday the giant pause button, the Iron Lung metaphor that I've been using, became a liability. I was told that I lack "follow- through" because I was able to put all of this on hold. Further, that became one of the deciding factors. Liability.
Afterward, as I sat thinking about this new paradigm, this new way of considering everything, I was struck by how much time I had wasted. Almost a year now, a bloody year has come and almost gone, and all I had to show for it was a couple of updates and a lot of articles read. I thought for just a moment, what if? What if I had continued instead of setting myself on a kind of intellectual and creative exile? Where would I be now? How would things be better? How many projects like Paper Zeppelin would I have finished? How much more advanced would my coding have become?
But the real question quickly became, why am I doing this to myself? If nothing else, every day I could have had something new to show for the day I spent.
So I'm throwing it off. When the very act that I thought would help was beginning to actively hinder me, then there is no reason to continue to use it.
To that end, let's consider the good bits that we can find. Yes, it did motivate me because I rightly would do nothing but code all day and make my games given an option. It did provide a carrot, but too far removed to provide a real fire. So here's the plan as I continue. Every day in the morning, I do what I need to do. No procrastinating and none of the other things that I could be doing. Then in the afternoon, provided that I did what I had set out to do that day, I'll get back to work.
A new paradigm. A new plan. A new start.

I know what it takes to start again...

Tuesday, March 1, 2011

The Lost Weekend

It's been a while since I typed anything onto these pages. I spent a part of yesterday re-reading chunks of my own diary, and the writing seemed foreign somehow. The jokes funny again because I had forgotten that I wrote them. It's been far too long.

In case you're curious (I say to all the un-people that read this), the thing is still very much hanging over me. But now I think I can talk about it, if only to have something to talk about. The long sabbatical from my writing, and my developments and my projects and my fuggin life, is directly related to my lack of employment. A widely known fact in that being an indie game designer, especially one that gives stuff away for free or for the almost free that XBLIG offers, isn't a way to become famous, or rich for that matter. In fact, it turns out it's almost impossible to feed one's self from the meager proceeds. So this thing that I adore so much, simply cannot love me back because it lacks the means to.
That means that I need to be employed for any of this to work. I need to devote 8 hours every day to somebody else's projects and somebody else's dreams, so that I can have the possibility of devoting 2 hours to my own.
What I begin to wonder about though, is if that very drive makes it difficult to continue. I wonder if a manager looks at all of this and simply assumes that is what I would do, given the chance. The honest truth of it is that, yes, I would. But I can't. The very fact of which depresses me, but being depressed about it doesn't make it any less of a fact.
I'll put it another way, like in a story that a friend of mine told me. He went to school and has a Master's Degree in Molecular Biology (which is quite difficult to say after the 3rd pint of Guinness) and finds that he is un-hirable. Any non-biology job that he applies for is turned down almost immediately. The reason is that, since he spent so much time and effort on being a Molecular Biologist, then clearly he is simply going to leave when an opportunity shows up. My design and programming and all of this are the same. The assumption is that I will leave when given the option to, in spite of the fact that I really just want a good place to be so that I can be my own patron.
It's maddening.
So when I go out to apply and do interviews and talk with people, in the back of my mind I'm always thinking, "I not just applying for this, but also to once again be the Lead Designer at Star Frog Games." Forget 401K or dental, that's the best benefit that I could ever want.

Friday, November 5, 2010

Quest Line

I'm finding myself in a somewhat positive situation now. Well, it has the possibility to be positive, in spite of the fact that it very well may change the trajectory that I'm on. Or it may be positive for exactly that reason. I'm trying not to get all worked up over it though. It's a little sad in some way that cynicism has found a home in my otherwise perpetually bright-sided brain, but I guess it comes with the territory.
In any event, with this given opportunity I was told to create a quest (hence today's title), but the quest has some severe limitations placed on it, regarding length, and who it was for, and how many people it would involve. After getting this, and staring at it, and then staring some more, I decided that staring at it blankly wasn't really going to do me any favours. In fact, I find that I do some of my very worse thinking in the cold glow of a computer screen. So I closed up the laptop (the requirements burned into my retinas at that point), grabbed some snacks and sat down to watch a recorded Manchester United game. Although it's completely off topic, no, I'm not British.
Well, sort of watched. Soccer is like Baseball, you can half pay attention and look up when the crowd is making a noise. In any event, the kernel appeared right in my mind. A core conceit that only needed some fleshing out. So I was off to the World of Warcraft wiki to look some stuff up. After looking about for a bit I was able to add the final pieces that would make my concept work from a story and mechanical level.
The stupid thing is, I seriously doubt that my quest design will ever appear anywhere. On the other hand, I wonder what kind of information the NDA specifies, since it's pretty vague (although less vague than I'm trying to be), but I assume that it would prevent me from posting that particular quest up. If and when I find out, I probably will.
There was a point to this whole bit of nothing once. The thing is, in spite of my last post and the worries it contained regarding atrophy and my creative juicy mojo, there seemed to be nothing of the sort. Quite the opposite. Once I had the goal and my ideas, I turned on the spigot and pure, glossy creativity poured right on through. Focused even. I didn't have to reign it in, pull it back, try to divert it. Hours passed that felt like minutes, writing came fully crafted to the page, new ideas would come out and fit into the overall structure fully formed and ready for installation. My brain just went like a train (rhyme!) in a single direction, with a single destination and an inevitability that it would get there with the passengers all quite pleased with the experience.
After these long months, it felt awesome to just let it loose like that. To unleash it at a task and see where the train would take me.
Yeah, yeah yeah, I know, that whole thing seems like a stupid nonsense, and writing about it seems self congratulatory at best. But after a while, it is possible to forget why I love doing this so much. It's something to say, "I like designing because it makes me happy," and finding that after the 4th hour of actually working there is a smile on my face that I don't remember putting there. Please don't mind my self indulgence, I'm just happy, and it makes me glad to say.

-On another topic, I was thinking recently about The Star Frog EP, mostly because it's something I can think about on a purely abstract level (unlike say, Paper Zeppelin or TTT, which have code which musses up the abstraction). I starting thinking about telling a story or making a point via mechanics. I mean, there are a few ways to tell a story in a game. You can always write a wall of text, or show a movie, or have talking. Those are the easy ones. The harder ones are things like using items in the game, or doing something with the art direction and style, or setting up a scenario that the player may find themselves in or notice in the background. I suppose that these can be classified as Direct and Indirect respectively. So an example of Direct is having a character tell you that the Wizard has stolen a Princess. An Indirect example would be to find the Wizard's Tower and see a Princess weeping in the tower. The Indirect method gives you a bunch of clues and asks you to figure it out. Braid does that. SqueEnix does 7 discs worth of movies and text. Games tend to want to use Indirect storytelling, so that the player figures it out.
If you still with me, I started this chunk by talking about Mechanical Storytelling. This one is kind of weird. I mean, it's an Indirect method, but not in the way you would expect. You see, the story in a game is the story about the characters in that game. The player deals with constants regarding the mechanics and uses them to progress throughout the story. I was thinking however, that Mechanical Storytelling affects the Player's Story.
What the hell am I talking about? Well, stick it out for a moment. You see, the Player's Story is the story of what happens to the player, and what they are experiencing. Generally, these are pretty small and deal with Id and emotions. So you have your joy, and your fun, and being scared and adrenaline and all of that. However, the biggest way to get something across to a player is to give them another way to perceive their interactivity with the world itself.
A good example is in the original Super Mario, when you get to the first water level. Suddenly, the mechanics are changed and you have to deal with swimming. I would bet that most people hate those levels, because the gameplay is altered. We can construe from the mechanics in the new area that, A) Mario is a terrible swimmer, and B) He should avoid water whenever possible. Now Mario doesn't emote. He doesn't say in his borderline racist Italian voice, "Mesa Hatesa Aqua," or whatever. All of that stuff that comes with it is from the player. They hate and fear the water. Their own story is about barely making it out alive.
GTA 4 does something else like it. In the game, you can get drunk, which effect the way the screen looks and how well Drunkle Nico is able to drive. These things change the player's ability to do them and further, it ties their inability to drive while the game is doing that to Nico's inability to drive because he tossed back 17 JaegerBombs.

-Speaking of drinking, I'm playing Fable III now. I'm finding it in most regards to be just like Fable II, which I think is a good thing. Only now you can use your own hero when playing multiplayer, which is nice. Although me and the wife argue a bit when I want to go clothes shopping. The biggest change, and this may be stupid, is that the simplified the combat. Well, except for swords, those still work in the same boring way. But now you can only use one spell at a time, and the shooting has become less interesting. Regarding the magic, it's not a big deal. In the last game the wife played the role of Sorceress, and she used the Fire based Inferno, and the Summon Creatures (or Darklings and they're known in our house) Spell. Although now the Darkling Summoning is a potion, and you can combine spells together to make new ones (try the Flaming Tornado or as I've dubbed it, The Fire Swirly), so it's kind of a push really.
The thing about it that makes me sad is that the shooting is simplified, which makes it boring. You see, in Fable II, once the gun was powered up you could pop of crack shots on a person and aim at specific body parts. My hero The Scarlett Sparrow would be able to rock his pistol and land shots on heads and nads with impunity. His son seems to lack Dad's skill with firearms, and all he can do it point and shoot like a DSLR. Not being able to aim takes something away, and doesn't replace it with anything useful. So now you can charge a shot for extra damage. So what, the aiming mechanic did the same thing and was a skill you could get good at. It was a kind of metagame in my house with II, could the Scarlett Sparrow shoot the bandits to death before the Wife's one two punch of Darklings and powered up Inferno?
It just seems a little less somehow. with II each of the methods of combat felt different. Swords were button mashy and kind of messy, guns were powerful but required skill to use really well, and the power up to charge nature of spells offered a high risk, high reward option. Now shooting feels like longer ranged close combat.
That's why my hero in this game uses magic almost exclusively - it's the most unique option for combat, although it is far easier than trying to play the whole game with a pistol. Then again, the combination of sorcerous fire and lightning would be.

Monday, October 11, 2010

Much Ado About Nothing

My dreams have become more vivid as of late. I wonder if it has anything to do with my creative juices sitting in the cupboard. I hope that I can keep it on a simmer, and that it A) doesn't atrophy, and B) doesn't explode into some kind of insanity. I used to be able to sleep fitfully, my brain having expelled its contents towards some kind of goal. The spark kindled into something useful, or at least interesting. Now it seems that my subconscious would rather let me know of its boredom via exceptionally vivid dreams casting me as a red bearded samurai or watching a show about a college based super hero that gets around by way of slip and slides. It's gotten to the point where I go to sleep and wonder what I'll watch tonight, and if I'll wake up amused or shaking.
Methinks that my Iron Lung needs to go away, else my spark ignites and consumes me with it. What worries me the most though, isn't the dreams, its the idea that given time they may just stop. I've taken to thinking of mechanics and concepts in my head. I've also started reading Making Magic, a column where the Lead Designer for Magic The Gathering (one of my favorite games of the last 15 years) talks about design and the principals of it. It's knocked Penny Arcade out of my go to first internet spot for Monday.

Since I haven't mentioned it yet, Star Frog Games has a new website. There was some stupidity involving hosting that I'm sure nobody cares about. The new site is template based and doesn't look like ass. I've taken to actually showing people it instead of just using for an email address. I'll probably figure out how to post all of this, there and then we can have a single website for everything. That would be cool I think. Also since it's based on a template I worked out a way to have the site have multiple templates. That means that when it's working we can have custom pages for The Thief's Tale and Paper Zeppelin and anything else we build. I'm already thinking of making the page art match the games themselves, so construction paper pages seem like a possibility at some point. Or I'll forget all about it.

I've been playing some games recently and I usually will comment on them as I play them, but I didn't want to put up stuff about nothing, so I;ll just go through them now.
The Forgotten Sands is the new Prince of Persia game. I liked it, the combat is still not terribly good and the story was kind of an excuse. I mean, you can't have character development when the character is already established in the bookend games. The platforming is still ducky though. Oddly, and this may be the radical view, I preferred the last one with the talkative Prince.
Okami was awesome, and very long. I played it on my Wii, and the brush just worked (more or less - stupid straight lines). It's like a Zelda, this is true, but without all the Zelda crap in it. Free of all of the tropes, it was free to do what every Zelda game since Ocarina has been trying to do. It's like Batman Begins in that way. Although I'm ripped apart by the sequel. On the one hand, I don't think it needs it since the story was tied up all nice. On the other, I so want a plush Chiburatsu, but I'm kind of a whore for merch.
Finally, I'm currently into Alan Wake. I usually don't play these kinds of games since the things that go bump in the night give me the creepies. I mean, games are usually power fantasies and making the player afraid of everything seems to defy my, "Make the player look cool,," game philosophy. Wake has these downright well designed mechanics. The flashlight is the first, mostly because it points where you point it with the stick. So when it's really dark and you're spazing out, the flashlight light spazzes too. Every shadow begins to look like something then. If there are enemies hiding in the darkness, the spastic movement of the flashlight (so you can see) actually makes you more screwed. I love that synergy. It's like the game is telling you to try to stay cool, and then doing everything it can to deny said cool. Oh, and the pages are ridiculous. They're hidden in the darkness and tell you what's going to happen, so you quickly become a junkie trying to find them, since the fear of the dark is the fear you know. The fear of the truly unknown is a different beast altogether.
After playing Alan Wake, my dreams always have a flashlight in them.

Yes, the thing that keeps me from doing anything cool is still hung around my neck like a monkey. I am trying to stay positive. I really am. I promise.

We are grateful for our iron lung...