Friday, March 26, 2010

Graphics Programming Black Book and iPhone Game Development

Many computer related savvy readers might remember hearing about the graphics programming textbook call "Graphics Programming Black Book by Michael Abrash", the author of other textbooks such as "Zen of Assembly Programming". Abrash focuses on optimization coding for C & C++, specialty in assembly language for 8086, 286, 386, 486, etc... I am quite impress of what Abrash had to say back then where computer limitation was a challenge compare to today microcomputer power.

Currently I am in chapter 20 of the textbook "Pentium Rules". This is still relevant to read in my opinion, not because we want to avoid the pitfalls of old CPU architectures, however we can not ignore possible improvements of implementation of algorithms and optimization habits, that will not go away anytime soon. It is true our microcomputers have become extremely powerful, with or without any, to no knowledge of optimization and algorithm we can implement and write systems that are very powerful and efficient. However it will become apparent that our computer programming skills needs to improve while we are in our search for developing video games.

This has become true for the iPhone development of a 2D video game for me. Although I might have taken the easy way out with Macromedia Flash development of a video game and later simply import it to iPhone I do think and believe I might have to still learn the iPhone architecture. Currently I am reading a textbook about 2D and 3D programming which writes a simple 2D framework and programs the behavior of game characters and objects plus objectives that needs to be completed. I will try out and see if I can use this framework to write my own 2D video game even if it ends up just being a simple puzzle game.

For the moment I do not have any source code to show off that is originally written by myself, however I was experimenting around with the example OpenGL ES template program that comes with xCode development. I did manage to draw and manipulate simple vertices and write a simple for...loop to draw a 32 x 32 pixels sprite to the OpenGL ES system however to write a visual screen I do believe it is much easier to write it in binary code the neccessary among of sprite I want to use for a 2D video game contrary with the .plist the textbook wants me to use. However using the .plist properties makes it a world of difference in simplicity for me the problem is the .plist might not work for further complex features later on.

My implementation of using vertices to create polygon images by brute force without using pointers and arrays to store it in binary files made the implementation impossible to work. According to the method I wanted to use I found a flaw of my current implementation accessing so many array elements that were dynamic instead of static which made it impossible to pass such a list to the "const GLFloat vertices[]" variable to the frame buffer of OpenGL ES with the command function that only took in a const pointer*.

Julio A. Cruz

No comments:

Post a Comment