Wednesday, January 28, 2009

Back to the Drawing Board

So coding the Leader/Clan creation portions of the site were successful. I ran a number of different tests, and tried to break it, and all seems well. With a vast emptiness and only my little clan, and absolutely nothing to do inside my world, I decided it would be good to take some time to finalize a more concrete sketch of some important details. I'm going to start by defining how quickly clans should grow, and how quickly resources should be gathered. I have the following in mind, as base numbers:

  • Clans will grow at a rate of 1 clansmen per hour. This can be modified by the charisma of the leader, as well as technology trees for the clan, so this number can definitely be increased. When a clan is created, it will start out with 10 clansmen.
  • Clans will have an initial cap of 50 clansmen. This will grow in proportion with the level of the leader, as well as various skills.
  • Base resources (iron, wood, stone) may be harvested at a rate of 1 per hour, per clansmen allotted to that resource. If a clan allots 10 clansmen to mining iron, then that clan will be able to mine 10 iron per hour.
  • The base storage for resources will be 250. Every resource may be stockpiled to a maximum of 250 units, until it is increased via skills/attributes.
  • There will also be a limit imposed on how many workers can be harvesting a particular resource. This base limit will be 10 until it is increased via skills/attributes.
  • Clansmen who are not allotted to any resource, will be able to carry out other tasks such as hunting, raiding, etc.
All of these various limits will allow me to pace the rest of the game. For example, by defining the cost of a particular building at 1,000 wood, I can essentially dictate that it will take (1,000 / 10), or 100 hours to build that building. Of course, this is not an exact science because obviously people can trade other resources for wood, and different abilities and skills will allow someone to gain wood at a higher rate than 10 wood per hour. However, this will at least allow me to have some level of control over the pace of the game.

If I can get this system coded into place, I will be able to start working on other parts. I will basically need to start creating some functions that will dictate and control all of the above elements.

Tuesday, January 27, 2009

What next? Code or Design?

At this point in the project I am ready to start getting my hands dirty. Ideas are running rampant throughout my head, and the game is consuming my thoughts whenever I have a free moment. I can start designing the graphical layout of my game, or I can begin coding.

I prefer to create my design around my content, rather than my content around my design, so I will begin coding. What sense would it be to create a wonderful layout, only to find out that it doesn't quite match the content I am outputting to my HTML templates. I'll play it safe.

Logically, the best thing to start coding is a login/authentication system. Oh wait, Google already handles that for me! If you have a Gmail account, you can start playing my game.

Just as an aside, GAE does not require you to use their user auth system, and it also does not require users to have a Gmail account. It merely lays that out as an option, and a very good one, too. I will be utilizing this by choice. In order to play Vile War, you must have a Gmail account. This will all interface very nicely into my user creation page, so it will really be no different than signing up for any other game, except that if you already have a Gmail account, you don't have to create a user.
With user creation, login, and auth handled by GAE, I can focus on creating Leaders and Clans. A Leader is the representation of the player. Leaders will have a number of characteristics, most of which are consistent with most RPGs (name, stats, skills, etc.). When creating the Leader, an alliance must also be chosen. This will essentially be a matter of choosing a deity to align with. Once this is done, all necessary error checking must be done to ensure that the Leader is able to be created. In no specific order, some of the error checking involves:

  • The name chosen doesn't already exist.
  • The name chosen contains legal characters (Letters, spaces).
  • The name chosen meets the required length requirements (2-20 characters).
  • The user hasn't already created a Leader.
  • The user is logged into his Gmail account.

Once this is done, the Leader must create his Clan. This is just a matter of choosing a name. Error checking similar to that above will be done.

I actually did this prior to writing this update, but that isn't so important to know. Now Leaders and Clans can be created, but they are entering a world of vast nothingness. I must create my world!

Monday, January 26, 2009


The idea is on the table, excitement is in the air. Now where do we start?

Let's start basic. Choosing how you are going to make your game is a great place to start making it. There are a number of perfectly good solutions:

  • PHP
  • ASP
  • Ruby on Rails
  • Python
  • Perl
  • Insert other languages here

If you had asked me to make this decision a year ago, the answer would have easily have been PHP with a MySQL database. After all, I've been coding in PHP for 7 years. Plenty of large-scale webapps utilize it, plenty of large-scale PBBG's utilize it... why shouldn't I?

Rather than tell you why I will not be using PHP/MySQL, I'd rather tell you why I will be using the Google App Engine (GAE):

  • Cost - GAE is absolutely free at this point, although premium version are in the works.
  • Performance - Google handles load balancing and performance scaling. To do this myself, I would be looking at having to rent or own multiple dedicated servers, and maintain the server hardware and software myself. I just want to code, I don't want to play the role of server admin as well.
  • Security - Servers are hosted by Google. No need to worry about DoS attacks, or utilizing my own dedicated line to keep a box up and running, or worry about remote maintenance if I rent one. Transaction security across the datastore is also handled by Google.
  • Django templating - Separating design and code has never been easier. There are good PHP solutions for this, but they simply do not compare.
  • Python - I couldn't ask for more. I could go on forever about this. Pre-compiled routines, indent organized blocks, and an overall fun experience.
  • The Google Datastore - Google utilizes Big Table for the database. Interfacing with it has saved me countless hours of debugging and security checks. Being able to create a new entity in my datastore is as easy as:
new_user = User() = "Brandon"

A new User with the name Brandon has now been created and saved in my database. No need to run a function to connect to a MySQL database, because the connection is already implied. The days of designing the database tables are over. Using the example above, designing an entity is as follows:

class User(db.Model):
name = db.StringProperty()

