0% found this document useful (0 votes)
28 views30 pages

34A Assignment

Uploaded by

luckygamer88296
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views30 pages

34A Assignment

Uploaded by

luckygamer88296
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Assignment 34A

Understand core concepts in game engine scripting


Assignment 34A

Scenario
PhiKetSau Studios is organising a showcase on games design and development.

The conference is aimed at year 10 and 11 students who are interested in a possible career in
the games industry.

The studio has approached you to create a presentation on core concepts in game engine
scripting. The presentation will be used on the first day of the conference to introduce delegates
to core concepts in scripting languages, artificial intelligence (AI) and physics within the Stencyl
2D game engine.
Assignment 34A

Brief
You must provide the content for a presentation evaluating key concepts in artificial intelligence,
scripting, and physics used in game engines.

You must illustrate your presentation with detailed examples of scripting languages, artificial
intelligence and physics in Stencyl with your own screenshots (and other engines if you wish) and
also examples from 2D games.

You must include an evaluation of the following in your presentation:


● core concepts in scripting languages
● artificial intelligence concepts, including finite state machine, fuzzy logic, pathfinding and
navigation
● core concepts in physics for 2D digital games

You can use the following slides as a template for the main topics to define and explain.
Assignment 34A

Criteria
DISTINCTION
Unit 34/A.D1 Evaluate examples of scripting languages, artificial intelligence and physics
in games.

MERIT
Unit 34/A.M1 Analyse examples of scripting languages, artificial intelligence and physics
in games.

PASS
Unit 34/A.P1 Explain core concepts in scripting languages and artificial intelligence.
Unit 34/A.P2 Explain core concepts in physics for game engine scripting.
Core Scripting Concepts

Objects
● Objects are actors that make up the game
environment, including character, enemies
and items. Each object can have its own
characteristics, behaviour and interactions

● This picture shows a various amount of


objects that have been used in a game.
Each of these objects have specific
characteristics
Core Scripting Concepts

Classes
● Classes in Stencyl can be referred to as
Core Scripting Concepts

Instances
● Instances is a specific copy of an actor
created from a class. For example you
might have a “Player” class and then
create multiple instances of that player
class to have different players in your
game
Core Scripting Concepts

Inheritance
● Inheritance is like a parent-child
relationship, where the child class gets all
the features of the parent and can add its
own unique features too.

● This picture shows different


animations for an actor where the
actor is the parent and the
animations is the child
Core Scripting Concepts

Events
● Events are any actions that happen in your
game, like the player pressing a button, a
character colliding with an object or a timer
expiring .

● This image shows a series of events


that require a player to press a
button in order to move.
Core Scripting Concepts

Data Types - Integers, Floating Points, Boolean


● Integers are whole A Boolean represents true or false
● Floating point numbers
numbers without any values. They are used in controlling
are number that have
decimal points. This can logic and decision making in a
decimal points. This is game.
be used for variables like
used for more precise
Score, Health or Leve
measurements.

● This picture shows the


● This picture shows a float
variable Jump to be set
being used.
as the Integer 0 when up
is pressed
Core Scripting Concepts

Constants
● Constants are special variables that holds
values that never change during the game.
They are fixed, unchanging values that
you can use throughout a game.
Core Scripting Concepts

Local Variables
● Global variables are variables that can be
● Local Variables are basically variables that
used throughout the game unlike local
are for a specific function.
variables that are just used for a single
part of the game

● This pictures shows an example of a local


variable.

● This picture shows a numerous amounts


of global variable that have been created
for a game
Core Scripting Concepts

Syntax
● These are basically the structure and the
rules that govern a programming language

● That picture shows the syntax for


creating conditions…anything other than
that would not be able to create
conditions
Core Scripting Concepts

Declaration, Initialisation, Assignment


● Declaration refers to defining ● Initialisation refers ● Assignment is the act
a variable to your code. This assigning an initial value for
can be specifying the name of of changing the value of
an attribute when it is a variable after it has
the variable and its data type
created. been possibly initialized.

● This picture shows me


● In This picture, the circled part changing the value of an
shows me declaring the name ● In this picture, the circled already initialised
to be “Floor”. And also part shows me assigning variable
declaring the data type to be a “15” as the initial value of the
number. attribute.
Core Scripting Concepts

Arithmetical Operators
● Arithmetical operators are tools used to
perform mathematical operations
● This picture shows a number of
arithmetical operators in stencyl

While this first picture shows score is being


added by 1
The second picture shows the Timer is being
subtracted by 1
Core Scripting Concepts

Logical Operators - AND, OR, NOT


