Archive for the ‘Uncategorized’ Category

My Problems with SWTOR PvP

Posted: February 14, 2012 in Uncategorized

I will preface this post by saying that I love SWTOR PvP. The combat is very dynamic and interesting. The moves are fun (at least on a Mercenary) and overall the combat system was pretty well thought out.

That said, most if not all MMORPGs have the problems when starting out. SWTOR is no exception. Below, I will describe what I find wrong with SWTORs PvP system overall (including the gear progression, dailies, etc.)


I have talked about my dislike of Ilum previously (in this post), but I needed to mention it. I will not go in depth into what I find wrong with Ilum (as I did that in the post linked), But I will list some of its problems:

  • Boring/Frustrating Daily
  • Kills not counting toward your daily count
  • Almost always empty on low pop servers
  • If not empty, the population is severely skewed towards one side.

Getting Gear

Getting the PvP gear in SWTOR can be very frustrating. The system itself is overly complicated, with a total of five different commendations that you can trade for gear, only 1 of which you earn through Warzones. You earn Warzone commendations, which you can then trade for Mercenary commendations (30 Warzone per 10 Mercenary). You use Warzone and Mercenary commendations (200 of each) to buy champion bags. These bags drop Centurion and Champion commendations (15 and 7, respectively) and have a low chance to drop tokens which you can trade directly for gear. The Champion and Centurion commendations can also be traded for gear. The last type is Battlemaster commendations, which you can use to buy Battlemaster gear. These are a rare drop in Battlemaster bags (kind of like the Champion tokens) which you can only get from the two PvP dailies (collect 30 armaments/kill 30 enemies in Ilum, and win 3 warzones). Battlemaster bags also drop Champion commendations (15 each). That was a mouthful! If it takes me an entire paragraph to explain the loot system for PvP, then its probably a little too complicated!

One of the biggest problems with this system as well, is the randomness. I (and many others) are ok with having a long grind to get PvP gear, but random number generation has no place in PvP gear progression. Before the latest patch (which changed the system to the above. Before Champion bags only have 3 Centurion Commendations, and Battlemaster bags only gave 3 Champion commendations) it was even worse, as people relied on the random tokens to get their gear. This resulted in people being lucky and unlucky, with some players getting 3-4/5 of the champion set in a few days, while some still only have 2 pieces after nearly a month. You could also get duplicate tokens, resulting in many people never getting the chest and head slot, but having 5-6 boots or gloves. I, for example, have full Champion/Battlemaster gear, except for my main hand weapon.

Bioware could easily make the system  a lot simpler, while keeping the gear progression grind. For example, if they simply restricted Champion PvP gear to those with champion valor rank (50), and allowing it (as well as Centurion PvP gear) to be brought with Warzone commendations (and/or mercenary commendations if they must), the grind changes from grinding bags and hoping to get lucky, to grinding valor. This is how Battlemaster gear works anyways, since you have to be valor rank 60 to wear it! It could take the same amount of time (or potentially longer) but people actually have a tangible goal they are working towards. Centurion gear could be available to everyone, regardless of rank, so that level 50’s below rank 50 don’t get abused by those with gear. They also would avoid the gear gap between fresh level 50s, and those with good gear, since Centurion armor would be fairly easy to purchase. And, this would simplify the system to two types of commendations.

The Various Exploits and Bugs

I’m sure Bioware is working on this very hard, but there are still many bugs and exploits that is really killing PvP. For example, the bug where you get logged out of game upon entering a Warzone, or the bug where Warzone wins don’t count towards your daily. The most irritating things are the exploits. There are exploits where you can get more than 8 players on your team. There is also a Jedi Sage exploit/hack which leads to the player doing insane damage. Exploits like these absolutely need to be fixed as soon as possible, or many people will quit.

Server Imbalances

Most servers have a population imbalance favoring Imperial players. More people have simply joined Imperials rather than the republic. This is one of the main causes of the problems with Ilum, but it also has more negative effects on the PvP. If you are an imperial player, Warzone queues can take forever at level 50, and about 90% of the Warzones played are Huttball. These problems can be fixed multiple ways. The way I hope they will fix it is by allowing free server transfers, and merging some of the low population servers. What will most likely end up happening is cross server Warzones. I am against cross server Warzones personally. I’m not going to get into my reasoning in this post (as that deserves a post of its own) but the gist of it is that cross server Warzones really take away from the server community.

