The Code Zone Bargain Basement Blog


Imparting Game Development Wisdom of Dubious Quality Since 1998

Friday, March 30, 2007

Flashamatizing

Oooh, CS3 is out. Looks like I'll be scraping together $499 so that I can get the big suite upgrade. I actually could just update the stuff I use most (Flash, Dreamweaver, Fireworks) for $399, but if I throw in the extra $100 I also get Photoshop and Illustrator.

And that's a pretty good deal for Photoshop and Illustrator. Given that Paint Shop Pro is not unexpectedly going the Microsoft Money route of "let's change the color scheme and add a couple of tutorials, then we can charge money for a new version", I'll probably welcome the new stuff. To be honest, I'd been using Fireworks for all of my image-editing recently. For web-stuff, I love their almost-invislble scheme of maintaining two files, one a lossless PNG that stores vector-data in the PNG's metadata (i.e. "the version that don't look good on web browsers") and the optimized flattened JPG/GIF/PNG (i.e. "the version that looks good on web browsers but ain't editable worth squat"). That means that on pages like this, if I want to change the callout text or add new balloons or change the drop-shadow, it's easy to do, and it'll save out both the nice-vectored-layered-not-web-compatible version for me and the optimized-paletted-dithered-gif version for the page.

I'm hoping they extended that same workflow to Photoshop and Illustrator. It's handy as all get-out.

The new Flash supports AS3 and Flash 9. Dunno if I'm gonna move there right away, though. AS3/Flash9 is an order-o-magnitude speed improvement over the old version, mainly because the Flash9 player actually has two VM's. One that interprets the old "similar to Java bytecode, including the speed" code and one that interprets the "similar to the old stack-based P-CODE/FORTH languages that were popular in the 1980's but fell out of favor, mainly because they required you to write an actual compiler and not just a line-by-line convertor". Of course, a piece of stack-based pseudoassembly runs about a hojillion times faster than that new bytecode VM, and JIT compilers didn't turn out to be the solution to all our performance problems that the 1990's promised them to be.

"Oh, Java performance sucks? Oh, well they'll be better when they have a JIT. In fact, they'll be better than C++. Lots better! You want proof. We got benchmarks!"

"Oh, Java performance isn't very good, even with a JIT? Well then, let's model our Actionscript interpreter after that!"

In Actionscript-macrodobe's defense, Flash wasn't really intended to become the web-application programming language that it's become, so I'll forgive the clear growing pains it went through. At least they're taking big steps to fix the problem, which Java never really did because they were too busy making releases that ensured that the naming conventions for library commands were consistent.

. . .umm, I think I'm ranting. Back to the topic. Only problem is that Flash9 ain't quite ubiquitous yet. Right now my Flash7-based site will work on about 99% of browsers, including weird ones like the Wii. And that's kinda cool.



Oh, and a quick hint out there for the cheap. If you're looking to upgrade your macrodobe products, get an account at fatwallet.com and click through them to buy it and you'll get a few bucks back.

The way that works is that fatwallet is hooked up to all of those affiliate programs that give 'em a kickback if you buy a product through their site. Fatwallet, however, splits the kickback with you. If you go to their stores page, you'll see how much your cut will be.

Mind you, the cash won't come immediately. Most affiliate programs pay quarterly or on some kind of "hit a certain point and we cut you a check" system, and Fatwallet splits the cash when they get it, so it's likely that you won't get your cut for 1-3 months. Once the cash appears in your account, you can request the cash via check or paypal, which only takes a couple of days.

I've been doing this for Civilgrrl's office supplies and our Dell purchases, and I couldn't be happier. According to the site, I've gotten $209 cash back so far.

Still, the Adobe Store kickback is 6%, which is about $30 for a $499 purchase. And that's certainly worth a free sign-up.

And yeah, I know what you're saying now. You're saying "Why let them have half. Why not just sign myself up as an affiliate and take the whole thing?" Well, I've done that in the past, and it's a genuine hassle. Some affiliate programs require manual approval or some kind of odd "link builder" system that makes things difficult. Also, some companies only send you your referral bucks when you reach a certain point (usually $100), which means that your referral bucks will likely never make it to you. Fatwallet's done the legwork with the affiliates, and it's worth the cut.



Finally something programming related. AS2 and AS3, like most new languages like Python, have dispensed with the concept of statement closure. That means that you don't have to end your lines with a semicolon. Giant screens and fast text editors have made whitespace in your code very cheap, so the semicolon has become the code-equivalent of saying "umm" when you speak -- it's just something to fill space.

