GameProgrammer.org
tutorials for dummies bug source let me google it for you my blog all about me
Quest of Persia, Nader's Blade
Here's a video clip I have made a while ago for the project I was working on as the lead programmer, or let's say the only programmer!

The sad thing is that I couldn't beat my own created AI! well it wasn't fair I had way less friends than the number of my enemies, and my special tricks couldn't help me win!

Posted on : 16 Jan 2010
Vahid Kazemi
0 Comment(s)
NVidia 3D Vision, does it work?!
NVidia promised to bring the ultimate 3D stereoscopic experience with GeForce 3D Vision technology. Of course there's always a price to pay, you aren't able to enjoy stereo 3D with your regular LCD monitor, and you're stuck with a few options one of which is a 22' LCD monitor from Samsung.

SynchMaster 2233RZ provides a maximum of 1680x1050 resolution with an impressive 120Hz refresh rate frequency just enough to provide each eye with standard 60Hz suitable for real-time rendering. The shutter glasses provided by NVidia gets synchronized with the monitor's refresh rate using a wireless IR transmitter which is connected to your PC with a USB cable.

NVidia Graphics Drivers handle everything internally without the developer worrying about the stereoscopic rendering. The driver uses a heuristic approach to find the appropriate vertex shaders and manipulates the shader code submitted by the application to create two individual images one for each eye. This is of course reasonable because NVidia wants to support all the games even those that weren't intended for stereoscopic rendering, but it's disappointing that there isn't a manual mechanism for the developer to take control of the system.

Ignoring the developer's concerns we come to the question for the end user does NVidia 3D Vision product really work?!

The answer is simply: No! It does not work for any practical use. I am so disappointed from NVidia's choice of technology, and even worse releasing the product that is absolutely useless. Yes you will see the 3D objects coming out or going deep into the monitor, but it doesn't take long until you will sense a weird feeling of pressure on your eyes and you start to get a headache.

Does it mean that stereo 3D doesn't work at all? Not true, the technologies provided by IMAX and Real-D for digital cinemas work absolutely perfectly and that is because each of your eyes will see a continuous independent frame in any moment, but NVidia's shuttering system works pretty much like old CRT monitors with low refresh rate frequencies. I could live with it at the time, but I can't bear getting back to it in 2010!

Posted on : 30 Dec 2009
Vahid Kazemi
0 Comment(s)
Best Games of 2009!
Here I want to list the best games of 2009 in my experience! Well I don't have an XBox 360, so this is ganna be biased towards Sony a bit. But anyway here it goes:

#1: Uncharted 2: Among the Thieves
This is an awesome must play game developed by Naughty Dog for Playstation 3. I was impressed by the the amount of effort they have put on small details in this game. At the end every single moment of this game is exciting and it doesn't get boring at all. It's a bit short for 60 euros I've paid for it but considering the multi-player component it pays off the price.

#2: Call of Duty: Modern Warfare 2
Stunning Graphics, awesome gameplay, and a not so clear story made this game #2 of my favorite games of 2009. This is perhaps the best multilayer game so far.

#3: Killzone 2
Killzone 2, the first person shooter game developed by SCE, delivers almost whatever you would expect from a PS3 game except one BIG problem! The problem is you have to hold L3 on PS3 controller to run and it really SUCKS!

#3: Assassin's Creed 2
Whatever you have expected from the first version is delivered in this one. The only disappointment may be is that the graphics is exactly the same as the first one which was of course great, but you always expect something new in a new version!

#4: Resident Evil 5
I am a fan of the series, so I like every resident kind of evil, but this game is really great. The graphics is great, and it has a story that keeps you playing, although the gameplay is pretty much the same as RE4.

#5: Prototype
I like games with story but this game's gameplay is so good that you don't need an story to keep playing. I mean what could be possibly more awesome than consuming zombies in the streets of New York City?

Posted on : 27 Dec 2009
Vahid Kazemi
0 Comment(s)
Uncharted: Drake's Fortune
This game is released for quite a long time now, but I got it yesterday and finished it today a couple of minutes ago, and here I am telling you how great the game was! Well I should say I was a bit disappointed that the game doesn't have a multiplayer mode, but on plus side the game has one of the best graphics I've seen so far on PS3, it has a smooth gameplay, the story is good and there's just enough cut-scenes to keep you motivated to continue playing, and I should add once I started playing the game I couldn't stop until the end.
Posted on : 24 Jun 2009
Vahid Kazemi
0 Comment(s)
Flash Tetris
Recently I started to learn a little bit of flash programming! Actually it's really fun, for the start I've created a 3D Tetris game but may be soon I create a flash section in GameProgrammer.org to put some more of my flash works.

