Friday, July 3, 2009

Relativia Gameplay

I'm working on a game for the Android Developer Challenge II. I've hired an artist to work on character, background, and item art, and Philip is helping me with the map API. I've got the basics of the combat system worked out, and I thought I'd share a short video demonstrating how gameplay will work.

The player is on the left side, the enemy on the right. Each turn, a player can use one action (an attack or spell, if they have enough of the right kind of energy) and they may drop one token into the playing grid. The game is very much like Connect 4. If a player matches 3 or more in a row of a given token type: gems (square), mana (round), or skulls, those tokens are removed from the grid. If gems are matched, the player gets gem dust, which is used to purchase items in markets. If mana is matched, the player gets energy corresponding with that mana type (blue, orange, green, or purple). If skulls are matched, damage is done directly to one's opponent. Actions can either cause damage to one's opponent, heal the player, or have some other effect (like gaining an extra turn). A given battle ends when one player reaches zero health points.



I'd like to add in more polish, e.g. feedback events for matching, smoother animations, etc., but the deadline is about six weeks away and I'm rushing just to get the basics implemented. I'm optimistic about the progress, but a bit worried about getting it in good shape for the contest. We'll see how it goes.

Reductionism

Yesterday I picked up Melanie Mitchell's new book Complexity: A Guided Tour. I had previously read her excellent primer for genetic algorithms, and this new book looked very interesting.

Though she's an excellent writer, I'm already a little disappointed in the book. For example, her first chapter is entitled What is Complexity?, and she then goes on to ignore the question and give lots of examples of complex systems. Chapter 7 is called Defining and Measuring Complexity, and would probably have been a better start to the book, since it actually attempts to lay out what the concept means and how it is difficult to find a consensus definition among people who study it.

But what made me even more disgruntled right off the bat is her assertion in the preface that reductionism is passe, or worse, dead:

But twentieth-century science was also marked by the demise of the reductionist dream. In spite of its great successes explaining the very large and very small, fundamental physics, and more generally, scientific reductionism, have been notably mute in explaining the complex phenomena closest to our human-scale concerns.

Now look...I'm a reductionist, and as far as I'm concerned, so is every other working scientist. That's why I get a bit peeved when I see reductionism mischaracterized as an outmoded approach that was good for studying classical problems, but a miserable failure for, you know, really complicated stuff.

Here's all reductionism is: Trying to understand a system by understanding its parts and how they work together. That's it. And guess what? That's a wholly sensible approach that works amazingly well.

Reductionism often gets propped up as a straw man and ridiculed for trying to understand a system at one scale in terms of parts at a much lower scale. For example, someone might say "It's ridiculous to try to understand an opera in terms of acoustical dynamics!" or "It's silly to try to explain the migratory patterns of birds in terms of subatomic particles!"

Hey, I agree! Such approaches are stupid. And that's not reductionism. And it doesn't work. The way reductionism bears fruit is by trying to understand a system in terms of its parts at the appropriate lower level of description. Richard Dawkins calls this hierarchical reductionism.

For example, if you want to explain how a car works, describing its function in terms of pistons and axles is going to yield far better results than describing its function at the level of atoms. If you skip too many levels of description between the parts and the whole, your explanation is simply going to suck.

Now, as a working scientist its often difficult to determine what the appropriate level of description of the parts needs to be. But what, exactly, is the alternative to such an approach? I've heard plenty of people knock their characterization of reductionism. But I have yet to hear a proposal for how you go about trying to understand a system without understanding how its elements interact. How do you "holistically" study or explain how a system works? Some of the early examples Mitchell gives of complex systems are ant colonies, human brains, and economic systems. She's correct that such systems composed of interacting elements can give rise to amazingly complex behavior. But I honestly don't see how we can go about trying to understand that behavior without examining the behavior of the constituent elements...which is reductionism.

I'm interested to read the rest of the book and see where it goes, but as far as I'm concerned she's already gotten off on the wrong foot.

Wednesday, July 1, 2009

Transformers 2 FAQ

I haven't seen Transformers 2, and most likely won't. I enjoyed this FAQ of the film probably far more than I would enjoy watching the movie. I liked this bonus question in particular:
So it's not as bad as shitting your pants?
Marginally. I honestly had to make a pro and con list to figure it out.

Saturday, June 27, 2009

The Hangover

