BOO! It’s Friday the 13th!

BOO!“Hee haw haw ha! Be careful, its Friday the thirteenth!”

So what is the old superstition surrounding this morbid date in the calender? Well I decided to do some quick googling around to find out. It seems that Friday the 13th is among the oldest superstitions around. Or at least in the western world it is. “A Friday occurring on the 13th day of any month is considered to be a day of bad luck in English, German, Polish and Portuguese-speaking cultures around the globe. ” — Wikipedia. So much so they have a scientific name for it. It’s called, ok get ready for tongue twisters, paraskevidekatriaphobia or friggatriskaidekaphobia. Shush! Don’t say the words out loud, according to an urban legend, if you do so on this very date, something bad might happen to yousmiley_devil.gif.

Apart from this superstitious belief, there is no explanation either rational or irrational that anything bad happens on this date. People have given all sorts of wired explanations why 13th and in fact Friday the 13th is bad. Everything from prehistoric man only being able to count till 12 to a boy being drowned and then reincarnated to do unspeakable evil, which apparently forms the plot of the Friday the 13th movie series.

As far as I am concerned I have never observed anything, or nothing has ever happened to me that would suggest that Friday the 13th was bad. In fact I remember one incident a few years back when I was doing engineering and I had a lucky break on a difficult math exam on this date. I managed to pass the exam because of that. So in fact Friday the 13th has been lucky for me once. I am kinda weired, 13 has always been lucky for me, go figure! But then that’s just me. Remember,

“Even spooks don’t go out on Friday the thirteenth!”

The art of mind-mapping: The easiest way to learn and manage anything.

What is a mind map? A mind-map is a diagram that captures a central idea and the though process that surrounds the idea. In short it captures the way your brain thinks graphically. Don’t get overwhelmed, it is actually very simple and is very easy to document. All you need is a pencil and a paper and you are set. (I personally use a software to do the same, but more on that later.) I have found it as one of the greatest ways to organize, learn and manage just about anything. I have used it to manage a lot of different things from learning complex science projects to designing complex software systems (like the O2 game engine and the Doofus game system). Continue reading

Games and game development on Linux.

This week I found some time to dabble with development on Linux. The O2 engine and the Doofus game both have been written to be cross-platform with full ANSI C++ compatibility. It was one of the stated objectives when we first began on the development of the engine that it would be portable across platforms. I must admit I have done all the development of the engine under Windows and with Visual Studio Express. However, I do intend to port the engine and the game to Linux and Mac OS’. So last week I fired up the Fedora Core 6 installation just to have a feel of what changes Linux has had over the years.

Its been about 4 years since I did any serious development on Linux and I was kinda surprised that things haven’t changed much. FC6 comes bundled with KDevelop and Eclipse. I tried both and found both to be wanting. I mean I use the free VC Express edition under windows and both these IDEs were nowhere near to even the free version of VC. I had expected more, unfortunately I was disappointed. Then I downloaded Code::Blocks, one of the IDEs that I have a keen interest in because of its close relationship with wxWidgets. The IDE is kinda neat. I am impressed, because I am completely at home on it. It also has a great feature where you can just import VC project files in it, cool! Though it is nowhere near as good as the Pro versions of VC, I found it much better than KDevelop and Eclipse. In my college days I use to program using emacs, but I have gotten lazy over the years, especially after joining the dark side ;)) . I like IDEs and I always hated the Automake system, it seems like too much work.

My next adventure was trying to run a sample OpenGL application. I wrote an application that renders a simple cube on the screen using OpenGL. Hmm.. setting up OpenGL under X is almost as painful as setting it up in Windows. But, after about an hour’s work I was there, only to find that the application’s was running at a measly 50 FPS! I mean, I run my game on this m/c under Windows and it runs at about 40 FPS with everything from stencil-shadows to environment bloom turned on. A simple cube application like this should run at about 1000 FPS. After much searching on the internet, I found that I, in fact, needed to update the display drivers. The application was using default Mesa drivers, which fall back on software under OpenGL. I did download and install NVIDIA drivers and I would like to say its not as trivial as setting the drivers up under Windows, and finally the application ran at about 1000 FPS as expected.

