Nov 24, 2008

Opening Magic

While playing Magic: The Gathering with a friend, I noticed the deck he was playing with consistently had mana issues and didn't get a drop before turn three. To exaggerate the deck's issues, we played a variation of magic. "Opening Magic"

In Opening Magic, games are very short. Start like usual, up until you would decide on mulligans (iow: shuffle, cut, draw, think). Consider the hand you have, and if you would mulligan it or not. Does the hand have enough lands to get out of the opening game? Do you have drops in the first few turns?

Hidden from view of your opponent, set your life total to seven if you'd play the hand, or six if you would mulligan. Place the number so that you'd be moving the view obstructing object, not the dice/spinner/whatever-you-use-for-life-points. Give the hand face down to your opponent (who has been doing the same you have done with their hand).

Now consider their hand, and whether or not you would mulligan it. Once your both decided, let them know your choice on the second hand, and see if it matches theirs. After this, discuss any borderline mulligans and disagreements the two of you had. Feel free to grab the first couple of draws to try and drive a good mulligan point home.

Once this exchange is complete, graveyard any revealed cards and repeat the process until the libraries are empty.

This can be done in solo as well to learn what is going well with a deck, and what isn't. If you have improvements to this, or similar games, please comment away.

Sep 25, 2008

Uno - C# Console

While learning how to code in C# (my first language), I recreated the game of Uno in console output. The game would progress though four human controlled characters, and had all the cards of a normal deck. The card shuffling system was most intriguing to create, but I probably had more fun explaining it to my class mates and teacher.

I had begun work on an soft AI for my application. Alas, like a poem, I abandoned the project for new ideas. The basis for the AI was an array equal to the number of cards in hand, each set to that number times two. It would then consider each card combination, and subtract one from both cards for each similarity the two cards shared (color and number).

After it had this array of varying numbers, it was to consider its opponents and how many cards they had in hand. It would multiply Draw 2's, skips, and reverses by a set amount if the next person to play had the fewest cards in hand. Two players away having the lowest cards in hand would reduce the value of skip cards.

Finally, any illegal moves were multiplied by 0. The highest value was chosen, or a random card in the case of a tie. On all zeros, a card draw was needed.

Aug 31, 2008

EVE, EVEMon, PHP, MySQL

EVE Online is an interesting game that is open in play style. I remember reading someone else's blog about a rogue in WoW that was attempting to level by never killing. They actually carried around a fishing pole to be sure their combat skills never increased. They had a hard time, as the majority of WoW is based around killing NPC Mobs (computer controlled monsters).

EVE, on the other hand, could handle this pacifist character much more naturally. Mining, trading, and hauling come to mind quickly as violent free options. On the other side, a player could be the good guy and clean up the system of pirates; or be the pirate himself.

Onward from EVE, I'd like to point out an excellent skill management program associated with the game. EVEMon, short for EVE Monitor, is an app that helps a player plan out what they want to do with their character. It also servers as an offline means of tracking skill training. (Did I mention that skills train in real time? sry...)

As I've played EVE--and used EVEMon to better understand the game--I thought it would be helpful to have "blank slate" characters to figure out what I wanted to start with as and how it would affect my skill training in the long run. By blank slate I mean a character freshly created in game. EVEMon normally either needs an API ID and key to add a character from your account, or an XML export of a character.

I liked this idea, and spoke of it in the EVEMon suggested features forum. Browsing other people's suggestions, I ran across a developer that responded to a lengthy discussion. The original poster stated an idea, went on and on about how easy it would be to implement, and never returned to the forum.

A lot of people open their mouths (or type) without having any intention of doing any of the work themselfs (sic).

-MrCue source

These words struck home. I hadn't pointed out an idea and said how easy it would be to make, but I had suggested an idea non-the-less. To this end, I set out onto the world to create the very thing I asked for. A blank character XML file for EVEMon to import. This is where the PHP comes in.

The number of combinations posible for a new character in EVE is 216 before considering the Attributes tab (five available points placed as pleased among five attributes, max three on any one), and the Gender and Appearance tabs (both of which have no effect on attributes or skills of the character). That's 17,496 unique combinations that can have an effect on game play.

