Last Good Quote: Son's are the seasoning on our lives. - Someone on Facebook

Tuesday, March 9

Artificial Intelligence - Take One

The next few posts will be about a proposal for an Artificial Intelligence (Ai) system. It’s based on many things I’ve read around the internet as well as my own general ideas on how such a system needs to be made.

My goal is to detail the system in a few articles and then attempt to build it. If given time, a thing I have precious little of these days.




This shows the basic concept of the AI. As you can see it’s made up of 4 components. We will talk about each component in depth but from a high level you have:

Sensors – Track and record changes in the environment. This would be the point at which data enters the Ai’s consciousness. An Example: A sensor may be responsible for tracking a single text box on a given web page.

The Brain – This is where all the interesting stuff takes place, stay tuned. An Example: The brain may decide that in response to text entered it should display a picture.

Motors – The brain will issue simple commands which the motors will execute on. Motors will perform actions on the environment. An Example: A motor may be responsible for displaying a picture to a webpage.

Memory – Pieces of data and how the brain acted upon this data are stored in memory. Later on I will go further in depth with what will happen here. An Example: The word “Hi” might be stored in memory as well as the fact that the brain responded “Hi” back to it.

Some things to keep in mind:
This is an all-purpose form of intelligence, it’s not what many would consider a knowledge based system, or built to be superb in a specific category. In fact, I predict that this brain will not be superb at anything, but rather much like the majority of humans, it will be sufficient at being adequately productive.

My goal is to build an Ai which can function in the same capacity as an average human. Think of the Turing test but including tasks rather than chat.

My measure of success: If the program can return/perform in such a fashion that I can’t tell the difference between it and a human, I will have succeeded.

Saturday, January 30

iPad and the Future of Computing

I believe that the Apple iPad represents the next step in the future of computing. A trite and often spoken phrase, but let me explain.

Right now, laptops, phones and pdas are all viewed as tools. When I want to do something "online", I go looking for my computer. The future is when using a computer or getting on the internet becomes as frequent and often as watching TV, listening to the radio or opening my fridge. It needs to become a thing that is a given, always there, always available and everyone has one. The iPad changes this by bring a computer within price range of the all Americans. This is said with the assumption that after the first year of release the price will half, like most other technical products.

The iPad also lowers the barrier to use. Humans have an odd trait that 80% of the time we will use the tool easiest available or soonest available rather than the best tool for the job. What ever tool has the least barrier to usage, becomes the one we use by choice.

Today, when I want to get online I have to go "find" and "turn on" a computer. Even if that action is as simple as opening a device and logging in. The iPad takes another step toward changing this. Here is a device that is always on, doesn't have to be "opened" and is more "available" then other internet connected device. (Excluding smart phones). It's light enough and small enough that I can leave it anywhere, my bed, the bathroom, the kitchen, the car...it can just be with me as I roam my life.

Removing the keyboard as an essential part of the computer experience is a huge step. Apple started it with the iPhone and if they can truly enable keyboard less computing, it will dynamically change the way we use computers.

A note, I think netbooks set the stage for the iPad but I never felt that they were really the next step, they made computers cheaper but at the cost of quality. A good thing, but not necessarily an advancement in technology.

Friday, January 29

A Test in AI

I've been doing a lot of reading up on AI and I got to thinking...

Question: Is it possible to "grow" code that acts in an intelligent fashion?

So, I thought I'd walk a little test and see "what happens". However I have a "goal" that at some point watching these bots interact together should be 'interesting'.

I started with a map, a bot and a set of actions that the bot can perform.

Map:
  • 20 x 20 square
  • Going off one side of the map brings the bot to the other side of the map. (much like pacman)
Available Actions:
  • Move Up one square
  • Move Down
  • Move Left
  • Move Right
  • Look Left returns true if another bot is to the immediate left
  • Look Right
  • Look Up
  • Look Down
  • If(a, b, c)

  • a, b c - can be replaced by any other action except if
  • if a is true then b will be performed
  • if a is not true then c will be performed
  • Fight - Kills any bot within one square
  • Breed - See below
An example bot:

(This bot moves in a circle attempts to fight, then breed then it runs south)
0: Move("E")
1: Move("N")
2: Move("S")
3: Move("W")
4: Fight()
5: Breed()
6: Move("S")
7: Move("S")
8: Move("S")
9: Move("S")


How they Grow
Populate the map with 20 bots. Each of them selects 10 random actions from the list above. They then perform the actions in sequence. We are looking for some type of intelligent behavior from these bots.

