SlideShare a Scribd company logo
Alexandria University
Faculty of Engineering
Computer & Systems Engineering Dep.
 Game Development
 Unity Interface
 Basic Components
 Control The Main Character
 Game Design
 Gameplay
 Basic component
 Enemy AI
 Memory management
 optimization
 Game Development
 Unity Interface
 Basic Components
 Control The Main Character
 Game Design
 Gameplay
 Basic component
 Enemy AI
 Memory management
 optimization
 The anatomy of a video game
 game development process
 Game Concepts and Game Play Instruction
A game usually simulates situations where
players are supposed to overcome challenges
and achieve the goals of the game. The user
interacts with the game while playing it and
follows the rules of the game.
A game usually consists of:
 The Rules
 The Goals
 The Challenges
A game usually simulates situations where
players are supposed to overcome challenges
and achieve the goals of the game. The user
interacts with the game while playing it and
follows the rules of the game.
A game usually consists of:
 The Rules
 The Goals
 The Challenges
Unity
2D Art :
 Concept Art
 Sprites
 Texture Art
 UI Artist
3D Art :
 Modeling Concept Art
 Wrapping & Texturing
 Animation
2D Art :
 Concept Art
 Sprites
 Texture Art
 UI Artist
3D Art :
 Modeling Concept Art
 Wrapping & Texturing
 Animation
 What is Unity ?
 Why Unity
 The interface
 Execution Order of Event Functions
 A game engine is a software designed to help developing
games. The tool incorporates most of the components
required in a game such as rendering, scripting, audio,
physics, networking and so on.
 Companies often go on developing their own engine for their
own games.
 Unity is a powerful 3d game engine that will allow you to
create professional games.
 Unity is written in C and C++ but developing a game will be
done using C# , java script and Boo.
 Unity uses the professional Nvidia PhysX engine to reproduce
all in-game physics.
 A game engine is a software designed to help developing
games. The tool incorporates most of the components
required in a game such as rendering, scripting, audio,
physics, networking and so on.
 Companies often go on developing their own engine for their
own games.
 Unity is a powerful 3d game engine that will allow you to
create professional games.
 Unity is written in C and C++ but developing a game will be
done using C# , java script and Boo.
 Unity uses the professional Nvidia PhysX engine to reproduce
all in-game physics.
 Unity plays equally brilliant on 10 global platforms:
modern browsers, Android, iOS, Wii, Playstation 3, Xbox 360,
Windows, Linux, Flash, and MacOs
 Instead of spending your time and budget on independent
development for each platform, Unity allows us to actually
focus on making games.
 Unity allows you to amaze gamers with brilliant full-HD
quality and visual effects.
 thousands of games powered by Unity
 Unity plays equally brilliant on 10 global platforms:
modern browsers, Android, iOS, Wii, Playstation 3, Xbox 360,
Windows, Linux, Flash, and MacOs
 Instead of spending your time and budget on independent
development for each platform, Unity allows us to actually
focus on making games.
 Unity allows you to amaze gamers with brilliant full-HD
quality and visual effects.
 thousands of games powered by Unity
Unity
int main() {
Initialize();
while (isRunning)
{
Process();
Update();
Render();
}
ShutDown();
}
int main() {
Initialize();
while (isRunning)
{
Process();
Update();
Render();
}
ShutDown();
}
There are a number of event functions that get executed in a
predetermined order as a script executes.
First Scene Load
Awake()
Before the first frame update
Start()
Update Order
Update()
LateUpdate()
FixedUpdate()
Rendering
Culling
There are a number of event functions that get executed in a
predetermined order as a script executes.
First Scene Load
Awake()
Before the first frame update
Start()
Update Order
Update()
LateUpdate()
FixedUpdate()
Rendering
Culling
 Mecanim workflow
 Asset preparation and
import.
 Humanoid character setup.
 Bringing characters to life.
 Mecanim workflow
 Asset preparation and
