Archive for the ‘Create It’ Category

Shock and Horror: Capitalism Online

Friday, August 8th, 2008

I’ve been doing some research on Flash games, and found someone with a lot of sense on the subject, but he doesn’t know much about capitalism:

Capitalism: Some people pointed their finger at me saying I am doing “capitalism”. Let me explain one thing: monetizing a Flash game is not capitalism. It’s almost an utopy that reminds me the early 80’s when lonely programmers in their rooms/garages made games that we still play today, in some retrogaming sites or with new fancy graphics.

Some people have a generally dim view of capitalism, especially in Europe. But still, this is capitalism. You use capital (human capital in the form of existing libraries and programming tool, and the physical capital of computer systems), you create something useful to other people, you make money off of it. Simply operating at a smaller scale within the market doesn’t magically make you a non-particpant in the market.

FanCruft Facelift

Saturday, August 2nd, 2008

FanCruft, my anime website, has just gotten a much-needed facelift. Here are before and after pictures:

When I first made Fancruft, I wanted to make it look good even in Internet Explorer 5 running on a fairly low-resolution screen (640×480). Many “Web 2.0″ concepts were new; RFC4627 was published just earlier that year. People were still advocating Smarty for PHP templating. I had been a Wikipedia administrator for maybe around a year and a half, and had not yet read The Wisdom of Crowds.

A lot of works still needs to go into FanCruft, but it now has a fairly modern face. IE 5 is no longer a concern, and the site now renders much more consistently across IE 7, Firefox 2 and 3, Opera, and Safari. IE 6 doesn’t seem to understand fixed positioning and misinterprets it as absolute positioning, but this is still acceptable. The site is now designed for a screen of 800×600, but linearizes fairly well and should still be acceptable on smaller screens.

The independent “scattered” buttons have been replaced by a bar with a uniform height and no margin. Min-width is now supported well enough that I don’t mind just setting it and forgetting it, instead of using the IE5/6 hacks of yesteryear. Also, the buttons now glow gold on hover; yay!

The fine print at the bottom of the page has been cut down to a minimum, and the RSS icon now hovers on screen, just in case it isn’t noticed in the browser’s address bar. Overall, FanCruft is sleek and good looking.

Made Of Division

Saturday, July 26th, 2008

I was a bit surprised earlier this week to find out that Omegapaladin (who is lightyears ahead of me in l33t math skillz) hadn’t heard of the concept of the modulo before. There’s a lot of unfortunate nitty-gritty problems about mod, but it’s a very useful operation. I wrote a small program in PHP that uses mod in two interesting ways.

The script is attached to this post. First, though, here’s the image it creates:

This is Pi, sort of. The image can be “read” from left to right starting at the top and going to the bottom. Because there are ten possible digits in Pi but there are seven rainbow colors, I needed a way to figure out what to map 7, 8, and 9 to. The “correct” way to do this would to get a base-7 representation of Pi, but I wanted to talk about mod. So, for each digit of pi, I picked a color for the rectangle by taking the corresponding digit of pi and modding it by 7: “i % 7″

Now, the digits of Pi can be thought of as a one dimensional sequence, but the image above is two dimensional. Given that we’re considering the nth digit of pi, how do we translate this into an x and y position? Using mod:

for($i = 0; $i < $length_of_pi; $i++) {
$current_pixel_y = floor($i/25);
$current_pixel_x = $i % 25;

The first line determines what row we’re in, from the top (there are 25 pixels in each row). The next line determines the column within the row, using mod. This works because the number of pixels left after accounting for all the previous rows go into the current row.

PiPHP.txt - The Script

Japan, Eat A Hand

Tuesday, July 15th, 2008

Now, for the explanation of the previous post.

I managed to get the buffering trick in XUL to work: it is possible to use a deck of stacks in XUL for animation. HOWEVER, doing so has a really, really high CPU cost, to the extent that just flipping back and forth between two images at 30fps shot my CPU usage up to 100%. (But note that other have done far more interesting things with the canvas tag without things being quite so disasterrific).

So, I basically decided that in-browser games are highly overrated, and I was looking for a more traditional game engine. My requirements were basically that it’s available under a BSD style liscence, a 2D focus, and has decent scripting. Somehow, I found LÖVE (Ha!). So of course, I started look at the demos, and found the Kawaii Kitten Adventure, which is a bizarre, bizarre game where you shoot eyebeams at hearts. Oh, and Caramelldansen is playing in the background while you do this. For an explanation of the title of this post, see the misheard lyrics; or maybe not, I think my eyes might be bleeding.

LOVE?! Kitten!? WTF?!!!

Tuesday, July 15th, 2008

I’ll post the story behind this pic sometime after I wake up “tomorrow.” The short version: It’s a screenshot of a tech demo for a game engine called “Love” that I found online.

Writing the Weird

Tuesday, June 3rd, 2008

I wrote another 500+ words for the second “People Have Value.” I know how I want to end the series, and I knew how I wanted to start the story, but until today, I was having a lot of trouble with the setting in this particular part. I basically had a serious problem with believability. Rob — the oldest son in the family — has disappeared. I need his family to go looking for him in order to write the ending I want. I originally just had them follow him in right away, but the dialog I wrote to justify this decision seemed… well, boneheaded:

Brian scanned his surroundings and straightened his mustache, lost in thought. “It doesn’t look like a military base. That’s good as far as it goes. If we get in there and explain what’s happened…”

Erm, no. That’s just stupid. When confronted with a giant, mysterious pyramid of unknown origin, how many people would say “not a military base, must be safe?” I have, fortunately, figured a way to get the family inside the pyramid without turning them into brain-dead idiots. :)

File paths, chrome, and XUL

Sunday, June 1st, 2008

I was working with XUL and Javascript yesterday, and I ran into some interesting problems. I’ve set up my chrome so that the project I’m working on in Eclipse is available in Firefox as “chrome://twodee/content/exampleScreen.xul”. I wanted a function I wrote to accept a filename as an argument, but no matter what I tried, a relative path wouldn’t work.

Well, of course not. You can’t just arbitrarily go from chrome-based URLs to file locations. Tossing a chrome URL into a function that’s expecting a file path is going to have some bad results. Specifically, “not a file” exceptions.

So, this works:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="2DYouSee" title="Demo &quot;Game&quot;"
	xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
	onload="Start2D('C:\\Users\\Nic\\workspace\\2DYouSee\\content\\demo\\gameworld.json.txt')"
	width="650" height="490">
	<script src="io.js" />
	<script src="json.js" />
	<script src="twodee.js" />
	...
</window>

This does not:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="2DYouSee" title="Demo &quot;Game&quot;"
	xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
	onload="Start2D('gameworld.json.txt')" width="650" height="490">
	<script src="io.js" />
	<script src="json.js" />
	<script src="twodee.js" />
	...
</window>

Writing for Darth Vader

Sunday, May 25th, 2008

I did a little bit of work on Apochswords tonight, the massive space opera trilogy that I’ve been working on since… 2003? 2004? A very long time indeed. Maybe even 2002, since I remember that I discussed StorySage.com with my roommates in college my freshman year.

Tonight’s work consisted of some chapter outlines for the third book in the trilogy. Apochswords has dynamic characters, lots of them. Some of them have a broken moral compass, or a moral compass that breaks in response to the drama of the conflict around them. One such character is, well, evil at the point I’m writing about. But how to show that this character is evil?

In the release order, what’s the very first thing Darth Vader does in Star Wars? He steps over the bodies of those that oppose him. And, for that matter, some of the people that were helping him.

So, of course, my character is going to kill someone, without any chance for surrender or mercy, and in the goriest, most over-the-top way possible. [Evil smile]

Ponoko

Sunday, May 4th, 2008

I just happened to find Ponoko, a site that will laser-cut things based on EPS files. Oh, and they have Inkscape templates available.

Miniclock

Sunday, March 16th, 2008

Since I’m an impatient person, I’ve put a little PHP based version of the clock right in this blog’s sidebar. I’ve also changed the way the colors switch after realizing that Green changing into Red looked way too Christmaslike.

StorySage Gutted, Renewed

Wednesday, March 12th, 2008

I’m now running StorySage on WordPress; there’s only one story there now instead of two, but it looks cool with its custom theme, NDASH.

More On The Logic Of The Clock

Wednesday, March 12th, 2008

Last time, I wrote that it’d be very difficult to work through the clock’s logic if I used only 5 output pins. Fortunately, there’s no requirement that says I need to do so — leaving two pins available for input should be sufficient. I can use 1 pin to denote AM/PM, and that leaves 10 pins available.
In general, the fewer pins make up a combination for a particular hour, the easier the logic will be to work through, so I’m starting by assigning every available combination that uses only 1 or 2 pins first (for AM and PM, respectively) then I move on to 2 and 3 pin combinations:
0000000001 1AM/PM
0000000010 2AM/PM
0000000100 3AM/PM
0000001000 4AM/PM
0000010000 5AM/PM
0000100000 6AM/PM
0001000000 7AM/PM
0010000000 8AM/PM
0100000000 9AM/PM
1000000000 10AM/PM
1000000001 11AM/PM
1000000010 12AM/PM

Tick, Tock, Tick, Tock. I Want To Make A Clock

Saturday, February 16th, 2008

Clock Drawing

As part of my 2008 campaign to “Create It,” I’ve decided to try to build a clock of my own design. This is, quite frankly, crazy. As a matter of fact, I have little experience with anything that I might use to create this project other than some halfway-decent programming sense.

Anyway, on to what I have in mind: A ring, on a square board roughly two feet wide. The ring acts a sort of pie chart of time, and updates in one hour increments (no minutes in my clock, I don’t believe in sweating the small stuff!). At 12:00 midnight, the clock is completely green. The clock then begins turning red, one hour block at a time. At noon, the ring turns yellow, and the process repeats until it cycles back to completely green again at midnight. The drawing above shows 4:00 PM under this system.

I’m thinking of using LEDs to light up the clock face, and I plan on picking some up to play with the next chance I get.

Things I’ve Learned

Wednesday, January 30th, 2008

Inspired by running across my old (pen and paper) journal last night, and by this post at the Happiness Project, I decided to create a list of things I’ve learned (draft version):

  • Be cynically optimistic.
  • There is a cost to everything.
  • Location, location, location — the physical world and its arrangement are still important
  • Words are not weapons.
  • Talk is cheap. Actions speak louder than words. This goes double for advice, boasts, and what you’re thinking. Don’t believe everything you hear, no matter who says it or how confident they are. Even, especially, if they’ve made a living saying it. Beware cognitive bias.
  • The world is strange. Cthulhu Mythos level strange. We just don’t notice because we’re used to it.
  • Small things can have a big impact, but the most obvious example, compound interest, may be overrated.
  • If something you want doesn’t exist, create it.
  • Despite the fact that talk is cheap, the crowd may have a point when everyone is doing, or believes, something.
  • We regret virtue more than vice. No, really.
  • The cost of not buying something can often exceed its price.
  • People are very important.

I’ll be going through each of these and evaluating and explaining them as I get time.

More scheduler stuff

Sunday, January 27th, 2008

For anyone that’s interested in looking at it: My Scheduler, Source Code. Be forewarned: it’s ugly.

The Scheduler is Done

Wednesday, January 23rd, 2008

…or, at the very least, it’s usable. Here’s a screenshot:

Chrono, my personal scheduling applet

The earlier screenshot that I posted was launched with window.openDialog, but I’m still having trouble getting Chrono to launch in its own window so that everything “just works” — so instead, I’ll be using it from inside Firefox, which I have open most of the time anyway. I even have a bookmark to go to it right away. I figured that I’d go over everything I’ve done, and describe what I’ve learned and what I could do to improve this project (but probably won’t). (more…)

Creating a new personal scheduler:

Wednesday, January 16th, 2008

I’ve been busy working on my 2008 theme, “Create it” — long fascinated by the power of XUL, I’ve decided to use it to improve my personal scheduling system. Here’s a screenshot of what I currently use, an OpenOffice.org spreadsheet:

My Scheduling Spreadsheet

And, here’s what I’m planning on replacing it with, a Javascript-automated, XUL scheduler:

XUL Scheduler Screenshot

Pretty spiffy. No, it’s not exactly Sunbird, but it could possibly make a decent Sunbird extension. One of the things I’ve had a lot of difficulty getting my mind around are the various security restrictions and variable scope oddities — I spent a lot of time trying to determine where my user settings (and by “extension” my chrome directory) actually were, since I’ve moved the same Firefox installation across three computers already.

My theme for 2008

Sunday, January 6th, 2008

Following the advice of the Chief Happiness Officer, I didn’t make any resolutions this New Year’s, but have chosen a theme for 2008. This year’s theme is “Create it.