Friday, October 24, 2008

My First Pixels...

Before I begin, I'd like to attempt to solve the lecture questions.

Quote question - "How many textures can they use if they are limited to 256 x 256, with a 24 bits palette of 8 bits colour depth?"

- still trying to figure out -
32MB/(256*256*24) = 268435456 bytes /1572864
= 170.6666667
hmm, different answer...

Side note: This week's lecture, 2, is mainly about pixels, resolution, colours, and rendering. New terms such as buffer, double buffer, as well as old terms like bits, bytes, megabytes. Now I know how the flickering problem was 'solved'.

Now, back to the task at hand. This post will be dedicated for Week 2's Practical.

Questions & Answers(hopefully)

Qn 1: Define a Callback function
Ans 1: A callback function is a function which is executable code which is passed to another function as an argument, eg, function_Name(callback_Function);

Qn 2: When exactly is myDisplay() called? How do you get to your findings?
Ans 2: It is called, JUST after the program draws the screen. Upon debugging, if we keep track of the function, it will show us precisely when a function is carried out.

Qn 3: List the process to access the VRAM.
Ans 3: Memory pointer to the VRAM is obtained. A double buffer memory is obtained. It is then cleared before being modified. After which, it is copied to the VRAM before being cleared once again.

Question 4: What colour format are we using here i.e. 8 bits, 16 bits, 24 bits or 32 bits?
A pixel takes up to 1 byte of information, as the values range from 0 to 255. Thus we are using 8 bits colour format since 8 bits = 1 byte.

Question 5: How much memory have we allocated?
Ans 5: 800*600*1 = 480 000 bytes
About ~ 468.8 kilobytes

Question 6: Describe what has glDrawPixel() done.
Ans 6: glDrawPixel() has just sent data for the system to draw the plotted pixels on the screen/window which was previously created.

Practical Results
Here are some of the screenshots of the pixels which I was able to plot, from modifying the code.

"Vertical Lights"

What I 'created' by accident. I actually wanted to code a 'Melt Up', but I got this instead. Still it's cool. And no, it's not random vertical lines being drawn to the screen. It starts out full screen. At
certain intervals, the lines disappear, making it seem like a laser show.

"Batik Design"

As the name suggest, it looks like part of a "Batik" design.

"Tiled Floors"

Looking at this reminds me of special tile designs, usually seen in documentaries from some magnificent building.
*Tip for readers: If you want to get these odd colurs, try inserting varying values for the colours.

All in all, it was a good practice, especially since this is out first time learning and using OpengGL.

Wednesday, October 15, 2008

Game Review

Title of the Game: N+



Platform of Game: PSP, DS, Xbox360



Genre of Game: 2D, Action, Platformer



Developer: Atari



Product Model Year: 2008



Game Requirements: None specific, only the console and handheld device.







Description of the game – You get to play as a ninja, with high agility as well as fragility. Game level consists of obstacles, which more often than not requires precision and timing to nail it.


Game Play - Simple controls on the PSP system, directional pad + to move your ninja & (x) button to do a jump. The longer you hold the higher your jump. Too high a jump without proper landing, leads to instant death. Good for handheld consoles since it’s more of the pick up and play type. No storyline.


Graphics – Simple but effective. The ninja is ‘stick-ed’, as in stickman drawings. But that is a good thing in this game, where one slight move could spell disaster. No 3D, no special effects, just 2D explosion upon contact with explosives.


Sound – Intro music is nice and catchy. In-game music is hardly in any way, distracting to players. Sound effects are appropriate, especially upon deaths from different causes. No repeated SE or weird/unmatched SE.


Conclusion – Good game to get if you plan on ‘travelling’ a lot, since auto-save points are 4 stages apart. The obstacles in each stage, forces you to develop a plan so as to be able to successfully complete each stage. It trains your reflex and reaction times as well as time management. Time is 2nd or 3rd on the ‘important to look out for’ list. I give it 4/5 overall.


Resources:


Anti-Blogger

Topic