Thursday, December 3, 2009

Steppin' Razor

I'm finding C# to be kind of scary. There's just so many things that it's capable of doing that it needs way to keep all of those things in order. It's got libraries of content and the IDE has the cute capability to show me what a give function needs for input. Oh, and it has autofill like my Jesus Phone, so a quick tab and I've called code into the world.
Yet, it does a lot of things that give The Rage and The Fear like squiggly brackets, main function loops and the ever present semi-colon. Not to mention a whole new vocabulary including Static, Void, Main and Namespace, oh which I didn't know anything as of yesterday. It's like my brain has a hole in it and stuff is being pumped right in. To wit:

"Static" means that the function or variable you've got there isn't ever going to change. I guess this means it takes less memory or something. I'm not sure what the point is.

"Void" is something added to the front of functions that doesn't return a value. My Blitz Code would probably have 99% of the functions with this on the front because my software runs from the top to the bottom using global variables.

"Main" is the program itself. C# and C based languages all use one of these because the thought is, "Find the Main Function, and run it." This is different than Basic bases languages which say, "Find the Top and run to the bottom, stop when you get there." Basically, in C#, if it's not a declaration of variables (or independence) it's probably lives inside a function.

"Namespace" I still have no idea, but it seems to be a linchpin of the whole language. I think it's a way for C# to not confuse itself, but I'm still not sure.

Right then, "why am I doing this" is a legitimate query. I mean, I'm already super versed in another language and have the capability to make games. The honest answer is so I can play The Thief's Tale on XBLI and other people can too. Yes, we'll probably get hits and people playing our game if it's given away via the altruism of internet. But we'll get more my several factors of 10 on Indie Games, which is the true point. I mean, I'd give it out for free on XBLI if I could if people play it.
Further, I've decided that moving forward, I'm going to use C# exclusively on the next project (the EP). Specifically because it's portable. I can do something once and (cue the Batman SFX) BAM! on the computer and then BLAMMO! it's on XBox too.
But I'm moving into big kids territory here. The abilities that I'll have at my disposal will be more than I have now, I just need to take the time to learn it. Baby steps a little at a time, slowly and surely. Then, oh yes, my Kung Fu will be Strong.

...like a strong House Beat Dub...

Wednesday, December 2, 2009

The Next Step

The Wall Level's gone now. I couldn't think of anything that could make that level interesting, and instead of having an extra level that didn't add anything to the sweet gameplay stew that I've cooked up, I'd rather just have one less. It's oddly freeing to hack things not due to time constraints, but due to content quality. It's a nice option to be able to exercise occasionally.
That means that, for all intents and purposes, the level crafting for The Thief's Tale is finished. I need to put together the final boss area, but other than that, it's good and done.
Which brings me to the next thing. Since I'm waiting for content to arrive (which is does, in tasty little morsels) before dong more coding, I found myself thinking about different stuff and thinking about the framework for the stuff I want to do later. Recording functions, tile collision engines and fluid dynamics algorithms have been coming together slowly in my head meat and sometimes finding their way down to the hands where prototypes have been coded. But that's not the next step I should be taking. It's not correct. The Programmer and Designer part of me craves the new, while the Producer side of me demands completion. It's the side that must always win, for good or ill.
So, the true next step, is XNA. I've a wrapper put together that will launch my software into an XNA environment, but I've not done so yet. I don't know how well it'll function through the wrapper on a non-PC platform. I don't know if the controls will work, or the display will function or any of it. It's stuff I can figure out, but the answers may be in a language that I don't know. From a programming perspective, it's being born again into a strange new land that has only traces of familiarity surrounded by new dangers and mistakes to make. I wonder if the programming that I've done up to now is without real value, like code training wheels. That frightens to ever so much.
But that's just me. Producer side of me has an altogether external fear, that for the Team. Made up entirely of volunteers all wanting to have resume experience (like myself) and the start of a (hopefully) great, big MobyGames entry, I hope that the idea of monies won't spoil it. It probably won't since I want to, and plan to, split anything we make fairly. But fears of negotiations dissolving and work being left for dead is enough to keep me awake at night, staring at the ceiling and making a frowny face.
The least of my current worries, is IGF. We have time to spare and in what will probably never happen again in game development, an entire game framework upon which to hang gorgeous arts and sounds. I know we can do that, I hope that we can survive everything else.

I want to Believe.

Monday, November 23, 2009

Sapped

Over the weekend I had but a single goal - to get the Wall level mapped out. So I had a sit down equipped with my trusty pencil and graph paper and began to sketch. After a few minutes, I decided that I hated what I had created (rhyme!) flipped a page and tried again. A few more minutes passed and I loathed the new design even more than the last. The puzzles just seemed too...pedestrian. There was no spark to them, and if they don't excite me to work on, then they're certainly not going to excite anybody playing them. So out it went. Then again, and again and again. There was nothing I could do about it, even the core conceit I had built up didn't help. All I could think of were things that I had already done in the other levels in the game.
Which isn't to say that I'm all out of ideas for levels, that's far from true, I just have exactly zero ideas for what to do with the Wall level.
So now I find that I'm fighting the urge to simply not build one and pass the story forward using some other means. The urge to move on and mark the level construction at an end is very strong indeed. Unless I can think of something that would make the level anything more than pure filler, then I'm leaning towards indulging it.