There is one case, though, where it's problematic, and that's the case of an empty statement. Suppose, for example, that you want to find the first null element in an array. the one-liner solution is this. . .

(note, this is actionscript, but it's durn close to C++ except that arrays have a "length" member because all actionscript arrays are dynamic)

int index;
for (index = 0; (myarray[index] != null) && (index != myarray.length); index++);

trace("the first non-null index is " + index);


Problem is, this is butt-ugly. You expect a for-loop to contain something to be iterated over, but in this case it's not necessary. The for-loop itself is doing everything needed, so it doesn't need a body and I can just close it.

The next problem is that most C++ compilers and syntax-checkers and lint-tools will bitch at you for it, mainly because there's about a 90% chance that that semicolon at the end of the for-loop is a mistake and will bite you in the ass once you start running and unless you debug it it's durn-near impossible to find.

Furthermore, it's a problem if semicolons are optional because the compiler assumes that the for-loop must contain something. So if I remove the semicolons from my above example. . .

int index
for (index = 0; (myarray[index] != null) && (index != myarray.length); index++)

trace("the first non-null index is " + index)


Does the trace now get called multiple times because the for-loop assumes that the line/block below it is part of the loop? It's ambiguous, and ambiguity piled on top of ambiguity isn't good.

The elegant, albeit obscure, solution to this is the following

int index;
for (index = 0; (myarray[index] != null) && (index != myarray.length); index++)
null;

trace("the first non-null index is " + index);


Both C++ and Actionscript interpret a null by itself as "don't generate any code", so putting the null in the block does triple-duty of making it obvious that the inside of the for-loop does nothing, removing the "you probably didn't mean to do that" warning, and also making its intentions clear in a semicolon-free universe.

This has been your code-obscurity minute. And as a bonus, it'll help your C++.

Yeah, I could've restructured the "find the first null value" code into several lines without a hit, but this one-liner is pretty easy to understand and doesn't quite make it into the "too durned clever for its own good" category that you're always encouraged to avoid.

Go in peace.

Wednesday, March 28, 2007

Happy Birthday To Blog.

Just noticed that the Bargain Basement Blog turns nine years old today. In celebration, please respond to this post with good birthday wishes, preferably in L33tspeek.

Tuesday, March 27, 2007

Final hitcount

Well, here's the final tally from my almost-digg-ing yesterday.

FWIW, I'm using Mochibot to collect stats on my games (as well as track if anyone's trying to host my SWF files offsite) and MochiAds to serve the ads. And their hitcounts were pretty far off. Looks like Mochibot's having trouble keeping up, because it only logged about 250 hits. MochiAds, though, says that it served just shy of 3500 ads yesterday for BaffleBees, which isn't mind-blowingly huge but is about 200 times what I normally serve.

So 3500 plays is the best estimate. Everything else got between 100 and 400 plays, which is still pretty high.

The good news is that everything survived the increased traffic just fine. The highscore table looks just fine. Daily update emails got sent out just fine. Everything worked just fine, thank Zwinky.

It looks like I picked up quite a few new folks in the process. Hopefully they'll become regulars.

And yeah, I got charts and graphs and such. Between Mochibot, Mochiads, Google Analytics, and the half-dozen traffic analyzers that are installed by my hosting provider, I can get up-to-the-second stats on what's going on.

But I ain't gonna post 'em because I'm lazy. Just picture a big spike yesterday that dwarfed all the other lines, and you'll get it.

Monday, March 26, 2007

I been dugg. . .I mean jayisgamed!

My hitcount on my games page is a mite north of its current "growth, but extremely slow" curve I've been seeing recently, as one of my fans has posted a review on The Casual Gameplay site. It's not even 10 AM here, and I'm already looking at a thousand plays.

So big big thanks for that :)


Two clarifications. . .

1. BaffleBees was actually TANSTAAFL's idea, which was a hexagonal version of my old Quinto game. Credit to TANS, though, for realizing that hexes is a much better mechanism for that game. The name and theme are mine :)

2. My blog has been around since 1998. I oughta do something for its tenth birthday next March.

Wednesday, March 21, 2007

New Daily Puzzle!

The Double Twelve Daily Puzzle is now up and playable. It's a domino game. It's a fairly leisurely-paced game compared to other efforts. Hope you enjoy it!

New Game is up!

Double Twelve is now up and playable.