Went to see the movie The Hangover today. The movie-going experience was marred by a sold-out theater. The movie's been out for at least a couple of weeks, and we went at 2:30 in the afternoon, and I don't remember every going to a movie that sold out in Lafayette...what the hell? Anyway, there were a couple of particularly annoying audience member. One woman to my left howled and squealed in exaggerated laughter at everything that happened on-screen. I'm glad she was having a good time, but screeching at every phrase and gesture in the movie is a bit much. I think the woman was either drunk or had a chemical imbalance.

The second big annoyance was sitting right in front of me. It was one of those people that feels the need to say everything that happens to be going through her head at the time, which happens to be not a whole lot. Mostly it was just stating what was the on the screen. When the characters in the movie wake up and we see a chicken in their hotel room, the genius in front of me said "It's a chicken." Guess what she said when the tiger was on-screen? This went on pretty much through the whole movie.

Oh yeah, how was the movie? It was all right, but definitely not worth packing the cineplex in the middle of the afternoon. Mostly the humor went for the lowest common denominator and ended up hitting it. We got copious helpings of full-frontal male nudity, and ass, and pedophilia jokes, and vomiting. And you know, there's nothing funnier than a baby getting hit with a car door. That's not to say there weren't a few clever bits, but for the most part the humor was pitched at the level of your average 7th-grader. If you find an old man getting a physical check-up inherently funny, this is the movie for you. Apparently it was also the movie for a lot of other people, because like I said, the theater was packed and the howler monkey to my left wasn't the only one enjoying the show.

That's one thing I really miss about Japan. The audience members in movies were blissfully silent. Here, everyone treats a theater like their living room. I hope if there is a hell, there's a special place in it for the chick sitting in front of me today. And when she gets there, she'll probably be placed front and center so she can contribute to the suffering by saying stuff like "It's hot in here."

Sunday, June 21, 2009

Windows 7 Sleep Nightmare

So I went through the horrible ordeal of trying to build my own PC and having the motherboard fry out on me, so I ordered a pre-built system.

In my continuing hubris, I decided to install the Windows 7 stable release candidate, mostly because I heard it was very good, and that Vista sucks. So I got my new machine on Friday night and spent most of yesterday installing new software and configuring the machine to my liking. Until today, I'd been very pleased with Windows 7.

However, there was a small problem that turned into a very large one. My computer is in the same room that I sleep, so I like to have the monitor either power down or go to a blank screen saver when I'm not using it. Sounds easy enough, but no matter what settings I used, the monitor would never power off or go to a blank screen saver. I read some stuff in various forums saying this was a problem with Vista not filtering input from optical mice (basically it thinks you're still using the mouse, so never shuts off). There's a patch for Vista, but nothing so far that seems to work for Windows 7. Still not a big deal.

I did notice the "Sleep" function in the Start menu and thought that might be a good thing to use. I could put the PC to sleep and it would quickly reboot each morning. So I put it to sleep. And guess what, friends and neighbors? The motherfucker wouldn't wake up. I pushed the power button, and the keyboard would light up, but it acted like it was still sleeping. I powered it completely off and then back on. Same deal. I unplugged the machine and tried again...nada.

This was about 5 hours ago. I was pretty upset, because I didn't want to have to return any more hardware to NewEgg and get a new machine. I tried Gateway's customer service. That was a huge freaking mistake. Both their chat and phone reps told me that I had to register my machine before they could assist me. Sounds easy, right? After all, I've got my warranty, the serial number, the SNID, and shitloads of paperwork on the thing. I've even got a piece of paper in the box that says "Register your computer online at www.gateway.com/register. It's quick and easy." Yeah, okay. But when I tried to register online, it tells me that since I don't have a 20-digit serial number, I'll have to register either by phone or chat. Guess what the tech support reps told me? That I'd have to fax or mail a proof of purchase to Gateway and wait 48 hours for processing, then call them back. WTF?

I asked the rep on the phone exactly why I couldn't register right then with him...I had all the information. He said it was because the computer was manufactured in June of 2008 and because of the time period between being shipped to the retailer and the purchase, Gateway had a policy of requiring a proof of purchase. Huh? Does that make any sense whatsoever? It shouldn't matter what the gap between the manufacture and the purchase. All that should matter is that I have evidence that I purchased the machine, and that they give it to me upon purchase so that I can quickly and easily verify that I purchased it. This isn't a fucking box of cereal, people. So I'm not happy with them.

I was ready to call NewEgg and just replace the stupid machine, but their customer support isn't open on Sundays, so I decided to wait until tomorrow morning. In the meantime, I figured I'd research the problem a bit more.

Thankfully, I came across this Gizmodo post.


Win 7 Tip: Sleep/Hibernate Mode Is Buggy, May Incapacitate Your Machine