Tuesday, November 17, 2009

Corner Painting

I'm finding that I do emails more than anything else right now. The programming stuff I have left to do is add controller support, get it to jive on my XBox and do some AI stuff. All of that of course requires a controller and/or enemy animations. So I'm waiting and getting on the stuff I can do, like send emails, poke the Team, and get thinking about the Wall level.
The original idea just got the toss, since it simply no longer works in the context of the game systems. Previously, I had designed the Wall areas into a kind of maze. But that was before I had built any of the levels after it. Now with other levels to compare, the conceit is both way out past Left Field and would feature a concept that is never used again. It made an odd wet noise when it was thrown from the car window at speed, like what I assume one of these would sound like.
In any event I think I need to start from scratch again. I need to build a level in the middle of the game, not too hot and not too cold, but just right, using conventions established in other parts of the game without being boring. The other thing is I built a Front Wall in the Tower Level, and the profile is only about 500 pixels wide.
An idea that I'm enjoying the rattle of, is to build another tower. In my sketches of the Castle, for symmetry there is always a second tower on the far side from the main Tower (referenced in the sketches usually as The Sun Tower - hence the "Chasing the Sun" chapter title). The other tower was labeled as either the "Moon Tower" or more commonly, "The Observatory Tower."
I don't want to construct another great big tower though, since the player does an awful lot of climbing upwards. So the idea rattling, is to make the tower fall over onto its side, and then build the level like it's sideways. With floors and ceilings that aren't and lots of angled surfaces (hello scripting!) and slides. Add in the broken pieces of wall and the last couple bits on the roof of the Castle Section from Chapter 7 and I think I may have something.
Now I just need to figure out some platforming puzzles.

Wednesday, November 11, 2009

Rocket Launcher

The front end's all done now. It was done, from a coding perspective, but now it's done from a "doesn't suck and works like it was supposed to in the first place" perspective. I find it to be adorable. I can open levels, close levels, leave the game loop, hop back in and get my game on. Added to the fact that the Engine is so lean, it takes zero time to load when I do it. Toss in the page flippy into and out of the Engine via the pause menu and it legitimately feels like paging through a book, which is kind of the point.
The trick I've found involved the giant stick method mentioned below. If the stupid thing didn't have a "Go" moment, then I just had to provide it a way to make good. So I built a Launch function, a single gateway into the Engine Loop that would tie all the disparate elements together, and get them dancing. Then I modified the Tutorial and all the rest of the gamemodes to use it, and now almost everything is functional and dandy. I'm very happy with it now.

I've also finished out the last of the Difficulty setting, um, settings. So now all of that stuff works. Perfect Mode requires perfection, Hard is wicked, Normal is doable and Easy helps you fight better and last longer. Seriously, I'm thinking Easy is too easy. Enemy attacks deal 3 damage per hit on Easy (as opposed to the Regular 7 and the Hard mode 10). With 100 HP you have to get smacked 34 times to get taken out. Add in the life gain at the end of the levels and the auto-block on high (which works great by the way) the enemies are the least threatening thing in the game.
Thinking about it though, I'm okay with that. Some skill is still needed to play, since a lethal fall is just as lethal on Easy as it is on Normal or Hard. I'm not going to force the issue and make Easy more difficult, since that defeats the entire purpose of having it.

- Since the menu works now, I found myself flipping though the levels and wound up playing the Castle (on Hard of course). It seems that the game is now large enough for me to forget stuff that's in there. So I started just playing to see if everything was loading right, and then something funny started happening, I started to enjoy the act of play. Not enjoying the coding, or the level design or the fact that the damn thing works, but the actual actions of pushing the keys and solving the level.
It's far too easy to get too close to something. I've ranted about it before where I stated that I couldn't enjoy what I had built, that seeing all the strings destroys the magic. I still stand by that to an extent. However, I've found that if I've not looked at what I made for a while I can come back with fresh eyes and enjoy what I have constructed. That's not quite right, I can enjoy the game, as a game, which is even better.

- I've got me some new engines to play with. I hate news on this blog (since I want all the news to be about TTT) but recently both the Unity Engine and the Unreal Engine have been made available for free. Not just for downloading and playing with like that rotten on the inside Maya Student Edition, but the real versions. Now they have new licenses for indies which is far better than the previous ones that involved $100,000, the blood of a virgin and a mustache ride.
So I got them installed and running and they are, let's use the term "robust." The Editors, which I'll call UnitEd and UnrEd, have features layered on features.
I started thinking about all the things I could do with UnitEd, since UnrEd barely runs on my laptop. New designs, new ideas, and then it hit me - I don't want to do any of those. All of the stuff I want to do would require me tearing into the deep guts of the software to get an approximation of what I could build from scratch with less effort. So I may open them up to have a peek from time to time, but I've no real wish to do a project with them. Of course, I may change my mind later.