I did dabble more with Linux. Also installed and tried the famous Ubuntu distribution. Did some python programming also and I must say that it was easier to work with than I had expected. As a development platform Linux seems to be a good, I had expected more but it’s not quite there yet. Eclipse seems promising, though it needs some more work. Code::Blocks is good and I am sure the team will do a good job with their upcoming release. On the whole, Gnome and KDE have also grown up, so its kinda nice to see good and fast GUI under Linux. Administration has also become a breeze with so many applications around. There is almost no need to go to the console to get things done, well almost.

As a platform for gaming, it seems to whole another issue. I can see there are a lot of problems that have to be addressed. Why are there no accelerated display drivers on Linux? Even if I did manage to port my game to Linux, for my game to run on a Linux system, the player must download my game first. Then he must download and install NVIDIA/ATI drivers. Then install the game and then finally play it. How on earth do you expect a non techie to do that? I mean I know people who do not even understand what a driver is. Do you expect them to download and install a Linux driver just to play a game! To my surprise, none of the Linux distributions I saw have NVIDIA or ATI drivers, they all have Mesa drivers! Holy cow! I mean Linux is such a great platform for games, but the setup of even the most noted Linux distributions fail to address simple issues. The gaming market is huge and I am very very surprised that the Linux community and distributors have no interest or are simply ignoring vital issues. Yes there have been game that are natively released under Linux. Some major development houses do release games for Linux regularly. But what is Linux’s market share in the gaming business? After Loki went bust, gaming on Linux has been on a decline. Why? According to me there is no reason. The platform is solid and has gotten better. There is nothing fundamentally wrong with Linux. There is a lot of potential to grow if some simple issues are addressed.

Python: Taming the serpent.

Python is a high-level programming language created by Guido van Rossum, a dutch computer programmer. He started out with a set of design goals for Python that allowed Python to be easy, intuitive, easily understandable, open source and had a very short learning curve.

Python was born in 1991 and was conceived by Van Rossum in the late 80”s, so per say it is not a very new language. So what makes it so special and more importantly why all the ruckus? Well, because of its simplicity Python is quickly becoming one of the leading programming languages and language of choice among developers today.

I am a staunch believer that no one programming language is better than the other. Forget about the language shoot-outs and the bench-mark tests created by “so called” experts. They are at best inconclusive and most of the time, flawed. Each language is like a tool and each is designed to address a particular problem or sets of problems. As an experienced developer you must know the merits and demerits of every language (or at least most of the popular ones). Don’t be shy to learn a new language, you probably do yourself a world of good by learning three, four or even more languages.