No need to create primary keys, or connect to the database and execute SQL queries to create my tables!

I would absolutely agree with anyone who says that PHP is a great "out of the box" language. It is easy to pickup and learn, and designing webapps can be fun. Small-scale apps are much quicker to design in PHP, due to the fact that there is little to no prep work. However, once the GAE project is created, the countless hours saved cannot be overstated. I've developed with PHP for many years, and after the initial discomfort of switching to Python, I am completely at home.

With my hosting, coding language, templating system, and database all taken care of, I can focus on starting my app. Now the next big decision:

Focus on code? or Focus on the web design? I've already got my answer, and this will be in my next update.

Contriving the Idea

Before one can begin coding or designing, the idea must be born. Luckily, over the past few years I have been writing down ideas for exactly this purpose. As someone who plays a plethora of games in various genres, I have plenty of ideas regarding what I would like to see in a game.

The idea for Vile War was partially spawned by playing EA's Spore. This game allows you to create a creature, and take it through various stages of evolution until you are part of a flourishing society full of your own creations. The idea is beautiful, the implementation was somewhat lacking, however. My favorite part of the game was the initial stages where you design your creature, and shape it based on the actions you take. Once your creature becomes civilized, this is where the game starts lacking. It just didn't keep me enthralled, plain and simple.

  • In Vile War, you will not be creating a race, but you will be creating a tribe, or a clan. You will play your clan's leader, and will have the ability to oversee all of your clan's development. Your clan will be part of a much bigger picture, however, as you will be part of one of many alliances of your own choosing. Alliances will not be user-created/controlled, and the number of them is still undecided. My guess at this point is that there will be between 2-5 alliances. More on this will come later.

  • In the early stages, your clan will be focused on self-growth and development. Tools, crafting, hunting, inventing, building, you name it. Your actions and decisions will shape the type of clan you lead. As this progresses, you will soon interact with other player created clans. At first the clans you encounter will be part of your alliance, so you will not be able to attack them. Instead, you will be working with these neighboring clans to progress your own interests. It will be stressed that working with other clans in your alliance will be an absolute must in order to progress at a high rate. However, if you do not want to work with other clans, you will still have that option.

  • Each clan will have different strengths (and weaknesses), and this is why it is so important to work with others. Your clan may be excellent builders, but your building designs are lacking because you are a low intelligence clan. With great builders, but shoddy designs, your buildings will not be built to the fullest potential. Sure, you can design and build and your own from scratch, but why not purchase plans from a neighboring clan who specialize in structural design? Similarly, when they want to start building their own buildings, it would be wise for them to approach your master builders to ensure a quick, but thorough job. This has not been completely hammered out, at this point, and changes will certainly be made, but that will come at a later date.

  • As mentioned before, alliances will be an integral part of the game. They will be incorporated into the design of the game. Each alliance will be defined by its respective god (or goddess!). These deities are hostile with one another, and are battling for control of the various contestable territories. Each clan will be under the protection of its god, and therefore you will not be able to attack another clan's home directly. All Clan vs. Clan combat will take place in contested territories. The reason I am designing it like this is because I do not want someone's home to be destructable. If someone destroys your home, I don't think it is fair to force someone to restart somewhere else. This will lead to people either leaving the game permanently, or creating dual accounts to start over. Yes, there are ways around this, but I don't think I will pursue them. So for that reason, there will be designated PvP areas that will contain player-built buildings, and those WILL be destructable. These contested areas are not going to be under the protection of a deity, which is why buildings are not protected.

  • You will be able to contribute resources, intelligence-gathering, innovations, and military might to the alliance you are in. This will (obviously), allow your alliance to have a better chance of survivability against others.

  • Leaders will also be an integral part of the game. A leader, simply put, is you. Standard RPG stats/experience will apply (strength, agility, skills, etc.). Your leader will be able to take other followers into dungeons (PvE) and contested territories (PvP). There will be quests, just as there are in standard RPGs, and they will require dungeon raiding and general PvE combat to complete. This will allow me to provide both PvE and PvP environments.

  • One of my favorite implementations will be PvP and PvE "Call-to-Arms." If you are online during a Call-to-Arms (C2A), you will have the option of volunteering to partake in them. A PvE-C2A will consists of some sort of NPC attack, such as a dragon attack. The goal will be to slay this dragon with other members of your alliance before another alliance does. To the victor cometh the spoils: loot, gold, all the good stuff. A PvP-C2A will involve all alliances being involved in a battle in one place, with maximum carnage to ensue. Again, rewards will be given.

I will be unveiling more as it comes to me, and as it is needed. My next update will be about the actual implementation process.


Welcome to the developer's blog for Vile War, a Persistent Browser-Based Game (PBBG). I will be taking you through the various design and implementation stages of this game. This blog is NOT a programming tutorial in any way, shape, or form. I will, at times, be posting direct code from the project, but the intention of this is to show you a little of what I am doing, as opposed to teaching you how to code your own methods. Staying in touch with this blog will hopefully give you insight as to how to approach various aspects of your own PBBG. Admittedly, this blog is as much for my own purposes as anyone's. It will (hopefully) keep me motivated, and organized.

Most people visiting this blog will already know what a PBBG is. Simply enough, it is a game that is playable in a web browser, and your game is persistent between sessions. In other words, progress you make on one day will be saved until the next you play the game. The benefit of this is that you are able to play a game that never sleeps, but is always there when you want to play it again.

Vile War will contain elements of both RPG (role playing game) and RTS (real time strategy). You will control a hero, as well as a clan of heroes and minions. I will talk more about this in a future update. In fact, this will be the very next update!