And it has a "guest login" button if you've been meaning to play my games and don't wanna futz with creating an account. Lemme know if you see any problems with this new scheme, as I'll be retrofitting all of the existing games with this.


Double Twelve is definitely a "feast or famine" kind of game. Yesterday's game was pretty trivial to beat. Today's game is nigh-impossible.

Tuesday, March 20, 2007

Tomorrow

Daily Puzzle Number Ten (AKA Double Twelve) should go live tomorrow. As always, the last ten percent takes up half of the time. And given that I have a dozen little icons and menus and tables and playback applets and other things that need to be built, putting up a new daily puzzle is no longer a trivial process.

Double Twelve is definitely one of the easier games. It's pretty leisurely paced and is fairly easy to beat. Some folks don't wanna have their brains bent at 8:00 in the morning while they're sipping their coffee, so this should fit the bill.

Biggest new addition is a guest-account. The game-login screen will now have an button that'll let you play as a guest, which should make things a little nicer for folks who wanna try out the puzzles. Guests won't have their scores recorded and will get a different puzzle from the registered players (so you can't use the guest login to cheat), but it's otherwise the same.

So give it a try and let me know if it's all working. If the guest-login thing works, I'll retrofit it into all of the other puzzles.

Monday, March 19, 2007

RIP CompUSA

Well mostly RIP.

The whole CompUSA saga takes me way way back to around 1989 when it was called Soft Warehouse and there was only one of 'em (that I was aware at least). It was on Marsh Lane in Dallas, and it was a thing to behold. Mind you, this was back in the day when the biggest computer retailer in your town was either the local Radio Shack or the local Big Bob's PC Clones, so the concept of a computer store that was as big as a K-Mart was something mythical.

Of course, I lived in College Station (Texas A&M) at the time, so Dallas was a good 3.5 hour drive. That didn't stop me (and Bryan IIRC) from making the trek a couple of times, usually returning with some obscure piece of software that couldn't be had anywhere else (this was pre-internet, mind you).

A couple of years later the chain grew and changed its name to "CompUSA" to reflect the fact that they didn't JUST sell software. And the Marsh Lane location moved across the street to an even larger building.

But now the Marsh store is closed, as well as pretty-much all of the stores in the D/FW area. In fact, the only stores left in north Texas are in Plano and Frisco (far northeast Dallas), so I don't think I'll be making the trek anymore even though Southlake-Frisco is quite a bit closer than College Station-Dallas.

Yeah they're geeky memories, but they're memories just the same. I'll miss 'em.

Friday, March 16, 2007

Lotsa things

I'm all back from sunny San Fran. The weather was great for the entire trip. Sunny and cool. Apparently March is a great time for the area.

We took a few extra days after the GDC to vacation there, as I realized that I've been to the area a dozen times but have never actually seen the city. Had a good time taking the boat-tour of Alcatraz and the Golden Gate Bridge. We visited Chinatown, which was a real slice of life. It's pretty fun, but there were a couple of places where I was worried that I'd be kidnapped, dried, powdered, and shipped off to the Far East to be sold as an aphrodisiac.

San Francisco is a land of contrasts. On one hand, it's reportedly full of touchy-feely-lawsuit-happy-commie-fag-leebrals who are constantly trying to impinge on your civil liberties in order to ensure a level playing field for all, but on the other hand I spent an afternoon clutching to the side of a streetcar climbing 45% grade while people with ponytails and SUV's (two things which are in good supply there) sped by me while while wiping the foam off the side of their Grande Lattes (which are also in healthy supply).

But the people there are really friendlier than they let on. Some of the locals think that their fellow locals are a bit too insular and self-important and are too wrapped up in their iPods (which every resident must, by law, own) to interact with others, but I really didn't see that. To be honest, I've never found Americans in one city to be all that different from Americans in another. Proportions of helpful chatty folks versus standoffish A-holes aren't really that much different from place to place.

That being said, San Francisco does have a higher quotient of religious lunatics, but I think that's really more due to the mixed marketplace of ideas than anything else. Here in Dallas, the evangelicals Jesus-worshippers have a more-than-comfortable majority, so somebody with a sandwich board proclaiming that the world's gonna end SOON (see earlier entry for a definition of SOON) is preachin' to the converted around here. In San Francisco, chances are much better that you're gonna be preachin' to someone who practices some kind of homegrown neopagan-homeopathic-jainist-dianetics-buddhist-ism, so your particular brand of religious hoohah is more likely to reach someone unconverted to it.

Shelly and I did have a funny conversation about Scientology, because we ran across a more than a couple "find out about your personality" tables that are intended to convert you to Scientology after explaining that it's not your fault that you're a complete loser.

What I don't understand is WHY I need to find out about my personality. I've been living very closely to myself for nigh on 40 years now, so I should have a pretty good handle on my personality. In fact, I should know about my personality better than anyone else given the close proximity I have with myself. And I should CERTAINLY know more about my personality than some kid who's trying to get me to fill our a questionnaire while showing me that a galvanic skin-response meter can reveal my deepest problems.

Furthermore, I am clearly comfortable with my personality, because if I was not I would change it. The fact that I am the way I am and I act the way I do makes it clear that I'm comfortable with my am/do because I am in the unique position to change things. . .but choose not to.

So the whole point of having someone tell me how I act is pointless because I know how I act. And telling me how and why I should change is similarly pointless because if I wanted to change I would do so!

The entire exercise seems as nonsensical as someone trying to determine if I like potato chips then seeing if I'm happy with my like or dislike of potato chips. If I like potato chips, then I already know it. Furthermore if I like potato chips then I will eat them, otherwise I will avoid them. Showing me a test to gauge my stance on potato chips then telling me my stance can/should/must be otherwise is pointless.

Of course, trying to get an explanation from a teenaged volunteer who's trying to earn credits that he can spend on more courses to learn about Space Cooties (which is ultimately what Scientology, at its core, is all about), is pointless.

So I ignored the whole thing.


Big thanks to Thompson-Course-Technology-Premier-Charles-River-Media-Cougar-Mellencamp-Press for letting Shelly and Maggie tag along at their author's party. The ladies were all impressed at how well-behaved Maggie was.

Of course, they were overlooking two things. . .

1. She had already done a full day of city-exploring with mer mom, and she was dead tired. She fell asleep on the bus on the way back to the room.

2. She was the only kid in attendance. Young kids are like lawyers. When there's only one present, then they'll sit quietly. If there's more than one, then you've got trouble.


Also big thanks to my cousin for opening up her little home-based bed-n-breakfast to us. We had a grand time, and Maggie had a ball with the kids. If you ever find yourself in San Francisco and you want to stay somewhere with a great rate and a full kitchen, you could do a lot worse than this. As an added bonus, she had a full washer-n-dryer, so we only had to pack half as much clothes as necessary.


Big thanks to gamedev for ordering me three shirts, then giving 'em to me the day before the end of the conference.

Honestly, though, I have to Melissa the proper respect. She pulled the whole thing together and manned the gamedev micro-booth much more than she had to. Given our little booth slideshow, I figured that we'd just leave the boothlet abandoned most of the time, but she was there quite often to pester passersby about the wonders of gamedev.

Although that wasn't really necessary. This conference more than others was one where I didn't need to tell people who we were. Apart from the Corel Painter booth (which is understandable given that they sell more to artists than game developers), everyone knew who we were. Even the paper-n-pencil-game company Wizards of the Coast knew who we were, and they're just starting to get into the software business (yeah, there are Magic The Gathering and D&D computer games, but they're not done in-house).