Breeding
Breeding is the key to the bots learning something. Any time a bot attempts to breed the following sequence takes place:
  1. Look for another bot within 1 square
  2. 5 times, take a random code from this bot and replace it with a random code from the other bot.
  3. Find a bot that is dead and has a lower score than either parent bot.
  4. Give the new code to this bot.

The primary bot, sometimes called father, is the bot that started looking to breed. (Hey, I'm a dude what can I say.)

The secondary bot, sometimes called the mother, is the bot that was found close by. (Sorry ladies)

Gross huh? or Cool, depends on how you look at it.

The other form of breeding could take place after the bot is dead for a given number of turns. When this is the case, the bots code is randomly mixed with random code and the bot is set alive again.


Scoring

So, I needed a way to identify "good" behavior. I'm still on the fence if I can call it intelligent behavior. Either way, this is how I scored each bot.
  • +1 for Killing another bot (Survival of the fittest)
  • +1 for Breeding (father)
  • +1 for Help Breeding (mother)
  • +.25 for each tick that the bot stayed alive
Keep in mind that during breeding a bot can only breed if there is a dead bot of a lesser score on the board. This keeps a "dumb" breeder from taking over the board.

Other Notes

Age - Keeps track of the number of times the bot's code was "messed with"

Kids - Number of successful breeding attempts

Parents - The last two parent bots of the current bot.

Bots will block each others path, unless dead.

When a bot is re-spawn or the child of another bot, they are respawned at a random location on the map.

What's happening?
OK, so I ran the simulation with the following parameters:
  • 1,000 iterations (steps)
  • 20 Bots
  • Respawn after 20 seconds
  • +1 for Killing another bot (Survival of the fittest)
  • +1 for Breeding (father)
  • +1 for Help Breeding (mother)
  • +.25 for each tick that the bot stayed alive
These were the top 3:

Bot 12: 5 iterations, 18 kills, 1 kid, score: 248

This bot tried to fight, breed then moved east a little and tried over
  • 0: fight([BOT_ID])
  • 1: look('S', [BOT_ID])
  • 2: fight([BOT_ID])
  • 3: look('S', [BOT_ID])
  • 4: fight([BOT_ID])
  • 5: look('S', [BOT_ID])
  • 6: findMate([BOT_ID])
  • 7: move('E', [BOT_ID])
  • 8: move('E', [BOT_ID])
  • 9: fight([BOT_ID])
Bot 19: 2 iterations, 10 kills, 4 kids, score: 260
This bot moved diagonal across the board mating and fighting as it went. Died a lot while I was watching.
  • 0: look('E', [BOT_ID])
  • 1: fight([BOT_ID])
  • 2: move('N', [BOT_ID])
  • 3: findMate([BOT_ID])
  • 4: move('W', [BOT_ID])
  • 5: look('S', [BOT_ID])
  • 6: look('N', [BOT_ID])
  • 7: fight([BOT_ID])
  • 8: move('W', [BOT_ID])
  • 9: look('N', [BOT_ID])
Note: During this round the bot with the most code changes (13) had the following line of code:
5: ifOnly(look('S', [BOT_ID]),"move('S', [BOT_ID])","move('W', [BOT_ID])", [BOT_ID])
6: fight([BOT_ID])

Intelligence? He looks south if he sees something he moves south and then attacks. Otherwise he moves west.
Bot 12: 5 iterations, 13 kills, 1 kid, score: 230Very similar to the first test. This bot tried to fight, breed then moved east a little and tried over
  • 0: fight([BOT_ID])
  • 1: findMate([BOT_ID])
  • 2: look('S', [BOT_ID])
  • 3: look('S', [BOT_ID])
  • 4: look('S', [BOT_ID])
  • 5: look('N', [BOT_ID])
  • 6: findMate([BOT_ID])
  • 7: look('N', [BOT_ID])
  • 8: move('E', [BOT_ID])
  • 9: findMate([BOT_ID])
Bot 15: 4 iterations, 13 kills, 1 kid, score: 249
Moved a little differently, but overall moved east...a pattern might be emerging.
  • 0: ifOnly(look('E', [BOT_ID]),"findMate([BOT_ID])","look('E', [BOT_ID])", [BOT_ID])
  • 1: move('E', [BOT_ID])
  • 2: fight([BOT_ID])
  • 5: fight([BOT_ID])
  • 6: move('W', [BOT_ID])
  • 7: move('E', [BOT_ID])
Bot 7: 4 iterations, 27kills, 0 kid, score: 262
Very efficent use of code, notice how he spawned to kids to compete with him. Thus giving him the high score.

  • 0: fight([BOT_ID])
  • 1: move('N', [BOT_ID])
  • 2: move('S', [BOT_ID])
  • 3: findMate([BOT_ID])
  • 4: ifOnly(move('S', [BOT_ID]),"fight([BOT_ID])","fight([BOT_ID])", [BOT_ID])
  • 5: ifOnly(move('S', [BOT_ID]),"move('E', [BOT_ID])","look('N', [BOT_ID])", [BOT_ID])
  • 6: move('N', [BOT_ID])
  • 7: fight([BOT_ID])
  • 8: look('N', [BOT_ID])
  • 9: move('W', [BOT_ID])

Thursday, January 28

CSS Tip - Center a Div

For those that may not know...

To center a div with CSS...do the following:

#content {
width: 700px ;
margin-left: auto ;
margin-right: auto ;
}