import.
 Humanoid character setup.
 Bringing characters to life.
 Asset Preparation
 triangulated mesh.
 Rigging
 Skinning
 Humanoid character setup
 Export & Verify
 Asset Preparation
 triangulated mesh.
 Rigging
 Skinning
 Humanoid character setup
 Export & Verify
 Bringing characters to life:
 Mecanim State Machines
 Animation States
 Animation Transitions
 Animation Parameters
 Bringing characters to life:
 Mecanim State Machines
 Animation States
 Animation Transitions
 Animation Parameters
 Design the game
 Terrain edition
 Adding Water and Skybox
 Import Assets
 Lightmapping and Fog
 Design the game
 Terrain edition
 Adding Water and Skybox
 Import Assets
 Lightmapping and Fog
 Isolated islands
 The design of The Island.
 The blocks between two islands
 Sketching
The Static Environment The dynamic
Environment
 Sketching
The Static Environment The dynamic
Environment
Unity
 Terrain edition Terrain edition
A skybox is a cubemap—a series of six textures placed inside a
cube and rendered seamlessly to appear as a surrounding sky
and horizon. This cubemap sits around the 3D world at all times,
and much like the actual horizon, it is not an object the player
can ever get to. The skybox is simply a cube wrapping the whole
scene in.
 placing the game Elements or Models ( props ,Tress, Bridges ,
Rocks , Houses , static props , particles, Fences ) And
Invisible Borders(Colliders ).
 Each Element Consist Of : Meshes ,Textures and Materials.
Use a Single Skinned Mesh Renderer
Use as Few Materials as Possible
Use a small size Of textures
Unity
 Lightmapping is the method of
baking, rendering to a texture file—
the lighting that happens to be
affecting a rendered 3D object. This
can be done in modeling
applications, but Unity also allows
you to lightmap all of your lights and
environment elements in one.
• The horizon line might look a little
sharp, we could extend the water
to a point that it is far enough or
we can blur the vision a little. For
this purpose, we use the Fog.
 Lightmapping is the method of
baking, rendering to a texture file—
the lighting that happens to be
affecting a rendered 3D object. This
can be done in modeling
applications, but Unity also allows
you to lightmap all of your lights and
environment elements in one.
• The horizon line might look a little
sharp, we could extend the water
to a point that it is far enough or
we can blur the vision a little. For
this purpose, we use the Fog.
The dynamic world don’t have an end The environment is formed by
premade blocks that follow one another randomly until The main character
reach to the required distance. These blocks are classified in different
difficulties, and an algorithm decides the order of the blocks according to
the difficulty.
 Each block consists of
End point:
This point is found at the end of each block to
know in which position The Next block will be
placed in The game world
Collider at the Start:
This invisible wall is placed at The start of each
block and is triggered to call The function That will
generate the next block to be placed as The next
block when The main character collides with.
Create The sprite image Attached to a txt file to show for each
component in the sprite image its position ( x,y ),width and
height.
Attach this image to a material
Unity
During Random Blocks
 Player run as default
 Avoid obstacles.
 Challenge
 Avoid falling in the
sea
During Random Blocks
 Player run as default
 Avoid obstacles.
 Challenge
 Avoid falling in the
sea
 Block components:
 Waypoints
 Static obstacle
 Movable obstacle
 Collider at the start
 End point
 Block components:
 Waypoints
 Static obstacle
 Movable obstacle
 Collider at the start
 End point
 Way Point:
 Every way point has left &
right way points and can
set these way point = null
if the way point not has the
right or left way point .
 Every way point has more
than next way points.
 Way Point:
 Every way point has left &
right way points and can
set these way point = null
if the way point not has the
right or left way point .
 Every way point has more
than next way points.
 During the Island
 Player movement
 Friends’ role
 Enemies’ role
 Challenge
 Escape from enemies
 Time
Hardness :
Number of enemies and friends increase.
 During the Island
 Player movement
 Friends’ role
 Enemies’ role
 Challenge
 Escape from enemies
 Time
Hardness :
Number of enemies and friends increase.
 During loading
 Check the target textures.
 Active the target objects
 During loading
 Check the target textures.
 Active the target objects
 Save his friends
 Hit the crate
 Destroy the crate
 Particles
 Save his friends
 Hit the crate
 Destroy the crate
 Particles
 Power ups
 Increase the power of the
player
 Arrow
 Active the arrow above the
player
 Power ups
 Increase the power of the
