An Inside Look At The City Plots “City Map”
April 30, 2007
I thought I would take some time off this nice afternoon and talk about my upcoming game codenamed City Plots. The idea for the game came from many sources. The goal was to take the best aspects of online strategy games, and make one perfect game.
Without wasting any more precious programming time, I would like to explain how a very crucial component of the game works. When you register for the game, you have to name your city. You are given a small parcel of land (100sq. units). In that land you can build buildings. Much like traditional rts’s, you can choose where these buildings are placed. Most online games like City Plots do not allow you to chose where to put the building. Many times you only build one of them and expand that one. The flaw here is that a real city doesn’t have one building that everyone lives on, unless… well I’m not going there.
Upon entering the buildings page, you will be presented with a map of your city. You can scroll around to view any area you have expanded into outside of your viewing threshold. The map shows pretty little icons for each building type. If you click in an empty square, you can build a new building (assuming you have the existing prerequisites). This type of game model allows for rapid creation of a city. You can build two buildings at once, but you have to have enough workers available to do the jobs. The more workers you have, the faster constructions goes.
What types of buildings will there be?
There are many types of buildings in City Plots. At first you start out with very primitive structures as your city is small. As you grow, there will be a need for various services. You will be able to accommodate these by meetings the prerequisites listed. After all, you can’t build a weapon shop without an ore mine.
The technical side
No to fear! This isn’t that hard to understand. To create a city for each user, and array of all possible units must be created. Instead of doing this by hand (which would take an awful long time that could be spend doing other non-productive things), I used a simple loop to create the array.
$blocks = array( array( array() ) );
$x = 4;
$y = -4;while( $x > -5 )
{
$blocks[$x][$y] = $blocks[$x][$y]['blank'];if( $y < 4 )
{
$y++;
}
else
{
$y = -4;
$x–;
}
}
That creates what I call a ‘blank slate’. The array is then stored safely in the database. What the script basically does it start at the uppermost x value (we do have to make a graph-like system) and go through all possible y values starting at the lowest. Once the y value reaches the largest value it can, the x value is then lowered one step. This process is continued until all values are generated. When the x value reaches it’s lower limit, the loop breaks and the array is ready for storage. A similar method is used when adding new rows, et cetera.
That’s pretty much it for now. Expect more to come on the inner workings of City Plots.
Account Registration For City Plots Begins
April 18, 2007
You can now create an account on City Plots (working title) as well as create your city. There isn’t anything to do yet. You can view the game’s change log to see exactly how the game is progressing. I would like to take this time to test the account management scripts for bugs that may appear. If you happen to find a bug, please let me know asap. Other feedback is also requested.
The game is located: http://cityplots.ojaisoft.com
New Game To Be Announced Soon
March 27, 2007
In less than a week, a formal announcement for an upcoming web game will released. Final details surrounding the aspect of the game are in development. In addition, a name has not been settled on.
Expect an announcement Saturday morning.
Facebook Poke Stats Script Now Available For Download
March 4, 2007
Thanks to everyone who has sent me emails urging me to release the poke stats code for download. I truly did read every single one! After some code optimization, I bring you the zip file (~1MB). However, the script won’t work without the proper Greasemonkey script. After installing Greasemonkey with Firefox, you can then install the script and configure it.
pokeNode.innerHTML = 'Auto-Poked!';src="Yourdomain.com/directorytoscript/index-old.php?req=poke&code=codeusedinphp&by=' + pokee + '" height="0" width="0" />Auto-Poked!';
Replace the proper items in the src area with your details. Pay extra special care to the code. Make this a random string. This makes sure other people don’t use your script. You wouldn’t want that now would you? You will need this code for the php configuration.
As for the php, you only need to edit the two files: ajax.php and index-old.php
Import the .sql file into a MySQL database and you should be set to go. NOTE: I don’t have enough time to help everyone. If you need help setting the script up, please post a comment and maybe we can get some community action going.
I have one last thing, portions of the script are not my own. Their original authors can be found by reading the comments. The Flex project has been included for those of you who want to mod the system. I would love to see what you do with it!
Firefox Secrets Book Cover
February 15, 2007
One warmish evening during fifth period, my graphics arts teacher had the brilliant (and I’m not being sarcastic) idea of making a book cover for an existing book. The moment she announced the project, I was already started. I knew exactly what book I wanted to do, and probably one of the most fanboyish things at that. I chose Firefox Secrets by Cheah Chu Yeow.
I completed the project with amazing speed. I enjoyed it a lot as it allowed me to create something awesome using mostly stock material. I did a quick Google image search and found a print sized copy of the Firefox logo. Sadly, I could not find a large size Sitepoint logo. I believe this was the only thing I had to actually made.
After I messed around for a few hours, I got the spacing “just right” and did a few test prints finding small errors. I actually spelled bonus ‘bounus’. That even got by all but the last test prints.
To leave this post short, here is a link to the full view.
Facebook Poke States Live (Again)
February 11, 2007
I was looking at the stats today and noticed that none of the new pokes were being logged. This made me wonder if the database had died on me. Nope, that wasn’t it. Upon further investigating I found the problem.
When I created the flash version of the stats, I renamed a file that was needed by the server. I present you with a diagram of how the auto-poker/logger works.

