Thursday, July 10, 2008

Why post?

I barely read blogs (bad thing given this one gets occasionally updated), don't really care if anyone reads it (or else I would have told everyone), so why do I keep on adding stuff here?



  1. Personal Reflection: Keeping thoughts in my mind is difficult. Writing just ensures that the thoughts come out - and enforces concentration.

  2. Global Log: Easily accessible from anywhere in the world given Google remains alive.

  3. History: So many other things I've lost, or have just gone. Each post is like a snapshot of who I was before.



Ah, time for my favorite part - the devil's advocate:



  1. Why Share if it's Personal? Not personal in that sense. More my thoughts on various things. For example, game reviews - something that I hunt for whenever I try to purchase a game - I appreciate having access to. (hundreds of bloggers is better than a few big-media as more things will come out of it - ok, I read blogs found through the web randomly, none followed in particular. Something to add for those who are being attentive)

  2. History? Yes, people change. This is a snapshot of who I am, today, July 10th. The best example of this is a hard drive I had in my old 386. Popped it into my current machine, booted it up, and boy did it bring back memories and set me straight. I wanted to be a cartoonist - so a little protagonist I had invented while in high-school graced the desktop as my wallpaper. I envy those days, things were less complicated because I didn't know any better to make things complicated.



Which comes to maybe the greatest reason. Blogger is the easiest method (so far) that I've found to keep my past alive. And I know complexity - as a programmer - I can tell how we overcomplicate our lives. For example, to access a database there's SQL that, for many things is overkill powerful, but works great. It needs to parse statements, check against the schema, and do a ton of things. I could do the same with a flat-file (and at times flat-files are better). We like complications, I like how things were much simpler when I was younger.



I digress - keep it simple stupid.

Monday, July 7, 2008

Better Terrain Rendering

After work, I get home. I spend the day in front of a computer, and wish to rest by writing even more code. What could be better?



Well, I'm currently working on a special project as a portfolio piece/awesome thing for the yearly Apple developer competitions. On the side, I've given up on GameLib - too much code with too little return - objective-C suits my needs. I still miss GameLib for it's ability to cram all implementation details in the .c file as opposed to C++/Objective-C - but if I keep with that route, I'll spend more time maintaining the library than taking steps forward with my interests...



Now, on to the meaty part, the rendering! I love ray-tracing, but it's not the solution that I'm searching for. What I want is a fast, detailed, renderer for terrain. Something that could draw the smallest pebble to the longest blade of grass.