Overall, while SWTOR PvP is fun, these things (among other more minor issues, that could be considered under glitches or bugs) are really ruining the experience. I hope Bioware is able to fix these problems soon, so we can all go back to enjoying the heck out of the PvP!

This is the final article in a 4 part series on starting your first Unity project. This article will provide some basic scripts that are common among different genres. These are meant to be a starting point, and by no means are they complete.

Basic Movement

The following code moves an object by 1 unit in the x or z direction. It is very simple, but can easily be expanded. You can change this to work on a speed variable, and easily add acceleration or other basic physics.

if (Input.GetKeyDown("a") || Input.GetKeyDown("d")){
 deltaX = (Input.GetKeyDown("a")) ? -1 : 1;
if (Input.GetKeyDown("s") || Input.GetKeyDown("w")){
 deltaY = (Input.GetKeyDown("s")) ? -1 : 1;

transform.position += new Vector3(deltaX,0,deltaY);

This simpy uses the GetKeyDown function of the Input object to determine if the a, d, s, or w key is pressed, and if so act accordingly. Note, that GetKeyDown is only true on the frame that the key was pressed. If you want to check if a key is pressed, disregarding whether it has been pressed for a while or was just pressed, use GetKey instead.

Programmatically Instantiating Objects

Sometimes we need to instantiate different objects programmatically, rather than in the Unity editor. This is especially true for things like bullets, and enemies. Now, there are many different ways to instantiate something, but I will go over the basic methods. You can easily instantiate a primitive object (like a sphere, cube, or plain) or a model.

One way to instantiate your own models, is to create a reference variable (like we did in part 2 with inter script communication) and drag the object you want to instantiate onto your script in the inspector panel. Once you do this, we can do the following

var objectTransform : Transform;//reference variable to model


var temp : GameObject = Instantiate(objectTransform, transform.position, Quaternion.identity);

This create whatever object you want to create at the location of the GameObject that has this script. You can of course change the location. The Quaternion.identity part is for the rotation. Rotation is stored at a Quaternion in Unity, and the identity Quaternion is essentially no rotation.

Tracking Points/Cash/Etc.

Tracking points is a fundamental part of most games, but can be somewhat tricky if you have a lot of different way to gain points spread across different scripts. The best and simplest way to keep track of points is to have a single script in charge of keeping track, adding and subtracting points, and setting up methods as interfaces that other functions can use. For example, we could do something like

//point tracking script: PointTracker.js
private var Points = 0;

function AddPoints(x){
 Points += x;

function RemovePoints(x){
 Points -= x;


if (/*player did something awesome*/){
 var pt : PointTracker = GetComponent(PointTracker);

However, this is more or less the same as if we just used a public variable. Changing the behavior of similar actions that generate the same amount of points would be tedious. However, we could use a system like the following

//point tracking system: PointTracker.js

private var Points = 0
enum PointType{ small = 50, medium = 100, large = 200 }

function AddPoints(type : PointType){
 if (type == PointType.small) Points += 50;
 if (type == PointType.medium) Points += 100;
 if (type == PointType.large) Points += 150;
function Remove(type : PointType){
 if (type == PointType.small) Points -= 50;
 if (type == PointType.medium) Points -= 100;
 if (type == PointType.large) Points -= 150;



if (/*player did something awesome*/){
 var pt : PointTracker = GetComponent(PointTracker);
if (/*player did something even more awesome*/){
 var pt : PointTracker = GetComponent(PointTracker);

This way, if we want to change the rules for how small point gains work, we only have to change it in 1 place, rather than many!

Basic Timing

Timing in games is very important. Unity provides you with a Timing class called Time, that we can use whenever we need to count something. For example, if you want something to happen every 5 minutes, you would need to do timing. Lets take an example. Say I want to print a message every 5 seconds. I could do

//print a message every 5 seconds
var lastPrint = 0;

function Update() {
if (Time.time - lastPrint > 5){
 print("A message printed every 5 seconds!");

Another, more practical example may be if I wanted to add something like a bullet delay.

//add 1 sec shooting delay
var lastShoot = 0;

function Update() {
if (Time.time – lastShoot > 1 && if (Input.GetKeyDown(“space”)){
//code to shoot a bullet in game


That ends the four part series in starting Unity. If you have any questions, leave them in the comments below!

This is the third part in a four part series about starting your first project in Unity. This post will focus on GUI programming, and more specifically, a simple state based system. GUI programming is a rather broad topic, and so I will not be going over the more advance topics. I will not be going over similar topics like GUI styles, but rather the scripting involved with GUIs. There are many good GUI tutorials online, and there are even  a few on the Unity3D website!

State Based System:

This is a system (sometimes referred to as a Finite State Machine) where a program (or machine!) operates differently, depending on the different states it could be in. This type of system for a menu is perfect, for it allows us to neatly and efficiently show different screens and menu items depending on the state.

This system can be very simple, or rather complex depending on how complex your game is, but they all have certain similarities. They all depend on some variable or value that represents some state. Sometimes its an enum, sometimes a boolean, and sometimes an int. In my example, I will be using a boolean value. Before we get into a

GUI in Unity

Unity takes a step away from the normal GUI model in a very unique but elegant form. Instead of the general pattern or setting up some sort of GUI element, than setting up some sort of listener for it, and acting on events. Instead, Unity combines the creation of the GUI element, with its listener. Using an if statement, you can both check if, say, a button is being clicked. GUI elements are reserved to execution in an OnGUI() function. this function is called every cycle (like Update) and you should put all GUI related code here. Consider the following:

//All of this takes place in an OnGui() function
if (GUI.Button (new Rect(50,50,70,20) "Ok!")) {
//create a button
//if its pressed, we go into this code block
print("You pressed me!");


Other GUI elements (like Boxes and labels) can simply be created without any if statements, like so:

GUI.Box (new Rect(150,150,300,500), "Box text. Use new lines \n to go to new lines!");
GUI.Label (new Rect(150, 700, 300, 300, "Label Text");

Introducing states to this model is trivial. All we need to do is keep track of the right variables. I will show an example with two states, but you can add more states at your leisure.

var MainState = true;
var OtherState = false;

function OnGui(){
 if (MainState){
 //we are in the main state.
 //show button to go to other state
 if (GUI.Button (new Rect(50,50,100,20) "Other State!")) {
 MainState = false;
 OtherState = true;
 else if (Other State){
 //we are in the main state.
 //show button to go to other state
 if (GUI.Button (new Rect(50,50,100,20) "Main State!")) {
 MainState = true;
 OtherState = false;

As you can see, we use two variables, MainState, and OtherState, that we use to keep track of what state we are on. We could alternatively use an enum, 1 value for every state, and have one variable which we change the value of once. This way, we don”t have to remember to set every other state to false. However, this assumes that we only want one state active at a time. There are some times (like when we are showing the user an alert style message) where we don’t need or want to remove other GUI elements, like the main GUI toolbar, or something of equal importance.

To end this article, I will also provide the code for a helper function I have been able to make good use of. It basically returns a rectangle that can be used in a GUI function call centered in the middle of the screen.

function Center(w:float,h:float){
 //halve height and width
 var h2 : float = h/2;
 var w2 : float = h/2;

 var x : float = ScreenCenter.x - w2;
 var y : float = ScreenCenter.y - h2;
 //print (x + " " + y);

 return new Rect(x,y,w,h);

Click here to see the final entry in this four part series:

This is part two of a four part series detailing starting your own game. I will talk about actually creating the game, and how to think about coding  your game features. This tutorial is geared mostly towards Unity, but the concepts can be applied to any game engine! The first part of this article well focus on concepts behind the creation of your game, specifically on game mechanics. The second part will get in the nuts and bolts of coding. The fourth part of this series will have some code examples of common basic game functions.

Creating the game

When creating your game, regardless of the genre, the first thing you have to think about are your game features. How will your game function, and what mechanics will the player interact with? For my game, the core mechanics rest of simulations and AI. Basically, the player provides the stimulus, and the game reacts to it. In many other genres, the game provides the stimulus that the player reacts to, like shooting at an enemy, and bouncing a ball. However, these mechanics are often built upon many simple mechanics. These “micro” mechanics are what make up the different mechanics of a game, and these are where you should start.

Deciding on Core features:

The first thing a developer should do when creating their game is make a list of core features that they want in their game. For example, in a platformer, one may want to focus on movement and jumping. Someone creating a building game (whether a classic RTS, or city sim, or combination) may want to focus on spawning buildings (at a mouse click, or at a certain position) first. These would be the micro mechanics that make up that larger more general game mechanics. Once you create this core functionality, you can add to it without worrying about disturbing the underlying functionality. They key to doing this is making sure that you thoroughly test the core features, and make sure they are done well! Unity’s unique development environment makes incremental development like this a breeze, and you don’t have to go through the hassle of compiling and recompiling your assets over and over again.

Modular Development

Because of the unique environment Unity offers detailed above, developing different aspects of your game as if they were different modules and an easy and effective way to get your game done! Different scripts that create different functionality can be kept separate, and turned off at will. This also makes debugging very easy. Separate game mechanics can be their own GameObjects, composed of various scripts, sounds, and other things that make make up the micro mechanics. Unity’s use of Object Oriented programming also adds support to modular development, as well as the availability of prefabs. I will discuss prefabs in more detail later..

Importing Assets

One thing I haven’t touched upon yet are the visual assets of your game. Importing these, as I said earlier, is extremely easy, but I thought i’d give an overview of your process.

Whether you are importing textures, models, music, or entire prefabs to your Unity project, you simply follow these steps:

  1. Make sure your Unity Project is created, and navigate to “Assets” folder in your projects root directory
  2. Either Copy and Paste your assets to the correct folder inside the Assets directory, or save the image/model/sound/etc. directly to correct folder inside the Assets directory
  3. Open Unity and your asset should be imported!

Thats it! Simple as pie

Writing the Code

The first decision to make when you start to write code is what language to choose. While I haven’t used to Unity flavor of C# much, I find this topic worth talking about. Javascript in Unity has whats known as type hinting, which is a solution for when you want to take advantage of typing, without having to use typing at all times. Unlike C#, which is a statically typed language. This makes getting into Javascript much easier, and with all the libraries supplied by Unity, Javascript is just as robust as C#. However, at times I wish that I had chose C# instead of Unity. the dynamic typing sometimes run into strange problems. Many of these problems can be fixed with clever use of type hinting, but these solutions aren’t readily apparent. C# bypasses these problems by virture of being statically typed. C# also has various programming language features that Javascript doesn’t (like operator overloading, explicitly passing by reference, etc.). I am also starting to run into typing problems with my user defined classes. While I have been able to overcome these problems, at times I envy a statically typed environment. Whether you would like to take advantage of arguably quicker and easier development times versus more stability in terms of typing and other aspects of the language, sticking to one language certainly makes development easier. You can write in 2 (or more) different languages (Unity also has Boo, which I won’t get into) but it slightly complicates the development process.

Getting Different Scripts to Talk

One of the early hurdles that any game developer using Unity will run into will be getting different scripts to communicate with each other. Certain information (like a users life, held inside the script that controls the user’s different stats and attributes) will be needed by certain other scripts (like the combat script, or AI script). Luckily, Unity makes it easy for different scripts to talk!

GameObjects: To understand how Unity has each individual object communicate, it helps to understand how things work internally. Everything in a game is a GameObject. These GameObjects can be empty, or composed of what Unity calls components. Components can be scripts, mesh colliders, and other various generic objects that have a variety of functions. GameObjects can also be composed of other GameObjects (which would become children of the base GameObject). GameObjects, in code, are a class, and thus have certain methods and attributes. Of interest to us will be a method called GetComponent, which returns an object that represents the component of a specific game object. This component could be a sound (or AudioSource), or a script, or any other component. What we’ll be mostly doing is grabbing other script components.

Now, there are several ways in which we can get another script that depends on where exactly this script resides (or rather, what GameObject is this script a part of). There are two cases here.

The first is if we have two scripts wanting to communicate in the same game object. To communicate, we simply call the GetComponent method, and use the scripts name (case sensitive) as an argument. Consider the following:


var Points = 0;
var health = 100;

function Update(){
 //called every cycle
 //do walking and other character related stuff.

This could be a script that holds all the actions and information a player object has. Another script, Script2, could be in charge of some other unrelated function, like gathering and computing stats to be displayed

function Update() {
 ... gather other metrics ...
 //we want to display the points
 //first we grab the component script, titled Script1
 //the colon lets us use type hinting, to tell javascript what type is going into this variable
 scriptObject : Script1 = GetComponent(Script1);
 points = scriptObject.Points;//we can access the scripts variables just like any other objects attributes

 Display(points);//Display() is some helper function, perhaps communicating with some GUI script
 ... rest of logic ...


You can infer from above that if you call the GetComponent method without an object reference attached to it, GetComponent gets called on the GameObject that the script is a part of. If you want to get a script (or other component) that is part of a different GameObject, you need a variable to reference that GameObject.

Now there are several ways to get access to a GameObject, many of which are explained here: I will go over the simplest method, using a reference that you can set up in the inspector view (part of Unity’s GUI).

The first thing you do, is add a variable to the script you want to do the communicating with. In the case above, If Script1 and Script2 were instead part of different GameObjects, I would add this variable in Script2, since its the one that queries Script1 for its data. This variable will be a reference to the GameObject that contains Script1. Lets say that this GameObject was called player (and we could call the GameObject with Script2 ScoreKeeper). Assuming these GameObjects already exist in your Object hierarchy (lower left side in most Unity setups), in Script2, we add a variable called, say, player, like so

var player : GameObject;

function Update() {
 ... gather other metrics ...

Now, we need to go object hierarchy, and select our GameObject called ScoreKeeper. We will then select Script2 in the inspector panel (there should be a slot for our newly added variable added), and go back to the hierarchy panel and drag the Player GameObject on to the player variable in the Script2 component. Once we do that the link is made! Now we can go back into Script2 and change it to the following

var player : GameObject;
function Update() {
 ... gather other metrics ...
 //we want to display the points
 //now we use the player GetComponenet method on the player GameObject, rather than the current scripts GameObject
 scriptObject : Script1 = player.GetComponent(Script1);
 points = scriptObject.Points;//we can access the scripts variables just like any other objects attributes

 Display(points);//Display() is some helper function, perhaps communicating with some GUI script
 ... rest of logic ...


Now regardless of what object we call GetComponent on, we can use the resulting object to call methods, just like we use it to get public attributes. So for example, we could do

function Update(){
 otherscript : OtherScript = GetComponent(OtherScript);
 var othervalue = OtherScript.OtherMethod();

Separate Functionality: Because of the ability to communicate between scripts, separating out functionality, and making different interfaces (like methods and attributes) for two scripts to interact further aids the modular development I discussed above.

AI Basics: 

Writing AI can be a very difficult but rewarding experience. Depending on how complex your game is, you may need fairly complex AI, but many times you can, at least temporarily, get by with simple AI. For example, when developing the various AIs that control various city and building properties in order to see how they interact with each other in a timely manner, I started with very basic simulation. For example, originally, simulating happiness was only  based on the amount of water resource available. Now it is a function of many different city properties! AI is a vast and complicated subject of its own, so I won’t talk much more on it until a later article.

View the third part of this series here:

view the first part here:

I am a frequent forum goer to the website (My username is Mikesta707), and one thing I see a lot from PHP novices is a question like

Hey, I am trying to echo a string, but it doesn’t look right. I’m using a variable and but instead of its value all I see is the php code! my code looks like

$str = "Poop";

echo 'I have to take a $str';

please halp!

Now, anyone who has uses PHP at an intermediate level or higher will tell this hypothetical novice to either use double quotes, or concatenate. The solutions would be as follows

$str = "Poop";

echo "I have to take a $str";//double quotes

echo 'I have to take a ' . $str;//concatenation

And of course, their error will be fixed, and they can go on their merry way, or post about another problem they have. In addition to the above solutions, one could also use heredoc syntax, but that is generally reserved for multi-line strings and can be a little complex for a new programmer. Many forum posters wouldn’t bother even mentioning it.

Anyways, what many posters fail to do in these cases, is explain why what they wrote failed. As a result of this, even people who know to use double quotes or concatenate will often not really know why you have to do that, beyond “uh.. just because man.”  In my experience as a forum poster for phpfreaks, I see a solution that concatenates rather than using double quotes more frequently, and this produces a very interesting effect.

Concatenation is simple enough, and easy to rationalize the use of without wondering why you were wrong. Without knowing about the use of double quotes (or simply not realizing), one may naturally assume, after having the above problem and being told to concatenate, that they can’t put variables inside strings.

This is half correct, as it is true with single quotes, but incorrect in terms of double quotes. This can lead an overall assumption that if you want to create a string that is composed partly of one or more variables, then you must always concatenate. Over the years I have worked with quite a few developers who have been looking over my shoulder while I am writing some code, and told me, “Hey, you gotta concatenate there!” or something along those lines when using double quotes. Usually this will come with the look of quiet satisfaction at having corrected (or thinking they corrected) a fellow coder’s mistake.

Unfortunately, because of this assumption many people miss out on one of my favorite features of PHP called Interpolation,  as well as having a somewhat faulty understanding of how strings work in PHP. For those who don’t know, interpolation is defined by Wikipedia as the following:

The process of evaluating an expression or string literal containing one or more variables, yielding a result in which the variables are replaced with their corresponding values in memory. It is a specialized instance of concatenation.

Now this basically means that when you put a variable inside of a string, PHP does a sort of replace, where the name of the variable (say, $str) is replaced with its value (say, “Poop”). PHP supports interpolation, but only when using double quotes or the heredoc string syntax. To take a simple example:

//The following are all equivalent
$n = "Mike";
echo "Hi i'm $n";//interpolation
echo 'Hi i\'m ' . $n;//concatenation
echo <<<EOT
Hi i'm $n
EOT;//heredoc syntax

As I said earlier, Interpolation is one of my favorite attributes of PHP. Interpolation isn’t supported in many languages (Perl, Tcl, Ruby and most unix shells are the others). PHP uses a sigil, or a symbol attached to a variable to show its a variable (and not a global constant), unlike many languages (including C, C++, C#, java, javascript, etc.) so interpolation is possible. Interpolation really makes creating strings that would be complex or look ugly in other languages easy and clean. Lets compare two strings, one in PHP and one in C++/C#/Java/ect…

//assume we have created 3 variables, $a $b and $c in PHP, and a b and c in C++

//PHP string
$str = "The first 3 letters of the alphabet are $a $b and $c";

//equivalent string in C++/C#/java/etc...
//assume we have the proper header includes
string str = "The first 3 letters of the alphabet are " + a + " " + b + " and " + c;

As you can see, the PHP version is much easier on the eyes, and much nicer to write! Of course, most languages that don’t support interpolation have a specialized form of interpolation in function form using string formatting (for example, printf() from C/Lisp).

To sum things up, I absolutely love interpolation, and think its one of the most amazing features of PHP. Its a very simple feature, but elegant at the same time, and extremely useful. Out of all of PHP’s amazing features, I know that I use this one the most. I love interpolation so much actually, that I plan on writing a part 2 to this post very soon. It will probably be a tad bit shorter, but will have some good information.

Part 2: [Click me]

Links of Interest:

String parsing (Interpolation):

Single quotes:

Double quotes:


Interpolation (Wikipedia):

Hiatus Over

Posted: September 28, 2011 in Uncategorized

Hello everyone. As you may have noticed, I took a rather lengthy break from posting on my blog. I have been very busy for the past month or two on various projects that I will elaborate on at a later date. I have some pretty exciting news to share in the next few days so stay tuned!

Well google has created a new feature for Google+ where you can invite people with a simple link! This makes inviting friends and other people much easier! Unfortunately, since Google+ is still in development, there is a 150 person cap per link. If anyone wants to try out Google+, go ahead and use the link below. Remember, I only get 150 people, so sign up fast! Don’t forget to add me to your circles! I regularly post my latest blog posts on Google+. Link below:

If you get that too late, and really want an invite, leave a comment below and i’ll see what I can do