Saturday, March 24, 2007

Writing

I could write 50,000 words.

No I couldn't

Yes I could.

If you put together all the fiction I've written in the last five years, it wouldn't amount to 50,000 words. 10,000 words for "One Bad Thing". 5,000 words for "The Road Song", and two or three shorter stories of 2,000 words or so.

They're good words, though. High quality words. Each one lovingly prepared and simmered to perfection.

I haven't written any fiction since 2004. But, I have done some writing... an account of our time in New Orleans... a blurb about our home group for the church newsletter... just this evening I wrote a techie article about using javascript to write roguelikes (a subject about which, you'll have to admit, I am a relative expert).

And there's this blog. If blogging is writing. Blogging might just be blogging. I dunno.

Hmm. I take that back -- I have written some fiction recently -- the backstory to the Seven Day Quest.

Clearly I need to exercise my fiction muscles! Time for a new story. Maybe about the Natchez Trace.

If anyone adds a comment to this post asking for it, then I'll put one of my short stories up on the web, so you can see what I'm talking about.

No point in doing that if I'm just talking to myself, though.

Thursday, March 22, 2007

Next Up

Well, next week I will participate in the Seven Day Roguelike Playing Week.

The date has been set for the 2007 24 Hour Comics Day: October 20th. A long ways from now and frighteningly close to the beginning of NaNoWriMo.

Of course, by the rules of 24 hour comics, I don't have to do it on the day. But I want to. Also, I don't have to go to any particular location, but I want the complete experience. Last year there were 89 locations where folks got together to do their 24 hour comic. None of them were in Arizona. I'm all for doing a bit of traveling as part of the whole adventure.

As far as what the comic is going to be about, the spirit of the 24 hour comics challenge is that you don't put a lot of thought into that -- no preliminary sketches, no story outlines. Sit down and start drawing. So, in that spirit, I'm going to try not to think about what my comic will be about. I will try to not think of that for seven months. Good luck to me. I will, however, start spending more time sketching. My sketching muscles are a bit atrophied.

NaNoWriMo follows shortly thereafter. The spirit of that contest is that you don't have copy written before November 1, but you can have notes, characters, plot outline figured out in advance.

Sunday, March 18, 2007

One Down, Two To Go?

Well, the challenge is over. According to the official report, twenty-two developers accepted the challenge, and eight of us succeeded.

Looking at other 7DRLs in general, it appears that minor bug fixes after the deadline are considered okay, so that's good.

And I was pleased to see an overall-positive review of my game in Roguelike. The Magazine. So I feel good about the seven day quest and The Seven Day Quest. I hope to hear feedback from my friends about it at some point.

But the experience was also sobering as I look forward to the rest of the grand plan, i.e. the 24hour comic and NaNoWriMo.

Actually, the 24 hour comic doesn't have me too worried, except I don't know if I can really stay awake for 24 hours anymore. I have plenty of time to polish up my drawing skills, etc. and I don't expect to have trouble coming up with enough material for 24 pages.

But NaNoWriMo may be biting off more than I can chew. A 175 page novel in 30 days. I found the 7DRL experience exhausting -- working 5 hours on the Roguelike after 8 hours of my regular job left me completely wasted after just a few days.
And writing code is a heck of a lot easier than writing fiction (at least for me). The longest piece I've written to date is 30 page short story. Unless I take at least most of November off, it's hard to imagine even coming close to success.

Saturday, March 17, 2007

Freakin Off-By-One Error

Writing software for 27 years, and done in by the classic newbie mistake. Can't even claim bleariness, it was code I wrote when I was awake.

For potions or scrolls, there's about a 1 in 100 chance it will create a treasure with undefined stats. If you pick this treasure up, the game breaks.

-sigh-

I'm going to upload the fix; not sure what that means in regards to whether I can still call this a clean victory.

Okay, so maybe I'm rationalizing here, but... I did finish the game with seven hours to spare. And I found, fixed, and uploaded the fix in only about 90 minutes... and the challenge is still going on; the weekend isn't over. And a bug fix is different from adding features.

-sigh-

Friday, March 16, 2007

Breaking The Tape

It is done!

Here is a link to the new intro page: http://www.babelsphere.com/7dayquest/game/

The game is uploaded. It's playable. It meets the criteria. My next step is to post to rec.games.roguelike.announce and declare victory! With seven hours to spare.