player
 Arrow
 Active the arrow above the
player
 Player and Enemy
 The player hit the enemy
 The enemy hit the player
 Player and Enemy
 The player hit the enemy
 The enemy hit the player
 Check The end of the level
 Make collision with the end
 All friends are free.
 Check The end of the level
 Make collision with the end
 All friends are free.
 The Friends :
 After the player free the
friend ,The friend follows the
player.
 Look at the player.
 The Friends :
 After the player free the
friend ,The friend follows the
player.
 Look at the player.
 The Enemy:
 Find path implementation:
 With navmesh
 With waypoint
 The Enemy:
 Find path implementation:
 With navmesh
 With waypoint
 Find Path Implementation:
 navmesh:
 Apply navigation
 way point :
 How Enemy attacks the
player
 Find Path Implementation:
 navmesh:
 Apply navigation
 way point :
 How Enemy attacks the
player
 Camera
 Lighting
 Meshes
 Skybox
 Colliders
 Prefabs
 Audio
 Camera
 Lighting
 Meshes
 Skybox
 Colliders
 Prefabs
 Audio
 Cameras are the devices
that capture and display the
world to the player.
 Layers and Culling mask.
 Cameras are the devices
that capture and display the
world to the player.
 Layers and Culling mask.
 Why we used lighting.
 Directional lights
◦ Directional lights are used mainly in open places
scenes for sun and moonlight.
 Point lights
◦ The most common lights in computer games.
◦ Example :Light bulbs.
 Spot lights
◦ Spot lights only shine in one
direction, in a cone.
◦ perfect for flashlights.
 Why we used lighting.
 Directional lights
◦ Directional lights are used mainly in open places
scenes for sun and moonlight.
 Point lights
◦ The most common lights in computer games.
◦ Example :Light bulbs.
 Spot lights
◦ Spot lights only shine in one
direction, in a cone.
◦ perfect for flashlights.
 Meshes make up a
large part of your 3D
worlds.
 Unity supports
triangular or
Quadrangle polygon
meshes.
 Vertices and Edges.
 Types of meshes
◦ Mesh Filter
◦ Text Mesh
 Mesh Renderer
 Meshes make up a
large part of your 3D
worlds.
 Unity supports
triangular or
Quadrangle polygon
meshes.
 Vertices and Edges.
 Types of meshes
◦ Mesh Filter
◦ Text Mesh
 Mesh Renderer
 Material.
 Texture.
 A Skybox is a 6-sided
cube.
 Blend.
 Material.
 Texture.
 A Skybox is a 6-sided
cube.
 Blend.
 Collision and Rigidbody
 Basic colliders
◦ Sphere Collider
 ping pong balls and rockets
◦ Box Collider
 for doors, walls, platforms, boxes
◦ Capsule Collider
 Character Controller and unusual shapes.
 Collision and Rigidbody
 Basic colliders
◦ Sphere Collider
 ping pong balls and rockets
◦ Box Collider
 for doors, walls, platforms, boxes
◦ Capsule Collider
 Character Controller and unusual shapes.
 A Prefab is a type of asset
used for clone GameObject.
 All Prefab instances are
linked to the original
Prefab.
 Make any changes to the
Prefab you will see the
change applied to all
instances.
 A Prefab is a type of asset
used for clone GameObject.
 All Prefab instances are
linked to the original
Prefab.
 Make any changes to the
Prefab you will see the
change applied to all
instances.
 Audio Listener
◦ acts as a microphone-like
device.
◦ Main Camera
 Audio source
◦ Audio Clip
 contain the audio data
used by Audio Sources
 Properties
 3D Sound
 Decompress on load
 Compressed in memory
◦ Properties
 Play On Awake
 Loop
 Priority
 Audio Listener
◦ acts as a microphone-like
device.
◦ Main Camera
 Audio source
◦ Audio Clip
 contain the audio data
used by Audio Sources
 Properties
 3D Sound
 Decompress on load
 Compressed in memory
◦ Properties
 Play On Awake
 Loop
 Priority
 Creating waypoints
• AI Controller
 Visualization
• Movement
― Ordered
― Random
 Visualization
• Movement
― Ordered
― Random
 Linear-Congruential