In other words, this wasn't going to be hard coded.

Wanting the app to be available quickly, and knowing it was a simple app, I choose to use PHP. The lanugage already being available to use via my site by my hosting provider also helped. PHP would also be another language under my belt.

One last thing. Tizag has been an excellent resource for learning PHP.

Update Sept 2008: Its done! Check it out -> EVEMon Template builder
Update Sept 10, 2009: For a reason I haven't investigated, the Template builder of mine no longer works. On the other hand, EVE has altered their character creation process in such a way that the Template builder is no longer necessary (attributes can be altered once a year, skills seem to be the same across the board, instead of profession'ed).

Aug 18, 2008

Programming Practice Problems

What happens when you don't use the knowledge you have? It deteriorates. Why do we let our knowledge deteriorate? Because we lack reason to use the skills we have been given. If you find this happening to you in the programming space, perhaps you should program something for the fun of it.

A friend of mine wanted to brush up her skills in C#, but couldn't think of anything to write. After hearing her dilemma, I created a problem for her to solve.

To see more practice problems, see the label of the same name.

Jul 30, 2008

Boom Blox - Wii

Boom Blox is a terrible game to rent.

In the previous generation of consoles, a player could play a game they rented continuously, barring eating, sleeping, and bathroom use. The only thing that player had to contend with is their own will to keep playing. A mental ability.

After the first lengthy session, Boom Blox makes many players reconsider if they want to keep playing due to muscle fatigue. A healthy percentage of gamers could last several lengthy sessions, but the same still results.

Assuming your not ambidextrous or hosting a party, this game may need to skip the renting step.

Jun 12, 2008

[REL] Resource Viewer's Source Code

A year ago, I was working on a tool for GPG's Supreme Commander mapping community. The goal of the application was to provide mappers with a quick means of modifying markers and create scripts relevant to regular games.

I had successfully implemented Jotto's "Spawn with Army" script, which would add mass and hydro extraction points where players existed, preventing players from having an easy outpost where players were absent. If memory serves me correctly, the "Map Size by Players" component was capable of showing data to the user, but I don't recall if these scripts were properly saved.

What is my motivation for releasing this software? At least a half year ago, I decided I was willing to release it, but never physically did it. Its easy to mentally ok something, but doing is another thing. A newcomer to the forums has made quick progress in creating a tool for editing markers, which already does more than what I had. This progress is what has motivated me to release my source code.

Coders beware, this code was powered by Mountain Dew!
Download Source: Resource Viewer v0.4.Beta2

May 30, 2008

RPG Bowling

For those of you who are bored with normal bowling, Ryan and I present to you a battle system to play with your friends. It is a two player game, and is compatible with Wii sports--provided your willing to do some math.

Your hit points are that of your average score in all your games in this session, divided by two. For your first game, players should start somewhere between 30 and 60. I suggest 35, or if you have some d6 handy, your hit points start at 25 + 3d6. (Note to self, we never actually killed one another. Perhaps starting hp should be lower)

Eg. Your total score among 3 games is 276, your average is 92, and your hit points for the next game will be 46.

Each frame is an opportunity to deal damage. The better roll's total minus the lower roll's total is how much damage the lower roller takes. If the two rolls totals are the same, the higher first roll deals 1 point of damage to the other player. Identical rolls (such as a five three and a five three) is no damage.

Eg. Player A rolls a 6 for the first roll, and a 2 in the second roll, their six two is worth eight points. Player B rolls a five dash, worth five points. Player A deals three points of damage.
Eg. Player A rolls a 9 for the first roll, and a spare for the second, their nine spare is worth ten points. Player B rolls a strike, also worth ten points. Player B's roll was slightly better, worth one point of damage.

Please note that this is a work in progress (the game, not the blog). If you have useful ideas to add to this, or perhaps you've created home rules, please post your comments.

Apr 12, 2008

Practice Problem: Columnar Transposition

A Programing Practice Problem where the user request that a coded string is translated into plain text.