Back to the games. I'm still going in a dozen different directions, but I'll have a little to show off in a few days.

Saturday, March 10, 2007

Graft!

Yes, it's the 2007 Grand Glorious Graft Grab, and here's the final haul for your humble reporter. . .



  • Three nice Wizards of the Coast chrome travel-mug
  • One SecuredApp plastic beer mug
  • Two rubber human hearts labeled "Mortal Kombat"
  • Two Magic:The Gathering "Core Game" starter sets
  • Two aluminum business card cases from Premier Search Inc.
  • Deck of playing cards from IGT, Inc.
  • Notepads from Disney and Maxon
  • Pack of mints from Disney
  • Package of jellybeans from WP Network
  • Go Pets lapel pin
  • Three drink-cozeys from IBM
  • Tiny USB-powered desk lamp from IBM
  • Two pairs of dice from Foundation9
  • Fold up frisbee from Radical Entertainment
  • iPod/cellphone holster from DeVry University
  • Balsa glider from Perforce
  • Three styrofoam gliders from RAD Game Tools
  • Two liquid-filled balls (that Maggie insists are eyebells but remind me more of breast implants) from EA Games
  • Roach-clip business card thingy from Wizards of the Coast
  • Three GoPets cellphone dongle-screen-cleaners
  • Cellphone condom (I have no idea)
  • 30 Days credit at ToonTown Online
  • Two poker chip keychains from IGT
  • Chocolate covered coffee beans from FullSail
  • More cellphone dongle-screen-wipers from ETRI.re.kr
  • Sweatband from High Moon Studios
  • Steel ball puzzle from Cryptic
  • Lip Balm from DRMNetworks
  • Egg full of silly putty from CrankyPants games
  • USB memory card reader from S3
  • Google Socks (really)
  • Cute little rubber robot-guy from THX
  • Rubber slot machine from IGT
  • Nerf rocket launcher from SlickEdit
  • Rubber spider-launcher from SlickEdit
  • Keychain from pogo.com
  • Two little rocketship keychains with blinky lights
  • Mini Magic 8-Ball
  • Two blinky necklaces from Motorola
  • Four lapel pins from Autodesk (showing the icons for their respective products)
  • 2007 calendar from Animation Magazine
  • Playstation Cellphone-Handle
  • Chocolate Cake from RealArcade
  • About 20 pens, some with blinky-lights




