You are on page 1of 12

Game Programming

CS-304

Instructor: Ms. Momina Masood


Submitted by: Laraib Fatima
Reg No: 19-CS-30
Question no. 1 (CLO1)
Describe the tasks a game programmer may be involved with. Of course, the task of a game
programmer is to develop game software - or other related software (such as various supportive tools).
List out different kinds of software a game programmer might produce in a video game production.

Answer:
Following are the most popular kinds of software a game programmer might produce in a video game
production:
 Go dot
 Adobe Animate
 Unity
 Android Studio
 Pygame
 Adventure game Studios
 Unreal Engine
In the beginning of computer games (from the mid-1970s to mid-1980s), a game developer additionally
assumed the employment of an architect and craftsman. This was by and large in light of the fact that
the capacities of early PCs were restricted to the point that having particular work force for each
capacity was superfluous. Game ideas were commonly light and games were just intended to be played
for a couple of moments all at once, however more significantly, craftsmanship substance and varieties
in ongoing interaction were obliged by PCs' restricted force.
Afterward, as particular arcade equipment and home frameworks turned out to be all the more
remarkable, game designers could create further storylines and could incorporate such highlights as
high-goal and full shading illustrations, material science, progressed man-made consciousness and
computerized sound. Innovation has progressed to such an extraordinary degree that contemporary
games as a rule brag 3D designs and full movement video utilizing resources created by proficient visual
craftsmen. These days, the disdainful term "software engineer craftsmanship" has come to infer the sort
of brilliant tones and blocky plan that were common of early computer games.

Question no. 2 (CLO1)


Discuss the scope and different opportunities for indie game developers in the current gaming industry.

Answer:
The term Indie stands for ‘Independent.’ Indie Game development is how small teams create a game,
and there is no specific financial support from leading publishers.

Scope for Indie Game Developers:

1) Rise of digital distribution


◦ One major change in the industry is the growing prevalence of digital distribution. On the PC
side, Steam has given developers and publishers access to a worldwide market without the need
to fight over limited retail shelf space.

◦ On the console side, digital distribution allows publishers to release titles without meeting
minimum quantity requirements from first parties and without having to pay first party royalties
for those quantities upfront.

Digital distribution has opened the door for many small indie developers to reach a much wider
audience.

1) Rise of mobile gaming

◦ The biggest change in gaming in the last several years has been the meteoric rise
of mobile gaming

◦ Major feature of mobile games is the lower development costs because mobile
games are typically more limited in scope than console

◦ This low cost has also allowed for more development outside of the United States
and Japan. Mobile development studios can be found all across the globe: South
Korea and Eastern Europe have become hotbeds of mobile development.

Opportunities for indie Game Developers:

◦ Independent games

◦ No publishers, but may come later though

◦ Low-Budget and sometimes no budget at all..

◦ Individuals and small teams

◦ Seeks Innovation and explore new aspects in game design and storytelling and even art
forms

Question no. 3 (CLO1)


Research ways in which artificial intelligence is influencing interactive stories. What are some ways to
make an NPC (Non-Playing Character) seem more authentic?

Answer:
Artificial intelligence plays very important role in game development, if we observe a game we think that
there is two characters in game one is human who is playing game and on other side the computer plays
as his opposition. In modern game technology, the computer side actions are performed on the basis of
artificial intelligence, like in fighting game the enemies are working on AI principles.

If we see the previous techniques, we think there is hard coded rules written by the programmer to run
the game, this make the game less interesting and boring because all the time everything is happening
in same manner. Then the techniques of path finding and decision tree arises which makes the games
interesting because the games are running on a proper algorithm and game works on their intelligent,
they find their own path and follow the algorithm.

Here we also discuss the NPCs, to make the NPCs better we should use the AI techniques to make the
NPCs intelligent and working on the basis of environment. We should use random forest and path
finding techniques and other machine learning algorithms to make them authentic to work better.

Question no. 4: Unity – C# Scripting (CLO3)

T1: Understanding two C# data types: value type and reference type

1) what’s the operator ‘using’ used for? what are the Unity Engine and
System.Collections?
Answer:
‘Using’ imports namespace. Namespaces are a collection of classes and other data
types that are used to categorize the library. Unity Engine we can say that is a collection
of all the classes related to Unity that are imported by ‘using’ keyword.
System.Collections is all the classes in .Net related to holding groups of data such as
hash table and array list. It is required whenever you use a class in that namespace. For
example, if you want to write to files then you need "System.IO."
2) When we create a new C# class in Unity, it automatically inherits from
the MonoBehaviour class, which is Unity's base class for components.
Answer:
When we create a new C# class in Unity, it automatically inherits from
the MonoBehaviour class, which is Unity's base class for components.
Question 4 T1 (a):
What is the printout in the Console window? Does the sphere change its
position? Why? Is the Vector3 a value type or reference type? When we amend
‘v1’, does the ‘transform.position’ change as well? Analyze the code and explain.
Answer:
In console window there is no change in the position of all three axis. It prints the same
position. Sphere do not change the position because due to value type datatype the
original value is not updated it only changes the variable so that’s why it prints out same
position and the sphere’s position does not change. On amending v1 the original value
of transform.position does not change because in this case it is a value type variable.

