Sunday, September 26, 2010

Im Still Alive

I've been playing Halo: Reach so much recently that I have't been able to post much here or work on my game. But, here is a status update for those that care:

I have the graphics and control systems loading properly and actually displaying something and hope to have some screen shots soon of what it can do.

I am currently working on the loading and saving of game worlds for both client and server.

That's all I got done last night, as that's the only time I've been able to work on it now that Halo has finally started getting old.

Saturday, September 18, 2010

Halo Reach

Today I'm going to take a break from programming to review "Halo: Reach".

Gameplay:
-SinglePlayer:
  In campaign mode, Halo Reach is fast paced, engaging, and fun. The story line is one of the best every seen on a Halo game, and the best there ever will be, since Bungie is no longer going to make them. The characters feel real, and you form real emotional connections to them.

-MultiPlayer:
  In multiplayer, the fun gets even better. Bungie went all out in this iteration of the game. Every game type you could want, up to 16 player matches, and an impressive lineup of maps. And, now, matchmaking in both campaign (Bungie has temporarily locked it to prevent "spoilers") and firefight modes.

Graphics:
 Bungie has redesigned the graphics engine for Halo Reach from the ground up to allow them to not only have AA, but also to have huge maps that span miles of terrain. The cutscenes look spectacular in particular and are rendered in the game engine so in co-op you see the player that did the best in the last round as "number 6". But dont worry that your XBox cant handle the AA, because the engine will turn it off if it needs to, in order to maintain a good frame rate.

Controls:
 The new control scheme takes a little getting used to if you didn't use "bumper jumper" in Halo3, but all the classic configurations are available if you don't like the new one. But, no matter which you pick, the controls never feel clunky and there is always a setting that will be comfortable to you.

Overall: 10 out of 10.

Sunday, September 12, 2010

Once again ... C/C++

Today I am going to talk about C++ instead of basic C. C++ adds several new ideas to C, the biggest of which is Object Oriented Programming. Objects are variables (called classes) that contain other variables and/or functions (called members). There are two ways to create an Object: class and struct

Typically, a class contains both variables and functions and a struct contains only variables, though in newer versions of C++ the two are treated the same. Lets create a struct:
struct Account
{
   int Number;
   float Balance;
};
Notice the semicolon " ; " after the ending bracket is required. To access the two variables I created, I would, first, create a variable of type "Account" then you can access the members of the class with the period operator " . ". Like this:
Account anAcct;
anAcct.Number = 123567;
anAcct.Balance = 0.0f; //"f" tells the compiler it is a float type. use "c" for char.

When you create a class, you can specify a "constructor" and a "destructor" that are automatically processed when the variable is created and destroyed respectively. Both are named the same as the class with no type defined though the destructor has a tilde " ~ " before its name. For instance:
class Account
{
   int Number;
   float Balance;
   Account()
   {
      Number = 0;
      Balance = 0.0f;
   }
   ~Account()
   {
   }

   void SetBal(float B)
   {
      Balance = B;
   }
};

To access the functions inside a class is the same as accessing a variable. I.E. I could call "anAcct.SetBal(1300.45f);". If you were to create a pointer to an "Account" object, you could access the members with the "arrow" operator " -> ". Anything referenced in such a way is treated as the real object and not a pointer. For Instance:
Account anAccount;
Account *pAcct;
pAcct = &AnAccount;
pAcct->Number = 9023;
pAcct->SetBal(10.0f);

Inside a class you can even tell the compiler how to handle operators (such as +, -, =, ==, etc.) using the operator keyword.

I've included two files to show the operator keyword in use:
DataTypes.h - the file that defines the classes.
DataTypes.cpp - the file that has the actual code.

And, finally for today, for an object to create a pointer to itself, it can use the keyword this.

C/C++ Part 3 - the sequeling

Last time I talked about Arrays and Loops. Next I need to mention conditional statements. The most common conditional is the if/else statement. The simplest way to show you how to use an if statement is to show you.

int x = 1;
if(x==1)
{
  //Stuff goes here if true
} else {
  //Stuff goes here if false
}

Fairly strait forward. If the condition is true then the first block is processed. If it is not, and you have supplied an else, then the else is processed.

Up until now, as most have commented, C is similar to many newer languages like JavaScript. That is mostly due to the fact that they are based off of C. Now, I will talk about some features that separate it from the rest.

Pointers, for instance, are powerful and fairly easy to use. Pointers contain only the memory address of a variable. Creating a pointer is easy. Simply add an asterisk " * " in between the variable type, and its name. White space is not needed as the asterisk is a special character that cannot be part of a variable name. To create a pointer to an int:
int* Pntr1;
int *Pntr2;
int * Pntr3;