And I'm happy with the outcome. The game is fun to play. I like the graphics. There's enough there for sure.

I'm happy with the code overall, considering how quickly it was written. The javascript is pretty clean, and there are no funky things like code branching based on what browser you are using. The game works in IE on windows and Firefox on windows and Mac. I know why it doesn't work on Safari (Safari just doesn't like using a div for input, it's an HTML problem, not a js one). I could work on fixing that, but it's not necessary for declaring victory.

Of course, there are a few shortcomings. The chase algorithm has a weird anomaly -- I know what it is and how to fix it, but it's actually kind of fun the way monsters behave unpredictably, and it keeps the hero on his toes, so I'm leaving that as is.

The balance interface is kind of klunky, and you have to rebalance each time you start a new game.

The winning and losing screens have been improved, but not much.

Never implemented traps, or blessed weapons.

I could spend the next seven hours trying to accomplish that, but it would be really irresponsible. I have to get back to my regular life now.

Of course, I do want to put those things in at some point.

Oh, and I didn't do a thing to support small screens. If you don't have at least 1150x800 resolution, it will be a real drag to play the game.

And, I'm already thinking about next years 7DRL: take the Seven Day Quest, use Ajax to hook it up to a j2ee servlet, and create a multiplayer online rogue... It's defnitely doable in a week's time...

Back Story

The town of Wentora has long been a prime tourist destination. Folks from all over Thorphilia would come to Wentora during tourist season to see the famed Amulets of the Seven Planets (or, as they later came to be known, the Amulets of the Six Real Planets and One Dwarf Planet).

But, tragically, during the bleak midwinter, a mysterious cataclysm caused the seven amulets to be dispersed throughout the Dangerous Realms -- seven magical areas that can only be reached through mysterious magical portals.

These magical portals have been reopened, but there is only one week to go until Tourist Season begins! The economic consequences for Wentora will be dire if the amulets cannot be recovered in time.

So the townspeople of Wentora have offered a substantial reward to any rogue who is willing to brave the Dangerous Realms, find the seven amulets, and return them before tourist season begins.

But (having been burned by rogues before), the townspeople want results. The Rogue who takes on the task must have one amulet back within 24 hours, or the townspeople will give the task to someone else.

As a matter of fact, the Rogue is told, if you can't come back with an amulet at the end of each day, don't bother coming back at all.

You are that Rogue, and this is your Seven Day Quest!

Give it a Try!

I uploaded the latest this morning before I left for work. I just tried it out (from work), and noticed that healing does not seem to be happening.

But you can definitely get a feeling for the game if you go there. Try out a level or two. See if you can find an amulet! If you give me feedback this afternoon, I might be able to incorporate it tonight.

I talked about pulling an all-nighter tonight, but that really isn't realistic. The game needs to be done by 7 am saturday, but I have a church board meeting at 9 am Saturday, so I really need to be able to sleep Friday night. I figure my effective deadline is midnight tonight. I may not get back to the computer before 8pm, but 4 hours should be plenty to finish what absolutely needs to be done.

Again, if you read this post, try the game here.

One more caveat: for certain realms, the very first time it draws a level, especially on IE, it will be very, very slow (like 20 seconds until the level fully shows up). This will be fixed by morning; it' s just a matter of preloading the .png's, but for now be patient. And remember that right now, balance doesn't actually work. The UI is there (although it doesn't go away once you bring it up, unless you refresh the screen), but it's not hooked up to anything.

Thursday, March 15, 2007

The Light at the End of the Tunnel

Quarter to 11 on Thursday. I was going to upload the latest, which is coming together nicely, but I think sleep is the most important thing right now. Tomorrow I have to go back to work. Tomorrow night I can pull an all nighter if necessary.

The only task that's absolutely necessary before declaring victory is finishing the monsters; I've got about 40 done and 10 to go. So I feel confident I'll meet the challenge.

Other things I'd like to accomplish:
- usable fully from keyboard or fully from mouse. Right now you have to use keyboard for everything except using objects in your pack, and you have to use mouse for using objects in your pack.
- traps. Haven't done those at all
- more special abilities for monsters. Only one right now (scorpion sting)
- nicer "you win" screen
- nicer "you lose" screen
- complete instructions
- way to clear a saved game
- hook up the UI to the game balancer
okay, this needs some explaining. I knew I wouldn't have time to balance the game, so I have put game balancers into the hands of the player. You will be able to adjust your vorpalness, monster vorpalness, monster frequency, treasure frequency, and time scale. Once it's been playtested a bunch we can freeze these values.

