Wednesday, August 31, 2011

Women.

Women. I tell you. See this? This annoys me.

Basically, the girl sets up an online dating account, and goes out on a date with Jon Finkel. She finds out he's a gamer. He played and plays Magic, the Gathering. And she decides "I'm never talking to this guy again."

Ok, I understand that being a nerd means you don't get the girls. And as a shlub who's main magic achievement is occasionally taking down a Friday Night Magic tournament, well, it isn't the thing I talk up when I'm trying to impress someone. Still, there's less stigma now than before, since pretty much everybody's a gamer now. At least amongst the younger crowd.

The thing that really annoys me about this whole bit is the impossibility in her mind of mitigating circumstances. Aside from the basics, he's not just good at the game, he's the best. Over the course of his career, competing against some of the smartest and most dedicated people in the world he's earned $291,865. And I'm pretty sure that number is low; the profile in question doesn't mention his surprising return from retirement to out and out win Pro Tour Kuala Lumpur. This guy lived the dream. But apparently having touched the cards is enough to make him undateable.

"Look, I understand you're Wayne Gretzky, it's just that I don't go for hockey players."
"Oh, you're THAT Angela Merkel? Well, I'm not very political, and seeing as you're the prime minister of Germany..."

Tuesday, August 9, 2011

MMO Arbitrage

So today I'm going to talk about an idea I had back in the day, possibly even while still in high school. As the title says, it's MMO arbitrage. I'll assume here that anyone reading this blog knows what an MMO (or MMORPG if you want the full acronym) is, but arbitrage may not be, so if you're too lazy to click that link, it's the process of making profits by trading something (usually currencies) at different rates. How does this work? Let's say I can buy euros with dollars at a 1:1 ratio in Lisbon. I can then sell the euros for $2 in Prague, then return to Lisbon and purchase twice as many euros, and repeat the cycle. The really good arbitrage is going to go through three or four currencies along the way and won't make near as much money per unit. (Ideally you'd also cash out with dollars and head to the States to spend them up, or find another arbitrage cycle to play with)

Anyway, how does this relate to games you may ask? Again, I'm assuming you did, because that's the question that's about to get answered. My plan was to create a stable of characters in several different MMOs, each of which had a certain amount of ingame cash. (The amount? Large) This would allow players who'd accumulated a large amount of cash in one game to trade it for cash in another game, so they could enjoy the wealth they had accumulated. Of course, most people could see several problems with this, such as:

1. Wouldn't it take a lot of time to accumulate that much wealth on that many games? Yes, it would. Unless of course I were able to recruit already rich players or buy them off. I suppose buying resources would be reasonable, given that most businesses expect to start off with a certain amount of investment.

2. How would you determine the cash value of the ingame currencies? The only one I can give a good accounting for is Kingdom of Loathing. As has been previously discussed, the game's currency is Meat, and there's no subscription fee. You can however donate $10 and receive a Mr. Accessory, which in addition to being pretty useful its own dang self can be traded in for monthly Items which do even more nifty things, and more importantly be sold to other players, making for a decent currency conversion. Currently they're selling for 8 million meat, making the conversion roughly 800,000 meat/dollar. So there's one.

3. How would you make money? Besides taking a commission on trading currency from one game to another, there would presumably be personal arbitrage trading and other deals going on the side, assuming the time and wherewithal to do so.

4. What would cause people to trust you? If my word of honor isn't enough, I shall demand satisfaction! Really, though, there's not much of a way, although I'm not familiar enough with PayPal to be sure that there's not a way to enforce a deal if it goes south.

5. How would you know what games to work with to actually get profits? Again, I've no real idea. My guess would be it would require one character in pretty much all MMOs that had a decent fanbase.

6. What about games that don't allow reselling of currency or items via third-party vendors? What about them? This is probably the biggest hurdle, but not the one that actually stopped me. (It was laziness more than anything) If I thought I could actually make a decent profit off this thing, I'd be willing to see if I could work around this. Unfortunately, I think it's just a decent idea. Still worth blathering about though.

Saturday, August 6, 2011

Modelling Axis and Allies

I've been trying to mathematically model an arbitrary Axis and Allies battle for a while now. Not having managed to do that, I went one lower, and taught my calculator to simulate the battles. I'm going to post the code.

Program: AXIS
{0,0,0,0,0}->AT2
{0,0,0,0,0,0}->DE2
0->WIN
Just setting up a couple variables here. Rather than individual units we list attacking units that fire at 1, 2, and so forth. The list also includes attack at zero for the first hit on battleships, for example. The Defense list has six entries, for the possibility of jet fighters defending at 5

