Great development languages: PHP, MySQL, Javascript/Ajax For killer apps.
If you have been to www.conquerclub.com, then you have seen what I think is a very interesting concept in wargame design. They have taken the game mechanics of Risk and built a system around them to allow for the use of any type of map (game board) you can imagine. And all of this is accomplished in a persistant browser-based game (PBBG).
This flexibility appeals to my low boredom threshold. I play a game/scenario/map several times and then I need a change. So I have studied their site and reverse-engineered it, in a sense. It is now my goal to develop a similar system of map flexibility while keeping a consistent set of core rules. My design is different in that I want to expand the complexity of the game - instead of following the Risk system of simple numerical superiority, I want to incorporate different unit types, such as infantry, armor, and air units.
For the prototype game, I have "borrowed" a map and unit icons from other websites. Once the game gets to beta testing, I will either try to design my own map and icon set or ask a better qualified person to donate their time to create them.
The game is coded in PHP with the accompanying MySQL database. In its current state, it uses very little Javascript, but I would like to incorporate AJAX at a later time for seamless combat and movement. The map and military unit data are structured in simple text files that correspond with the map image. I have created two classes: one for the map and one for units. The rest of the functionality is in a separate "functions" include file.
I have invested around twenty hours developing the system and have at least 10 more hours until I have a playable system ready for Alpha testing. I will post the link here when it is ready to go. Once the game is live, I will also post code samples and go into the design of the game in more detail. Keep checking back for updates to this promising wargame.
In the meantime, I suggest you go to Conquer Club and try your hand at one of their interesting maps.
/* Comment */
function test() {
echo("This is my syntax highlighter test.");
return;
}
The new wargame is now in a playable state. The test map is not fully implemented, so you can only move throughout the western side of it, and there must be three players: Player one is Britain, Player two is France, and Player three is Germany. In the near future I will allow for the first player to decide how many other players to allow in the game - up to a set maximum.
Try out the game (remember, it's in a rough form for now) at http:www.hackworks.net/game/war/ and give some feedback on the Contact page. You will be required to log in to the game with your HackWorks username and password.
The next post will begin to explain how the game logic was implemented and I will give code samples. But for now, try it out and let me know what you think.
Game Notes:
1. The game ends when one player controls all regions
2. Combat strength is based on sheer numbers and combined arms (the best army contains infantry, armor, AND air)
3. To create a new army, reinforce an empty region.
Have fun.
In case you're wondering how the new risk-like wargame works, I will explain some of the ways I designed it. if you haven't seen the game, it can be found here. This isn't to say that my design is the way it has to be done, or even that it's the best way. This is just the way that I decided to do it. One thing to keep in mind is that I wrote it quickly without much forethought and I did it while simultaneously working on multiple professional projects.
First, lets start with some simple MySQL. The game uses five tables, one of which is the User Accounts table from the HackWorks site. For security reasons, I won't go into detail on that table.
The other tables store data for Armies, Regions, and Games. The last table is a Game Index table that ties together User Id, Player Id, Game Id.
Let's look at the Armies table:
CREATE TABLE `armies` ( `a_id` int(11) NOT NULL AUTO_INCREMENT, `a_owner` int(11) NOT NULL, `a_r_id` int(11) NOT NULL, `a_infantry` int(11) NOT NULL, `a_armor` int(11) NOT NULL, `a_air` int(11) NOT NULL, PRIMARY KEY (`a_id`), KEY `a_owner_id` (`a_owner`,`a_r_id`) ) ENGINE=MyISAM;
As I've said, this is a simple game, so armies are comprised of three units: infantry, armor, and air. Each unit has static strength that is hard-coded into the game. This can be easily changed by storing strengths in the database so they can be modified. In the table, "a_owner" refers to the Player Id and "a_r_id" is the Region Id from the Regions table.
The Armies table is initially populated at the start of the game with all starting army data from an Army text file.
Let's look at the Regions table:
CREATE TABLE IF NOT EXISTS `regions` ( `r_id` int(11) NOT NULL AUTO_INCREMENT, `r_game_id` int(11) NOT NULL, `r_region_id` int(11) NOT NULL, `r_owner_id` int(11) NOT NULL, PRIMARY KEY (`r_id`) ) ENGINE=MyISAM;
The regions table is populated at the start of a new game with data from a "map" text file. This table keeps track of which regions each player controls at any given time in the game. Since this game does not require you to maintain armies in every region you control, we have to keep track without the help of the Armies table. To help the players, we display a country flag in all unoccupied regions. Whenever an army moves into an enemy region, we have to update the army's location (a_r_id) in the Army table, and the region owner in the Regions table.
Next time we will discuss the Games table and the Game Index table, and how they track multiple ongoing games. Maybe we can even get into some PHP code samples then.
Yesterday I received an Acer Aspire One netbook that I bought on Ebay. It has an 8Gb solid-state harddrive and 512Mb RAM. The operating system is Linpus Linux which I originally thought would be great since I prefer Linux to anything else. Unfortunately, Linpus Linux is like Linux for Dummies - you get a limited number of menu icons to access standard programs like Firefox, Open Office, etc. But all the great features of Linux are hidden.
I immediately downloaded a copy of Ubuntu Netbook Remix 9.10 to a windows computer and used the usb-creator program that comes with it to create a bootable USB flash drive with the Ubuntu ISO image. When the flash drive was ready, I booted the netbook with it and ran it live from the flash drive to test it before I installed it to the computer.
The only issue I seem to have is with the WiFi light not working. This isn't an issue since there is a WiFi icon in the top toolbar that tells me what I need to know. Linpus Linux booted in an amazing 14 seconds, but now with a full version of Linux it takes 34 seconds to boot (very happy with that speed for a full operating system). Shutdown slowed from 12 seconds to 14 with the new OS.
It is amazing that Ubuntu Netbook Remix works great on the Acer Aspire One right out of the box. The Ubuntu team sure has my vote.
I recommend installing Ubuntu Netbook Remix 9.10 on any supported netbook. The list of supported netbooks can be found here.