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.