Category Archives: Programming

Thoughts on online shopping

Introductory Waffle

I’ve been thinking for the past few days about the differences between now and back in 2003, when I first got started. Specifically, in the area of online shopping.

It’s amazing to me, that after all this time, the user experience during online shopping still sucks. It’s not so bad the first time, but when you find other stores you want to shop at, you’re likely to run into differences in the user experience. I don’t really like this. For me, the optimal user experience should be similar to walking into a real store. You pull out some cash or you swipe a debit/credit card, and you leave with a bagful of goodies. Short, sweet, easy. No passwords to remember, no worrying about the safety of your personal information, just pay the cashier and leave with your purchases.

Of course, this isn’t literally possible online–if only to prevent fraud and maintain some sort of accountability, there needs to be some step to establish that you’re really who you say you are. So, online businesses have to ask for your name, address, card number, and all that, and they pass it along to their payment gateway, which will verify or decline the transaction. That’s unavoidable, but it can be made relatively painless. Not completely painless, but relatively painless. I’m gonna share some purely hypothetical thoughts on that subject over the next few pages of this post.
Continue reading

Art and programming, part II

I figured out how to abuse the data-driven graphics feature of Photoshop CS5 even further so I could use it to spool out cars with unique shop numbers and roof numbers. This time, more pictures and less boring text.

First, I set up the texture PSD file of the classic Interceptor scheme as a template. This involves just creating variables and assigning them to layers.

The next thing I did was set up a comma delimited text file to use as the data set source, in good old Notepad:

Yes, that’s it. Just a list of values.

Once both of those things are set up, a few button clicks in Photoshop will change the text layer strings and save each change out as a separate file:

A bit of duplicating and re-merging in Ultimate Papercraft 3D gives me an 8-up layout, and all of the materials have been reassigned to the new texture variants:

I also spent a few minutes tweaking a copy of the OpenOffice layout template to work with the 8-up version:

Okay, all of that is just a one-time setup thing. I literally only have to do that once. From this point on, I can simply copy the Ultimate Papercraft 3D and OpenOffice 8-up templates to another folder, and after assigning variables to any other scheme, I can painlessly export a different 8-up without tediously editing a lot of layers and saving things out by hand.

The only real limit on how many variations I can include in a single PDF is completely dependent on the amount of video RAM and system RAM on my machine, and the amount of work needed to set up the unique variations is much less than it used to be when I had to do them all individually by hand. Nice. I definitely could get used to this feature.Note: Don’t worry about how odd the texturing looks. The model is currently wearing a baked global illumination lightmap, which is the source of all the shading, and that lightmap is only used to make the Metasequoia work-in-progress screenshots look a bit nicer. I usually crank the lightmap opacity almost all the way down when exporting paper models for real, so the PDF won’t be anywhere nearly that harshly shaded.

When art and programming collide

You know what I do on my days off? I work some more. Okay, no, not literally, but I do kind of tend to play around with work-related stuff.

I just discovered something awesome about Photoshop CS5 a couple hours ago when snuffling around in the help files like a truffle pig: data driven graphics. At first, I was a bit puzzled because that really doesn’t sound like a very artsy kind of thing, but it piqued my inner programmer’s curiosity. Turns out that you can basically turn a PSD file into a template, load variables from a text file, and use those variables to do things like change text layers, replace pixels, and hide/show layers.

Of course, I had to give it a try, and after some brief thought, I hit upon the idea of using this functionality to rapidly generate a large number of unique license plates for the Brio, Interceptor, and other vehicles. So, I saved out copies of the Interceptor textures, then cropped them down to just the license plate frames, deleted all superfluous layers, and turned them into license plate templates.

I set them up so I could change the country code and plate text layers on the UK and European plates, and the North American test plates had 4 configurable layers (month of registration, last 2 digits of registration year, serial, and locality). No real reason, I just wanted to see if I could do it.

With the artistic half completed, it was time for the programming bit. I didn’t want to waste my time manually entering license plate data over and over when I could just randomly generate a large amount of data and dump it to a text file that could be loaded in Photoshop. So, I whipped up a rough PHP script and fired up my local install of EasyPHP.

License plates tend to follow a pretty specific format, so it’s not like you can just generate random strings and be done with it. I wrote the script to take a formatting template as input, so I could specify a formatting template like “111-aaa” (3 random numbers, hyphen, 3 random letters), “AA11 AAAA” (2 random alphanumeric characters, 2 random numbers, space, 4 random alphanumeric characters), and so forth. That was fun to do.

I realized shortly after a few rounds of testing that I could literally do any license plate in the world in mass quantities with relatively little work, and it would pretty much only require a different template and formatting string. So, pretty soon, I’m going to be setting up my very own Department of Motor Vehicles next door to Uppity Robots and Ebbles Variations, where you guys can download sheets of unique stick-on license plates for that little bit of extra flavor.

Speaking of which, just for grits and shiggles: here’s a sheet of 570 (yes, that’s not a typo) unique North American-style license plates that I did as a test: licenseplates_test.zip

That’s just a few minutes of hands-on work! All I did was press a few keys, click a few buttons and all of the grunt work was done by Photoshop, Bridge, and OpenOffice.

I’m gonna be modifying the script a bit to randomize the registration date and locality variables for that little extra touch of uniqueness, and also refactoring the data set generation script so I can quickly modify new copies of it to generate plates for a specific country.

Yeah, this is all a bit silly, but it was fun to do, and I don’t often get to exercise both of my core skills at the same time like this.

UPDATE: Here it is! Department of Motor Vehicles

Speaking of that big project…

Back in February, I announced that I’d taken on a programming contract for all of March. It takes a lot to get me to agree to do contract work, but this particular contract was an easier sell for me than any of the other requests I’ve received over the years.
It was an opportunity to work with my friend Denny Unger on the new website/storefront for WorldWorks Games. We’ve worked together in the past on other, smaller projects, and he’s a lot of fun to work with. It wasn’t exactly a “You had me at hello” thing at first, I admit, but the offer of up-front payment and the fact that Denny’s easy to work with sweetened the deal enough to break the ice.

So, we’ve been working together since March on WWG’s new home on the Internet. Denny handled the graphic design and artwork, and my job was to turn his static compositions/mockups into living, breathing webpages. Here’s a little teaser that should bring a smile to your face:

Yes, that’s a product page for one of my models.
As for the rest of the project, I can’t really discuss any technical details or anything of the sort yet. That will all come in due time, when WWG begins to post teasers and announcements of their own. What I can tell you, however, is that this is a pretty huge project, and I’m doing the whole codebase from the ground up.
There’s also a second half to this big project: adding my old stuff to the WWG storefront. A bit over half of my catalog didn’t make the cut because it was just too old and stale. Specifically, anything from before 2007 is gone forever. Out of the remaining stuff, about half needs some touch-up work, a bit of a makeover, or reformatting for machine-cutter compatibility. As an example of minor touch-up work, stuff like the Sandmaster V will be getting new store graphics, like the promotional render shown below:

In the case of makeovers and reformats, stuff like the Itoyo 950 are getting new store graphics, a bit of a texture refresh, and reformatting to support machine-cutters:

As one final bit of teasing, I want to show off the catalog thumbnail format that Denny and I put together for my stuff: