New URL

This old URL hasn't been updated for a while, but I'm still putting out new stuff! Check out the shiny new domain at http://blog.ascagnel.com/.

Thursday, December 17, 2009

Making a side-scroller

At least in the US, the ideas and concepts presented in side-scrollers usually center around Super Mario Bros.  However, one of my favorite games of 2009 is a dead-simple side scroller called Canabalt, which strips the game down to a single button: press space to jump.  Inspired by Canabalt's retro graphics and simple gameplay, I decided to create my own.

I don't have much of it done, but development is proceeding relatively quickly thanks to the Allegro library.    Its a pretty simple library that handles a lot of the typical game stuff (loading sprites, blitting, etc.)  I'm considering just repurposing one of the examples that already has the loading & rendering code written, but I would rather not at this point since I want to have that learning experience.

The general game plan is to have the player start in the city, where everything is dark and grey, and as they gain speed, color enters back into the world as they start to move into the countryside.  As with Canabalt, it only needs one button (forward movement is automatic, the only thing you need to do is jump).

Hopefully it'll be done by the end of my upcoming break.

Tuesday, December 1, 2009

DIRT 2, or, Why Games Come Out on PC 3 Months Late

Back in September, Codemasters' Racing Studio released their game for the year: DIRT 2.  Since I'm a sucker for racing games (especially the Codemasters RS series, Race Driver/GRID and Colin McRae/DIRT), I decided to check out the PC demo when it was released this morning.

First impression: the game is slick and sexy.  Everything from the menus to the in-game HUD has been redone, and has been given an extra splash of style.  Gone are the minimalist white menus of CMR04/05 and the first DIRT, and in their place is a trailer, festival grounds, and other real-life areas.  The only disappointment here is the festival grounds, which are just skybox swaps for each location.



As for the actual racing, its the same gorgeous visuals mixed with the same twitchy, yet floaty, handling from the first game.  A new added bonus is that the rally stages are now staggered starts, as opposed to individual journeys, so other racers come into play in a much more direct manner.  Doing poorly will have the next driver pull up behind you, and doing well could lead to a pass (or two, if you're lucky).  The other mode offered in the demo was a motocross-style race, on a closed arena circuit, against 7 other drivers.  AI was better than in the previous game, and would yell at you if you made contact, and typically stayed out of your way unless it was attempting to run you off.



The in-car view is back, and its still good.  This view is harder, more realistic, and looks awesome.  I have no idea if multiplayer matches can lock to this view, like in GRID, but I'm hopeful.



The graphics are a step above anything I've seen this year, and actually come close to Crysis.  The amount of small detail in the game is just crazy.  Heavy vehicles like trucks hunker down and their wheels bulge under the weight, while lighter cars keep their wheel walls straight.  Brushing up against a stone wall knocks rocks off the top, creating hazards for anyone close behind.  The sun reflects off of the corner of a shiny bumper, or the crest of the roof, and creates distortions and halos around the screen.  Driving through a big puddle completely occludes the screen for a few crucial seconds while your wiper blades whisk the water off.  Since everything is so good, its disappointing to have a female driver get voiced by a man, a boneheaded mistake to make.

To top it off, here's a video capture from a replay, at 720p.

Saturday, November 7, 2009

My sordid past

My sordid past isn't what the average person thinks as sordid.  But, it is sordid for a developer.  I've spent two summers working as *gasp* a Visual Basic for Applications programmer.  I hate the language, I hate the developer tools (a knockoff of Visual Studio 5 or 6 embedded in Microsoft Office), and I hate some of the overdone verbosity of the language.  While the language has a good API behind it, and the structure of the language is something along the lines of GTK+'s "just keep typing til you get something you want done" development, it was missing a few critical, common chunks.

One of these chunks is the bog-standard stack.  There's no stack object built into the API, and Microsoft's "here's how to make a stack" guide is a bit complex for everyday use (they go into some weird ByRef memory management stuff, and an item linked from a stack isn't a true stack, per se). 

I rolled my own, but added a few tweaks that are outside the normal stack.  I added a "peek" function that either checks the top of the stack without popping, or can look up a value at a specific index.  Also added was a depth function, to check how big the stack is, and the ability to look up if a value is already in the stack.  I created this block for a project that needed to analyze the full contents of the stack on a repeating basis, and it worked out very well.  There are still a few tweaks that could be made, such as peek returning a null if the index is outside of the scope of the stack head, or maybe adding in more substantial error checking.

Rather than posting the file here, I'll let PasteBin handle the beautification here: http://pastebin.com/f3f11da41

Wednesday, October 28, 2009

Nethack: A Microcosm of Reality

A quick view at the date of my last post says that I've been neglecting my posting duties.  I blame a small app that's been sucking up every last bit of free time from me.  Normally, I'd call that app "The Stute," and I've been very busy with that.  Instead, the culprit is far simpler: Nethack.


For those of you unfamiliar with the concept, Nethack is a "rougealike": the game is played entirely in text-mode (although there is a version with tiles available), the dungeons are generated randomly on each playthrough, and the game is ridiculously difficult.

Its the last bit that leads me to how Nethack is a microcosm of the modern world.  When you begin, just about everything hates you.  Your only friend is a loyal pet, and if you're not careful, they can turn on you, or worse, die on you.  In the early game, just like a child, you are vulnerable.  A single misstep to the "DYWYPI" (Do you want your possessions identified?) screen.

Something about Nethack strikes me, not only because of the difficulty, but the way in which things can work together.  If a fireball happens to hit a potion, it will boil.  If a rolling boulder trap hits a shopkeeper, the shopkeeper will perish, and any valuables will be squished in the process.  Everything just "clicks."

Like in the real world, when everything works together, its a sight to behold.  That nice big meal means you can travel farther without having to scrounge for food, both in-game and out.  If you're lucky (and skillful enough) to charm an enemy, they can quickly become a friend.




So, Nethack.  For a game that uses glyphs, its more realistic than anything on the market today.

Wednesday, February 18, 2009

Broken Windows Economy...

In my "inaugural thoughts" post a few weeks ago, I came up with this gem:
Pound-wise and Penny-foolish - The maxim states that one must not be "penny-wise and pound-foolish," and Obama must be the opposite of that maxim.  He must be willing to not only cut wasteful projects, but also start new projects that create jobs and replace aging, crumbling infrastructure.  The 2007 bridge collapse in Minnesota and the 2003 blackout on the East Coast show that this country's infrastructure, most of which was built between 1930 and 1960, is in dire need of repair.  As with FDR's "New Deal" during the Great Depression, funding must be directed toward replacing this infrastructure to keep citizens safe and bring America into the 21st Century properly.  As an added bonus, such government spending can help stimulate the economy by providing jobs for the working classes, rather than simple handouts.
I was recently pointed to a Wikipedia entry on the Parable of the Broken Window:
Have you ever witnessed the anger of the good shopkeeper, James Goodfellow, when his careless son happened to break a pane of glass? If you have been present at such a scene, you will most assuredly bear witness to the fact, that every one of the spectators, were there even thirty of them, by common consent apparently, offered the unfortunate owner this invariable consolation—"It is an ill wind that blows nobody good. Everybody must live, and what would become of the glaziers if panes of glass were never broken?"
Now, this form of condolence contains an entire theory, which it will be well to show up in this simple case, seeing that it is precisely the same as that which, unhappily, regulates the greater part of our economical institutions.
Suppose it cost six francs to repair the damage, and you say that the accident brings six francs to the glazier's trade—that it encourages that trade to the amount of six francs—I grant it; I have not a word to say against it; you reason justly. The glazier comes, performs his task, receives his six francs, rubs his hands, and, in his heart, blesses the careless child. All this is that which is seen.
But if, on the other hand, you come to the conclusion, as is too often the case, that it is a good thing to break windows, that it causes money to circulate, and that the encouragement of industry in general will be the result of it, you will oblige me to call out, "Stop there! Your theory is confined to that which is seen; it takes no account of that which is not seen."
It is not seen that as our shopkeeper has spent six francs upon one thing, he cannot spend them upon another. It is not seen that if he had not had a window to replace, he would, perhaps, have replaced his old shoes, or added another book to his library. In short, he would have employed his six francs in some way, which this accident has prevented.
My argument for creating jobs based on replacing crumbling infrastructure is not a broken window philosophy.  Money spent replacing the infrastructure is necessary spending.  It is the equivalent of the shopkeeper taking poor care of his shop, and then having to spend money on replacing the roof when it is revealed to be on the verge of collapse.

The state our country's infrastructure is in is absolutely shocking, and that's what led me to make that statement.  And this is the end of political/socioeconomic commentary I'm going to make on this blog.

Tuesday, February 17, 2009

My Messy Desk

As prompted by a friend (Gene, a studying architect at the New Jersey's Institute of Technology's NJ School of Architecture), I decided to pick apart my workspace.  It's nowhere near as nice, but it's got some good points.

Last year was miserable.  This photo comes from about October 2008, right around when I started this blog.
What the heck was I thinking?  No organization whatsoever, stuff piled on top of my keyboard, an Xbox controller and PSP within an arm's reach, and a generaly messy desk.  This did eventually get cleaned up, though, and I was able to fly through my classes.

This is the upgraded, 2009 model.  New room, new dorm, new desk, new laptop.
My trusty old desktop, a custom-built PC I inherited from a friend, gave up the ghost when it failed to output any video (not even a BIOS screen), so its been replaced with my old Dell Precision M60 laptop for any Windows tasks.  It also serves as a desktop, since I never move it.

A whiteboard, even a small one, is great for managing tasks.  Keep one in a highly visible location, like right over your monitor, and you'll constantly reference it.  It can be quickly and cleanly erased as tasks change.

My desktop may have died, but running the MacBook with a second monitor is absolutely awesome.  Mini-DVI to DVI adapters cost $20, a but much for a dongle, but well worth the expense.
I'm considering getting a new desktop, either an iMac or MacPro.  I love OS X too much to go back to Windows, and a Mac Mini is just too little hardware for what I need.

A coffee mug for drinks both hot and cold is a great tool to have around.  My room is excessively dry, so not drinking something for an hour usually leads to either dry mouth or a nosebleed.  The stack of papers and notebooks next to it is my to-do pile, sorted by priority.  The black Moleskine datebook on top is my main planner.
Not the greatest photo, but this is an alarm clock with radio.  Sometimes headphones aren't comfortable anymore, and sometimes there's something happening you want to hear live, like a sports event.  Also functions as my morning wakeup.

Keyboard and mouse.  Necessary tools for any computer.  The keyboard is a Microsoft Natural Keyboard 4000, coming highly recommended from blogs like Coding Horror.  There's no major learning curve to get used to it, and its damned comfortable to type on.  The mouse is a Logitech TrackMan Wheel, which is currently on special from NewEgg.

Finally, my headphones: SteelSeries 4G.  I got the pair off woot at the end of 2006 at a dirt-cheap price, and they've served me well for two solid years and a little more.  They cost ~$15 without shipping, so they've paid for themselves several times over.  As an added bonus, they have a mic that can be hidden inside one of the coconut halves.  I didn't get them specifically for the mic, but Skype conversations with it are a thousand times easier to set up (even if my friends say it makes me look like a "WoW nerd").

Not the greatest post, but a quick rundown of what's around my desk at the moment.

Thursday, February 12, 2009

Postbox (beta 7)

Recently, the DownloadSquad blog made a posting about a mail app called Postbox. Its idea is to tie into social media, with the ability to pull in Tweets, Facebook status updates, and FriendFeed postings, as well as support for POP3, IMAP, and MobileMe email.


As an email client, its perfectly acceptable. To be blunt, it's Mozilla Thunderbird with a new skin. It is based on Thunderbird, so any quirks or favorite elements you had will still be there. The notable exception, though, is that extensions are unavailable. A nice addition is the ability to view GMail messages in a threaded style similar to the web interface, but this may have been recently added to Thunderbird, which I haven't used in several years. Also nice is the ability to Google search from the interface, and a listing of all the links and embedded media in the current message.

The social media aspect, however, is terrible. You can make updates, but not receive them. Making updates is done through an arcane (and oddly-named) "Promote" dropdown button. For other features, like To-Do tasks, there is no interface for easy viewing. To-Dos can be created from emails, and then pinned to the top of the email list, but there is no central store for them.

The threaded GMail messages is an awesome feature, and one I've been waiting for in a desktop client since GMail first added them. But the half-finished social networking features are so bad to be nearly worthless.

One suggestion: A split sidebar, like on the left side, added to the right. One section should be social media updates (Facebook/Twitter/FriendFeed messages), and another to-dos. Better yet, these panes could be added to the left sidebar. Such services work best at-a-glance.

Wednesday, February 11, 2009

Adventures in Terminal.app coding (Part I)

In June of '08, I decided to get myself a MacBook.  As a CS student going into my second year, and most of my assignments requiring UNIX compatibility (well, NetBSD to be totally accurate), I wanted a system that would last a while, have some pretty hot hardware, be somewhat reasonably priced, and have strong support for *NIX OS's.  Granted, the MacBook isn't the cheapest laptop in the market, but for what you get, its a decent value.

One great feature is how there's an awesome terminal built right in.  It runs bash by default, and has a lot of the GNU tools (and I'm a HUGE GNU screen fan) installed either by default or with the dev tools.  Most important is its support for a SSH connection and X forwarding running on top of that.  Previous semesters saw projects that ran entirely in console mode, or were (mostly) cross-platform Java apps, while now I'm writing GLUT apps that need a screen to display on, so I'm moving outside of simple terminal use.

My preference, so far, has been vim in an SSH login.  It's easy enough to learn, and I haven't really had the time or desire to learn emacs to date.  My only issue is having to jump into pico for a Makefile, since I have vim set up to use 2 spaces instead of a tab.  Aside from some of the usual *NIX grumbles (specifically, constant use of the command line), this is a great experience.  Running inside screen, a utility I discovered only a few months ago, has seen my productivity double or triple, and allows me to do work from anywhere for either a few minutes or a few hours.  The only issue is that a wireless connection is a bit much for a SSH session, with the lag ruining the otherwise native speed of access.

As a bonus, here are my .vimrc and .screenrc files:

.vimrc:

set background=dark
syntax on
set softtabstop=2
set shiftwidth=2
set tabstop=4
set expandtab
set nowrap
set ruler
set number
set numberwidth=4
set cursorline


.screenrc:
hardstatus alwayslastline
hardstatus alwayslastline "%{+b kw}[ %H ] %{yK} (%n). %t  %-=%{kk} %{gk}%c.%s  %{yk}%d.%m.%Y"
startup_message off
screen -t screen1 1
screen -t screen2 2
screen -t screen3 3
screen -t screen4 4

Saturday, January 31, 2009

Fresh Prince of Bug Aire

A friend sent me this Craigslist Listing: http://philadelphia.craigslist.org/zip/1015979135.html

And I came up with this:

iiiin east philadelphia
born 'n raised
in the lab is where i spent most of my days
chillin out relaxin and maxin all cool
all sellin some grubs outside of the school

when a couple of larvae
they were up to no good
started makin trouble in my chemical hood
i got in one little booboo
and my mommy got scared

she said you're moving with your aunt and uncle to bel air

Tuesday, January 20, 2009

Inaugural Thoughts

Possibly the worst part of seeing what is widely considered a notable event is that everyone has a reaction. After some gestation and discussion, I think that now-President Obama needs to do something to define himself.
President Obama's campaign was run on the concept of "Yes We Can!" an uplifting and empowering motto.  However, just spewing this motto forth like the queen of a hundred worker bees accomplishes little.  Obama needs to define himself in a few ways in order to be an effective commander-in-cheif.
  1. Organizer - The President has far too many responsibilities to do everything himself.  He must choose wisely and delegate carefully, something that he has not yet done properly.  Hillary Clinton is on the surface an experienced choice for Secretary of State, but has had very little real experience in both sculpting policy and overseeing negotiations in her positions as First Lady and Senator.
  2. Pound-wise and Penny-foolish - The maxim states that one must not be "penny-wise and pound-foolish," and Obama must be the opposite of that maxim.  He must be willing to not only cut wasteful projects, but also start new projects that create jobs and replace aging, crumbling infrastructure.  The 2007 bridge collapse in Minnesota and the 2003 blackout on the East Coast show that this country's infrastructure, most of which was built between 1930 and 1960, is in dire need of repair.  As with FDR's "New Deal" during the Great Depression, funding must be directed toward replacing this infrastructure to keep citizens safe and bring America into the 21st Century properly.  As an added bonus, such government spending can help stimulate the economy by providing jobs for the working classes, rather than simple handouts.
  3. Wise on Technology - Although Obama seemed to understand technology better than any other candidate, and in fact used technology far more and to far greater effect than any other candidate, his opinion concerning important points like Net Neutrality and Telecom Immunity are either lacking or pro-business.  Connectivity, in its many forms, is no longer a luxury but should be an expected utility in the 21st Century, much like water and electricity.  The United States has some of the highest broadband rates in the world, limited availability, and limited speed.  Beyond this, many Internet Providers choose to limit what customers may do on general-access accounts, limiting features such as the ability to host servers to higher-end, and more expensive, business accounts.  The Internet is a great democraticizing force since it is a two-way medium; limiting this bidirectional connectivity to those who pay is no better than existing radio, print, and television connectivity.
These are just three things that have been bugging me.  Now let's see Obama get to work fixing these things.

Saturday, January 17, 2009

Sex, Drugs, and Cocoa Puffs: A Low Culture Manifesto by Chuck Klosterman

Sex, Drugs, and Cocoa Puffs: A Low Culture Manifesto Sex, Drugs, and Cocoa Puffs: A Low Culture Manifesto by Chuck Klosterman


My review


rating: 4 of 5 stars
Sex, Drugs, and Cocoa Puffs is little more than what its name presents it as: A Low Culture Manifesto. SD&CP constantly challenges the reader to completely re-evaluate how they look at modern culture, since modern culture is usually consumed and discarded with out much of a second glance. Although it is an entertaining read, Klosterman never comes to a final crescendo, and so on completion there is an empty feeling created by a sense of unfulfilled greater importance or meaning.


View all my reviews.