All three are correct. To "point" a pointer to a variable you simply need to use the ampersand " & " character before the name of the variable. Such as:
int Acct;
int* pAcct = &Acct;

And, finally, to treat the pointer as if it were the original variable, use the asterisk again before the pointer name. For instance:
int Acct;
int* pAcct = &Acct;
*pAcct = 5;

In this example Acct will be set to 5 and the pointer will remain unchanged. In C the most common use of pointers if for whats called a "C-Style String" which is simply a pointer of the type "char". Strings, of any type, are able to store lines of text as an array of chars terminated by a " \0 " (a special character with a value of 0).

To use strings, and other special types, you will next need to know about the #include statement. #include is a pre-processor directive meaning that it is processed during the compile process (when the compiler turns the code into a program). Pre-processor commands are all independent of the program you are making and, in fact, will not be part of the final product. There are only a few commands and the ones you will most need are:

#include - includes a file.
#define - creates a pre-processor variable used both in #if statements and in the C code
#if - operates mostly the same as a normal if statement
#ifdef - if a pre-processor variable is defined, then the following code will be compiled.
#ifndef - if a pre-processor variable is NOT defined, then the following code will be compiled.
#else - if the last #if command was false then this code is used instead.
#elif - same as an #else except it also includes its own condition.
#endif - ends an #if statement's reach.

The rest can be found here as well as some other interesting info. I am not going to go into detail about C include files but most of them can be found here.

Next time I am going to talk about C++ which adds many new things.

Saturday, September 11, 2010

C/C++ Continued

If you haven't read it yet, my first C tutorial should be read first by beginners. Last time, I talked about some basics of C. This time, I will talk about some more slightly advanced topics.

Lets say, you wanted to store one hundred account numbers in your program. To do this with normal means would mean typing out:
int Acct1, Acct2, Acct3, Acct4; //And so on ...
// Yes, you can define more than one variable at a time.
Needless to say, this would take a long time and you would have to reference them all separately. This is the reason we have arrays. An array simply is a simple way to store a lot of data within only one variable. To create an array holding 100 int variables, you would simply do this:
int Accounts[100];
Then to call a position in the array you would do this:
Accounts[0] = 2884756;
Arrays will always start at 0 and end one position less than the number you typed originally. In this case I typed 100 so the array indexes are from 0 to 99.

Since you can call a position on an array with a number, you can simply insert a variable holding a whole number inside of the brackets " [ ] ". (char, int, short, or long) This allows for much more versatility than having to specify each time which variable you wanted in your code. For instance, Lets say I wanted each number in the array to be set to 0. You could do the following:
int Accounts[100], x;
for(int x=0; x<100; ++x) // I'll talk about this in a minute.
{
    Accounts[x] = 0;
}
Or to make it simpler, when you create an array you can set a default value by using the curly brackets "{ } " around a value. Like this:
int Accounts[100] = {0};
You can also set all values by separating with a comma like this:
int Abc[3] = {1,2,3};

Now, in the last example I used a new command called for. for is one of the loop types available in C (as well as many other languages). for takes 3 parameters broken down into 3 steps: Initialization, Condition, and Increment.

Initialization is processed only once before the loop starts. (In the example, creating a integer variable "x".)
Condition is checked every time the end of the loop is reached. (In the example if x is less than 100.) If Condition is true, the loop repeats. If it is false then it doesn't (or breaks).
And, finally, Increment is processed every time the loop repeats. (In the example "++" causes the variable x to increase by 1. It is the same as typing "x=x+1")

Other types of loops are:
do while - 1 parameter; Condition. The do while loop always processes the first time regardless of the Condition statement. Use:
do {
   //Stuff goes here.
}while(x<100)

while - 1 parameter; Condition. Use:
while(x<100) {
   //Stuff goes here.
}

In all of these, the condition statement must return either true or false. This, in C as well as other languages is called a "Boolean" statement. To get this you need one of the Boolean operators:
== (equal)
!= (not equal to)
< (less than)
> (greater than)
<= (less than or equal to)
>= (greater than or equal to)

Wednesday, September 8, 2010

C/C++

For today's topic I figured I could teach a little C/C++.

If you already know the language, then this will seem very boring. This is designed for those who know nothing about C/C++.

To begin, C++ is just an extension of C that adds functionality. So to learn C++ you need to learn C first. In both, everything is case-sensitive which means that something named "ABC" is not the same as "abc" or "AbC". All are unique names.

In C, each command is followed by a semi-colon " ; " signifying the end of the command, and extra spaces, tabs, and line breaks (collectively called "white space") are ignored. So, you could put multiple commands on the same line if you wanted.

I.E. the line:
a=3;b=1;c=a+b;
is the same as:
a=3;
b=1;
c=a+b;

