Tuesday, December 11
Top 4 Questions
Question: Discovering your dream job involves asking yourself these basic questions over time :
(1) What do you really love to do?
(2) What do you do well?
(3) What should you do so that you tap into your true voice?
(4) What does the world need?
What do I really love to do?
I love to design solutions. This stems from a child hood of discovering how to put things together. How like and dislike things can create something new when put together.
What do you do well?
I am very good at finding workable solutions. I say workable as there is always a perfect solution to a problem, but given other constraints (time, money, effort) that solution will not work. I have a knack for finding those solutions that will work within the constraints.
What should you do so that you tap into your true voice?
Start recording random thoughts and notes in a journal.
What does the world need?
I am not sure. I think there are a lot of development efforts happening which are good efforts in and of them self, however I think that they all lack a general foundation of knowledge that they all use and add to. I believe our efforts are too dispersed and this keeps us from "taking the next step" in computer science.
I would encourage anyone reading this to ask themselves these same questions and post responses or links here.
Wednesday, December 5
Battle Forces Online - Update
- Enhanced Unit Graphics
- Added some animations
- Added new Unit
- Added in game chat
- Fixed Table Bug
I lost internet access one night so I had the time to do graphics. I redid both mages, I think they look a bit more professional. I also added a few animations for their spells.
Added New Units
I added a new unit, it's a "Spell Stone" which can cast either of the healing spells. I plan on adding a number of these stones in the future.Fixed Table Bug
There was a bug that was causing people to join a table but not start a game, it was not happening very often. I killed it. (I hope)
Tuesday, November 27
First Day in the Advertising Park
Active Keywords
The following keywords were used, the cents represent how much I paid per click.
Date | Keyword | CPC | Imp. | Clicks | CTR | Avg CPC | Cost | Position |
11/26/2007 | free online multiplayer rpg games | $0.10 | 122 | 4 | 3.28% | $0.22 | $0.87 | 3.4 |
11/26/2007 | good strategy games | $0.05 | 1 | 0 | 0.00% | $0.00 | $0.00 | 4 |
11/26/2007 | play rpg games | $0.05 | 149 | 4 | 2.68% | $0.16 | $0.66 | 4.1 |
11/26/2007 | strategy game | $0.10 | 518 | 9 | 1.74% | $0.21 | $1.89 | 3.6 |
"free online multiplayer rpg games" was interesting because I could not set it lower then $0.10 per click.
57% Came and Left
43% continued to play the game.
62% used Firefox
53% used IE
They visited 4.5 pages per visit. (There is about 6 pages total)
My Mistake with Google Adwords
Setting Up
In case you have not tried this, in general the steps to setting up google ads is as follows
- Create a google account
- Create a "Campaign" ("Battle Forces Online")
- Create an "Ad Group"
- Create an "Ad" (see below)
- Create Keywords
- Set your keyword price
- Set your google network price (this was my mistake)
- Give Google some money, so they can give money to advertisers.
My Ads
I made two ads, they are both equally effective at this point.
Battle Forces Online
Tactical turn based strategy game
Fight, Battle and Play now
www.BattleForcesOnline.com
Online RPG
Tactical turn based strategy game
Fight, Battle and Play now
www.BattleForcesOnline.com
My Mistake
I did not realize or the default Cost per Click for the Google Network was set at .20. When I let my ads go live, I racked up about $50.00 in an hour. The good news is I got 70,000 impressions and 100+ visitors.
I have since turned off Google Ads, My goal today is to re-evaluate my keywords.
Caveat
Be aware of the fact that it takes about 3 hours for the results of your ads, (and how much money you spent) is updated in the Google Admin Control panel. This was part of my issue as well.
In your history log most of the refers from adwords will be labels as pagead2.googlesyndication.com
Monday, November 26
Flash or Javascript
I'm happy to say the bugs that were causing the game to not work in Firefox were very minor.
I have fixed them and the game is now 100% compatible with IE and Firefox.
The problem occurred when I was using a custom attribute within an HTML tag. For example a tile has a div on it and the div has an attribute "isWalkable"
--div class="tile" id="tile_x_y" iswalkable="Y"--
I would use the following javascript to access and set this attribute:
if(document.getElementById("tile_x_y").isWalkable == "Y")I changed this to the following:
{
//....blah, blah, blah
document.getElementById("tile_x_y").isWalkable = "N";
}
if(document.getElementById("tile_x_y").getAttribute("isWalkable") == "Y")
{
//....blah, blah, blah
document.getElementById("tile_x_y").setAttribute("isWalkable", "N");
}
I'm hoping that this works in Opera but at this point less then 1% of my users use that browser so I'm forgoing compatibility on it.
Saturday, November 24
Flash or Javascript
In addition to this I wanted to build a game that could possibly have multiple front ends. To do this I made all the request and programming logic available through API or URL calls. (This is called REST-like architecture)
Unfortunately as of right now more then 50% of my visitors are using FireFox. And there is a bug causing the battle field not to work properly. SO I am paying the price.
I'll keep you updated on this.
Friday, November 23
BFO - Needs some AI
Kinda hard to get the game started with this in play. A fella suggested that I add some type of AI which will allow a player to play.
I wonder if there is some type of sub-game that I can create. One that will allow people to stay on line and play while watching for another player to get online.
This may be critical to getting the game to actually launch.
Marketing and Stats
Anyway, the day of the post I got 100+ visitors, next day 35, and yesterday 15. This goes much as I expected as I figured that as time passed my posting would drop to the bottom of the forums.
My game allows a person to play as a Guest without registering, so it's hard for me to tell how many new players have signed up, however here are some stats:
Number of Players: 31
Number of Guests: 25
Humm, doesn't help a lot. Does it.
The other interesting items to note are that the following sites give me the most referrals:
48 - forums.indiegamer.com
14 - devmasters.net
14 - gianttip.com
12 - bbgamezone.com
12 - gameproducer.net
My next attempt at marketing will be to put the game on some list but first I have to push an update.
It's a Small World
One of them is the fella behind Rusty Axe (www.RustyAxe.com). And he's been in game development for a number of years.
The other fella does sprite/pixel art and I've always loved his art work (spriteattack.com - custom graphics).
Both of them gave me some solid advice for the game. And some awesome art work!
Wednesday, November 21
Marketing A Browser Based Game
Referral Program
The number one item that I put into place to help with marketing is the ability to refer a friend. If you refer a friend and that friend plays the game a bit, you can get a free unit (game piece). I'll be interested in seeing if this helps with word of mouth.
Forum Postings
I feel like such a heel. I've gone to about 10 different forums and posting a request for beta users for the game. I felt like a spammer. In my defense I tried to post only in those threads designated for new games or advertisements.
To be honest I don't expect a lot of traffic from these posts.
Gaming Directories
I've posted the game to a number of gaming directories, it will be interesting to see which ones will prove to send the most traffic.
Stats
I should point out that I am using Google Analytics for my stats tracking.
Battle Forces Online - Released
Battle Forces Online is a tactical turn based RPG game. You control a number of "Blades". You configure their starting setup. You battle other players in a multi-player heads up arena.
Free for all to play! How many can you gather under your command?
This is an isometric game in which you have 6 Blades / Units to start with. Wager and win more Blades from other players. There will be something at stake every single battle!
http://www.battleforcesonline.com
Sunday, October 7
More Thoughts on AI
Image a wheeled robot with one input, a bumper sensor that returns true or false if the front of the robot is pressing against something.
This robot can take two actions. It can roll forward, it can roll backward.
We place this robot in a box (say a 6 foot square box)
That's the environment and scenario. So the question is what "algorithm"/process do we put in place.
I run into a problem at this point as I realized that this had not specified any "goal" for the robot. Am I putting the horse before the cart asking this question at this point? (I don't know)
I think that every action we take (conscious or unconscious) is driven by some motivating factor. At it's most basic this motivation would be to stay alive, this would account for our involuntary actions.
If this is the case then the robot also will need to have some motivation, otherwise we place it in the box and it does nothing.
I got over this hump by assigning an ambiguous goal for the robot. It wants/needs to cover 100 feet of ground.
Keep in mind, even though there is a goal. The process that I am designing is not designed to achieve the goal. The process is designed to allow the robot to "learn" what it can do.
To me this sounds as a natural place to separate "mind states" (I'm not sure of the terminology). One piece of the mind is going to track the goals. Another piece of the mind is going to track what it "knows". I think the second part is what I am focused on at the moment.
What does the robot "know", I think this is where the predictive model comes into play. Knowing something means that when you receive a certain input and you take a set of actions...you can predict what the next set of inputs will be.
Currently the robot is unable to predicate any input / actions. I ran into a problem here as the technical side of me wanted to describe how the robot should capture this input = action = input relationship. I set this aside for the moment though.
The robot would survey it's input, see that it's bumper is not true and would then decied to take one of it's actions. (I equate this to what a baby does, hands waving, feet wiggling and so on)
Let's assume the robot rolls forward, (it could have choose to roll backward). This is where a sense of time needed to come into play. The robot is going to roll forward for a small time segment (maybe a few milliseconds) at which point it's going to review it's inputs.
So let's say it rolled forward 2 inches, at this point it needs to make that input = action = input relationship.
It will continue this cycle until it hits a wall. At this point, it now gets conflicting relationships. How does it resolve this conflict? And this is where I get stuck...
Friday, September 21
Artificial Intelligence
Wikipedia: Machine Learning - The design and development of algorithms and techniques that allow computers to "learn"
Wikipedia: Computational Learning Theory - mathematical field related to the analysis of machine learning algorithms
Wikipedia: Learning to Learn - Applying knowledge gained from one problem or task to a different but related problem or task. For example, learning to walk could be used in learning to run, or learning to recognize cars could be used in learning to recognize trucks. (More info is needed on this topic)
Wikipedia: Alife - simulating life and intelligence
Wikipedia: Digital Organism (Bot) - Self-replicating computer program that mutates and evolves.
A.I. Systems Integration - Making individual software components interoperable with other components to create larger, broader and more capable A.I. systems.
Wikipedia: Agent Communication Language - Proposed standard language for agent communications
Example Environments
Breva - Build 3D simulations of decentralized systems and artificial life. Uses a language called Steve. (website)
DarwinBots - a virtual environment in which a number of "bots" interact, fight for resources, and eventually reproduce and evolveEvolve - Allows the user to create simulations, run them, and watch the evolving creatures.
Technosphere - Users build their own creature, modular type of AI. This was very interesting and I'd like to follow up on it.
Ideas
Create an Agent Framework that uses REST and XML protocols
Tuesday, August 7
Don't and Do
Technically the brain can not distinguish between a do and don't statement. This is because don't is not a noun so we do not visual it. (See you just tried to visual it, even when I said don't)
Don't think about the elephant.
Don't smoke
This is a sneaky way to persuade someone into doing something. Place the thought in their head and come back around to it.
Monday, August 6
Notes on Reading Stock Chart
Please note: I am not a financial advisor, take all you read here with a grain of salt.
Head and Shoulders - picture
Signals that the price will make a downward move after having moved up in past periods.
Inverse Head and Shoulder signals the opposite
Cup and Handle - picture
Signals that the price will continue in an upward direction after the handle after having moved down in past periods.
Pattern should be a nicely rounded formation, similar to a semi-circle.
The valley should be between one-third and two-thirds the size of the previous upward movement
Double Top, Double Bottom - picture
Sometimes called "Twin Peaks"
Double Top (M) - Signals a downward direction change after moving up in past periods
Double Bottom (W) - Signals an updated direction change after moving down in past periods
Symmetrical Triangle - picture
Signals a consolidation to a given price. Once consolidated it may move in original direction, but it can go in the opposite direction.
Ascending Triangle - picture
Triangle shape, the top of the triangle will be straight. Each "side" of the triangle should be "tested"/"touched" multiple times.
Signals the price is to take an upward direction.
The optimum point to get in on this is right before it moves above the top of the triangle.
Descending Triangle signals the exact opposite.
Wedge - picture
Looks a lot like the symmetrical triangles, however they tend to last over longer periods of time.
Good Question: What's the difference between a wedge and a triangle
Gap - picture
A gap doesn't signify much as far as price trending, other then drastic changes in price.
Triple Top - picture
Trend has to test the same limit 3 times
Trend has to fall to the same support 2 times
Each test of limit will be marked with declining volume
Signals a downward direction
Triple Bottom - picture
Trend has to test the same limit 3 times
Trend has to fall to the same support 3 times
Signals an upward direction
Be careful as this looks just like Triple Top but signals an upward trend.
References:
Investpedia
Random Links for Week of 07.31
- Teach Kids to Program - Scratch is a simple web based platform which makes it easy to learn programming.
- Creating a valued Blog - Very interesting article on how to create a profitable blog space.
- Using Code Review for Interviews - Using code reviews to help weed out people during interviews.
- Create Draggable CSS Windows - A simple way to implement draggable windows using scriptlicious.
- SitePoint - Request a design, list a price, watch the masses compete.
- Search for Code - A few different search engines that specialize in finding source code.
Thursday, August 2
Wednesday, August 1
CSS XRay
XRAY
Thursday, July 26
Random Link: Foxmarks
If you use Firefox on more than one computer, you'll want Foxmarks. Install Foxmarks on each computer, and it will work silently in the background to keep your bookmarks synchronized. As a bonus, log in to my.foxmarks.com from any computer anywhere to access your bookmarks.
Wednesday, July 25
Creating AI - Who Knows
For a new born baby life consists of inputs, actions and expectations. I have already discussed inputs. I would like to discuss actions and expectations.
The actions that a new born can take are fairly limited. It can cry, coo, sleep and poop. Breaking those into generalities; a baby gives negative and positive feedback, recharges and discharges.
SideBar: For the sake of my sanity we will leave pooping and discharging out of the rest of this conversation. (Let's act older then 6 here boys and girls)Our "Baby Program" has the ability to give negative feedback, *waaa*, and positive feedback, *coo*, so far so good. Now comes the hard part deciding when to do what.
When does a new born make it's first choice? When it first realizes it's hungry of course. The baby's belly begins to hurt and then he needs to do something about it.
You could say that the baby is driven to want to be feed. And he is driven by the pain he feels.
Our "Baby" program has no built in wants. In addition to this is has no built in pains either. I believe we need to implement some more rules.
Our program will have one want, it wants to learn how to do things it has not done before. When it is not learning anything new it suffers from pain.
How will we implement this?
Rule: When there is no input, take an action (output) that you have no expectation for and perform it.Doing this will allow the program to learn or gain an expectation from an action. As a side rule we should note that if the program takes an action and gets no immediate input from the action, that is not saved as a reaction.
Rule: All actions (outputs) will have a reaction (input) associated with them.
Rule: Each time an reaction (input) is added to a reaction relationship it should strengthened that relationship.
Rule: Different inputs to the same outputs get linked as things that are alike.
An Example Interaction:Well I seemed to have gotten myself lost...maybe I will try this again soon.
> Baby: *waaa*> User: What's wrong?
- Baby wants to learn something new, this is an action that he does not have an expectation for.
> Baby: *cooo*
- At this point, the Baby adds saying "What's wrong?" to it's action list
- It also links "What's wrong" as a reaction to *waaa* with a strength of 0
> User: Oh you like me, huh
- Baby wants to learn something new, this is an action that he does not have an expectation for.
So a million conversations go by....Baby never gets any relationship with a strength above 0 until one day someone repeats some thing that the Baby has heard before.
- At this point, the Baby adds saying "Oh you like me, huh" to it's action list
- It also links "Oh you like me, huh" as an reaction to *cooo* with a strength of 0
>Baby: Yo, how you doing?
> User: Oh you like me, huh
- Baby adds one to the relationship "*cooo*" -> "Oh you like me, huh"
Feel free to comment and help me out.
Creating AI - The Baby
Sensory Input
It all starts with sensory input. So what sensory inputs does a program have? I can think of a number of them but I will limit myself to text for the time being. (I reserve the right to branch out though!)
Let's look at how a new born baby starts to recognize things. I think the first thing a baby recognizes is momma's milk. (some might say it's momma nipple, but let's keep it PG13, huh *hey geekboy get your mind out the gutter*)
A baby drinks milk for the first time, he doesn't know what it is but he knows he likes it. The taste and smell of milk gets stored in it's memory as well as the fact that he likes it. (Hey look it's a boy!) At this point life consists of smells and tastes that are milk and not milk. Anything that is milk he likes, the jury is out on anything else.
Following that logic, when the "baby" program encounters text it stores it in it's memory, however it knows nothing about it or what do with it.
Side Bar: It's important to note that the baby did not store multiple memories of the milk. Therefore the "baby" program will not store multiple versions of the same text.
Sounds simple so far...
Side Bar: I've always noticed that nature uses simplistic methods to create complex results, thus a side objective with this program is to keep the rules extremely simple.
With that in mind, the following logic is applied to all sensory packets that come into the program.
Each saved object will have a "goodness" attributeI know, I know the brighter bunch of you are screaming...How does a program get a "BAD VIBE" this guys is full of .... Well hold on a second, put that issue to the side for a second, I promise I'll come back to that in the next session.
If the program get a "bad" vibe from the object, subtract one
Otherwise add one to it's goodness attribute
Using these rules what would the following set of inputs give me? Assuming that "b" gives a off a "bad vibe".
IN MEMORY
--------------------
a a: +1
a a: +2
a a: +3
b a: +3, B: -1
a a: +4, B: -1
b a: +4, B: -2
a a: +5, B: -2
OK, final step, we will now give the baby program two responses, one negative..."waaaa", and one positive *cooo*. Using the above mentioned rules interaction may look like the following:
IN OUT
--------------------
a *coooo*
a *coooo*
a *coooo*
b *waaaa*
a *coooo*
b *waaaa*
a *coooo*
At this point the baby progam has learned to like the letter "a" and dislike the letter "b"
Here is a basic summary of the rules our "Baby Program" follows:
Rule 1: Incoming text is saved and assigned a goodness value of 0The next section will go into how the "baby" program gets a good or bad vibe from input.
Rule 2: If text gives off a "bad" vibe from the object, subtract one
Rule 3: If text gives off a "good" vibe from the object, add one
Rule 4: If goodness value is positive, output *cooo*
Rule 5: If goodness value is negative, output *waaa*
Random Links
If you don't know what that is, it's not for you.
How Do You Solve Problems?
He was examining how the human mind solves new problems that it has not encountered before. He then compared that to how computers handled new problem solving. I found this to be very interesting.
I'm going to list a couple of comment he made and add some thoughts to them:
"The reason [we can still recognize patterns in a split second that a computer can’t figure out with days of continuous processing] is the unique way human beings store and process patterns. "Store and Process. I can agree with this. I am curious to know if there are systems that attempt to mimic the way human's store information. I know there are neural nets, but from all I read they appear to mimic the thought process rather then the storage of information.
I am curious to know if there are systems out there that try to mimic the way human's store information. I know there are Neural Nets out there but from what I have read they appear to mimic the thought process rather then the storage of humans.
Your mind stores and processes information in what are called invariant representations.
Your mind strives to identify and save general patterns
Just to clarify, he goes on to state that the memory is stored in some sort of "fuzzy" pattern. This pattern is what is known as a invariant representation. This does not change, we just re-categorize it.
Your entire life’s worth of knowledge is stored in your mind as associatively linked, hierarchically organized, invariant representations.
An interesting exercise would be to come up with a system that could store and retrieve information stored in this fashion
You don’t need to process the complex sensory data from the car the same way you did the first time you saw a car.
This line made me think, the mind must have a way to take a complex set of data and distill it down to a general representation. Perhaps when we encounter something for the first time we make many representations for it. We then delete the incorrect one's until a particular one fits the mold. All the representations that we deleted are then stored as "like" representation. "It looks like a car but not quite." Maybe this is the way the mind goes from the representation of something unknown to the representation of something known.
There must be some basic representation models that we start from and we build our entire library from these...IE: All items fall into an Alive or Not Alive representation.
I think the reason your mind stores the unexpected experiences in far greater detail than the routine ones is to give it the opportunity to later process those memories into invariant forms.I thought that this line of thought fits easily into my thinking.
Another way of saying this is that the more intelligent you become, the less you’re surprised by reality.A great quote. If it fits a representation I know then it will not surprise me that it exists.
To sum it all up, a great article to get you thinking about how you think.
Odd Sight While Driving Home
Anyway, As I'm driving, I pass a guy with a broken broom handle in his hand, about 3 feet worth of pole, his shirt is ripped. He has this scowl on his face and he's walking very strongly. (I know odd use of the word but it catches what I saw)
About half a block down, I see this woman, dressed relativly nicly, she's holding a baby in her arm and she's doing this odd half run, skip and fast walk thing. And I notice that she keeps looking over her shoulder.
My gut instinct says that something's not right but as I glance in the rear view mirror I see her smiling and laughing.
Hummmm, I drive about 3 blocks and then I turned around. (Don't ask me why, I ain't that much of a fighter) I drive back and she's gone. ???? However the mad guy has turned down a side street and is walking in another direction.
As I drive down the three blocks again, I notice a daycare and a bus station. I concluded that she must have been running late and was trying to get to the daycare and catch the bus? I guess...It was an odd situation, I'll probably never know what happened. Oh well.
Here's a link on how to make a citizen arrest. (If I ever need to)
Random Links
Visual View of Hot Sites
A bit confusing but interesting
Wierd Words
Amusing, if you have time.
How to make a Citizen Arrest
Might have come in handy
LastFM
Online Radio, I'm always looking for good stations.
Monday, July 23
How Do You Like to Learn?
Take a short test the best way to learn new things.
My results:
The Visual/ Nonverbal Learning Style
You learn best when information is presented visually and in a picture or design format. In a classroom setting, you benefit from instructors who use visual aids such as film, video, maps and charts. You benefit from information obtained from the pictures and diagrams in textbooks. You tend to like to work in a quiet room and may not like to work in study groups. When trying to remember something, you can often visualize a picture of it in your mind. You may have an artistic side that enjoys activities having to do with visual art and design.
Friday, July 20
A Group is it's own worst enemy
This article was written in 2003 and deals with how online group dynamics work.
How is a group its own worst enemy?
Important Facts:You are at a party, and you get bored. You say "This isn't doing it for me anymore. I'd rather be someplace else. I'd rather be home asleep. The people I wanted to talk to aren't here." Whatever. The party fails to meet some threshold of interest. And then a really remarkable thing happens: You don't leave. You make a decision "I don't like this." If you were in a bookstore and you said "I'm done," you'd walk out. If you were in a coffee shop and said "This is boring," you'd walk out.
You're sitting at a party, you decide "I don't like this; I don't want to be here." And then you don't leave. That kind of social stickiness is what Bion is talking about.
And then, another really remarkable thing happens. Twenty minutes later, one person stands up and gets their coat, and what happens? Suddenly everyone is getting their coats on, all at the same time. Which means that everyone had decided that the party was not for them, and no one had done anything about it, until finally this triggering event let the air out of the group, and everyone kind of felt okay about leaving.
- You cannot completely separate technical and social issues.
- Core Group - Members are different than users - "the group within the group that matters most."
- The core group has rights that trump individual rights in some situations.
- Design Handles the user can invest in
- Design a way for there to be members in good standing. Who is in the Core Group
- Barriers to participation
- Find Ways to spare the group from scale
Thursday, July 19
Things to Remember: Negotiating
Negotiating from a position of real need is a bad, bad situation. You are almost certainly going to lose. The other party will push until they find your threshold of pain.
Read More...
Google Gadgets Venture
Read More
Wednesday, July 18
Link: Ways to speed up your computer
I have an emachine at home, I just put in a new motherboard and it keeps looking up after about 15 min of use. This may be a good way to fix that.
Daily Cup of Tech: Screencast
Random: Cast Spells at Your Computer
Instructables
Random: "Where did I come from"
I got this great recommendation from a friend.
"Where did I come from" by Peter Mayle
I'll let you know how it works out.
Journal: Seeing the Forest AND the Trees
Any development solution has to be looked at and developed from these two perspectives. First is a large view or the "whole picture" as soom of us like to say. The other is the details, the nitty gritty of the problem. All good developers have the ability to "zoom" in and out, changing their perspectives as needed.
What accured to me is what perspective do we tend to naturally fall into. Give yourself this scenario: Let's say you are half way through a project and you starting a new day. Do you start with the "whole picture" and "zoom" in? Or do you find out where you left off, do a little coding and "zoom" out to make sure you have the whole picture in mind?
I like to zoom in. I tend to start my day by looking at things from the big picture and zooming into the detail.
I don't think either way is necessarily better, they are just different.
Monday, July 16
Interesting: Web Based Web Crawler
http://snippets.dzone.com/posts/show/3853
"This is based on Web crawler code I found on this site. This version allows your to run the crawler from a Web page, instead of from a command line, and output the results to the Web page. This would be useful for someone who wants to harvest links for a search engine or for someone who works for a Web security company and wants to harvest suspicious URLs for inclusion in a database."
PHP Code: Validate Email Address String
validate an email address.
URL: http://snippets.dzone.com/posts/show/4022
<?
function validate_email($email){
$exp = "^[a-z\'0-9]+([._-][a-z\'0-9]+)*@([a-z0-9]+([._-][a-z0-9]+))+$";
if(eregi($exp,$email)){
if(checkdnsrr(array_pop(explode("@",$email)),"MX")){
print("$email is ok.
");
}else{
print("$email is ok. But domain is not.
");
}
}else{
print("$email is not ok.
");
}
}
validate_email("shantanu.ok");
validate_email("shantanu.ok@gmail.com");
validate_email("shantanu.ok@fsjaldkfjlsfjsljflsfjsldk.com");
?>
PHP Code: Get Root Folder
ULR: http://snippets.dzone.com/posts/show/4210
function getCurrentDirectory() {
$path = dirname($_SERVER['PHP_SELF']);
$position = strrpos($path,'/') + 1;
return substr($path,$position);
}
Link: Display Images in Folder
From Snippets:
http://snippets.dzone.com/posts/show/4259
Great Quote
The statistics on sanity are that one out of every four Americans is suffering from some form of mental illness. Think of your three best friends. If they're okay, then it's you.
-Rita Mae Brown
I don't have any friends I would say are crazy just different. Does that make me the crazy one?
New Game: Blade Warriors
I built a new game called Blade Warriors. It came out of some of the previous blog entries.
It's got a couple of cool things going on. There is an isometric grid being displayed. This grid is built with javascript and css. I used a familiar layering technique.
- Build the floor first
- Each tile is it's own div with a unique id (IE: tile_x_y)
- Lots of complicated mathmatics to get the exact positioning right, I just kinda played with the numbers till they all fell into place.
- Once the floor is built I then place objects on top of the tiles
- Once the objects are there I placed the unit images on top
I'm going to go back and examine my analytics log and see what's happening there.
Thursday, February 22
War Game Update
I added the ability for the agents to move in a direct line, this will come in handy when determining line of sight. I think that completes the initial requirements lists. So here is the next list of todo's for this little project:
1. Restrict movement range
2. Restrict firing range.
3. Allow user to turn on and off range display.
4. Display units as images rather then circles. *grin*
5. Scorekeeping needs to be added for kills.
That's it for now.
Monday, February 12
ASP and multiple values
Question: I've got multiple text input fields on a form. All the input fields have the same name. How do I recover the values in the fields once the form is posted.
Answer:
When this happens all the variables go into an array on the response object. You can access them by selecting thier index value. Like the following
PetsName(0)
PetsName(1)
PetsName(2)
You could also loop the the array and display each value.
for each pName in PetsName
response.write(pName)
next
Thanks Wes for the blog posting.
Friday, February 9
War Game Update
Instead of creating an agent object and creating an array of those. I used a collection of arrays. I know, I know half of you are cringing at hearing that. Now normally I'm all for OOP goodness but as I implemented it that way. I found that there was a huge lag when it came time to paint the map with the agents on it.
I'm clearing the map, then painting all the agents on the map. Of course this means I have to loop through the array of agents, then calling the property object. You don't realize the overhead until the screen starts to lag.
Lesson Learned. I went back and created a number of array's that hold agent information. Something like the following...
Dim agentID(0) As Integer
Dim agentOwnerID(0) As Integer
Dim agentX(0) As Integer
Dim agentY(0) As Integer
Dim agentDestX(0) As Integer
Dim agentDestY(0) As Integer
Dim agentWait(0) As Integer
Dim agentAttWait(0) As Integer
Dim agentIsAttacking(0) As Integer
Dim agentSpeed(0) As Integer
Interesting huh...we will see how much this cost me in the long run.
I also built a quick push function which will put an element on the end of the array. It's rather simple and there probably is a much better way to do this.
Function pushInt(ByRef arr() As Integer, ByVal v As Integer)
Dim tmp(arr.Length + 1) As Integer
arr.CopyTo(tmp, 0)
tmp(tmp.Length - 1) = v
arr = tmp
End Function
Anyway at this point users can login, register, select thier unit, move it, and shoot an enemy unit.
Each unit will wait 10 seconds before it becomes active again.
Thursday, February 8
Programming Languages
PHP
Classic VB
ASP
VB.NET
C#.NET
Java
Lisp
SQL (mySQL,T-SQL)
I've done a little with the following languages but definitely wouldn't label myself as a professional.
C++
C
Perl
Tuesday, February 6
Game Concept: War Game
This will be done in .Net as a web enabled application.
1. Completed 02.06.07 - User will need to login and register. Authentication will take place through a web service which pings mobeamer.com.
2. Completed 02.06.07 - The playing board will be seen in a top down view.
3. A user will have an "army" list:
- 1 - Heavy Hitter
- 2 - Medium Hitters
- 3 - Light Units
5. Completed 02.06.07 - After taking action a unit will become inactive for a time period.
2 wait periods, one for moving and one for shooting
6. Completed 02.06.07 - Units can take one of the following actions:
- Move - Move to a location within their movement range
- Shoot - Shoot an enemy unit within their shooting range
- Line of sight will not be taken into account yet.
8. AI will be extremly simple, as an ai unit becomes active it will shoot any thing within range. If nothing is within range it will move closer to a unit.
Estimates:
1. User Login - 4 hrs
2. Top Down Map - 8 hrs
3. Army Lists - 2 hrs
4. User interact - 2 hrs
5. Inactive Unit - 2 hrs
6. Movement and Target - 8 hrs
7. Communication - 16 hrs
8. AI - 8 hrs
Estimates - Revised 02.07 :
1. User Login - 1 hrs
2. Top Down Map - 2 hrs
3. Army Lists - 4 hrs
4. User interact - 4 hrs
5. Inactive Unit - 1 hrs
6. Movement and Target - 3 hrs
7. Communication - 4 hrs
8. AI - 8 hrs
Intro - What this is all about
That being said I have a side hobby which I really love, game development. I certainly don't consider myself a professional at it. But I do like to think I'm a little better then most hobby game writers.
I keep a few of my games on www.untouchablegames.com and I play with code on mobeamer.com. Check out either site and feel free to leave a comment.
I'm keeping this blog in hopes to capture all the crazy ideas that tend to sprout from my head. My most recent craze is to develope a .Net game.
Followers
Copyright 2009 mobeamer. Powered by Blogger
Blogger Templates created by Deluxe Templates
Wordpress by Nattywp