Generators (LCG)
Xn = (a * Xn-1) mod m
where
m is prime number
a is constant number
Xn-1 the random
number of last
iteration
 Linear-Congruential
Generators (LCG)
Xn = (a * Xn-1) mod m
where
m is prime number
a is constant number
Xn-1 the random
number of last
iteration
 Away From Waypoint
 How Get Direction
 How Get Direction To Player
 Properties of enemy
◦ Run
◦ Fire
◦ Walk
◦ Jump
◦ Think
 Away From Waypoint
 How Get Direction
 How Get Direction To Player
 Properties of enemy
◦ Run
◦ Fire
◦ Walk
◦ Jump
◦ Think
Unity
 Object Stored in Heap.
◦ Allocate and release automatically
 Value and Reference Types
◦ Function call and data types.
 Allocation and Garbage Collection
◦ Areas in heap.
◦ Block requesting
◦ Small heap with fast and frequent garbage collection
◦ Large heap with slow but infrequent garbage collection
 Object Stored in Heap.
◦ Allocate and release automatically
 Value and Reference Types
◦ Function call and data types.
 Allocation and Garbage Collection
◦ Areas in heap.
◦ Block requesting
◦ Small heap with fast and frequent garbage collection
◦ Large heap with slow but infrequent garbage collection
 Avoid in coding
 Lookups
 Object pooling and Animations
 Textures and optimized 3D models
 Profiler
 Avoid in coding
 Lookups
 Object pooling and Animations
 Textures and optimized 3D models
 Profiler
• Check condition
• Triggers
• Check condition
• Triggers
 Example: Script AI
◦ Sleeping
◦ Limit the amount of call
 Example: Script AI
◦ Sleeping
◦ Limit the amount of call
• Functions that give you access to other script or other object
i.e Find method.
• Time cost
• Functions that give you access to other script or other object
i.e Find method.
• Time cost
 Object pooling
◦ Problem of destroy object
◦ Cost time
◦ Advantage
 Animation
◦ Culling Mode to Based on Renderers
 Object pooling
◦ Problem of destroy object
◦ Cost time
◦ Advantage
 Animation
◦ Culling Mode to Based on Renderers
 Avoid large size
 Time of render
 Combine together objects that share same
materials.
 Avoid large size
 Time of render
 Combine together objects that share same
materials.
 What is the profiler.
 Process and time
 Improve performance of code
 Example: Functions and scripts
 Example: Comparison

More Related Content