But, for simplicity and to make it easier to debug (find and remove problems) you'll want each command on a separate line. You can also create segments of the code that the compiler (what turns the code into a program) will ignore by using a double backslash " // " (which will ignore everything after it on the same line) or by using backslash-star " /* " to start and star-backslash " */ " (which can span multiple lines) to end. These are called comments because they are commonly used for explaining what your code will do in a section.

So we could have written the above code like this:
a=3; //This part is ignored
b=1; /* and so
is this */

c=a+b;

In C, code can be separated into sections called blocks by using the curly brackets " { " and " } " to open and close a block respectively, and each command that you create (function) will need to have a block of code directly following it's name. So, lets create a function shall we:

int Add(int a, int b) //int is a variable type I will talk about in a second
{
  return a+b; /* "return" causes the function to exit with the value that follows it (must be the same type the function is defined as) */
}

Now, I introduced several new things in this so lets review them. First, a function is created by first calling the type of variable the function will "return" followed by its name and a set of "parameters" inside of a set of parenthesis " ( ) ". When you call this function later you simply use the name you provided and fill in the parameters you want (I.E. you could call "Add(1,2);" and it would return "3".

Variables are the places where you store data. When you create a variable you define its type followed by it's name. In our example above we created two variables in the function declaration: int a and int b

int is a variable type that holds a single number (if your on a 64 bit system its range is from –2,147,483,648 to 2,147,483,647). int by default is signed meaning its first bit tells whether it is positive or negative but this reduces its maximum value by about half. If you wanted it to not contain this sign bit, you could call it as unsigned int.

The unsigned keyword changes a variable that is default "signed" to be unsigned. the signed keyword does the opposite.

Other data types are:
void - holds no data at all. (used later)
bool - holds a single bit. (true or false)
char - holds a unsigned number 1 byte long. (0 - 255)
short - holds a signed number half the size of int
long - holds a signed number twice the size of int
float - holds a signed floating decimal point number (1 of 2 only default types that can contain a decimal)
double - holds a signed floating decimal point number twice the size of float (also called double precision)

in C those are the basic types. You may have noticed that they all only contain numbers. "Well how do you store text?" you might ask. The char type can contain a single letter as well by placing single quotes around it. Such as 'a' would contain the number corresponding to "a" (or 61) in ASCII. To store more than one letter you need an "Array" which I'm not going to talk about this time. (next C lesson maybe)

That's enough basics for now. I'll continue with more later.

Until next time. Have fun.

Edit: I forgot the double var type.
Edit2: I forgot the bool and void types as well.

Monday, September 6, 2010

Prayer Vs Work

In my youth I was promised that as long as I was a good person, God would help me when I needed him. But, I always asked, "Where was God when my mother had lost both of her kidneys? Where was God when my father couldn't find any work? Where was God when my mother died?" and, yes, my family was religious and all prayed for help.

Now some of you christfags will say "It was God's plan" but that doesn't mean anything when you also say that if you pray, God will help you. If God just follows his plan, then what is the point of prayer. Because, if you pray, and you believe, God says he will help you. But, if it was part of God's plan, then he wont help even if you pray.

Therefor, even to christfags, prayer does nothing.

Or let me ask another question:
Can God create a rock so heavy not even he can lift it?

If you answered yes, then you just said God can't lift that rock, and is therefor not omnipotent.
If you answered no, then you just said God can't create that rock, and is therefor not omnipotent.

And, if God is not omnipotent then he is not God.

Saturday, September 4, 2010

Another Day ...

and nothing new to report on so how about random wallpapers.

Friday, September 3, 2010

Duke Nukem Forever

Wow! Duke Nukem Forever, for those not in the know, has been long, long, long, long awaited ever since Duke Nukem 3D that came out on the N64. And now, thanks to Gearbox (the makers of Borderlands), there is a playable demo at PAX and it will be coming out in 2011.

Wednesday, September 1, 2010

Oh Noes It's Teh Furriez

Today I figured I would link some of my favorite places to visit (and usually do so once a day)

(WARNING: some of these are not work safe)
Do Not Click any Red links unless you are 18 or over.

First we have Web Comics:
GUComics - started as an Everquest only comic, he now makes fun of all games and gaming news
WTFComics - a long standing comic following the adventures of a few characters in Everquest.
Housepets! - funny furry comic following a few anthropomorphic house pets.
Original Life - Jay Naylor's newest comic. (not everything on site is work safe)
House of LSD - (Not Work Safe) 3 girls start up a porn company.

I also have a few other things I regularly view:
Knotcast - Furry relationship podcast (Not Work Safe)
Fur Affinity - (mostly work safe until you have an account and tell it to show adult content) a place for furs to share art mostly.