Sunday, January 22, 2012

Mech Hero MMO

Lately I've been wasting allot of time playing a massive multiplayer online (MMO) game called Mech Hero. It's very similar to Star Craft or Warcraft 2100, with shades of Mech Warrior blended along the edges. What I find interesting about this one is that it is completely browser based and is built around an elegant freemium business model.

The basic premise is that you run a city, and have to selectively build the city's infrastructure to produce and support a mech army. You can harvest resources, attack random "non-player" targets, or raid other player's cities. There are bot strategic and tactical aspects of the game.

So here's what I've learned:
* Don't research support vehicles past level 2.
* Don't research armor plating.
* You don't have to research weapons sequentially, so don't invest in assault rifles.
* Until your resources exceed level 9, don't build resource storage silos past level 3. Instead, build bunkers. Bunkers don't hold as much as silos, but they protect resources from pillagers.
* The cost-benefit curve for bunkers goes exponential at level 7 and negative at 11. Once a bunker hits level 5, build another. Once your resources exceed 10, upgrade the bunkers to level 7.
* The cost-benefit curve for resources starts to suffer after level 10 and goes negative around 13 to 14.
* In the case of electrical resources, build to level 11. Upgrading one power plant to level 13 would yield a 17% boost in power for about $110K. Amortized across the four plants, that end up being about 4%. Upgrading one plant to level 12, and installing a power coil, costs the same, but increases by 8%... for all plants, giving a 30% total yield.
* Always use recon satellites in sets of three.
* Build a trading post and transport units early. Weapons can be purchased for far less than the cost to research them.
* When attacking a non-player controlled (NPC) training site, it is almost always defended by a single Raptor with either machine guns or assault rifles. Attack with 2 lasers and 2 cargo carts. The lasers will keep the mech out of gun range, and two carts will carry the full bounty.
* One cargo cart can carry about 2500 units of resources and a harvester can carry about 2000.
* Whenever you send a mech to battle, have harvesters standing by: If you lose, your weapons will be ejected from the battle in a debris field.
* Each weapon has a weight. When harvesters retrieved weapons from a debris field, the weapon's weight is the same as 100 times the resource weight. This means a machine gun with a weight of 10 will take as much space as a 1000 resources.
* Precision Laser Rifle (PLR) is the early weapon of choice. Once you have shields, start thinking about railguns and plasma weapons. Avoid assault rifles and mortors.
* Weapons that are too big to be carried be a harvester (a PLR weighs 25, displaces 2500) can be "dis-assembled" and carried by two harvesters.

Monday, December 26, 2011

TED Stuff to Remember

I've been a big fan of TED for several years, because it offers insight into what "the intellectual elite" consider important. Most of these people wouldn't give me the time of day, but occasionally, a few of them make some good points. I had some notes written on the back of an envelope that I wanted to throw away... ah... I meant recycle... so I figured I better blog them so I could find them later.

On Being Wrong
This presentation has a cute graphic of what it looks like to "realize you are wrong". I didn't care for the speaker, but the take away was what she called the "Unfortunate Assumptions of Wrongness":
There are three reasons someone might think you are wrong:
1. Ignorance- They don't understand the facts, so perhaps you can educate them.
2. Idiocy- You've explained it to them, so they must be too stupid to be to understand.
3. Evil- Maybe they do understand, but are trying to undermine your brilliant plan.
In my case, its always number three.

The Moral Mind
Very politically slanted, but not wrong. The speaker states that there five moral values, of which "Conservatives" acknowledge the importance of all five, but "Liberals" acknowledge only two.
1. Harm/Care - protection
2. Fairness/Reciprocity - don't lie, cheat, steal
3. Ingroup/Loyalty - community, tribalism
4. Authority/Respect - patriotism
5. Purity/Sactity - sexuality
The research seems to indicate that everyone agrees on 1 & 2, but that the divide is the "Conservative" insistence on the importance of 3, 4, and 5.


Self Deception

This presentation has a good explanation of the difference between a false positive and false negative, and how it relates to decision models.
Finding order in chaos which does not exist, is patternicity.
* More patterns are percieved by the left eye.
If the pattern (or model) is wrong, we have made either:
  Type I Error (false positive): believing something that is not real.
  Type II Error (false negative): not believing what is real.