After reading about the transposition cypher Columnar, create an application that can read input text and a key to both encrypt and decrypt text to an output field. (Hint: Char arrays are your friend. If your still having difficulty with this transposition cypher, try ROT13 first (see link below).)

Keyword: alphacentauri
ieeowtfro ueeootsii donfilhat weiatcsoo omtdlolnn osdldoett kcdmthcpp ftcwwsiys uyceematd yoonwdlpi ireoasnsi lsadvssro lubrwaenz

Note: My app isn't perfect by any means. It considers spaces and symbols as chars in the cyphertext, which Columnar drops. It also shows extra spaces instead of nulls (note, in this context, null is a reference to a false letter in the cyphertext, not the programming null). This extra white space will cause the decrypt to fail if they are removed.

Once you have completed the app to allow for the cyphering and decyphering of Columnar transposition, include a dropdown list that allows the user to choose other cyphers:
ROT13 - As a keyword isn't necessary, and encryption is identical to decryption, the keyword and decryption options should be disabled.
Simple Substitution - Similar to ROT13, but does need a keyword and decrypt action.
Double transposition - Another textbox should be provided to have a second keyword.

Mar 23, 2008

Piece Value



Its intriguing to me that I have such strong control of the board. But for a single misstep, such as white's next move not being b10, black at a9, white at anything but a3 makes a6 and b7 defenseless (or worse white to b6 and a group of 5 falls with black to c5.) The rules so simple, yet strategy so complex.

Simplicity in the AI's mind is a barrier. With value of pieces, it has an easier time differentiating what a good move is compared to a bad move in chess.

Here, on the other hand, it lacks a value function to easily weed out large trees of moves that human players can perceive after a few games.

Piece value isn't the only component in AI by far, but has weight in its own right.


Note: White has played about 40 games, and this is black's first game. Image from Its Your Turn, a game site that takes correspondence chess to the next level, and brings friends.

Mar 8, 2008

Practice Problem: Simple Math Problem

A Programing Practice Problem where the user is a studying math student.

Math Problem

Create a Form with the math problem of x + y = z
x and y should be displayed via label, z as a textbox.
There should be a submit button, which will store wether or not the user was right, and give the user a new problem. z's textbox should be cleared upon submit.
After ten questions, display the test results to the user in a method of your choosing (ex. results label, messagebox, output to file)

Once you have completed the above, consider extras from below:
-The user can select other math symbols (-, /, *) as part of the test
-Provide the user with a final grade
-Use a time limit per question/test
-Track the problems and answers as part of the end of test output
-Show multiple problems at the same time (and still track all of them as one test)

How difficult was it to make changes to the program after its initial creation?
What could have been done differently in the initial creation to allow changes to be made easier?
Did you use any other classes other than the original form?
What objects could have been created to take better advantage of Object Oriented Programming?

Feb 19, 2008

Supreme Commander

Note: This post is very reminiscent.

I figure you are losing interest like so many others? Anyway, you have shown some programming skills and LUA proficiency....

-A friend from the Supreme Commander mapping community
Yes, I lost interest. I went back to WoW after being clean for 8 months back in August. When FA was released, I didn't want to spend the money to upgrade, and found many things incompatible to how they were.

I had seen several help threads, but wasn't up to putting the time into getting back up to speed. Before I had left, I had already answered several questions incorrectly as patches I was unfamiliar with changed the ball game.

LUA. One of the last things I was messing with. I had the paperwork design and theory to create not just mass points based by players being there, but at predictable random spots. Random around a circle's edge for starting locations, random inside of a set box for slightly shifting mass locations each game, on or off based on multiple players (the mass point half way between the bottom left and right players is on while both players are there).

I remember the mathematics behind these ideas, but LUA is not my native language--C# is. For LUA, I look at existing code to be able to write new code. The more example code I have, the easier it is. It was a big help when (I think) PainAngel stated the files of the game were just zips.

Alas, I'm at end of term now, and come next term is my last of college. What we call "Senior Project" is also next term for me, which counts as a full time job. It appears I'll be lucky and forgo choosing what my project will be, and let my IT Code Development supervisor choose it so that I can be able to be paid while working on it. Post edit: Student Success System is the project that was chosen.