...and I can't do it all on my own...I'm no Superman.

Friday, November 6, 2009

A Great Big Stick

Up until almost 1 AM yesterday. I like being up late, it puts the next morning into a new, unremembered context and smooths out the unpleasantness. Anyway, I was doing the Lord's work and experimenting with the laws of science.
Dealing once again with the Shadow Maps idea and the total lack of speed, I thought that grabbing a pixel and comparing it to another pixel was slowing the whole process up. So, it occurred to me that I could render the entire screen via mathematical expressions. If each picture is a a table that has as many cells as there are pixels in the parent picture, I can do all my comparisons using math and tables (which is, by the way, wicked fast). I could conceivably even apply an Alpha channel to the thing and get some honest to goodness transparency happening. But before I went in and did that, I felt a test was in order, I needed to be sure that the other half wasn't the slow part; that it wasn't the drawing of the pixels themselves that was the slow and stupid bit. So, I built a quick test and ran some loops. What I found was that the loops, can run more than fast enough to support a game. Easily on par with the game loop's speed. Then I added the pixel drawing part and it was slow again. Far too slow for running in a game. So, yeah, dammit.

Which brings me to the title. After realizing that running a shadow map using Blitz Basic is likely a fools errand, I got back into the code. There was a bug that needed hammering and it needed it now. The Front End code was still being, let's go with stupid. Run a game, quit out, run a game, quit out and sometimes, just for fun, it would load you in the wrong place and kill you. The trouble was, nothing was telling it to load you in the wrong place, it did it of it own accord as far as I could tell. Some artefact of the code being wielded by some ghost in the machine. After trying, for several days at this point to find the source, I decided that being crafty with it wasn't paying out, so I beat it to death. I stuck a little bit in the loading function that basically says : "If you did all that, and the character is someplace stupid, you did it wrong. Do it again, and keep doing it until you get it bloody right."
It's hardly the most elegant thing in the world, and I would rather it just work like it's written. Yet, it does in fact work now. So I'm happy enough with it. Now I can move past the thrice damned thing and work on the other stack of things that still need doing.

Monday, November 2, 2009

Speed Racer

Over the weekend I got to fiddling with the shadow code some more, and turned to my old friend the CAD menu to do an experiment. It was posited that maybe, the code wasn't the problem, the processor was simply too slow. Maybe the code as it is, is too big a bloated from something to work on a normal system with normal system resources. So I went ahead and opened the little bastard up and let it run and it took 95-100% of my processor resources to run. A giant overflow of want that the bounty of my not-slow laptop could not provide. So clearly, the basic structure of the code is flawed. I'll try to think of something else.

While I tried thinking of exactly that something else, I got to dealing with some of the little coded pieces that need doing. So I started finishing off the Perfect Mode features. So now, if at any point you happen to have more than 1 life in perfect mode, you instead only have 1. That way my doll code all works still and I don't have to add little exceptions to every single scripted bit. It also kicks you out to the front menu if you die and doesn't offer a continue option. I bashed that for the better part of 15 minutes before finding that it was the pause menu itself that was trying to be helpful when I didn't want it to be. Either way, the base of the Perfect Mode is all done. It needs the little polished bits like stat tracking and things like that, but that'll come when I build those things for the rest of the game. In the meantime, I'm confident it gets a great big "Done" stamp.

I'm finding the little pieces all coming together to be great. It's not the epic battle that often comes with doing assets and codes. It's a subtle groove that carries me along. A bit here, a script there and then whole delicious chunks of game just are. Nuggets of progress to enjoy on an almost daily basis. Really quite yummy.

- It's not all sweet cookie code, the front end has gone all stupid again. First, it wouldn't launch the game loop. I would tell it, "Let's run the game! It'll be fun!" to which it would sardonically reply (through it's actions) "Yes, that would be fun. It really would be." Leaving me feeling like a rube for even suggesting.
So I made a little change to the code to put the Launch Sequence in more places. Now, it doesn't load correctly. Start it up, and it works. Quit out or die out, and start again, it doesn't load right, keeps you in the same place and usually kills you.
Or if you go into the Chapter Select, and the back out to the Front Menu, it launches prematurely (I've told it that it happens to every bit of code sometimes).
Something is rotten here, but thankfully I know that it did work once. My new changes clearly the issue. I just need to fix it, but not well enough to recreate the original problem.

- Finally, I think we missed our deadline of 11-1. Yep, we sure did. The odd thing was, I didn't even notice as we sailed on by, too engrossed in the progress we're making. The slow brew in a magic cauldron.