Width must be specified.


Now if only I could center a div that has an absolute positioning

What is RAM?

So the Hot One, my wife, comes to me the other day with a flyer in her hand..."Is this laptop a bargin?"

"Sure, but you'll need more Ram", I said.

"Why" says the 10 year old.

"It'll run faster", I answered.

Now, what most people want to know is "How much do I need", here is the short answer: 3GB.

And here is the long answer. Most people may vaguly remember that RAM is memory. However, I like to think of it as the ability for a computer to multi-task.

The more RAM a computer has the better it will be at multi-tasking. You see, each program and application you open will request an amount of RAM for its own exclusive use. This is ok, but at some point the computer has no more to give. Now, being a good tool, the machine does not stop working, but it does start running slower. And as you keep opening windows it will get slower and slower.

So in conclusion, the more RAM you have the "things" you can do with your machine without affecting the speed.

Like all rules, this one has an exception. Some programs when they load, go ahead and take up all available RAM. You know who these greedy beast are before you even fire them up...cause usually they are the only thing you have open. Examples would be: 3D games, Virtual Boxes and Development environments.

The other time that RAM really comes into play is on start up. The computer needs to start a million things at once...to speed this up it constantly swaps part of the programs being started into and out of memory. The more memory you have the more it can switch and swap.

Here's a quiz for you... What can you do to speed up your machine, without spending money on new "hardware"?

By the Way: Join me in Charlotte, Feb 6th for the Annual HSCC Open House. We're teaching kids how to build Java websites this year. More Info at bdpa-charlotte.org

Thursday, January 14

Today is Special




A little wiser and a little smarter.

I did a little artwork for myself...couldn't sleep last night.

Thursday, January 7

Why Flash is Not a PBBG

A lot of folks ask me what "games" I develop. I tell them I make Persistent Browser Based Games (PBBG), their eyes promptly gloss over and I promptly move along.

However, there are some few folks who know what I'm talking about. This post would be for those select few.

Flash games are not Persistent Browser Based Games.

A PBBG is the defined as the following (from pbbg.org)
A persistent browser-based game, or PBBG, is a computer game that satisfies the following two criteria:
  1. It is browser-based. The game is played over the Internet using only a web browser.
  2. It is persistent. Progress in the game is achieved over multiple playing sessions.
PBBGs merge the depth and longevity of an application-based game with the accessibility and portability of a browser-based game. PBBG can be spoken as pee-bee for brevity.
Notice the explicit use of the word only .

Flash requires a plug-in, regardless of which browser a user uses. Thus it is out. Even if the game itself is "persistent". Now, flash can be an added bonus/feature to your game. But if a user needs flash to play your game then its no longer a pbbg.

Flash stay in your genre or make your own.

Why is this important to me?
PBBG is a different art from flash development. I like the fact that PBBG development requires you to understand all the three levels of web development. It also assist you in growing skills that can be used in a more "professional" environment.

Flash on the other hand, can more easily blur the lines in the three levels of web development as well as cut some corners on some fundumental development skills that professionals need.

If someone comes to me and says I've developed a PBBG...I can assess thier skill set pretty quickly. If someone says they've done a Flash game...well...I know a lot of easy ways to throw a flash game together.

Is it important to you that Flash games be excluded from PBBGs?

Tuesday, January 5

5 Interesting Sites for the Creativity Seeker

Innovative
This site takes my breath away. Creative, beautiful and entertaining. It's not about a whole lot but still shows the power of what you can do with the web.
Expirements in Javascript
Click on one of the links, this guy has a bunch of experiments in Javascript and flash. Interesting stuff to play with and see just what you can do with Javascript.
Photoshop Tutorial Playground
Whenever I visit this site I always find something new to try and play with on my own. It's a list of links to tutorials on photoshop and image manipulations, but let yourself wander through the sites, they are all pretty good.
DIY Wonders
Wonderful things you can create all by yourself with a little ingenuity and creativity. Some technical related, some just fun to do. Again, I never fail to find something to try after reading this page.