● Logical operators allow you to create
conditions based on true or false
statements
● This picture shows that a bunch of code is
● AND will work when both statements are
going to work if both left and right isn’t down
true
● OR will work if any one of the statements
are true.
● NOT will basically negate the statement
given.
Core Scripting Concepts

Conditional/Selection Statements - IF, ELSE, ELSEIF


● These statements check for certain
conditions and will execute blocks of code
if these conditions are through.

● This picture a bunch of code that will only


work if left is down.
Core Scripting Concepts

Loop/Iteration Statements - DO, FOR, REPEAT


● These statements allow you to execute a
block of code under certain conditions

● The circled part in this picture indicates the


part that say that block of code should be
repeat every 1 second
Core Scripting Concepts

Jump Statements - break and continue


● This provides a way to break out of loops
or conditional blocks through a condition
and continue to another reptition in the
game through another conditon
Core Scripting Concepts

Subroutines - construction, calling


● Subroutines are mini codes that are
reusable.
● Constructing involves creating the
subroutine by defining it in the block editor.
● Calling it in then involves simply using it in
the your game
Artificial Intelligence

Finite State Machine


● This is a concept that manages various
states that an object can be during
gameplay.

● This is a picture that show different states


of a player that will be used in a game
Artificial Intelligence

Fuzzy Logic
● Fuzzy Logic allow you to create a more
flexible game mechanics. This enables
you to factor in a range of variables and
their degrees of truth.
Artificial Intelligence

Pathfinding and Navigation


● This refers to the methods used to enable
characters or objects to move efficiently
through their environment.
● Pathfinding uses algorithm to determine
the best route for from one point to
another while avoiding obstacles
● Navigations are the movements controls
and animations that help pathfinding once
an actor’s destination is determined
Physics

2D Physics Engine Particle Simulation


● This engine allows you to ● This refers to a method
implement realistic interactions used to model and analyze
like gravity, collision and other the behaviour of particles
force while still maintaining a 2D within a system. This
Layout basically means that
particle simulation helps to
visualize how individual
particles interact with one
another to external forces
Physics

Collision Detection and Resolution


● This refers to the process used to manage interactions between objects within
a game environment.
● Collision detection is a technique used to determine whether two or more
objects overlap or come into contact with each other during gameplay.
● Once a collision is detected, resolution comes into play. This involves
responding to the collision by determining what should happen next.
Physics

Rigid Body dynamics Soft Body dynamics


● This refers to the methods ● This refers to the simulation of
used to stimulate the flexible, deformable objects
physical behaviour of solid within a game development
objects that do not deform platform. This concept enables
when forces are applied . object to bend or flex
Physics

Speed Velocity Accerlation


Speed tells you how quickly Velocity Dictates both the Acceleration affects how
your character moves character’s speed and quickly your actor can
across the screen. You direction. You might even change speed. You can use
might a speed for “walk”, velocity to make a character acceleration to create a
and a different speed for move diagonally or “weighty” feel if you don’t
“run”. smoothly change direction want your characters to
while running. instantly increase speed
Physics

Mass Density Friction


The mass of The density affects This determines how
how objects float or objects slide against
objects affects how sink in fluids, each other, affecting
they move and influencing gameplay movement and
in environments with interactions on
interact with forces waters or other liquids surfaces

Elasticity Angular and Linear Damping


This defines how These are used to
bouncy an object is stimulate resistance to
after collision motion, affecting how
influencing how quickly objects slow
objects behave when down after being set in
they hit each other. motion
Physics

Force Resolution of Forces Impulse


This is the process of breaking This is the change in momentum of
This is used to determine an object. It is basically the “kick” an
down a single force into its
how objects accelerate objects receives due to a force
components(usually horizontal acting over a period of time. For
and change motion. For
and vertical). Game engine use example, in a fighting game a small
example, if a character is attack will impact the opponent
this to calculate the effects of the
jumping. The force of the lightly, while a big attack will have a
force acting at angles massive impact on the opponent
jump dictates how high
they leap

Momentum
This measures an object’s mass in motion. It is the
product of an objects mass and its velocity. For example,
imagine two characters of different weights running at the
same speed. The heavier character will have greater
momentum because they have more mass
Assignment 34A

Bibliography
EXAMPLE FOR VIDEO GAME
Title of game (edition or version). Year. Platform [Game]. Publisher: Place
of publication.
e.g. Dragon Warrior Monsters, 2000. Nintendo Game Boy [Game]. Enix:
Tokyo, Japan.

EXAMPLE FOR WEBSITE


Family name, INITIAL(S) (or company name). Year. Title. [Online]. [Date
accessed]. Available from: URL

You might also like