Follow me on Twitter RSS FEED

A Lesson in Game Design

Posted in
You can tell when you are playing a good game. Hours fly by as mere minutes. You become so immersed in the game world you don't want to stop. How do you come up with a game concept so grabbing? Well, for one thing, even if you have a pretty lame idea, it can be made into a fairly cool game if you design it correctly. But to make a game that people will love, you have to love it yourself. The creator of Pokemon, Shigeru Miyamoto, originally created the game because he had an idea that he loved, and so just made it for his own personal use. He sold it, and got tons of money.

Sid Meier says the easiest way to get a game concept is to dream up the details, then genre [e.g. I want to make a game about cars... I think action would be the best genre for this]. This is pretty good advice. If you try to start with FPS.... what hasn't been done before? But if you start with a car concept and choose the genre FPS then you might come up with a mix between Mario kart and Halo.

You need LOTS of play testers. Your fellow nerds [assuming you're a nerd], your Mom & Dad, all your friends, just anybody who will play test it. They can give you valuable feedback on what aspects are too hard/easy/annoying etc... Also, with all these people anticipating the game to be released, you are less motivated to just stop developing the game.

You also need motivation. There have been precious few games I have actually finished. 99% of my games I just stopped developing because I lost motivation. If you lose motivation, just plod your way through unless its obvious that the game idea is lame. Sooner or later [hopefully the former] you will regain motivation when things get more interesting.

Most game ideas are lame. Totally lame. [Yeah, I know. The cup is half full with me right?] And sometimes, you don't realise it until after you spend hours [even days] working on the game. So DON'T START DEVELOPING until you know that the idea at least isn't FULLY lame. Write down all the details about your game idea on a piece of paper or type them up [I always do the latter]. Then come back after a long period of time. Try not to think about the game idea too much. Come back at the least an hour or so later. For best results [now I sound like pop tart toasting instruct writer] I would leave the idea for a full day. When you come back to the idea, try to think about your game in a rational way. Try to think why the game would be fun to play. If you do this, you could save yourself hours [even days] of work. Once you think you're sure the idea isn't lame, or at least is kind of fun, then start designing!

Now for the designing part. If you are totally new to the whole programming thing, then Game Maker is for you. If you feel you are willing to actually type in the code, then you should look at Microsoft's XNA game studio, Microsoft's Dark GDK, and Java. I personally use XNA, but its your choice. Maybe sometime in the future I'll make some XNA or Java tutorials..... but not right now.

Anyways, that pretty much wraps up this "tutorial". Thanks for reading!

We now have nine chicks

Posted in
We used to have ten. One died. I'm not going to point any fingers, but my Mom says its her fault because she didn't change the water before she went on her retreat. But anyways we don't care. We didn't name it; we're not attached to it:

Sulley, you're not supposed to name it! Once you name it, you start getting attached to it! Now put that thing back where it came from or so help me...
-- Mike Wazowski
Princess Daisy is doing fine. Whenever we put her back in with the other chicks, though, they peck her. So my Mom bought separate water and food feeders for her. Now I thought that being a chick was boring. They just waddle around all day. But being a chick by yourself..... that must be really boring.

Princess Daisy

Posted in
Most of you have probably heard of the female video game heroine, Princess Daisy. But most of you have probably not heard of the chicken named Princess Daisy.
Princess Daisy is the princess of Sarasaland, who first appeared in the game Super Mario Land.  Although Daisy is the ruler of Sarasaland, her current place of residence is in the Mushroom Kingdom. 
-- Mario Wiki 
Our chicken named Daisy hurt its leg a few days ago. The girls nursed it back to health and named it after the video game character Princess Daisy [don't ask me why]. I think Mike Wazowski said it perfectly:

Sulley, you're not supposed to name it! Once you name it, you start getting attached to it! Now put that thing back where it came from or so help me...
-- Mike Wazowski
But I admit its not likely that we'll be bringing Daisy back to the store.

Python Project: Recursive File Scanner

My harddrive was filling up, so I wanted to find the biggest files on my computer. I thought python would be the perfect language to do this, so I wrote a little script. The script starts in drive C:\, and recursively scans through every directory and file on your computer. If any file is larger than one Gigabyte, then it is put in a list. After every file has been scanned, then the program prints out the list of files larger than a Gigabyte. This is very useful for finding big files to clear your hard drive. Here is the code:


    import os


    def listdir(path):
        good = []
        try:
            files = os.listdir(path)
            count = 0
            for i in files:
                filepath = os.path.join(path,files[count])
                byte = os.path.getsize(filepath)
                gigabyte = byte / 1073741824
                if(gigabyte >= 1):
                    good.append(filepath + "  --  " + str(gigabyte) + "GB")
                if(os.path.isdir(filepath)):
                    bbt = 0
                    tempt = listdir(filepath)
                    for p in tempt:
                        good.append(tempt[bbt])
                        bbt += 1
                count += 1
        except WindowsError, e:
            print "Windows Error:"+str(e)
            print " -- Continuing..."
        return good


    lists = listdir("C:\\")
    count = 0
    for i in lists:
        print lists[count]
        count += 1


I am, as we [well actually just me] speak, moving quite a few GB to our MyBook.

Four Types of Humor

Posted in
My friend and I are going to make [or at least start making] a movie where I star as the comic relief. So I needed to write up some lines, and then punch them [get it? punchlines?] before we visit next. I came up with a few ways to do that. Lets list a few [I say "lets", but I'm doing all the work]:

  • Equivocation: You use the same word two times, each time meaning separate things.
    If, of all the animals, man is the only rational being, then that means women are irrational
  • Sayings that are warped in a way that is applicable.Concerning Penguins: Birds without feathers flock together
  • Mishearing/Misinterpreting One character says something, and the other character responds as if the first character said something that sounds like what he really said.Mr. A: You are loquacious [lo-kwa-shus]Mr. B: On the contrary, I'm very cautious!
  • Taking Literally: This is probably my favorite; I'm definitely the best at this. When one character says something, the other takes him literally.Mr. A: Where on earth have you been???Mr. B: At Latitude 40.68952 and Longitude -74.04444
By the way, Latitude 40.68952 and Longitude -74.04444 is the statue of liberty.

So hopefully, with these in mind, you can write funny one-liners/dialog.

I don't want to get involved with any copyright infringement or whatever, so I'm going to say that equivocation joke was from The Fallacy Detective. The rest are made up by me.

Yesterday....

.... we went to Greek class. As we sat down for our quiz, the fire alarm went off. We grabbed our most important stuff, and piled outdoors. We finished the quiz outside, a good distance from the building. Nathan said he wished he left his geometry book inside in case the building was on fire. By the time we finished the quiz, the alarm had stopped. We all went back in and continued class as normal.

While the Mom's were talking [instead of leaving =)] me and Nathan talked about some movie concepts. He wanted me to be the Comic Relief, so on the way home I made up some puns and humorous equivocation. I'm thinking about making a tutorial on how to write Comic Relief...

Around 10:00 last night, we went into our garage to check on our chicks. One of them had a broken leg or something, and it couldn't walk. All the other chicks were pecking at it. We put it in a separate box [lined with newspapers and wood chips] and gave it its own food/water supply. This morning, it was just a tad bit better.

Python Tutorial 4: File IO

Posted in

If you have worked with PHP or Perl, then file IO should be familiar. To edit/read a file, you need a file object. To get the file object, you have to open the file.

fileObject = open("file.ext", "r")
print fileObject.read()

But what if you wanted to start reading from the middle of the file? In python, this is possible. To set the file read cursor, you must use the seek function:

fileObject.seek(offset,where)

where is optional, and it tells the compiler where to start from in the file. If where is 0, then it puts the cursor at offset characters from the start of the file. If it is 1, the characters are counted form where the cursor is currently. If 2, then they are counted from the end of the file. If where is not specified, then the compiler uses 0.

The offset [as previously explained] tells the compiler how far from where to set the cursor. Negative numbers are acceptable

  • fileObject.seek(15,0) would move the cursor 15 characters from the beginning of the file
  • fileObject.seek(15,1) would move the cursor 15 characters to the right from its current position
  • fileObject.seek(-15,2) would move the cursor 15 characters away from the end of the file

Notice the negative sign before the fifteen in the last example.

seek, read, and open are the most basic IO functions. Lets look at some more: tell(), readline(), readlines(), write() and close()

tell() gets the position of the cursor in the file, which [as shown above] can be set with seek().

cursorPos = fileObject.tell()

The readline() function reads from the cursor position to the end of the line. The readlines() function reads from the cursor position to the end of the file, and returns an array with each line in a separate index. You will never guess what the write() function does. Ok, you might if you are really smart. Assuming you arn't really smart, I'll tell you what it does. It writes to the file. It writes at the cursor position, overwriting any characters infront of it, like if you press the Insert button in Microsoft Word and type. The close() function closes the file object so you can't read or write to it anymore without reopening the file. You should always remember to do this because if you don't, then the changes you made most likely won't effect the file.

Now lets talk about pickles. No I'm not being random; Pickles are a way in python to save objects to files. You can save almost any object to a file with pickles. Inorder to use them, though, you have to import them with the statement: import pickle. Then you use the pickle.dump() function to save them to the file:

import pickle
numbers = ["one",2,"three","four",5,"can you count?"]
fileObject = open("numbers.txt", "w")
pickle.dump(numbers,fileObject)
fileObject.close()

To read a pickle back in, you use the pickle.load() function:

import pickle
fileObject = open("numbers.txt", "r")
numbers = pickle.load(fileObject)
fileObject.close()
for item in numbers
    print item

The main con with pickles is that you can't save more than one object to a file. A way around this would be to put all the objects into an array, and then save the array to the file.

That concludes my fourth python tutorial.

Python Tutorial 3: Loops and Conditionals

Like I said in my First Python Tutorial, there are no brackets [ { and } ] ; Python uses indentation instead.

    a = 0
    while a < 10:
        a = a + 1
        print a
    print "End of loop"

Everything after the while a < 10: statement that is indented is repeated until a is no longer smaller than 10. Everytime through the loop, a is incremented, and then printed. The output of this program:

1
2
3
4
5
6
7
8
9
10
End of loop

Notice that "End of loop" is only printed once. That is because it is not indented, and hence comes after the while loop ends. Here is the basic form for the while loop:


while {condition that the loop continues}:
    {what to do in the loop}
    {have it indented, usually for spaces}
{the code here is not looped}
{because it isn't indented}




The if statement is rather similar


if(condition)
    statements
else
    statements




This can be very useful for many things


if(enteredPassword == correctPassword)
    login()
else
    print "Incorrect password";

Chicks

Posted in

We got baby chicks! I knew Mom & Dad were planning to do this eventually, so I was surprised when they walked out of Tractor Supply Co. with them. They had gone in to buy supplies for them, so we'd be ready when we got them.

We currently have them in a box in our garage. We had to buy wood shavings and a special heat lamp and water container for them. We lined the cardboard box with newspapers, then covered it with wood shavings.

click images to view them full size





I must be out of my mind; uploading pictures that don't have me in them.....
Now for the chicks:






My Dad will be building the Chicken Tractor for them, and then they will stay outside. But for now, we'll keep them in our garage.

Affect vs. Effect

I don't know about you, but I haven't ever heard an easy-to-understand rule about when to use affect and when to use effect.

So I could turn this into a really long definition [like a grammar book would], but I'll keep it short and sweet.

Affect: verb
Effect: noun

    I affected the dreams of Luke and Levi [view post]

Since, in this case affected is a verb, it has an A.

    The effect of the WordPress editor is not pretty [view post]

In this case effect is a noun, so it has an E. If you already knew this then...... this is just for a reference for me

Affecting Dreams

Posted in
Most of the time, I go to bed later than my other siblings. One night, Luke was asleep on the floor. When I came in he stood up and got in bed. I noticed his eyes were closed, but wondered if he was awake. I decided to do a little experiment. Note that Luke's eyes were closed the whole time.

Me: Did Bob take the mustard?
Luke sits up in bed
Luke: Maybe
Me: Did George take the mayonnaise?
Luke scratches his chin
Luke: OK, bye.
Luke lies down in bed


I tried to pursue further conversation, but he was obviously fully asleep. A few nights later, Levi seemed unusually fidgety. I decided to try it with him. Note that Levi's eyes were closed the whole time.

Me: Levi? Are you awake?
Levi nods, eyes still closed
Me: Can you give me a high five?
Levi shakes his head a few times, then nods
I hold out my hand
Levi highfives a few various invisible hands
Levi shakes his head


So in both of the above cases [yes they really happened], I obviously affected their dreams, more or less. With Luke though, I could only affect his dream up to a certain point. So at what level of consciousness do I affect their dreams? At what level of consciousness is it not really a dream for them? Since consciousness can't be measured these questions may never be answered.

Unless of course in 10 years from now, we discover a way to measure consciousness.

Why I Chose Blogger over Wordpress

Posted in
WordPress is very feature rich, and the widgets and themes are very appealing. But the editor is awful. It takes out line breaks, and edits the HTML code. All its features can't compensate for the editor's flaws. So I decided I was done with WordPress. I tried out a few different blog engines, but none of them were what I needed. Blogger is the bare minimum of what I need. Its like WordPress, without all the widgets and themes and faulty editor. As you can see, my first post was the same Python tutorial on my old blog.

I wrestled with the WordPress editor for half an hour before I got it looking the way I wanted it. With blogger, I just type in the text in the WYSIWYG editor. Like WYSIWYG implies, What You See Is What You Get. The WordPress editor, though it is called WYSIWYG, is definitely not.

If WordPress comes out with an Update that fixes the editor problems, then maybe I will switch back to it. But for now, I will leave the WordPress blog as-is and just post to this blog.

Here is my old blog.

--Adam

Python Tutorial 2: Variables

Posted in
In this tutorial, we’ll study variables. Python variables are related the closest to PHP and Perl, except they don’t start with any symbols. In Python, both concatenation and addition are done with +. All the others you would expect.


+Addition / Concatenation
-Subtraction
*Multiplication
/Division
%Modulos
**Powers


Python variables are generic; you don’t have to declare them with a type [int,string,char etc...] or with var, you just simply use them. A variable can hold a number at one point, and later in the program hold a string of characters.


    varone = 5
    vartwo = 6


After assigning the variables, you can add them together and store them in another variable:


    varthree = varone + vartwo



This assigns varthree to 11. You can subtract, multiply, and divide in the same way. You can divide vartwo in half like this:

    vartwo /= 2

This takes vartwo, divides it by two, then assigns it back to vartwo. So since we had vartwo set to 6, it would now be set to 3. You can multiply by two with *=, add two with +=, subtract two with -= etc...

Strings are slightly different.

    stringone = "Hello"
    stringtwo = "World"
    greeting = stringone + " " + stringtwo


This gives the variable greeting the value "Hello World". Commas do virtually the same thing as + with strings, except commas insert spaces. The above greeting assignment does the same thing as the following:

    greeting = stringone,stringtwo