While C++ and Java (and to some extent C#) are the unequivocal barons of the programming world, Python’s attitude is very different. Its likes to be the short sweet comedian with its unconventional syntax and ridiculously boyish code layout. Let the looks not fool you though, Python is a very powerful language and can easily go head to head with any of the above mentioned trio. Python has all the power the three can yield and yet allows you to be simple in every sense of the way.

Another very important aspect of Python is, it is very easy to learn as compared to C++ or Java. With a good resource, you can pick it up within a matter of days. The syntax is very easy to understand and almost seems natural. I have seen people, who have had no programming backgrounds earlier, pick up basic Python skills in 2 or 3 days. Compare to that, learning C++ could take many weeks. C++ is an old language and has some quirks like, poor (or nonexistant) memory management, pointers, undefined behaviour, no garbage collection and many more. Most modern languages including Python solve these and many other issues.

For me, coming from a C++ background, Python was like a blessing in disguise. Make no mistake about it, it is not a perfect language. No language is. But it has its place. Most C++ veterans I have worked with and who have used Python swear by its merits. One senior colleague of mine even went as far as saying that Python was like a C++ scripting language. Well, it is not, but he was speaking metaphorically. What he meant was, Python has most of the merits of C++ and almost none of its short-comings. I still work 90% of the time on C++ (or is it 95%), and I am not putting down C++ in any way. C++ will continue to be popular and I am sure I will be working in C++ for quite a while more (since I am an game engine programmer, and C++ will probably stick with me longer). As I said, each language has its merits and demerits.

Python offer higher productivity than C/C++, meaning you can write, debug, test programs faster in Python than you can in C++. It offers all the new programming language features like modules, classes, exceptions, very high level dynamic data types, dynamic typing and automatic garbage collection. Yes! Python is slower than C/C++ per say. But slow is a very relative term. A badly designed program in C can be slower than a correctly designed program in Python or any other language. Theoretically a program written in assembly/machine language should be faster than any program, even when compared to a compiled language program like C++. You don”t see many programmers (even game developers) write codes in assembly, do you? Why? Maintaining an assembly program is a nightmare. Case and point to C++. As programs get larger, complexity increases exponentially. Python by design has a very clear syntax which goes a long way in avoiding complexity.

So what do you require to get started with Python? Well first download and install Python. The 2 places that I recommend are The Python official site and Activestate. I am a little partial on Activestate because their distribution involves a complete package including comprehensive documentation and an IDE (under Windows). After that you need a place to type in Python code. I personally used only a notepad (under Windows) or emacs (when using under Linux) when I began. Today there are a myriad of tools/IDEs available. The Python community is large and had done an excellent job at coming up with some very good tools. Strictly, you don’t need any tools. However most IDEs do offer productivity boosts. My current favorite is PythonWin. Many people also prefer SPE. What you use is up to you really. As a beginner I would recommend Activestate’s distribution and directly using the command line and/or notepad/emacs.

The Python documentation comes in with all the tutorials you will ever need to get started with the language. Taking the tutorial one step at a time is all that you need to do. The Activestate’s distribution also has 2 excellent books bundled in plus some fair extra bit of Python goodies in the form of documentation. The Python tutorials found in the documentation are geared towards an absolute beginner. If you are already a programmer working on (insert your favorite language here), then picking up Python is just a matter of reading through the first few chapters. For beginners, it is recommended that you read through all the chapters one by one. Examples start with simple calculus and slowly move on to more advanced stuff like arrays, tuples, sequences. Within a short time you will be proficient in writing complex scripts rather easily.

Python is object-oriented, but in sprite a lot less complicated than C++ or Java. Python’s class mechanism adds classes to the language with a minimum of new syntax and semantics. Very easy for a newbie to pickup, and often appreciated by veterans. All class members (including the data members) are public, and all member functions are virtual. You could argue that this violates encapsulation and to some extent is an over utilization of polymorphism, you are correct, it is. What it does, is makes things much simpler. Instead of a newbie trying to figure out how polymorphism works or why his protected functions are not accessible, Python empowers him to concentrate on actual writing of his program. Maybe you don’t agree with me, but this is very much in line with Python philosophy, short and sweet.

Next we move on to GUIs. GUIs are the foundation of computer programs these days. A good GUI can make all the difference and can literally make or break your program, unless of course you are strictly writing server-side code or device drivers. Python comes bundled with Tkinter (Tk for short) and is Python’s de-facto standard GUI. Tkinter is Python’s interface to Tcl/Tk. It is a lightweight toolkit which offers basic functionality through a set of widgets. It is very easy to learn and understand, and if you are new to GUI programming, you will probably find Tkinter a lot easier to pick up than most other toolkits. Although tkinter is very easy to learn, it falls short for complex GUIs. Tkinter is by design small and lightweight (adhering to python philosophy), but if your GUI is complex, you end up writing horribly complex code to get in all the functionality. For more complex GUIs there is an excellent toolkit/framework called wxPython. wxPython is actually a Python binding for the popular (and comprehensive) GUI package calledwxWidgets. The package offers nearly complete functionality w.r.t modern GUI design. It has a huge collection of widgets and an equally large community behind it. There are also bindings to other toolkits please refer below.

Being a game developer, I just could not resist not having something related to game development in this blog. So here it is, Python has bindings for OpenGL, the defacto industry standard for 3D development called PyOpenGL. OpenGL itself is limited to 3D graphics, what most game developers or, rather game development needs is an access to complete game development system. That is exactly what is offered by pygame. pygame is actually a Python binding for SDL and OpenGL. It is mature enough to be used in game development, but still has some way to go before it can be considered main stream. To be fair, I have only played with it for a while and I am no expert with it. I encourage you to try, and if you are a budding game developer or a newbie to game development, then I strongly suggest you take a tour of the library.

Before I conclude this post there is one more aspect of Python that I want to talk about and that is Python as scripting language for your program. Python can offer strong extensibility features to your program/library written in C/C++. Even if your library itself is written in C/C++, having python bindings to it can boost productivity significantly. Even with game engines you don”t need to have all your code in C++. I fact doing so can be a real pain to deal with. C++ is not the friendliest of languages where as Python fills in the gaps left over by C++ nicely. To be fair, Python was never meant to be a embeddable scripting language. It is designed to be a high level language for rapid application development. There are other languages like Lua and/or AngelScript (also many more) that are more geared towards the embeddable language design philosophy. So go back a few sentences and read what I said; I said “Python offers strong extensibility features.” Meaning you can write the core of your program/library or parts of code that are time-critical in C/C++ and then have python bindings for them so that they can be accessed via python. You can write bindings for C/C++ code using SWIG or using Boost.Python.

As a parting note I would like to mention StacklessStackless is not a library or a module but a modified version of Python that allows the use of light-weight threads called microthreads. Microthreads allow for all benefits that threads have to offer at the same time avoiding complexity and overheads associated with conventional thread based programming. Using any kind of threading implementation in your program can be a challenge, so Stackless can find limited use with conventional programmers. Microthreads are mainly used in AI (Artificial Intelligence) systems for game engines to allow a more natural module design. They are similar to coroutines in Lua.

The truth is that there are many (many) ways to implement advanced functionality with Python. Though it is debatable whether Python offers a pure functional programming paradigm, it does allow for a “functional style” (for lack of a better word) program to be written. Another advanced concept is concurrency. Concurrency mechanisms are often difficult to implement with Object-Oriented style of programming. It involves a whole new set of design fundamentals and issues. Though my knowledge in these areas is limited, I have read a paper on this very topic a few years back. It can be found here. You are free to draw your own conclusions on these subjects.

Last, for some real world implementations and applications. It is no secret that Google uses Python extensively to power it’s engine and services. Another good example is an open source 3D modeling program called Blender. There are many more, but I leave it to you as an exercise.

SOME EXTRA GUI LIBRARIES FOR PYTHON.

PyQt
PyGTK

What are game Genres?

Genres or game genres is a term used for the classification of games. A genre of a game generally outlines what type of game it is, how it is going to play, what type of content it may carry. For example a FPS (First person shooter) game will always be associated with violence and violent content. The broad nature of the game will be one where you will have to shoot up a bunch of enemies to reach your objective or your intended goals. A FPS game could have a storyline where you could fight your way across alien worlds or engage enemy troops in combat in some war episode. Essentially the experience remains the same.

Classification of games

Classification of games is not always systematic and many individual games can easily fit into one, two or may be even more genres. Some types of games do not fit into any type of genre. Sometime there is no absolute way of saying which games belong to a genre, because genres are by necessity defined abstractly. The point of classifying a game to a particular genre has more to do with marketing than anything else. A first person shooter has a certain audience which the developers and the publishers want to reach out to. Genre classification helps them achieve that.

Game genres can”t be made too rigid, this is because of the fact that games are essentially an art form. Any piece of art can and should maintain some sort of ambiguity with regards to its form and nature allowing the artist to achieve a true unique piece of work. The other reason is that there are some truly amazing games out there which will find it difficult to place themselves in a rigid genre lineage. Such games may not get marketed and eventually not get made.

Sub-Genres

Like most taxonomic entities, genre is open to dispute. So much so there are continuous ramblings on forum posts on this very topic. Ultimately all of this has given rise to Sub-Genres. As the name would suggest, sub-genres are genres inside genres. As if genres themselves weren’t confusing enough, sub-genres can sometimes add fuel to the fire making matters even more complicated.

How are games classified

New games are classified based on already published games. If a game is similar to a game that is already classified into a genre, then the game gets that genre. So how were the very first genres made? How do new genres evolve? Well, the ihobo site say genres have been defined by the games that establish the new genre. When Wolfenstein was first distributed, it was considered to be a new sub-genre of the Shooter category – a first person (3D) shooter. There were games before Wolfenstein which comfortably fit into this genre, but it was the arrival of this particular game (and its successor), Doom which defined the new genre category, the FPS genre.

ihobo considers a true genre to be a particular unique category of games, and a sub-genre to be a division of that genre. For example, 2D scrolling shooters can be considered a sub-genre of Shooters.

In the ihobo taxonomy the highest level genre categories are considered Phyla, in parallel to the typical way animals are categorised. Each Phylum is then divided into Classes, Orders and Families. The use of these terms is explained in the taxonomy. Each Phylum is considered a Genre, and each sub-category of a Phylum is considered a Sub-genre. There are also Pseudo-genres, which describe a stylistic element of games, rather than the core of the game play (such as Survival Horror).

Types of Genres

Further reading

Conclusion and background

Most sources about this topic that I found were far form conclusive. Maybe this is because game genres is such an abstract topic. Every different website has a different genre classification. Personally, I think that game developers should concentrate on having a good game play for their games and leave the genre classification debates to the gamers and people that have too much time on their hands.