When evaluating the outcome of a decision where the threat could be inanimate versus a predator, we naturally err on the side of the entity. This is called agenticity.
Agenticity is a difficult concept, especially since the speaker wraps it around religion, but the base of it is the belief that others can control chaos that we can't. If you're walking through the jungle and there is a rustle in the grass, it could be the wind or a lioness. If you assume it is the wind, and it is a predator, you get eaten. If you assume it is a predator, and that the predator has heightened senses, is faster and stronger, than you become over-cautious. If it is not a lioness ready to attack, its a "false positive", because you attributed agenticity to a sound without investigation. But you survive! Thus, we are wired for false positives.

Tuesday, December 06, 2011

Merrill *not* Lynch Retirement Calculator

For those of you from outer space, the American economy has been having a hard time recently. One shining example is the paragon of Wall Street, Merrill Lynch, which imploded nicely several years ago, but was too big to fail, so it was "bailed out". It now survives as a subsidiary of Bank of America, who was also too big to fail.

We'll I stumbled upon web based retirement calculator (click the Find Out button to the right) and decided to have some fun. I learned something interesting.

First the rules of the game: The calculator asks questions and determines a magic dollar value that you have to achieve. Four factors drive the calculator:
Current age
Current retirement contributions
Current income
Projected retirement age
Obviously the last variable is stupid, since everyone knows that retirement age is 65.

Given my actual age, a reasonable estimate of the value of my retirement accounts, and a reasonable estimate of my current salary, the calculator yielded a pass/fail rating. Pass was defined as having enough money to maintain my current lifestyle, and fail was defined as running out of money before I died... Which is apparently at age 91.

I had control over two factors, which determined if I passed or failed: First, the amount of money I contribute each month for retirement. Second, my investment style, defined by my degree of risk exposure. What I did not have control over was market performance, so I was presented output based on average market performance and below average market performance, which I guess means Merrill and Bank of America do not expect above average market performance over the next 45 years.

And what I learned was I get a passing grade if I save X dollars a month, using Y investment strategy:
$10,000 Conservative
$9,200  Moderately Conservative
$8,700  Moderate Risk
$8,500  Moderately Aggressive
$8,200  Aggressive

Needless to say, my New Year's resolution will not be to save $10,000 a month. So, I guess I "lose". But here's what I see as the moral of the story: The difference between playing it safe and taking the biggest gambles is less than 20%. If I put in a more realistic monthly contribution of $1,500 per month and act conservatively, I retire at 65 and run out of money at 67. If I'm aggressive, I run out of money at 68.

So, I guess I'll go aggressive. Let's be optimistic! What's the worse thing that could happen. After all, what's the likelihood that Wall Street will screw up again in the next 20 years?

Tuesday, November 08, 2011

Creating a New Project in SVN

It had been over a year since I'd created a new SVN project, so of course I forgot how and had to waste an hour trying to figure it out. Assuming a remote SVN server with SSH and working keys...

On the server:
cd /svnrepos
svnadmin create newproject
The project should now be visible in WebSVN.

On the client:
mkdir -p /tmp/newproject/{branches,tags,trunk}
cd /tmp/newproject
svn import -m "New Project" . \
    svn+ssh://websvn/svnrepos/newproject
Refresh WebSVN, and the three sub directories should be displayed, but we need to "prime the pump" by uploading an active item.
cd trunk;
svn co svn+ssh://websvn/svnrepos/newproject/trunk .
touch dummy.txt; svn add *
A         dummy.txt
svn ci . -m "First"
Click the trunk link in WebSVN, and the new file should be visible and the project should be active. Unfortunately, its in the wrong place... this is in /tmp.

Wipe out the "prime" directory:
rm -rf /tmp/newproject
Move to the "real" location and checkout the new project:
cd /some/path
svn co svn+ssh://websvn/svnrepos/newproject/trunk .
svn del dummy.txt; svn add *; svn status
Populate the directory with the project files. The next check-in should remove the dummy.txt file and sync with the server.

Sunday, October 16, 2011

Potty Humor

In a gents, somewhere in the UK, a sink manufactured by Thomas Crapper & Company.
Uh huh huh huh-- He said crapper.

Recyclable Turkey Gravy

..and its delicious and wholesome, too.

Tuesday, September 27, 2011

Good-bye Gnome