Remember folks. Where there is free stuff to be grabbed, Gamedev will be there to grab it. See you next year, folks!

Thursday, March 08, 2007

Expo Hall Day Two

Well, not officially day two quite yet. I'm just taking in a GDC Breakfast Special (a bran muffin and a Diet Pepsi) while waiting for the hall to open.

San Francisco is a pretty nice place, but I don't know if I could live here. For one, I don't think you can move TO San Francisco from anywhere else unless you bring along a suitcase of cash because property is so expensive. My house in Southlake Texas (a rather expensive part of Dallas/Fort Worth) has about the same square-footage as my cousin's four-story house in Upper Haight (sp?). She's on maybe 1/6 of an acre as opposed to my 1.5 acres. And her house probably costs six times what mine does.

Of course, you can't get around in D/FW without owning a car, so that'll save you. . .not nearly enough to live here.

Also my zoning allows me to legally own a horse. I don't think there's anywhere in SF where you could keep a horse.

Wednesday, March 07, 2007

Ahhh, the expo floor

Hey I'm here and enjoying the finest finery that is the GDC Expo Floor.

Or, that is to say, floors. The Expo Floor is broken up this time into three sections, one on floor two, one on floor one, and one at "Moscone North", which is across the street.

And the graft is flowing graftily. I'm fully a dozen pens ahead of the game. Real Networks gave me a chocolate cake (yes, you read that right), and I have more little things that have little blinky lights than a person should be allowed to have.

Thus far I can't rightly say what's the finest freebie in the set. VirtualHeroes has a rather nice looking all-metal pen, although I've never been much for metal-barreled pens, as they make my fingers sweat. Gamedev's free chewing gum is nice, as are the mints from a half-dozen places. All in all, it's about a twenty-pound haul of finest tradeshow bits. Not bad for day one.

Pics are forthcoming.

Thursday, March 01, 2007

A few things

First off, HP is a genuine pain in the ass. As mentioned earlier, Vista complained that it didn't have current drivers for my Designjet 450c printer (basically a 4 foot wide inkjet). HP said that they'd have current drivers in late January, but missed the deadline.

Then later they posted a list of printers that would NEVER be supported under Vista, and my stalwart 450c was on the list. After trying to get confirmation of this on their support-forums, I got no reply. I thought it was odd that they announced support of the 430 but not the 450c, even though they are the same printer (the 450 has a ROM upgrade to support color).

And I got no response.

What's weird, though, is that Vista's printing support is basically unchanged from XP. Vista stated that most XP printer drivers should work. Just for grins, I downloaded the XP drivers. Vista warned that the driver was unsupported, but it then installed and worked fine.

Umm. . .why on Earth wouldn't HP mention this on their site? Why tell me that I'm SOL for printing from Vista to a 450c when I'm not?



I'm working on Daily Puzzle Ten (currently titled Double Twelve). It's intended to have multiple screen layouts (ala Mah Jongg solitaire), so I needed to have a way to edit screen layouts. Rather than write my own, I grabbed Mappy and gave it a look. Sure enough, it did exactly what I wanted in isometric mode. As a bonus, it could export a layout as an ActionScript array, so I had the whole thing working in less than an hour.



I didn't bother setting up actual tiles. The little default isometric tiles did the job. With a little array-reading loop, I went from the mappy version to one on my game. . .





GDC is next week. I'll be there to do expo floor coverage. See you there!