Use [Arrow Keys] and [Space] to play!

Posted on : 09 Feb 2008
Vahid Kazemi
0 Comment(s)
It's all about performance!

Writing an effective code is one of the most important and challenging responsibilities of a game programmer.

High-level programming languages like C++ hide a lot of things from the programmer that you can hardly guess what exactly would your compiled code look like. A simple call to a function in C++ could generate dozens of lines of machine code, but you don't need to care because your CPU can process billions of lines of machine code in a second, but when it comes to video game programming everything changes. To achieve real-time frame rate you have only got fractions of a second to process thousands of objects and millions of polygons.

A simple optimization technique that I want to talk about here is about memory allocation and deallocation of fixed multi-dimensional arrays. Here is a simple code to allocate and free a two dimensional array:

// allocate
T **data = new T*[sizeX];
for(int i=0;i<sizeX;i++){
    data[i]=new T[sizeY]
}

// free
for(int i=0;i<sizeX;i++){
    delete [] data[i]
}
delete [] data;

But if your array is fixed and you don't plan to change its size then it's not the most efficient way to do it. Consider you want to allocate a 100*10 array, to allocate and free this amount of memory you should call new and delete operators 101 times and that takes a lot of CPU time, but with a little change to your code you can optimize it so that one call to new and delete does all the job. Here is my implementation:

class FixedArray
{
public:
    template<class T>
    static T **New(int sizeX, int sizeY)
    {
        int sizeAddress = sizeof(T*)*sizeX;
        int sizeData = sizeof(T)*sizeX*sizeY;

        char *data = new char[sizeAddress+sizeData];

        for(int i=0;i<sizeX;i++){
            ((T**)data)[i] = &((T*)(data+sizeAddress))[i*sizeY];
        }

        memset(data+sizeAddress, 0, sizeData);

        return (T **)data;
    }

    static void Delete(void *p)
    {
        delete [] p;
    }
};

A better implementation for a multi-dimensional fixed size array can be found on Boost library.

Posted on : 27 Apr 2007
Vahid Kazemi
0 Comment(s)
Unsized array

Last night when I was coding some parts of my current game project I found out about a Visual C++ extension which allows you to define an unsized array in the end of an structure.

struct KT
{
    int Keyframes;
    Matrix4f Transform[];
};

KT *data = static_cast<KT *>(file->GetData());

for(int i=0;i<data->Keyframes;i++)
{
    Matrix4f &m = data->Transform[i];
    ...
}

It's nice but in my case something like Matrix4f Transform[1] could work as well, and may be It doesn't worth the portability issues, but I found some interesting uses of the extension in MSDN, like:

struct PERSON {
    unsigned number;
    char name[]; // Unsized array
};

struct PERSON me = { 6, "Me" }; // Legal

But you must be careful when using an unsized array, because the size of such an array won't be counted on the size of the container structure.

Posted on : 22 Apr 2007
Vahid Kazemi
0 Comment(s)
Welcome!

Welcome to my blog!

Finally I decided to start my blog here, I try to write a little bit about what I'm doing, and may be you can find some beta versions of my codes and articles in here.

I didn't have enough time to code the blog so if you want to post a comment you need to wait until I code the comment system. Actually I was in the middle of playing God of War II, and I managed to beat it last night! It was hell of a game, my brain just blew off specially at the ending. You won't find such a different and amazing gameplays on any other game, I can undoubtedly tell you that It is the best game ever on PS2 or may be just ever! If they just keep up the good work then may be God of War 3 become the best game of PS3 however we can't expect it in near future considering how long it took them to create previous episodes.

By the way if you have any question, suggestion or comment or may be a virus you want to share with me, send it by email to vkazemi [at-sign] gmail [dot] com.

View Vahid Kazemi's profile on LinkedIn

Posted on : 21 Apr 2007
Vahid Kazemi
0 Comment(s)
Copyright © 2003-2010 Vahid Kazemi, GameProgrammer.org

iPhone Games