In the latest machine re-org, I reloaded my workstation with Fedora 15. I don't like it. I think they've made several wrong turns, the single biggest being their implementation of Gnome 3.

With Gnome 3, they have set a minimum acceptable video hardware platform. That's fine, because they provided a fallback mode in case the machine does not support 3D rendering. Accept for one minor problem... most of the desktop's features do not work in fallback mode.

For instance... The ability to exit the GUI. Yes: there is no logout, quit, exit, stop, leave, or otherwise feature. The only way out is to open a terminal and init 3. If they missed something as important as an exit function, just image what else they missed. (Hint: allot!)

So, I'm trying to switch to KDE and it looks promising. As a matter of fact, I have found a fix for my single biggest complaint with KDE. I am so use to highlighting text in a terminal window and pressing "Shift-Insert", that for five years, I have refused to use KDE because it required the extra step of "Ctrl-Insert".

On the taskbar, near the clock is a scissors icon. Left click, select Configure Klipper, and click "Synchronize contents of the clipboard and the selection". Now it works the way I want!

Monday, September 12, 2011

VM Autostart on XenServer

Its a good thing I don't need to run VMware, because they are so dependent on a pre-existing Microsoft infrastructure, that I couldn't run it, even if I tried. And I've tried. Of course, I should just go ahead and invest the $3,000 in Microsoft software... just so I can invest a $1,000 in VMware software. Or, I could use Citrix XenServer.

Unfortunately, Citrix is doing everything in their power to ruin their entry level product, based on the philosophy that if they strip enough useful features from their product, eventually people will have no choice but to buy it. I don't know... If I'm going to throw two grand at them, I might as well up the ante and buy VMware.

Or just hack their product. I mean, come on guys... are you even trying?

So, I've got a cluster of XenServers, and I want to start a VM with the host boots. Ah! Upgrade XenServer to enable! Or add the following to the /etc/rc.d/rc.local for all hosts:
xe vm-start name-lable=YourVmName
If the host is the first to boot, it starts the VM. If the host is not the first, it attempts the command, gets a failure message (becuase the VM is in the wrong power state... on), and boots as normal.

And now we give thanks to the command line Gods.

Wednesday, September 07, 2011

Linux Rescue for VM on XenServer

I finally figured out how to rescue a Linux VM running on a Citrix XenServer host, an believe it or not, it is completely unintuitive! First, power off the VM, though if you're going to rescue mode... you're probably "down" already. Second, mount the rescue media (CD/DVD). Third, make sure the VM is highlighted on the left pane of XenCenter.

Here's the trick: Across the top of the XenCenter menu, select VM, and Start/Shut down, and Start in Recovery Mode. The machine should boot from the rescue media. Proceed per rescue SOP.

Be forewarned... For some reason, booting is incredibly slow.

Monday, September 05, 2011

SSH Tunneliung of X11 Apps

I had occasion to finally test something I've been wondering for a while: What is the minimal configuration to allow and X11 application to tunnel through SSH? First, this procedure assumes you have a workstation that can display X11 applications. This can either be a Linux desktop or a Windows machine running Xming or another lesser X client.

Second, install a system with only the core or base packages, possibly by building the system through kickstart. Third, edit the /etc/ssh/sshd_config and make sure X11Forwarding is set to yes. Reload if needed.

Next install a simple graphical application; for my test I used xclock:
yum install -y xorg-x11-apps
Attempt to run:
ssh 192.168.1.1 -X xclock
Error: Can't open display
In this case a failure is what we expect.

Conventional wisdom says we need to install the entire "X11 Window System" group, which will grab almost 100 packages. Instead install one RPM:
yum install -y xorg-x11-xauth
ssh 192.168.1.1 -X xclock

Warning: <snip> (repeated several times)
...but behold! A glorious xclock. The errors are from not loading fonts on the remote machine. Oddly, if we install xterm, it also complains, yet it works just fine.

A side note on this procedure: To prevent from issuing the -X (or -Y) with the SSH command line, change /etc/ssh/ssh_config, adding:
ForwardX11 yes

Adding gedit will require 57 more packages.
Adding kedit will require 68 more packages.
Best choice: gvim, requiring three packages.
yum install -y xorg-x11-fonts-Type1 xorg-x11-fonts-misc
yum install -y gvim