Question 4 T1 (b):
What is the printout in the Console window? Does the sphere change its
position? Why? Is the variable ‘trans’ with the type ‘Transform’ a value type or
reference type (of data)? When we amend ‘trans’ (by changing its ‘position), does
the ‘transform.position’ change as well? Analyze the code and explain.
Answer:
In console tab, there is a change in the position of all three axis. It prints the updated
position of the cube. Sphere changes the position due to reference type datatype the
original value is updated it changes the reference so that’s why it prints out updated
position and the sphere’s position is changed. On amending trans the reference to the
value of transform.position changes because in this case it is a reference type variable.

Question 4 T2
1) Define a new class called GameObject2D in the script ‘CSharpDemo.cs’ as
below: using UnityEngine; using System.Collections; class GameObject2D
{string name;} public class CSharpDemo : MonoBehaviour { … } Answer the
questions: what’s the accessibility of the attribute ‘name’? public, protected or
private?
Answer:
As the scope is not defined by the programmer so by default it will be treated as private
variable.
2)
using UnityEngine;
public class GameObject2D
{
string name,va lue;
void setName()
{
name = value;
}
string getName()
{
return name;
}
}
public class CSharpDemo : MonoBehaviour
{
void Start()
{

}
void Update()
{

}
}

3)

using UnityEngine;
public class GameObject2D
{
string name,value;
void setName()
{
name = value;
}
string getName()
{
return name;
}
}

public class CSharpDemo : MonoBehaviour {

void createGameObject2D()
{

GameObject2D Peter, David, John;

List<string> c = new List<string>(10);


string[] names = { "Peter", "David", "John"};
foreach (string item in names)
{
Debug.Log(item);
}

4)

using UnityEngine;
public class GameObject2D
{
string name,value;
void setName()
{
name = value;
}
string getName()
{
return name;
}
}

public class CSharpDemo : MonoBehaviour {


void Start()
{
createGameObject2D();
}
void createGameObject2D()
{
GameObject2D Peter, David, John;
List<string> c = new List<string>(10);
string[] names = { "Peter", "David", "John"};
foreach (string item in names)
{
Debug.Log(item);
}
}
}

5)

using UnityEngine;
public class GameObject2D
{
string name,value;
void setName()
{
name = value;
}
string getName()
{
return name;
}
}
class Rectangle : GameObject2D
{
int width, height;
string name;
public Rectangle (string n, int w, int h)
{
name = n;
width = w;
height = h;
}
}

public class CSharpDemo : MonoBehaviour {

6)
using UnityEngine;
public class GameObject2D
{
string name,value;
void setName()
{
name = value;
}
string getName()
{
return name;
}
}
class Rectangle : GameObject2D
{
int width, height;
string name;
public Rectangle (string n, int w, int h)
{
name = n;
width = w;
height = h;
}
Rectangle Rec1 = new Rectangle("Rectangle1", 60, 30);
Rectangle Rec2 = new Rectangle("Rectangle2", 20, 40);
Rectangle Rec3 = new Rectangle("Rectangle3", 90, 50);
}

public class CSharpDemo : MonoBehaviour {

void Start()
{
createRectangle();
}

void createRectangle()
{
var arraylist1 = new ArrayList()
{"Rectangle1",60, 30};

var arraylist2 = new ArrayList()


{ "Rectangle2",20, 40};

var arraylist3 = new ArrayList()


{"Rectangle3",90, 50 };

foreach (var item in arraylist1)


{ Debug.Log(item); }

foreach (var item in arraylist2)


{ Debug.Log(item);}

foreach (var item in arraylist3)


{ Debug.Log(item);}
}
}

7)
using UnityEngine;
public class GameObject2D
{
string name,value;
void setName()
{
name = value;
}
string getName()
{
return name;
}
}
class Rectangle : GameObject2D
{
public
int width, height;
string name;
public Rectangle (string n, int w, int h)
{
name = n;
width = w;
height = h;
}

public class CSharpDemo : MonoBehaviour {

void Start()
{
reference_DataType();}

void reference_DataType()
{
Rectangle Rec1= new Rectangle("Rec1",30,50);
Rectangle Rec2= Rec1;
Debug.Log(“Rectangle one:”);
Debug.Log(Rec1.name);
Debug.Log(Rec1.width);
Debug.Log(Rec1.height);
Debug.Log(“Rectangle two:”);
Debug.Log(Rec2.name);
Debug.Log(Rec2.width);
Debug.Log(Rec2.height);
}
}

b.
using UnityEngine;
public class GameObject2D
{
string name,value;
void setName()
{
name = value;
}
string getName()
{
return name;
}
}
class Rectangle : GameObject2D
{
public
int width, height;
string name;
public Rectangle (string n, int w, int h)
{
name = n;
width = w;
height = h;
}

public class CSharpDemo : MonoBehaviour {

void Start()
{

reference_DataType();
}

void reference_DataType()
{
Rectangle Rec1= new Rectangle("Rec1",80,20);
Rectangle Rec2= new Rectangle("Rec2",40,50);
Debug.Log(“Rectangle one:”);
Debug.Log(Rec1.name);
Debug.Log(Rec1.width);
Debug.Log(Rec1.height);
Debug.Log(“Rectangle two:”);
Debug.Log(Rec2.name);
Debug.Log(Rec2.width);
Debug.Log(Rec2.height);
}
}

You might also like