So here's my first solution to my little problem: render a special mesh that is the terrain. Simply, have a mesh with concentric circles - where the user should focus the circles are closer and denser. Then, the further, the sparser they become. The fun part comes when it's time to render - use a height-map to display the mesh and to do bump-mapping. So as the user approaches something they see a wonderfully high polygon count, but further away it appears blurred (which I use to mask all the other shortcuts I've used)



Now I want a million blades of grass with such features -- sending me back to the drawing board, even though I may have a solution resting in my head. I just haven't thought it through enough yet.

Monday, April 28, 2008

Shortcuts

Down the winding road we walk. Past tall oaks, thick grass, a rickety trail laid in the center, created by generations of travelers.

Father and son, off to the village through the scenic route. The quick way would be through the village's nice wide roads, but the unnatural build of the city, it's perfect corners, its people, all seem artificial.

The fashion craze sweeps the city, manufacturers hunt for shortcuts. They found them half-way across the world. Something not even a madman would have considered eons ago.

The rickety forest trail, with all it's detours is faster than the straight road once red lights are factored in.

Now, where's the evolution? Unless if the human is not really the master, but the slave to a bigger creature. A creature, where a human is merely a cell, a very complex piece of DNA, expendable as there are millions. Soon, the transport system will be the arteries, and the computer the brain.

Life creates life, and forms life. We aren't doomed, we just fit perfectly inside a machine, for galactic-sized creatures. To become the ants of the galaxy, in order to be observed by the humans of the galaxy.

Mario Kart Wii

I was skeptical. Reading review after review, either from 1up, IGN, GameSpot (who trusts them?), EGM, and any other site that was captured by the Google web crawler. Every person seemed to be really beating down on the game. It felt like -- this is yet another addition to the Mario Kart series. You know what to expect.

After having played the game for a while (finishing the 50cc, now working on the 100cc), that this is Mario Kart as I'd expect it. You have read all the bad from other sites - and I can state that they are correct in their analysis. At times you win by luck, items are rigged so that the racers remain close together, there is one AI that is destined to be your main competitor chosen at the beginning of each race...

But this is nothing new. All people who know the franchise must be aware of this. It was like that in the GBA version, and it was like that in the N64 version.

Before continuing, Mario Kart is a kart driving game, but it's also an action based kart driving game. If I have a power-up, I want someone to target it with. This puts the blue-shell and star in perspective. If you're behind, you'll want some action or else the race will be boring - and these power-ups rarely, if ever, pull you to the top 3. They just bring you towards where all the activity is. If you want a racing game purely involving skill - look elsewhere unless you only want to deal with the multiplayer/vs mode. I'm defending their decision, yes, but do agree that some of the complaints of reviewers were well founded.

The choice of maps from previous games seems questionable. None of them I was truly fond of (my favorite still being Yoshi's maze on the N64 version). The new courses though are great. Wario's Gold Mine is amazing, so is blasting across the highway in the star cup. This game deserves at least to be rented to play all the courses (on 50cc mode, you'll see them in about a day max, half a day or less if you're good).

Speaking of the N64 version, I played that a day before, so it's fresh in my mind. First, blue shells are much more commonplace in Mario Kart Wii. If this is a good thing, we'll know in the long run. It is annoying, thus forcing you to stay behind until the last minute... which I never do - thus always getting hit by the shell.

The wheel actually plays very well. I thought I'd go back to my classic controller, but have been hooked on it. (use the Wii Wheel for a few laughs...)

But there's one glaring failure of the game. The manual. For example, why do I get random boosts in speed for no reason I can tell in game (not from drifting, just regular driving)? What's the difference between heavy-weights and light-weight classes? This gets into how karts are coupled to drivers, and other nuances of the game. For gamers, this doesn't matter - it's for the Mario Kart uninitiated that I worry about...

Tuesday, January 29, 2008

Raytracing Woes

Well, last semester I wrote a raytracer for class. Now I'm currently adapting it to other projects this semester, and working on it to be fast enough to become the default renderer in GameLib.

It's amazing how much a month of neglect of code brings out all the flaws. Rested mind, I easily found spots where the logic was questionable - and impossible to enter if statements. And all that in the core ray-shooting code.

Right now I'm adding amortized rays, and removing bad code. The program is somewhat faster - from 0.8fps -> 1.8fps max on a 256x256 texture. I had hoped for more than just a single fps gain - so will revisit the code next week to improve subdivisions.

The implementation from last semester used Altivec to amortize rays - the problem being that if rays diverged paths then a lot of useless calculations would be done (the higher the resolution, the better the benefit, or so is the bet).

Saturday, January 26, 2008

Review of Advance Wars: Days of Ruin

Apart from scaring the person at the counter in the electronics department at the local grocer as I bought the game the day it came out; I've been quite pleased with the latest installment in the series.

Compared to Advance Wars DS and Advance Wars 2, this game seems even easier. I have managed to get through the first dozen levels with mostly S-ranks all over the place. The AI doesn't seem to defend their home base making capturing it a much more trivial affair (my favorite strategy involves a dozen War Tanks surrounding the enemy base while it's being captured). For example, the first level with boats, the AI moved all of its forces to attack my tank leaving its base free (about 3 moves away) - long enough to load up a lander (moving with 3 decoy ships that couldn't attack - they were destroyed, the lander survived) and they had enough time to dock and capture the enemy's HQ. In a subsequent level, the HQ was defended by missiles (the things only useful against air units) - again, with a lander (boats carrying units) it was trivial to bring two tanks to hold off the attack and a motorcycle to take care of the HQ.

The audio is good, but the music for certain COs feels like noise - but it doesn't feel out of place either. Actually, put on headphones, it sounds less like noise.

The graphics are much better - except for the wooden areas which look more like grass. But given this game's strength is not graphics (Final Fantasy Tactics Advance 2 looks much better); I don't really care as much.

The battles scenes are nice, but feel slower. For example, in DS they would be zoomed in or out then attack. In Days of Ruin, opposing forces appear on a different screen - the first attacks, while the second waits for the bombs to arrive.

The story within the campaign is good, and easy to get into. The amount of text to read to follow the story can seem tedious, so if you lose hit start to skip all the text. (something I've noticed with Intelligent System's games as I've been recently playing Fire Emblem for Wii - where they go to a point of mocking that fact in Paper Mario).

Downloading maps and uploading them was very easy. Too easy some could say. I have yet to see if playing against random opponents compares to playing against the AI (this is primarily a game I play on the bus)

The gameplay is standard Advance Wars fare. Some units found a new name, and some now can do more. Also, CO powers a not to be found in the first 17 or so levels in the campaign - meaning you can't rely on a CO power to save the day - which is a good thing in my opinion. The motorcycle units are extremely useful and remove the need for the transport/mech combination used to initially capture properties.

In the end, I'm really enjoying this game - except for the fact that I haven't sumbled onto an overly difficult level yet (still have hopes that one will slow me down).

Saturday, July 7, 2007

A Smarter rm for Mac users

Hmm, today I had a nice experience. I wanted to remove two files; httpd and httpd.tar. The former being a directory.

Did a rm -r httpd *

Went away, then returned, panicked, seeing that the space between the httpd and *.

Well, there went a good part of my documents. The important things I tend to replicate everywhere, but now I'm hunting lego manuals. From this experience came out a nice little script for all my fellow OS X users. All OS X users, who, like me, don't want to say "y" to every file during an rm.

First, open your .profile and add in the following line:

alias rm '~/rm-trash'

Second, open the terminal and type the following:

$ touch rm-trash

$ chmod 755 rm-trash

open the empty rm-trash file in your favorite editor, and type up the following:


#!/bin/bash

if [ "$#" -eq "0" ]; then
echo "No files specified for deletion."
else
for i in $*
do
echo "Trashing: $i"
mv "$i" ~/.Trash
done
fi


There, my little magic script to forward my rm's to the trash; so from the command line, if I make a mistake, it's not as fatal. I can still get my files back. And if I didn't make a mistake? Just open the apple menu, and do an empty trash.

Just call it like:

$ rm "Some Folder" "Some File"

No need the -r, or things like that. But you need quotes. Bash handles wild-cards, so:

$ rm "Some*"

would remove both files "Some Folder" and "Some File". Put in the quotes! Or else bash may treat the sections of the file name divided by spaces as different parameters.

This should work for Gnome/KDE users as well - I believe that a folder is used for the trash as well.