When I came home last night, I thought my previously healthy Windows 7 machine was dead. It was making a horrendous squeal and refused to reboot multiple times. Turns out it was asleep.

I'm not sure what kind of sleep it was in (I was only gone for 6 hours and I've left it alone for half a day before and it was fine), but a regular reboot refused to restart it. So I did that ten times in a row, before giving up. I had to pull out the power cable (it's a desktop) and let the motherboard's lights go off and battery drain out. After this, it was able to correctly boot up again to a "Resuming Windows" screen, which then didn't respond to any keyboard/mouse inputs, so I had to reset again.

It's not like previous the sleep mode in Windows versions worked perfectly, but the manufacturer usually tests it once or twice to make sure that it's compatible enough that you don't have to jump through crazy hoops to re-enable your system. So our hint is to disable sleep/hibernate/power save mode on your system, in case it's incompatible, for now to save yourself headaches later.

And yes, it's a beta, so we're hoping compatibility gets fixed by release time.


Now I had unplugged the machine, but only for a few seconds. I went ahead and unplugged the machine for about half an hour, then tried again. It did exactly what the post said, attempting to resume windows on the first reboot, stalling again, then properly booting on the second attempt.

Holy shit, people. What a noxious bug. It locks you utterly and completely out of your system. You can't boot into the BIOS. You can't boot from CD. You can't do shit because the system never properly shuts down and so stays forever in sleep mode.

That was scary, let me tell you. I would have been irritated by having to reinstall the operating system, but when you can't even do that, things are looking really bad. So now at least I know. I disabled all sleep functions in the power management settings, and I'll never manually use it again.

This when I was planning on writing a blog on the coolness of Windows 7. I was very pleased with it until then. It's fast and slick. I really like the way it handles the layout of screens, the toolbar, and the desktop view. But now I'm a little afraid of it. Mostly, I'm just glad I was able to boot back into my machine.

Friday, June 19, 2009

Back From Atlanta

I'm back from the IJCNN in Atlanta, where I presented my paper "Sequential Hierarchical Recruitment Learning in a Network of Spiking Neurons". Sounds like a barrel of monkeys, don't it?

Even though I presented on the last day, attendance to the session on spiking neural networks was good. Eugene Izhikevich was in the audience, but didn't say or react much to the talks. Incidentally, his talk on large-scale brain models was very nice. I've been increasingly skeptical about the approach of trying to make enormous models when we have such little grasp of how small, local circuits in the brain work, but he made a very good case. I see the usefulness of large-scale models for studying global phenomena and simply have available a model of that magnitude to tweak and study. Hopefully the large-scale and small-scale models will one day be able to tie all the theory together in one, nice coherent bundle.

John Hopfield's talk was also a highlight. The theme was basically that you want to pick hardware that's best going to fit with the type of algorithm you need to run, and that evolution leads to such efficient coupling. Thus, if we want to try to understand the algorithms of the brain, we need to pay close attention to the type of operations that neurons carry out very well. His conclusion was that understanding the synchronous operations of populations of neurons is key to understanding how they learn and process information. I wholeheartedly agree. :)

Another highlight was a 3-hour tour of some neuroscience labs at Emory. I got to see live recordings from the network that controls the involuntary "swallowing" in crabs and lobsters. I got to see how they make brain slices from rats and mice (first you drug, then decapitate the animals, then you use a razor blade affixed in a machine that's moving back and forth very fast). Another group was studying a group of neurons in leeches which control their heartbeat. Another group was monitoring cells in awake, alert mice, studying how cells in their auditory cortex respond differently to sounds of mice pups depending on whether or not they have given birth to them. And yet another group was monitoring the activity of cells in a rat's hippocampus as it explored novel objects.

Just as with the Boston conference, I'm exhausted, though. Lots of information to assimilate, so time to fall into bed and sleep.

Tuesday, June 16, 2009

The IJCNN in Atlanta

I'm current attending the International Joint Conference on Neural Networks in Atlanta. It's my first time at this particular conference. For any given conference, I typically expect 20-30% of the content to be relatively engaging and relevant to what I'm studying. In this case, that number is a bit lower. The plenary talks have been decent, but the sessions and posters haven't offered me much of interest. And since there's a serious engineering contingent here, some talks are simply slide after slide of equations, which I don't get much out of.

There's a talk this afternoon on large-scale brain simulations...hopefully that will be interesting. And then, I give a talk on Thursday morning. And Thursday evening there's a tour of "wet" neural labs at Emory, i.e. we're gonna tour labs where people work with real brains.

So more later...