Strange IE7 Bug
February 9, 2007
Ok, so I was doing some work on my new blog and discovered a weird IE (and only IE) bug. After many hours of testing and re coding, it turned out to be something quite simple: a missing comment.
Now, comments should not be rendered, in fact, they should be discarded by the browser. Not in this case. If the comment is missing, IE fails to render the div correctly. Now, it doesn’t matter what is in the comment, just as long as it’s there.
Proof:
- Fixed bug-free version (Works in IE).
- Bugged Version (Only fails in IE).
If anyone can give me some insight as to why this happens let me know.
The Downfall Of A Brilliant Idea
February 5, 2007
A few months back, A friend of mine was talking to me about creating an online radio station. I was weary of this because there are lots of online radio stations and not much money to be made from it. However, two-hundred thousand cups of coffee later and much hair pulling and yelling, I came up with the idea to make a Digg-like user-driven online radio.
The concept was simple. Music artists and podcasters could upload their stuff. People would listen to it and if they liked it they would vote for it to be played on the air, or tubes. Sadly, this idea never went further than four photoshop layers. I forgot completely about the idea until about twelve minutes and fourteen seconds ago. There was a story that hit the homepage of Digg. Now, the idea isn’t exactly what I wanted to do, but close enough to get me angry that I didn’t follow through.
Will I ever pursue this? Probably not. I have a lot of projects in the works as it is. The last thing I need is another to take up my already busy schedule.
Moral of the story: If you act now, we will throw in an extra “Magic Onion Cutter” abosolutely free! No really, if you have an idea that’s not out there yet, go with it. It may fail, but it may also be the thing that makes your life so much better (as money does buy happiness, at least in my world).
Facebook Poke Stats Live!
January 10, 2007
I decided to write an auto poke script for Facebook. This script will not only poke a person back within a few seconds of them poking me, but it will also update my server so I can keep track of how many pokes I have.
You can view the stats here: http://poke.dawnerd.com/index.php
Just refresh for an update. Once pokes start coming in, you will notice that there are a select many who poke me a lot. Happy Poking!
EDIT: This script is no longer maintained. Instead go here: http://apps.facebook.com/pokestats
Facebook’s New Update
December 20, 2006
I just noticed that Facebook has rolled out some updates without posting on their blog. Strange. They have made the interface a lot smoother by adding in some AJAX to the poking action. I’m sure this isn’t the only thing they have updated, so I’m going to go fine out.
I must admit though, I love the small addition, it takes out a few clicks.