Header Ads

Game Development: 2D games Perspectives & Z Order

Game development main aspect is to understand each and every process theoretically as well as practically. Today's post is more theoretical than practical.
I will be discussing today a very vital concept, which is commonly discussed and practice while designing & developing games i.e. 2D games Perspectives & Z Order. I shall be focusing on game perspective in 2D games & what is Z Order. 

Prerequisites: 

1) Gaming Enthusiasm.


Z-Ordering


In 3D games, developers can manipulate 3-axis i.e. X-axis, Y-axis & Z-axis, similarly, developers can view the object from these three directions. However, in 2D games, both developer and user can develop/view objects only in 2D with manipulation of X-axis & Y-axis. In 2D games arranging objects/sprites on the canvas is a little trickier because of access to two dimensions. For example, in order to give effect of a mountain scene. Scene is arrange in such a way that it will show us far distance objects and near objects, this is simple to do as we can simply put small size objects at scene top and big size objects in front of scene to give near/far distance effect. But, what if we want to place some objects in between and want to configure that which object should come before which object. Thats when Z-order comes in power play, we can choose which object to display before which object by simply changing Z-order value, i.e. we can use +ive value to place objects behind another objects & lower +ve or -ve values to place objects in front another objects. Z-ordering is more like layering your objects in scene in similar manner as layering in photoshop or using Go to Back or Go to Front command of MS-Office suites. For further study you can explore Z-order in top-down 2d games
 


2D-Perspectives 

In 2D gaming there are mainly two types of perspective i.e. a) First person shooter/perspective. b) Third person perspective.  

a) First person shooter/perspective  

This perspective only shows game object e.g. guns, fire etc, giving player the look and feel of being controlling the game by themselves.

 

b) Third person perspective 

This perspective involve the characters in games allowing player to manipulate the character movement and play through game.


Third person perspective however, further categorize into two kinds of view which are used in different level editors to construct graphic user interface for games visually i.e.
a) Orthogonal view.
b) Isometric view.

a) Orthogonal View  

This view arrange the Graphical User Interface (GUI) in following manner i.e.


This view is arranged in level editors by dividing screen into small squares which are called tiles. The orthiginal view is the simplest view to implement as game developer because its map coordinate matches screen coordinates and game objects or sprites can easily be manipulated.

b) Isometric View 

This view arrange the Graphical User Interface (GUI) in following manner i.e.


This view allow the developers to create 3D kind of effect in 2D environment. This view is also arranged in level editors by dividing screen into small squares which are called tiles. The isometric view is the most difficult view in 2D games to manipulate because it rotate the orthogonal tile view by 45 degree in triangular shape and this rotation shifts the isometric map coordinates from the screen coordinates, therefore, developers have to convert the isometric map coordinates into screen coordinate to manipulate the game objects or sprites.

Thats about it!!!

Enjoy Gaming!!!

P.S: I do not own any of the images.

No comments