I have an "Inspirational" and "Interesting" folder link, these sites sit in there. From time to time I bring up the folder and go visiting. Especially when I'm bored.

Where do you visit to kill time? (Excluding game sites, we all know how to find those.)

Tuesday, December 29

Setting up Development Environments

I'm all about instant gratification. I get this kewl idea for a game. I wanna get started on coding. I wanna see something up and running in an hour. I want to have a functioning prototype in the following day or two. I wanna do it and I wanna see results NOW!

*sigh* The details always seem to get in the way. If you are a game developer and have done more than two games, you know exactly what I'm talking about. Before I can get one lick of code written I have to setup a "playground" for myself. Generally this involves the following:

  • Create a web directory (root, images, js, include folders)
  • Create a database
  • Ensure connection to the database
  • Create a login page
  • Create a registration page
  • Create a shell template
Maybe it's just me, but I find all this stuff ... boring. I'm interested in alternatives that folks might have, but this is what I do right now.

I have a copy of XAMP (Apache, PHP, mySQL for windows). It all exists in one directory.

In the root directory I have a template folder which has a login, register and basic template. I copy this folder when ever I start a new idea.

In the mySQL folder, there is a template database (user tables mostly), I copy this folder to create the database folders. This creates my databases.

I then edit the config file to connect to the correct database, this usually gets me off and running.

This usually takes me about 30 min to do, which I'm really kewl with as it gets me off to the races quicker. But I sure wish it took me 30 seconds. *grin*

So, to all my developers out there, how do you setup your development environment and how long does it take you?

Monday, December 21

5 Steps to Good Virus Protection

"You're protected from viruses, right?" I ask my friend.

I watch the always dependable reaction. Eye shift, foot shuffle, then a wincing "I think...I mean I have Norton on my desktop". Usually followed by a sheepish grin.

My friends, like most average users, know that they should have virus protection, but it's ... difficult to make sure you have the right thing installed. In hopes of making it easy here are some quick tips.

My rule about Anti-virus software: It should be invisible, until I have a problem. If this ain't true then I've got the wrong software package.

Step 1:
AVG.com - Go to the site, click on home version, click on trial and download it. It expires in 30 days, but we will discuss this later. DO NOT INSTALL YET.

Step 2:
Remove any anti-virus software that you might already have installed. Click the Start button, Goto to Control Panel, Add Remove Programs, Uninstall your old anti-virus.

This is an important step as multiple anti-viruses will slow your machine as well as cause one another to fail.

Step 3:
Now install AVG. Just follow the prompts, its relatively painless. You DO NOT have to INSTALL any toolbars. (Unless you want them)

Step 4:
When your done installing, click on the AVG icon in your start tray. (The area down by the time and date).
  • Click on Scans
  • Create a scheduled scan
  • It should scan once a week
  • It should scan all drives
  • Let it start at 12:00 Noon
  • If it misses a scan, start a new scan the next time the machine boots.
Step 5:
Whenever you login, check for the AVG icon in your start tray. If you don't see it you have a problem.

That's it! It's not difficult! The only time I see AVG is when I have a virus. It automatically checks all files I save, anything I download and it even checks web links before I click them. It's cool, in a geeky sorta way.

Trial Period
Oddly enough, my 30 day trial expired, but this means that when a virus is detected, I get an offer to buy the product but it still cleans and scans my machine. I encourage you to upgrade and buy the full package. Matter of fact, I'm going to buy the software today.

Updating
At times you might get a popup/message that it's time to update your virus protection. Do it, it will take 15 min and run in the background. You should be aware that AVG will daily download minor updates for itself. However this will happen without you being aware of it. The bigger updates typically mean something special happened. These are the ones you will receive an alert on.

Other Antivirus Packages
There are a number of anti-virus packages out there. All are pretty good, so feel free to try them. Just try them one at a time. I recommend AVG as it's NOT well known. Which means hackers are not specifically targeting their system. It's a small advantage, but "life's a game of inches."

Malware - Antivirus Impersonators
This sounds counter intuitive, but be very careful of any popup message saying you have a virus There are a number of hacks that impersonate your anti-virus software. They look very close to the real thing! If your suspicious of something, just cancel out and click on your AVG icon (in the start tray). It will let you know if there is a problem.

If you get one of these malware viruses that LOOK like a anti-virus software, seek a professional. These viruses tend to get out of hand very quickly!!!

Finally, I would challenge my friend Mr. Clark over at Clark Thought Leadership to write his own blog entry on this topic. He specializes in IT and PC Security.

So tell me what Anti-Virus do you use, and does it work for you?

Followers