Unity

  • 1. Alexandria University Faculty of Engineering Computer & Systems Engineering Dep.
  • 2.  Game Development  Unity Interface  Basic Components  Control The Main Character  Game Design  Gameplay  Basic component  Enemy AI  Memory management  optimization  Game Development  Unity Interface  Basic Components  Control The Main Character  Game Design  Gameplay  Basic component  Enemy AI  Memory management  optimization
  • 3.  The anatomy of a video game  game development process  Game Concepts and Game Play Instruction
  • 4. A game usually simulates situations where players are supposed to overcome challenges and achieve the goals of the game. The user interacts with the game while playing it and follows the rules of the game. A game usually consists of:  The Rules  The Goals  The Challenges A game usually simulates situations where players are supposed to overcome challenges and achieve the goals of the game. The user interacts with the game while playing it and follows the rules of the game. A game usually consists of:  The Rules  The Goals  The Challenges
  • 6. 2D Art :  Concept Art  Sprites  Texture Art  UI Artist 3D Art :  Modeling Concept Art  Wrapping & Texturing  Animation 2D Art :  Concept Art  Sprites  Texture Art  UI Artist 3D Art :  Modeling Concept Art  Wrapping & Texturing  Animation
  • 7.  What is Unity ?  Why Unity  The interface  Execution Order of Event Functions
  • 8.  A game engine is a software designed to help developing games. The tool incorporates most of the components required in a game such as rendering, scripting, audio, physics, networking and so on.  Companies often go on developing their own engine for their own games.  Unity is a powerful 3d game engine that will allow you to create professional games.  Unity is written in C and C++ but developing a game will be done using C# , java script and Boo.  Unity uses the professional Nvidia PhysX engine to reproduce all in-game physics.  A game engine is a software designed to help developing games. The tool incorporates most of the components required in a game such as rendering, scripting, audio, physics, networking and so on.  Companies often go on developing their own engine for their own games.  Unity is a powerful 3d game engine that will allow you to create professional games.  Unity is written in C and C++ but developing a game will be done using C# , java script and Boo.  Unity uses the professional Nvidia PhysX engine to reproduce all in-game physics.
  • 9.  Unity plays equally brilliant on 10 global platforms: modern browsers, Android, iOS, Wii, Playstation 3, Xbox 360, Windows, Linux, Flash, and MacOs  Instead of spending your time and budget on independent development for each platform, Unity allows us to actually focus on making games.  Unity allows you to amaze gamers with brilliant full-HD quality and visual effects.  thousands of games powered by Unity  Unity plays equally brilliant on 10 global platforms: modern browsers, Android, iOS, Wii, Playstation 3, Xbox 360, Windows, Linux, Flash, and MacOs  Instead of spending your time and budget on independent development for each platform, Unity allows us to actually focus on making games.  Unity allows you to amaze gamers with brilliant full-HD quality and visual effects.  thousands of games powered by Unity
  • 11. int main() { Initialize(); while (isRunning) { Process(); Update(); Render(); } ShutDown(); } int main() { Initialize(); while (isRunning) { Process(); Update(); Render(); } ShutDown(); }
  • 12. There are a number of event functions that get executed in a predetermined order as a script executes. First Scene Load Awake() Before the first frame update Start() Update Order Update() LateUpdate() FixedUpdate() Rendering Culling There are a number of event functions that get executed in a predetermined order as a script executes. First Scene Load Awake() Before the first frame update Start() Update Order Update() LateUpdate() FixedUpdate() Rendering Culling
  • 13.  Mecanim workflow  Asset preparation and import.  Humanoid character setup.  Bringing characters to life.  Mecanim workflow  Asset preparation and import.  Humanoid character setup.  Bringing characters to life.
  • 14.  Asset Preparation  triangulated mesh.  Rigging  Skinning  Humanoid character setup  Export & Verify  Asset Preparation  triangulated mesh.  Rigging  Skinning  Humanoid character setup  Export & Verify
  • 15.  Bringing characters to life:  Mecanim State Machines  Animation States  Animation Transitions  Animation Parameters  Bringing characters to life:  Mecanim State Machines  Animation States  Animation Transitions  Animation Parameters
  • 16.  Design the game  Terrain edition  Adding Water and Skybox  Import Assets  Lightmapping and Fog  Design the game  Terrain edition  Adding Water and Skybox  Import Assets  Lightmapping and Fog
  • 17.  Isolated islands  The design of The Island.  The blocks between two islands
  • 18.  Sketching The Static Environment The dynamic Environment  Sketching The Static Environment The dynamic Environment
  • 20.  Terrain edition Terrain edition
  • 21. A skybox is a cubemap—a series of six textures placed inside a cube and rendered seamlessly to appear as a surrounding sky and horizon. This cubemap sits around the 3D world at all times, and much like the actual horizon, it is not an object the player can ever get to. The skybox is simply a cube wrapping the whole scene in.
  • 22.  placing the game Elements or Models ( props ,Tress, Bridges , Rocks , Houses , static props , particles, Fences ) And Invisible Borders(Colliders ).
  • 23.  Each Element Consist Of : Meshes ,Textures and Materials. Use a Single Skinned Mesh Renderer Use as Few Materials as Possible Use a small size Of textures
  • 25.  Lightmapping is the method of baking, rendering to a texture file— the lighting that happens to be affecting a rendered 3D object. This can be done in modeling applications, but Unity also allows you to lightmap all of your lights and environment elements in one. • The horizon line might look a little sharp, we could extend the water to a point that it is far enough or we can blur the vision a little. For this purpose, we use the Fog.  Lightmapping is the method of baking, rendering to a texture file— the lighting that happens to be affecting a rendered 3D object. This can be done in modeling applications, but Unity also allows you to lightmap all of your lights and environment elements in one. • The horizon line might look a little sharp, we could extend the water to a point that it is far enough or we can blur the vision a little. For this purpose, we use the Fog.
  • 26. The dynamic world don’t have an end The environment is formed by premade blocks that follow one another randomly until The main character reach to the required distance. These blocks are classified in different difficulties, and an algorithm decides the order of the blocks according to the difficulty.
  • 27.  Each block consists of End point: This point is found at the end of each block to know in which position The Next block will be placed in The game world Collider at the Start: This invisible wall is placed at The start of each block and is triggered to call The function That will generate the next block to be placed as The next block when The main character collides with.
  • 28. Create The sprite image Attached to a txt file to show for each component in the sprite image its position ( x,y ),width and height. Attach this image to a material
  • 30. During Random Blocks  Player run as default  Avoid obstacles.  Challenge  Avoid falling in the sea During Random Blocks  Player run as default  Avoid obstacles.  Challenge  Avoid falling in the sea
  • 31.  Block components:  Waypoints  Static obstacle  Movable obstacle  Collider at the start  End point  Block components:  Waypoints  Static obstacle  Movable obstacle  Collider at the start  End point
  • 32.  Way Point:  Every way point has left & right way points and can set these way point = null if the way point not has the right or left way point .  Every way point has more than next way points.  Way Point:  Every way point has left & right way points and can set these way point = null if the way point not has the right or left way point .  Every way point has more than next way points.
  • 33.  During the Island  Player movement  Friends’ role  Enemies’ role  Challenge  Escape from enemies  Time Hardness : Number of enemies and friends increase.  During the Island  Player movement  Friends’ role  Enemies’ role  Challenge  Escape from enemies  Time Hardness : Number of enemies and friends increase.
  • 34.  During loading  Check the target textures.  Active the target objects  During loading  Check the target textures.  Active the target objects
  • 35.  Save his friends  Hit the crate  Destroy the crate  Particles  Save his friends  Hit the crate  Destroy the crate  Particles
  • 36.  Power ups  Increase the power of the player  Arrow  Active the arrow above the player  Power ups  Increase the power of the player  Arrow  Active the arrow above the player
  • 37.  Player and Enemy  The player hit the enemy  The enemy hit the player  Player and Enemy  The player hit the enemy  The enemy hit the player
  • 38.  Check The end of the level  Make collision with the end  All friends are free.  Check The end of the level  Make collision with the end  All friends are free.
  • 39.  The Friends :  After the player free the friend ,The friend follows the player.  Look at the player.  The Friends :  After the player free the friend ,The friend follows the player.  Look at the player.
  • 40.  The Enemy:  Find path implementation:  With navmesh  With waypoint  The Enemy:  Find path implementation:  With navmesh  With waypoint
  • 41.  Find Path Implementation:  navmesh:  Apply navigation  way point :  How Enemy attacks the player  Find Path Implementation:  navmesh:  Apply navigation  way point :  How Enemy attacks the player
  • 42.  Camera  Lighting  Meshes  Skybox  Colliders  Prefabs  Audio  Camera  Lighting  Meshes  Skybox  Colliders  Prefabs  Audio
  • 43.  Cameras are the devices that capture and display the world to the player.  Layers and Culling mask.  Cameras are the devices that capture and display the world to the player.  Layers and Culling mask.
  • 44.  Why we used lighting.  Directional lights ◦ Directional lights are used mainly in open places scenes for sun and moonlight.  Point lights ◦ The most common lights in computer games. ◦ Example :Light bulbs.  Spot lights ◦ Spot lights only shine in one direction, in a cone. ◦ perfect for flashlights.  Why we used lighting.  Directional lights ◦ Directional lights are used mainly in open places scenes for sun and moonlight.  Point lights ◦ The most common lights in computer games. ◦ Example :Light bulbs.  Spot lights ◦ Spot lights only shine in one direction, in a cone. ◦ perfect for flashlights.
  • 45.  Meshes make up a large part of your 3D worlds.  Unity supports triangular or Quadrangle polygon meshes.  Vertices and Edges.  Types of meshes ◦ Mesh Filter ◦ Text Mesh  Mesh Renderer  Meshes make up a large part of your 3D worlds.  Unity supports triangular or Quadrangle polygon meshes.  Vertices and Edges.  Types of meshes ◦ Mesh Filter ◦ Text Mesh  Mesh Renderer
  • 46.  Material.  Texture.  A Skybox is a 6-sided cube.  Blend.  Material.  Texture.  A Skybox is a 6-sided cube.  Blend.
  • 47.  Collision and Rigidbody  Basic colliders ◦ Sphere Collider  ping pong balls and rockets ◦ Box Collider  for doors, walls, platforms, boxes ◦ Capsule Collider  Character Controller and unusual shapes.  Collision and Rigidbody  Basic colliders ◦ Sphere Collider  ping pong balls and rockets ◦ Box Collider  for doors, walls, platforms, boxes ◦ Capsule Collider  Character Controller and unusual shapes.
  • 48.  A Prefab is a type of asset used for clone GameObject.  All Prefab instances are linked to the original Prefab.  Make any changes to the Prefab you will see the change applied to all instances.  A Prefab is a type of asset used for clone GameObject.  All Prefab instances are linked to the original Prefab.  Make any changes to the Prefab you will see the change applied to all instances.
  • 49.  Audio Listener ◦ acts as a microphone-like device. ◦ Main Camera  Audio source ◦ Audio Clip  contain the audio data used by Audio Sources  Properties  3D Sound  Decompress on load  Compressed in memory ◦ Properties  Play On Awake  Loop  Priority  Audio Listener ◦ acts as a microphone-like device. ◦ Main Camera  Audio source ◦ Audio Clip  contain the audio data used by Audio Sources  Properties  3D Sound  Decompress on load  Compressed in memory ◦ Properties  Play On Awake  Loop  Priority
  • 50.  Creating waypoints • AI Controller
  • 51.  Visualization • Movement ― Ordered ― Random  Visualization • Movement ― Ordered ― Random
  • 52.  Linear-Congruential Generators (LCG) Xn = (a * Xn-1) mod m where m is prime number a is constant number Xn-1 the random number of last iteration  Linear-Congruential Generators (LCG) Xn = (a * Xn-1) mod m where m is prime number a is constant number Xn-1 the random number of last iteration
  • 53.  Away From Waypoint  How Get Direction  How Get Direction To Player  Properties of enemy ◦ Run ◦ Fire ◦ Walk ◦ Jump ◦ Think  Away From Waypoint  How Get Direction  How Get Direction To Player  Properties of enemy ◦ Run ◦ Fire ◦ Walk ◦ Jump ◦ Think
  • 55.  Object Stored in Heap. ◦ Allocate and release automatically  Value and Reference Types ◦ Function call and data types.  Allocation and Garbage Collection ◦ Areas in heap. ◦ Block requesting ◦ Small heap with fast and frequent garbage collection ◦ Large heap with slow but infrequent garbage collection  Object Stored in Heap. ◦ Allocate and release automatically  Value and Reference Types ◦ Function call and data types.  Allocation and Garbage Collection ◦ Areas in heap. ◦ Block requesting ◦ Small heap with fast and frequent garbage collection ◦ Large heap with slow but infrequent garbage collection
  • 56.  Avoid in coding  Lookups  Object pooling and Animations  Textures and optimized 3D models  Profiler  Avoid in coding  Lookups  Object pooling and Animations  Textures and optimized 3D models  Profiler
  • 57. • Check condition • Triggers • Check condition • Triggers
  • 58.  Example: Script AI ◦ Sleeping ◦ Limit the amount of call  Example: Script AI ◦ Sleeping ◦ Limit the amount of call
  • 59. • Functions that give you access to other script or other object i.e Find method. • Time cost • Functions that give you access to other script or other object i.e Find method. • Time cost
  • 60.  Object pooling ◦ Problem of destroy object ◦ Cost time ◦ Advantage  Animation ◦ Culling Mode to Based on Renderers  Object pooling ◦ Problem of destroy object ◦ Cost time ◦ Advantage  Animation ◦ Culling Mode to Based on Renderers
  • 61.  Avoid large size  Time of render  Combine together objects that share same materials.  Avoid large size  Time of render  Combine together objects that share same materials.
  • 62.  What is the profiler.  Process and time  Improve performance of code
  • 63.  Example: Functions and scripts