Input "Attackers at zero:",A
Input "...at one:",B
Input "...at two:",C
Input "...at three:",DD
Input "and at four",E
{A,B,C,DD,E}->ATTACK
{A,B,C,DD,E}->AT1
Input "Defenders at zero:",A
Input "...at one:",B
Input "...at two:",C
Input "...at three:",DD
Input "...at four",E
Input "...and at five",F
{A,B,C,DD,E,F}->DEFENSE
{A,B,C,DD,E,F}->DE1

So, seeing as I"m doing this on my calculator, there are... interface issues. Basically I've got to express the question as a series of queries. The ABC variables can be ignored. "D" was used for something else important that I didn't want to mess with.

Input "Number of simulations",A
For(N,1,A)
ALLIES
"ALLIES" Is the command to run the eponymous program. After this is a bunch of stuff tallying results of a particular run of the battle.
[snip]
End

The specifics of tallying are moved to afterwards, where they'll make a bit more narrative sense. Moving on to the subroutine:

Program: ALLIES
0->HIT
0->DHIT
Clearing up some variables. From here there are going to be a number of nested loops, it's going to get complicated.
While (sum ATTACK)*(sum DEFENSE)>0
Recall from above that the sum of either list is the number of units on that side left on the battlefield. When one of them zeroes out the program ends.
For (M,2,5)
...makes sure what follows goes down each attack value of attacking units
For (O,0,ATTACK(M))
And this one does the operation for each individual attacking unit
If randInt(1,6)=HIT
Rolls one six sided die per unit, adding up the total number of hits.
End
End
Ends both for loops. We're still inside a while loop, and the for loop from the previous program. If you're keeping track, this is the attacker doing one round of attacking.
For(M,2,6)
For(O,0,DEFENSE(M))
If randInt(1,6)=DHIT
End
End
A mirror image of the attacker's code, with the usual exception for jet fighters. Note that casualties haven't been removed yet, so all defensive units in the casualty zone get their parting shot. Naturally, this means the model is invalid for submarines with first strike.
For (M,1,5)
If ATTACK(M))>DHIT
Then ATTACK(M)-DHIT->ATTACK(M)
0->DHIT
Else DHIT-ATTACK(M)->DHIT
0->ATTACK(M)
End
End
A more complicated equation, I'm separating it out a bit to make it more readable. Parse the logic if you like, basically it removes casualties while ensuring it never goes to negative numbers. The first End is for the If statement, the second for the For loop.
The defense has an identical loop, only with the variables DEFENSE for ATTACK and HIT for DHIT. Oh, and the For loop goes up to six.
End
And that's the finish of that While loop at the start of this program. If after a particular round of combat one or both armies is eliminated, the while loop triggers and we go back to the main program, to finish out that For loop.

If sum ATTACK>0 Then WIN+1->WIN

If there are still attackers at the end of the battle, the sum of the ATTACK list will be greater than zero; indicating the attacker took the country.

(Back to AXIS)
ATTACK+AT2->AT2
DEFENSE+DE2->DE2
AT1->ATTACK
DE1->DEFENSE

If any units survived on the invading side, they'll be expressed as integers in the ATTACK list. AT2 gives you a running sum of all the units that survive in each simulation. Same with DE2. The other two lines reset the lists to your original inputs before you go back for another jog through the loop. (Remember, this is all in the context of a For loop from above.)

Once the loop stops, once the simulation is run, we can tally up the results:
Disp (Win/A),(AT2/A),(DE2/A)
Stop
Hammertime
The first number you get is the percentage of the simulations where the attackers took the country. The second list gives you how many units the attacking army can expect to survive, and the third list is the expected survivors on the defense. Stop stops the program, so it never actually gets to the necessary sequel, which is a comment on the code. Or a comment on my taste in jokes.

And one general, vital question: Do I trust the results? In a word, no. I'm always suspicious of computer models in any situation, and I'm not convinced my logic is satisfactory in this case in particular. And even if my logic holds up this is still based on rolling a large number of dice; while you won't get too far away from the law of averages it's still an inexact predictor.

Yeah, ok, so we can't necessarily trust the results; what sort of results does the program give? Bad ones. By setting up a battle that can have only one outcome (attackers at zero, defenders not) I find the modeled results don't match up to reality. So it looks like I'm going to have to save this post, do some debugging and come back. Grr.

After saving this post, doing some debugging, and finally coming back, I don't have a solution. My logic is fine, as far as I can read it, so I'm not sure where the errors are creeping in. Even so, I'm lacking in content, so I'll post this now and maybe give you an update if I ever figure out where I'm going wrong.