Okay, a line count before I go to bed:
Looks like on the order of 3500 lines.

Starting to look like a game...

One feature that is kind of cool is that the game autosaves if you leave the page and autorestores if you come back.

I have artwork "mostly done" for all but the final environment.

I have a lot of monsters but I need a lot more.

I have a couple scrolls and one potion. No traps yet.

Weapons are all in and working nicely.

Amulets are in. Total winner detection is in (but it's hard to be a total winner with no graphics in the final environment -- the amulet, and everything else -- just looks like a broken document).

Those curious can view the work in progress at
http://www.babelsphere.com/7dayquest/game/7dayquest.html

Wednesday, March 14, 2007

Alpha Discoveries

Well, I put what I have so far on the web. It works okay on firefox, but it's unacceptably slow on IE the first time you enter a particular realm -- like 25 seconds to draw a level. I think I can work on that. And keyboard input is not working on Safari at all. I think safari just doesn't like taking input from a div. I can probably fix both those things, if I can find the time.

I'm Getting Too Old For This

Okay, if I do this next year, I'm going to take the week off of work. Let's face it, I'm not as young as I used to be. I was next to useless at work today after staying up hacking until midnight 4 nights in a row.

Sigh.

I remember once Michael stayed awake from Monday morning until Friday evening. Back in the day.

Anyhoo, finished debugging weapons. Added a couple monsters. Started graphics for island & underwater levels.

I had hoped to have something to upload for select folks to have a look at before I left for this church thing, but not going to have time to upload it. Have to do it after I get back.

Hump Day

I have obligations this evening that will probably take a couple hours out of my precious coding time. sigh.

Fortunately, I was able to put in almost 2 hours this morning before work; got weapons fully coded up but not debugged or tested.

Also redid the graphics for the base environment. Looks much better, although graphics is one of the things I'm being sloppy with in order to finish in time.

Other sloppy parts:
- Battle system made up on the fly. No idea if it makes for balanced play
- Really lame monster chase algorithm (just move-towards-Rodney)
- Really lame sight system (whole map always visible, object visible if they are nearby, no checking for line-of-sight or even in-same-room -- might try to improve this if time permits)

And lots of things intentionally left out for time's sake ---
food, rings, wands & staffs, mazes, gold, party rooms (hey, maybe I can put that in...)

The main thing "added" (added compared to original rogue that is, I assume there are other roguelikes out there that do this) is the time constraint. You have to find 7 amulets, and you have 24 hours to find the first one. Each one you find gives you another 24 hours to find the next one.

That plus the seven different environments -- final list: Cave, Forest, Desert, Castle, Islands, Under Water, Dream World.

Everything else is minor variations on the classic theme.

Tuesday, March 13, 2007

Progress Report

Eleven pm Tuesday evening. The good news is that save/restore is working well. The bad news is that I've spent the whole evening so far just on that. Still, I'm glad I have it.

No protection against save scumming. The battle randomnumgen is reseeded where you left off, though, so if you save in midbattle you can't keep restoring and hope for a different outcome.

This being written in javascript, the game is saved to browser cookies. My tests had total save sizes of ~1K, but I figure that will grow as I add more to the game; since there is a 4K limit to browser cookie size I broke it up into 4 cookies, which should be safe.

Monday, March 12, 2007

Plan B

It's closing in on eleven pm...

Didn't do anything about creating a view object. It would make for better code, but it won't get me complete any faster.

Instead, added the transition code -- a central level that leads to all seven different provinces. And got some stuff necessary for save/restore -- making sure I can recreate any level based on the root random seed, etc.

Changed stairways to portals, since the levels aren't necessarily "down" anymore, just elsewhere.

Got 4 of the 7 scroll types working.

Created a lot of the graphics for the forest province (Cave & Desert graphics already mostly done; haven't started on castle, island, water or sky)

I'm going to try to put in one more hour tonight.

But what if I don't want to write code?

Okay, my first evening of coding after a full day of -- well -- sitting in my office thinking about spending the evening coding.

The plan - ish - for tonight: rearrange the code a bit to pull out all the view code into a view object

Put in some of the save/restore infrastructure

Add the scrolls, potions, traps, and maybe weapons.

Or as much of that as I can manage.

But first some coffee. Chickory coffee from Café du Monde. Heh.

Mondays are Still Mondays

No time to code this morning. Just a quick note before I head off to my actual job. From here on in, it is evenings only.

By my count, there are now 16 coders accepting the challenge.

I have discovered there are other Javascript roguelikes out there. Mine may still be the first 7DRL in js.

I'm in an interesting position, I think, because the only roguelike I've ever played (or even seen in any detail) is Rogue. And I haven't participated in discussions in the roguelike development group until now. So my 7drl will probably look like a throwback (or hopefully a Classic) to the other participants.

Sunday, March 11, 2007

Arg wu Sentifinticate Nar Dunderford

11:30 pm sunday. I have had it for today. Can't decide if I'm making enough progress or not. Starting tomorrow this is spare time only.

The fighting system is done and working, hit points, experience points, going up levels, etc. But I only have a few monsters and I haven't implemented any special abilities yet (infrastructure is there, though).

Also, treasures are created and placed about the dungeon. You can pick them up and they go in your pack; you can drop them and they go back on the floor. That's about all you can do with them, but it's progress.

I'm up to 1700 lines of code in 17 files now.

But I'm getting bleary -- near that point where I'm likely to do more harm than good if I keep going. So, it's update the blog and get some sleep.

The Battle Rages

Five O'clock on Sunday. Still a long way to go today, but monsters chase you and fight you and you kill them or they kill you.

Thought I'd need an involved chase algorithm, but a dumb one seems to be working fine. So there's some infrastructure in there that I won't be using for now.

I've only put in stats for about 8 of the 49 total monsters. And of course, those stats will probably need adjusting.

Trying to balance the game is my biggest worry; I won't have time to play even one full game before I have to publish, so I could end up with something impossible to win and I'll never know it. I wonder how others have handled it?

I'm basing a lot on a few key numbers that I can adjust. I may make it so that players can adjust it and balance the game for themselves.

Reliving My Misspent Youth

In the spirit of the contest, I ordered a large pepperoni, sausage and bacon pizza and drank several cans of coke last night; the empties are piled on my desk. Donuts and strong coffee for breakfast this morning. I can probably survive one week of hacker food.

I was putting together a playlist of songs to code by ... I went with songs about adventerous things, but I'm thinking maybe I should do a playlist of songs from the early '80s, the stuff we were listening to when we were writing Rogue long ago. I have very strong memories of freezing in a cabin in Lake Tahoe, designing the characters for the Mac version while Michael wrote the code, listening to Phil Keaggy's "Play Through Me" over and over. Unfortunately, Play Through Me is out of print and not available on iTunes. We also listened to a lot of early Steve Taylor and Daniel Amos. (Well, we didn't think it was early when we were listening to it, but it is now)

***

Looks like we have seven contestants this year in addition to myself. Read all about it at http://groups.google.com/group/rec.games.roguelike.development/topics.

***

So I'll be able to start coding this morning by 10 a.m., not too bad. The crucial things for today are monster movement, fighting, and save & restore game. I was going to leave save & restore for late in teh week, figuring that I could declare success even without that functionality, but now I'm thinking that it's better to have the infrastructure for it earlier than later.

As I go, I'm testing the code on Windows usng firefox & IE 6, and I will probably do a little testing on Safari Mac. Hopefully it will work fine in other browsers as well, but I won't have any time to make sure of that.

Saturday, March 10, 2007

So Ends Day One

Well, it is midnight. I have added wandering monsters -- sort of. They don't actually wander, they just stand there. And you can walk right through them. I need to get battle working tomorrow; that wasn't even on my list, but of course it's vitally important.

I have to go to church in the morning, so I have to get to sleep now. I'll get back to this as soon as I can tomorrow.

Oh, and my son's car won't start, so I have to get that dealt with tomorrow, too.

Still, I think I'm doing okay.

Nine Forty Five

15 hours in, but only about 10-12 spent actually coding. About a dozen files created, about a thousand lines of code written, and all working nicely. Lots of infrastructure; builds levels, Rodney can move around in them and go down stairs. Everything I planned for day one is in, but I want to get a little more progress, maybe just some work on the screen layout and stuff, before sleep.

Already I can see it needs some refactoring, though. I need to share more code between monsters and treasure. That's what I get for working without a spec.

Four p.m.

I'd say at the moment I appear to be ahead of schedule, which is good because today is really my only full day to work on this.

I've got the program drawing levels, creating rodney, interpreting keystrokes, and letting Rodney run around the level.

Have not done stairs or messages yet, those need to get done today, but I've got lots of time left.

Three Hours In

Looks like so far there are 6 participants in this years 7DRL, incuding myself. Seems like a smallish number. Maybe more are yet to join.

Coding is going well so far. I've put in about 3 hours of work, and I have a bunch of the infrastructure, and I am successfully drawing levels. Of course, those levels are empty. The next step is to create Rodney and make it so he can walk around those levels.

Gentlemen, Start Your IDEs!

6:30 a.m. on Saturday, and I'm awake. It's not a kayak trip, so it must be a 7 day roguelike. Oh, maybe I'm not all that awake after all. In a few minutes, I will post my starting message and I will create my first file.

Last night I figured out what all the monsters would be. I'm not going to post it here because I don't want to spoil it for you.

Friday, March 9, 2007

Oh, a Design Would be Nice

Forty-Five minutes until I can start coding. But I don't have to start at midnight; as I understand the rules, I can start any time on the tenth, and I have 168 hours from whenever I start.

Maybe I should use this evening to really spec out the game I'm going to write. I have it pretty well set in my head, but it's a hodgepodge of ideas.

I want to capture the essence of Rogue, but also be minimalist enough to be sure I can finish (let's face it, I probably have less than 60 hours in which to actually get work done).

I'm going to make the whole level map visible all the time; no dark rooms, no secret doors. The "stairway" won't show up until you are next to it, though.

Distance weapons and wands are kind of complex, but I don't think I can leave those out.

I could leave out armor. The original Rogue didn't have armor for a long time; folks at UCSC still loved playing it. Maybe I'll just push that out to the end, so I can skip it if I get behind.

I don't know if it's cheating to create the graphics files outside the 168 hour window. The rules are a bit vague. I think other 7drl's have used existing graphics, so it seems reasonable.

Still, I haven't created any, so I better get on it.

Captain's Log -- Supplemental

I figured out where I'm going to put the game.
It will be here

The Antepenultimate Hour

Holy Shamoley.

The contest begins in less than four hours.

There's still tons of stuff I haven't even started to figure out -- like what the monsters are going to be!

But I'm feeling good; ready to get started. It was an excellent day at work today. Managed to pump out an 18 page design spec in one day, and it's pretty darn good if I do say so myself. First day since sometime in November where I feel like I actually earned my pay.

I'm going to spend a little time this evening just getting all my ducks in a row -- making sure I've got the libraries I need, getting some graphics files, etc, and figuring out where I'm going to upload this to (probably babelsphere.com, since I let mindcountry.com lapse....)

Just want to make sure all my ducks are in a row so I can hit the ground coding at midnight (or in the morning if I'm too tired to code at midnght).

Saturday, March 3, 2007

Seven Days Until...

Okay, the first stage in my trilogy/triathalon begins one week from today. I'll have the full day to work on this on Saturday, and most of Sunday (might see if I can get out of going to church). The rest of the week I'll only have spare time.

I may set some stuff up today -- no actual rogue programming of course, that would be cheating, but get together all the javascript libraries and exising non-rogue-specific code that I'm going to use. Also map out a timeline for the development. Saturday will be the most important day.

For the game, I think I want to go with the different-evironment-each-day plan, though I don't think I'll have enough time to really represent it graphically. Here's a proposal for each quest's environment and magic item
Day 1: Cave -- wand of mercury
Day 2: Forest -- potion of venus
Day 3: Desert -- key of mars
Day 4: Castle -- boots of jupiter
Day 5: Islands -- amulet of neptune
Day 6: Under water -- dog tags of pluto
Day 7: dream world/sky -- mirror of saturn

or something. Needs work. Well, I've got a week....

I think I will leave out rings, food, and gold, just to reduce the scope of the effort...


Here's a straw man development plan:
Saturday: map, levels, rodney, keyboard input, movement, stairs, messages
Sunday: pack/inventory, basic monsters
Monday: hand-to-hand weapons, armor, more monsters
Tuesday: wands & staves. more monsters
Wednesday: potions and scrolls, save & restore game
Thursday: distance weapons, amulets
Friday: transitions, intro, clean-up, testing

Maybe I should download and play some other seven day roguelikes to have a look at what is out there, huh?

All right, I'll do that, and let you know how it goes.