0% found this document useful (0 votes)
35 views74 pages

Game Development Manual22 PDF

The document outlines the structure and guidelines for a bonafide certificate from Dhirajlal Gandhi College of Technology, including student details and certification of laboratory work. It also details lab manners, the college's vision and mission, program educational objectives, outcomes, and specific outcomes related to computer science and engineering. Additionally, it includes course objectives and a list of experiments for a Game Development course, emphasizing practical skills in game design and development using various engines.

Uploaded by

nidhafarheen2005
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)
35 views74 pages

Game Development Manual22 PDF

The document outlines the structure and guidelines for a bonafide certificate from Dhirajlal Gandhi College of Technology, including student details and certification of laboratory work. It also details lab manners, the college's vision and mission, program educational objectives, outcomes, and specific outcomes related to computer science and engineering. Additionally, it includes course objectives and a list of experiments for a Game Development course, emphasizing practical skills in game design and development using various engines.

Uploaded by

nidhafarheen2005
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/ 74

DHIRAJLAL GANDHI COLLEGE OF

TECHNOLOGYDEPARTMENTOFCOMPUTERSCIENCE&ENGINEERIN
G

DHIRAJLALGANDHICOLLEGEOFTECHNOLOGY
SalemAirport(Opp.),Salem–636309Ph.(04290)233333,www.dgct.ac.in

BONAFIDECERTIFICATE

Name : …………………………………………………………

Degree : …………………………………………………………

Branch : …………………………………………………………

Semester : ……………Year:……………Section:……………

Reg.No. : …………………………………………………………

Certified that this is the bonafide record of the work done by the above student in

…………………………………………………………………………………………

Laboratoryduringtheacademic year …………………………………

LAB-IN-CHARGE HEADOFTHEDEPARTMENT

Submitted for University Practical Examination held on……………………………………

INTERNALEXAMINER EXTERNALEXAMINER

i
DHIRAJLAL GANDHI COLLEGE OF
TECHNOLOGYDEPARTMENTOFCOMPUTERSCIENCE&ENGINEERIN
G

ii
DHIRAJLAL GANDHI COLLEGE OF
TECHNOLOGYDEPARTMENTOFCOMPUTERSCIENCE&ENGINEERIN
G
LABMANNERS

 StudentsmustbepresentinproperdresscodeandweartheIDcard.

 Studentsshouldenterthelog-inand log-outtimeinthelogregisterwithout fail.


 Students are not allowed to download pictures, music, videos or files
without thepermission of respectivelab in-charge.
 Students should wear their own lab coats and bring observation note
books to thelaboratoryclasses regularly.
 Recordofexperimentsdoneinaparticularclassshouldbesubmittedin the
nextlabclass.
 Students who do not submit the record note book in time will not be
allowed to dothe next experiment and will not be given attendance for
that laboratoryclass.
 Studentswillnotbeallowedtoleavethelaboratoryuntilthey complete
theexperiment.
 Students are advised to switch-off the Monitors andCPU when they leave
the lab.
 Students are advised to arrange the chairs properly when they leave the
lab.

iii
DHIRAJLAL GANDHI COLLEGE OF
TECHNOLOGYDEPARTMENTOFCOMPUTERSCIENCE&ENGINEERIN
G

iv
DHIRAJLAL GANDHI COLLEGE OF
TECHNOLOGYDEPARTMENTOFCOMPUTERSCIENCE&ENGINEERIN
G

College
Vision
To improve the quality of human life through multi-disciplinary programs in
Engineering, architecture and management that are internationally recognizedand
would facilitate research work to incorporate social economical and
environmental development.
Mission
Tocreateavibrantatmospherethatcreatescompetentengineers,innovators,
scientists, entrepreneurs, academicians and thinkers of tomorrow.
To establish centers of excellence that provides sustainable solutions to industry
and society.
To enhance capability through various values added programs so as to meet
thechallenges of dynamically changing global needs.

Department
Vision
To cultivate creative, globally competent, employable and disciplined computing
professionals with the spirit of benchmarking educational system that promotes
academic excellence, scientific pursuits, entrepreneurship and professionalism.
Mission
 Todevelopthecreatorsoftomorrow’stechnologytomeetthesocial needsofour
nation.
 TopromoteandencouragethestrengthofresearchinEngineering,Scienceand
Technology.
 TochannelthegapbetweenAcademia,IndustryandSociety.

Program EducationalObjectives(PEOs)

TheGraduatesoftheprogramwouldconstantlylearnandupdatetheknowledge
PEO1 in the emerging fields of technology.

The Graduates will be able to analyze, design, implement, test and


PEO2 administer computer-based solutions to the real world problems aligned
with the Industry expectations.

The Graduates inculcate soft skills such as communication, team work,


PEO3 leadership qualities, professional and ethical values and an ability toapply
the acquired skills to address the societal issues.

The Graduates will be able to work with an environment conducive forlife-


PEO4 long learning needed for a successful professional career.

v
DHIRAJLAL GANDHI COLLEGE OF
TECHNOLOGYDEPARTMENTOFCOMPUTERSCIENCE&ENGINEERIN
G

ProgramOutcomes(POs)

Toapplyknowledgeofmathematics,science,engineeringfundamentalsand
PO1
computer science theory to solve the complex problems in Computer Science
and Engineering.
Toanalyzeproblems,identifyanddefinethesolutionsusingbasicprinciplesof
PO2 mathematics, science, technology and computer engineering.

Todesign,implement,andevaluatecomputerbasedsystems,processes,
PO3
components,orsoftwaretomeettherealisticconstraintsforthepublichealth and
safety, and the cultural, societal and environmental considerations.

PO4 Todesignandconductexperiments,performanalysis&interpretationand
providevalidconclusionswiththeuseofresearch-basedknowledgeand research
methodologies related to Computer Science and Engineering.
To propose innovative original ideas and solutions, culminating into modern
PO5 engineering products for a large section of the society with longevity.

Toapplytheunderstandingoflegal,health,security,cultural&socialissues,
PO6
and thereby ones responsibility in their application in Professional
Engineering practices.
Tounderstandtheimpactoftheprofessionalengineeringsolutionsinsocietal and
PO7 environmental issues, and the need for sustainable development.

Todemonstrateintegrity,ethicalbehaviorandcommitmenttocodeof conduct
PO8
ofprofessionalpracticesandstandardstoadapttothetechnologicaldevelopments
of revolutionary world.

To function effectively as an individual, and as a member or leader in diverse


PO9 teams, and in multifaceted environments.

Tocommunicateeffectivelytoendusers,witheffectivepresentationsand write
PO10 comprehends technical reports and publications representing efficient
engineeringsolutions.
To understand the engineering and management principles and their
PO11 applicationstomanageprojectstosuitethecurrentneedsofmultidisciplinary
industries.
Tolearnandinventnewtechnologies,andusethemeffectivelytowardscontinuous
PO12 professional development throughout the human life.

ProgramSpecificOutcomes(PSOs)

PSO1 Design,develop,testandmaintainstrategiesinsoftwareprojectdevelopment to
deliver a quality product for business success.
vi
DHIRAJLAL GANDHI COLLEGE OF
TECHNOLOGYDEPARTMENTOFCOMPUTERSCIENCE&ENGINEERIN
G

Design,develop,testandmaintainsoftwareinareaofalgorithms,system
PSO2 software,webdesign,multimedia,bigdataanalyticsandnetworkingforefficient
design for computer based system.

CourseOutcomes(COs)

CO1 Explain the concepts of 2D and 3D graphics.

CO2 Design game design documents.

CO3 Implementation of gaming engines.

CO4 Survey gaming environments and framework.

CO5 Implement a simple game in Pygame.

Mapping

PO PO PO
COs PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PSO1 PSO2 PSO3
10 11 12

CO1 3 2 2 1 2 2 2 2

CO2 1 2 2 1 2 2 2 1

CO3 1 1 1 2 1 2 2 2

CO4 3 3 1 3 3 2 2 3

CO5 3 3 2 1 3 2 2 3

AVG 2.2 2.2 1.6 1.6 2.2 2 2 2.2

MappingGrade:1-Low,2-Medium,3-high
vii
DHIRAJLAL GANDHI COLLEGE OF
TECHNOLOGYDEPARTMENTOFCOMPUTERSCIENCE&ENGINEER
ING

CCS347 GAME DEVELOPMENT LTPC2 0 2 3

OBJECTIVES:

 To know the basics of 2D and 3D graphics for game development.


 To know the stages of game development.
 To understand the basics of a game engine.
 To survey the gaming development environment and tool kits.
 To learn and develop simple game using Pygame environment.

LISTOFEXPERIMENTS:

1. Installation of a game engine, eg, Unity, unreal engine, familiarization of the GUI.
Conceptualize the theme for a 2D.
2. Character design, sprites, movement and character control.
3. Level design: design of the world in the form of tiles along with interactive and collectible
objects.
4. Design of interaction between the player and the world, optionally using the physics
engine.
5. Developing a 2D interactive using Pygame.
6. Developing a Puzzle game.
7. Design of menus and user interaction in mobile platforms.
8. Developing a 3D game using unreal.
9. Developing a multiplayer game using unity.

TOTAL: 60 PERIODS
COURSEOUTCOMES:
Attheendofthiscourse,thestudentswillbeableto:

CO1:Explain the concepts of 2D and 3D graphics.


CO2:Design game design documents.

CO3: Implementation of gaming engines.


CO4:Survey gaming environments and frameworks.
CO5: Implement a simple game in pygame.

viii
DHIRAJLAL GANDHI COLLEGE OF
TECHNOLOGYDEPARTMENTOFCOMPUTERSCIENCE&ENGINEERING

CONTENTS

Ex Page Date of Marks Staff


Date NameoftheExperiment Remarks
No No completion Awarded Signature

1 Installation of a game
engine eg., Unity, Unreal
Engine, familiarization of
the GUI. Conceptualize the
theme for a 2D game.
Character design, sprites,
2 movement and character
control.
Level design: design of the
3 world in the form of tiles
along with interactive and
collectible objects.
4 Design of interaction
between the player and the
world, optionally using the
physics engine.
Developing a 2D interactive
5 using Pygame.

6 Developing a Puzzle game.

7 Design of menus and user


interaction in mobile
platforms.
8 Developing a 3D Game
using unreal.
9 Developing a multiplayer
game using unity.

RECORD COMPLETION DATE :

AVERAGE MARKS SCORED :

IN –CHARGE :
Experiment Score /10
EX.No:1 Dateof
Completion AdditionalCredits

INSTALLATION OF A GAME ENGINE EG., UNITY, UNREAL ENGINE


FAMILIARIZATION OF THE GUI. CONCEPTUALIZE THE THEME
FOR A 2D GAME.

AIM:
To install the game engines, Unity and Unreal Engine. Also to familiarize the GUI in Unity
and Conceptualize the theme for a 2D game.

1. Installation of Unity
PROCEDURE:
Step 1: Download Unity Hub website (https://unity.com/) or (www.unityhub.com)
Unity Hub is a management tool that allows you to install and manage different versions of
Unity, as well as access tutorials, projects, and assets.
Go to the Unity website and download Unity Hub from the "Downloads" page.

Step 2: Install Unity Hub


Open Unity Hub after installation.
Go to the "Installs" tab.
Click on the "Add" button to add a new Unity version.
Select the version of Unity you want to install from the list of available versions.
Click "Next" and follow the prompts to complete the installation process.

1
Step 3: Create or Sign in to Unity ID:
If you haven't already, create a Unity ID by clicking on "Sign in" or "Create one" in the Unity
Hub.
A Unity ID is required to download and activate Unity licenses.

2
Step 4: Activate Unity License (Optional):
Unity offers both free and paid licenses. Depending on your needs, you may choose the
appropriate license.

Step 5 Start Using Unity:


Once Unity is installed and activated, you can start using it to create games and other
interactive experiences.
3
Step 6. Explore Resources and Documentation:
Unity offers a wealth of resources, tutorials, and documentation to help you get started
with game development.
You can access tutorials and resources directly from Unity Hub or from the Unity website.

4
5
2. Installation of Unreal Engine
PROCEDURE:

Step 1 : Install Unreal Engine


1. Access the website at https://www.unrealengine.com.
2. Register and download the Epic Games Launcher.
3. Install and start the launcher.
4. Click the Unreal Engine tab on the left-hand side.
5. Click on the Library tab that appears at the top of the screen.
6. Click the + button next to ENGINE VERSIONS to add a version of Unreal Engine to the
launcher. You can use the newest version available.
7. Click the Install button. The launcher will start downloading the files needed for
installation and may take a long time to complete.
8. Click the Launch button to start an already installed version. It is possible to have multiple
versions of Unreal Engine installed on the same machine – you simply set one of them as
the current version. The Launch button at the top right of the launcher will start the current
version.

Step 2: Creating new projects and using templates:


`After starting up Unreal Engine Editor, the Unreal Project Browser will appear.
The Recent Projects box on the top left is used to open existing projects and the other boxes on
the left are categories of templates used to create a new project. The following screenshot shows
the templates of the Games category

Select the Third Person template, choose a location folder, and fill in the Name field for the
project. Select the Project Defaults mentioned in the previous list and then click
the Create button. After the project loads, the Unreal Engine Level Editor will be displayed, as
shown in the following screenshot:
6
Step 3: The Unreal Engine Level Editor
These are the key panels of the Level Editor:
1. Toolbar
2. Viewport
3. Content Browser
4. Outliner
5. Details.

Step 4: Blueprints Visual Scripting


The Toolbar Panel
The Toolbar panel is located at the top of the Blueprint Class Editor and contains some essential
buttons for editing Blueprints:

The buttons are described as follows:


The Components panel
The Components panel shows all the Components that are part of the current Blueprint.

7
3. Familiarization of Unity GUI
PROCEDURE:

Step 1: Scene View:


The Scene View is where you design and build your game world.
Step 2: Toolbar:
The Toolbar provides quick access to common actions and tools.
Step 3: Unity Editor Layout

Step 4: Navigation and Manipulation

Step 5: Asset Management

8
Step 6: Scripting and Components

9
4. Conceptualize the Theme for a 2D Game
PROCEDURE:

Step 1: Define the Theme and Story

Step 2. Theme: This 2D game combines the charm of a whimsical bakery with the underwater
world.
Step 3: Story (Optional): You are a friendly seahorse who has opened a unique bakery on the
ocean floor.
Step 4: Gameplay:
Players collect ingredients by completing mini-games or tasks.
Step 5 : Art Style
Step 6 : Target Audience
This game is perfect for casual gamers and families who enjoy relaxing and creative
experiences.
Step 7. Create Art Style and Assets
Step 8. Iterate and Refine

RESULT:
Thus the installation of a game engine, Unity, Unreal Engine, familiarization of the GUI was verified
and installed successfully.

10
Experiment Score /10
EX.No:2A Dateof
Completion AdditionalCredits

CHARACTER DESIGN

AIM:
To conceptualize and finalize a character design for a game.

ALGORITHM:

Step : 1 Brainstorm character concepts considering the game's theme, setting, and requirements.
Step : 2 Sketch multiple rough designs exploring different characteristics and visual styles.
Step : 3 Select one concept and refine it based on feedback and artistic vision.
Create detailed artwork for the finalized character design, including front, side, and back views.

Programs for game character design: 3D modeling


Autodesk Maya.
3DS Max.
Zbrush.
Blender.
Makehuman.
Unity.
GameMaker Studio.
Unreal Engine

Autodesk Maya:
Developed for interactive 3D rendering in video games, animated features,
television, and movies, Maya has been used in multiple successful projects, from
Game of Thrones and Spider-Man to Halo and numerous Pixar movies.
Zbrush:
One of the great alternatives to Autodesk software, it is also widely used for
modeling, texturing, and painting high-resolution 3D video game character models
Blender:
Just like the previous tools, this software is used for modeling, designing, and
animating 3D characters.
Makehuman:
Just like Blender, MakeHuman is an open source 3D graphics tool that can help you
create realistic human beings.
Unity:
Unity is a game design engine that you can access for free. It presents different ways
to customize game character design and settings, building from predefined elements.

12
GameMaker Studio:
GameMaker Studio is a game development tool with its own programming system.
Unreal Engine:
Finally, let’s talk about Unreal Engine. This is a development engine that, for its next
version, will present a fully customizable character creator.
OUTPUT:

RESULT:
Thus the character design using blender verified and executed successfully.

13
Experiment Score /10
EX.No:2B Dateof
Completion AdditionalCredits

CHARACTER SPRITES

AIM:
To create sprite animations for the designed character.

ALGORITHM:

Step 1: Break down the finalized character design into individual sprite frames for various
actions (e.g., walking, jumping, attacking).
Step 2: Use graphics software to create sprite sheets, ensuring consistency and clarity in sprite
design.
Step 3: Animate the sprite frames to create smooth transitions between different actions.
Create Character Sprites:
Step 1 – Create a new project in Scratch. To get started, create a new project in Scratch. ...
Step 1: Go to MIT Scratch.

Step 2: Click on Create.

15
Step 3: Choose a Backdrop.
How to use a backdrop in Scratch?
To use a backdrop in Scratch, you must follow the following steps:
Step 1: Open Scratch and click on the “Choose a Backdrop” option which is in blue color in
the shape of a circle available at the extreme bottom left corner of the Scratch user
interface.
Step 2: Once you click on the blue button, the following options will appear on the screen.
You can choose, paint, surprise, and upload a backdrop using these options.
Step 3: To choose a particular backdrop, click on the first option that says, “Choose a
Backdrop”.

Step 4: To paint a backdrop, click on the second option that says, “Paint”.
Step 5: To upload a particular backdrop, click on the last option that says, “Upload
Backdrop”.

16
How to edit the backdrop in Scratch?
To edit a backdrop in Scratch, the user must follow the following steps:
Step 1: Click on the “Costumes” option available in the navigation bar at the top of the
screen.
Step 2: Once the user clicks on the “Costume” option, the following screen will appear.

Step 3: Click on the “Backdrops” box available at the extreme right of the screen under the
Stage.
Step 4: Now the user can easily edit the backdrop using the available tools present on the
left side of the editing screen.
Step 4: Choose a Sprite.

17
Step 5: Write the script for the project.

Step 6 : Run.
Step 7 : Conclusion.
Step 2 – Select the “Paint” option to create a sprite. ...

18
Step 4 – Fill in the sprite colors using the fill tool. ...
1.Click on the fill tool
2.Select the fill color
3.Click on the object to fill in.

Step 5 – Export the sprite.


1.Right-click on the sprite in the sprite menu
2.Click export.

19
If we want to save it as a .png file. Click on “Convert to Bitmap” then export.

OUTPUT:

RESULT:
Thus the Character sprites using blender verified and executed successfully.

20
Experiment Score /10
EX.No:2C Dateof
Completion AdditionalCredits

CHARACTER MOVEMENT

AIM:
To implement basic movement mechanics for the character.

ALGORITHM:

Step1: To implement basic movement mechanics for the character.


Step2: Implement logic to handle player input (e.g., arrow keys for movement).
Step3: Update the character's position based on input, considering collision detection with
obstacles.
Step4: Apply gravity or other physics principles to simulate realistic movement.
Creating Character Mavement:
Inside your PlayerCharacter_AB Animation Blueprint, navigate to the Anim Graph.
The AnimGraph is used to evaluate a final pose for the skeletal mesh.
Right-click on the AnimGraph and from the Actions drop down menu, search for and
select Add New State Machine.

Rename your State Machine node to Locomotion, then double-click the node to open its
graph. Drag off from the Entry pin, and from the Actions drop down menu, select Add
State.
Name the new state Movement, then double-click to open the Movement State Node.
Navigate to the Asset browser, and search for Locomotion_BS, then click and drag it into
the graph.
From the My Blueprint tab, click and drag your Speed float variable into the Blend
Space's Speed vertical axis.
21
Navigate back to the My Blueprint tab, then click and drag your Direction float
variable into the Blend Space's Direction horizontal axis.
Connect the Animation Pose output pin to the Animation Pose Result pin of the Output
Animation Pose node.
Compile and Save.

Navigate back to the Locomotion state machine, then click and drag the Movement state
node to create a new Animation state named Crouch Movement.
Double click the Transition rule node to open its Anim Graph.
From the My Blueprint Tab, navigate to the variables category and drag your Is
Crouched boolean onto the Can Enter Transition input pin from the Result node.
From the My Blueprint Tab, navigate to the variables category and drag
your Speed and Direction float variables into their respective pins on
the LocomotionCrouch_BS, then connect your LocomotionCrouch_BS Animation
Pose into your Output Animation Pose Result pin.
Compile and Save your Animation Blueprint.

Navigate back to the Locomotion AnimGraph then click and drag off
the CrouchMovement Animation state and connect it to the Movement Animation
State.
Double click the Transition rule node to open it'sAnim Graph.
From the My Blueprints tab, click and drag the Is Crouchedboolean variable onto the
Anim Graph, select Get Is Crouched, then drag off from its output pin and in the drop
down actions menu search for and select NOT Boolean.
Next, connect the NOT Boolean's return pin to the Can Enter Transition input pin.
Compile and Save.

22
Navigate back to the Anim Graph, then click and drag off from the Movement Animation
state and select Add State.
Rename this Animation State to Jump, then double-click to open its animation graph.
Navigate to the Asset Browser and search for Jump_From_Jog, then drag it into the graph.
Finish your Jump Animation State by connecting your Play Jump_From_Jog Animation
Pose to your Output Animation Pose Result pin.
Navigate back to the Locomotion Anim Graph, then double-click the Movement to Jump
Transition rule node to open its Anim Graph.
inside the Transition Rule Anim Graph, navigate to the My Blueprints tab, and drag
your Is Jumping Boolean variable onto the Result node's Can Enter Transition input
pin.
Navigate back to the Locomotion Anim Graph, then click and drag off the Jump anim
node and create a transition to the Movement Anim Graph node.
Double-click the Jump to Movement Transition rule node to open it'sAnim Graph.
From the My Blueprints tab, click and drag the Is Crouched, and Is Jumping Boolean
variable onto the Anim Graph, then drag off each of their output pins and from the drop
down actions menu search for and select NOT Boolean.
Drag off the NOT Boolean output pin and search for and select for the AND Boolean.
Connect both the Is Crouched, and Is Jumping NOT Boolean node output pins into
the AND Boolean node's input pins, then connect the AND boolean's output pin into
the Result node's Can Enter Transition Input pin.

Navigate back to the Locomotion Anim Graph, then click and drag off the Crouch
node and create a transition to the Jump node.
Inside the CrouchMovement to Jump transition rule Anim Graph, navigate to the My
Blueprint tab, then click and drag your Is Jumping bool variable onto the Result node's
Can Enter Transition input pin.
Navigate back to the Locomotion Anim Graph, then drag off from the Jump
node to create a transition to the CrouchMovement node.
Double-click the Jump to Crouch Movement Transition rule node to open it'sAnim
Graph.
From the My Blueprints tab, click and drag the Is Crouched and Is Jumping Boolean
variables onto the Anim Graph.
Your completed Locomotion AnimGraph will resemble the image below.
Navigate to the AnimGraph and connect the Locomotion Pose Output pin into
the Output Pose Result pin.
Compile and Save.
23
OUTPUT:

RESULT:
Thus the character movement using blender verified and executed successfully

24
Experiment Score /10
EX.No:2D Dateof
Completion AdditionalCredits

CHARACTER CONTROL

AIM:
To design and implement controls for the player to interact with the character.

ALGORITHM:

Step 1: Map player inputs (e.g., keyboard keys, controller buttons) to character actions (e.g.,
moving, jumping, attacking).
Step 2: Provide options for customizing controls to accommodate player preferences.
Step 3: Implement special abilities or skills for the character, along with corresponding control
schemes.
1. Concepting.
2. Blocking.
3. Sculpting.
4. Retopology.
5. UV unwrapping.
6. Baking.
7. Texturing.
8. Rigging & Skinning.

Using Blueprint to Control the Character:


STEP 1:
1. In the Content Browser expand the Sources panel and create a folder called Movies. Then,
right-click on the new folder and select Show in Explorer.
In Explorer.

25
2. Drag the Sample Video (or your supported video) into the Content>Movies folder of your
project on your computer.
3. Inside your project, create a Media Player and associated Media Texture asset
called MediaPlayerand MediaPlayer_Videorespectively.
4. Create a File Media Source asset called Video and inside it, point the File Path to the
video added in Step 2.

5. Open your Media Player asset and disable the Play on Open option.

6. In the Place Actors panel under Shapes, drag a Plane into the level and resize as desired
26
(Place Actors can be found under the Window tab if it's not already enabled).
7. Drag the MediaPlayer_Videotexture onto the Plane, then in the Details panefor the Plane,
add a Media Sound Component set to use your Media Player asset.
Blueprint Setup:
Next, we want to set up our initial Blueprint, so later we can add functions to it.
1. From the Main Toolbar, click the Blueprints button then select Open Level Blueprint.

2. In the Level Blueprint, create a variable called MediaPlayer(of the Media Player Object
Reference type) and set it to point to your MediaPlayerasset.
3. Hold Ctrl and drag the MediaPlayervariable into the graph and use Open
Source and Event Begin Play to open your Video File Media Source asset.

Play/Pause – Up:
Add an Up keyboard event connected to a Flip Flop and off your Media Player variable,
use Play and Pause as shown below.

27
When the Player presses the Up arrow keyboard key, the Media Source will start playing while
pressing a second time will pause the video.
1. Add Left and Right keyboard events, then off your Media Player variable use Set
Rate with the left key at -2 and the right key at 2.

2. This will enable the Player to press the left arrow keyboard key to set the Play Rate of the
video to -2 (playing the video in reverse at double speed as a value of 1.0 is normal forward
playback).
3. You could add additional Blueprint logic to determine the number of times the Player
presses the rewind or fast-forward keys and increase or decrease the Play Rate from 2x to
4x or 6x speeds or higher.

28
Keep in mind there is a distinction between Thinned and Unthinnedrates. Thinned means that
some frames will be skipped at this rate, while Unthinned means that all frames will be decoded at
this rate.
Close/Resume – Down:
1. Add a Down keyboard event connected to a Flip Flop, then off a Media Player reference,
use the Get Time function call.

2. Right-click on the Return Value of the Get Time node and promote it to a variable
called Stop Time, then connect all nodes to a Close function call as shown.
This will close the Media Player when pressing the down arrow keyboard key, but store the
current time in which the Media Player was stopped.

3. Off the B pin of the Flip Flop use the Open Sourcenode and set the Media Source to
your Video Media Source.
4. Drag off the Media Player reference and use the Assign On Media Opened Event
Dispatcher and connect as shown.
5. Off your Media Player reference, call the Seek function followed by the Play function.
6. Create a Stop Time variable and connect it to the Time pin on the Seek node. Then
connect the Seek and Play nodes to the OnMediaOpenedevent as shown.
7. Close the Level Blueprint and click the Play button from the Main Toolbar to play in the
Editor.

OUTPUT:

29
RESULT:
Thus the character control using unreal engine in blender verified and executed
Successfully.
30
Experiment Score /10
EX.No:3 Dateof
Completion AdditionalCredits

LEVEL DESIGN: DESIGN OF THE WORLD IN THE FORM OF


TILES ALONG WITH INTERACTIVE AND COLLECTIBLE
OBJECTS

AIM:
To Level design of the world in the form of tiles along with interactive and collectible objects.

ALGORITHM:

Step 1: Create a New Project


Step 2: Understand the Unreal Engine Interface.
Step 3: Modify and Add Assets
Step 4: Blueprint Visual Scripting
Step 5: Level Design.
Step 6: Test and Iterate.
Step 7: Package and Share.

The Viewport panel


 The Viewport panel shows the visual representation of a Blueprint and its Components.
The Viewport panel has controls similar to the Level Editor, which you can use to
manipulate the location, rotation, and scale of the Components.

31
You can move around the Event Graph by right-clicking and dragging it to see the other Events.
STEP 1: Adding Components to a Blueprint
Now, let's create our first Blueprint. It will be a very simple Blueprint that will only
contain Components. For now, we will not use Events or Actions:
Double-click this Blueprint to open the Blueprint Editor.

32
On the Details panel, there is a property named Static Mesh, which has a drop-down input.
Click on the dropdown and select the Static Mesh property named SM_Chair. This Static
Mesh is part of the starter content. The following screenshot shows the selected SM_Chair:

33
STEP 2: Create a New Level
1. Inside the Unreal Editor, click the File Menu option then select New Level..

This will open the New Level dialog window:

2. Click the Empty Level to select it. Finished Step


Placing Actors in the Level In the Place Actors panel on the left, click
the Geometry category and select the Box .

34
Left-click and drag the Box into the Level Viewport .

35
When you release the Left Mouse Button , the Box is added to the level.

In the Details panel (lower-right window of the editor), with the Box still selected,
set Location and Rotation all to 0 .
Set the Scale to 4 x 4 x 0.1 .

We will use this as the floor on which the player can walk around.
In the Place Actors panel select the Lights tab, then drag-and-drop a Directional
Light into the level on top of the floor.
36
On the Translation Tool , click and drag the Z-Axis (blue) on the gizmo up, away from the
surface of the floor.

If the Directional Light becomes unselected, you can re-select it by Left-clicking on it in
the Level Viewport .
In the Place Actors panel, select the Visual Effects tab and drag-and-drop an Atmospheric
Fog into the level.

The Atmospheric Fog Actor will add a basic sky to the level and the level will become
37
illuminated instead of dark.

In the Place Actors panel, select the Volumes tab and drag-and-drop a Lightmass
Importance Volume into the level.

Inside the Level Viewport , press R to switch to the Scale Tool .


Click and drag the white box in the center of the Scale Tool so that the Lightmass
Importance Volume encapsulates the floor.

Inside the Content Browser under Content >StarterContent>Props , drag-and-drop


the SM_TableRoundinto the level.
38
Try to place the table in the center of the floor using the Move Tool (press W if it is not
selected).
Also under Content >StarterContent>Props , drag-and-drop the SM_Chairinto the level.

With the SM_Chairselected inside the Level Viewport , press E to access the Rotation
Tool .

Left-click and drag the blue axis arc (the gizmo will update to show degrees) and rotate
the chair to face the table.
39
Using the placement methods above, create a small scene by adding more Actors from
the Modes Panel and Content Browser .

Try adding some lights, props, walls and a roof (found under
the Content >StarterContent>Architecture folder.

STEP 3: Test and iteration:

40
RESULT:
Thus the Level design of the world in the form of tiles along with interactive and collectible
objects using unreal engine is verified and executed successfully.
41
Experiment Score /10
EX.No:4 Dateof
Completion AdditionalCredits

DESIGN OF INTERACTION BETWEEN THE PLAYER AND THE


WORLD OPTIONALLY USING THE PHYSICS ENGINE

AIM:
To design of interaction between the player and the world.

ALGORITHM:
1. Initialize the Game Environment
2. Create the Player
3. Define the World
4. Handle User Input
5. Update Player Position
6. Detect Collisions
7. Update Game State
8. Render the Scene
9. Repeat
10. End the Game Loop

PROGRAM:
import pygame
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((800, 600))
clock = pygame.time.Clock()
player_x, player_y = 400, 300
player_speed = 5
running = True
while running:
for event in pygame.event.get():
if event.type == QUIT:
running = False
keys = pygame.key.get_pressed()
if keys[K_LEFT]:
player_x -= player_speed
if keys[K_RIGHT]:
player_x += player_speed
if keys[K_UP]:
42
player_y -= player_speed
if keys[K_DOWN]:
player_y += player_speed
player_x = max(0, min(player_x, 800))
player_y = max(0, min(player_y, 600))
screen.fill((0, 0, 0))
pygame.draw.circle(screen, (255, 255, 255), (player_x, player_y), 20)
pygame.display.flip()
clock.tick(60)
pygame.quit()

OUTPUT:

43
RESULT:
Thus the design of interaction between the player and the world, optionally using the
physics engine is written verified and executed successfully.

44
Experiment Score /10
EX.No:5 Dateof
Completion AdditionalCredits

DEVELOPING A 2D INTERACTIVE USING PYGAME

AIM:
To develop a 2D Interactive Game using Pygame.

ALGORITHM:
1. Initialize Pygame
2. Set Up the Screen
3. Load Assets
4. Define Game Objects
5. Handle User Input
6. Update Game State
7. Render Graphics
8. Repeat
9. Handle Game Over Conditions
10. Display Game Over Screen
11. Clean Up

PROGRAM:
import pygame
import random
pygame.init()
WIDTH, HEIGHT = 800, 600
screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Simple Game")
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
player_width = 50
player_height = 50
player_x = WIDTH // 2 - player_width // 2
player_y = HEIGHT - player_height - 20
player_speed = 5
obstacle_width = 50
obstacle_height = 50
obstacle_speed = 3
obstacles = []
clock = pygame.time.Clock()

45
spawn_obstacle_event = pygame.USEREVENT + 1
pygame.time.set_timer(spawn_obstacle_event, 1500)
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
elifevent.type == spawn_obstacle_event:
obstacle_x = random.randint(0, WIDTH - obstacle_width)
obstacle_y = -obstacle_height
obstacles.append(pygame.Rect(obstacle_x, obstacle_y, obstacle_width,
obstacle_height))
keys = pygame.key.get_pressed()
if keys[pygame.K_LEFT] and player_x> 0:
player_x -= player_speed
if keys[pygame.K_RIGHT] and player_x< WIDTH - player_width:
player_x += player_speed
for obstacle in obstacles:
obstacle.y += obstacle_speed
if obstacle.y> HEIGHT:
obstacles.remove(obstacle)
player_rect = pygame.Rect(player_x, player_y, player_width, player_height)
for obstacle in obstacles:
if player_rect.colliderect(obstacle):
running = False
screen.fill(WHITE)
pygame.draw.rect(screen, BLACK, player_rect)
for obstacle in obstacles:
pygame.draw.rect(screen, BLACK, obstacle)
pygame.display.flip()
clock.tick(60)
pygame.quit()

46
OUTPUT:

Result:
Thus the development of 2D interactive using pygame is written verified and executed
Successfully.
47
48
Experiment Score /10
EX.No:6 Dateof
Completion AdditionalCredits

AIM:
To develop a Puzzle game using pygame.

ALGORITHM:

1. Initialize Pygame
2. Set Up the Screen
3. Load Assets.
4. Split Image into Tiles.
5. Shuffle Tiles.
6. Draw the Puzzle
7. Handle User Input.
8. Move Tiles.
9. Check for Win Condition
10. Display Win Screen
11. Repeat
12. Clean Up

PROGRAM:

import pygame
import random
pygame.init()
WIDTH, HEIGHT = 480, 480
TILE_SIZE = 120
ROWS, COLS = 4, 4
screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Sliding Puzzle")
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
image = pygame.image.load("puzzle_image.jpg")
image = pygame.transform.scale(image, (WIDTH, HEIGHT))
tiles = []
for y in range(ROWS):
for x in range(COLS):
rect = pygame.Rect(x * TILE_SIZE, y * TILE_SIZE, TILE_SIZE, TILE_SIZE)
tile = image.subsurface(rect)
49
tiles.append(tile)
shuffled_tiles = tiles[:]
random.shuffle(shuffled_tiles)
def draw_tiles():
for i, tile in enumerate(shuffled_tiles):
x = (i % COLS) * TILE_SIZE
y = (i // ROWS) * TILE_SIZE
screen.blit(tile, (x, y))
running = True
while running:
screen.fill(WHITE)
draw_tiles()
pygame.display.flip()
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
elifevent.type == pygame.MOUSEBUTTONDOWN:
if event.button == 1:
mouse_x, mouse_y = pygame.mouse.get_pos()
clicked_tile = (mouse_x // TILE_SIZE) + (mouse_y // TILE_SIZE) *
COLS
blank_tile = shuffled_tiles.index(None)
if clicked_tile - 1 == blank_tile or clicked_tile + 1 == blank_tile or
clicked_tile - COLS == blank_tile or clicked_tile + COLS == blank_tile:
shuffled_tiles[clicked_tile], shuffled_tiles[blank_tile] =
shuffled_tiles[blank_tile], shuffled_tiles[clicked_tile]
pygame.quit()

OUTPUT:

50
RESULT:
Thus the development of a puzzle game using pygame is written , verified and executed
Successfully.

51
52
Experiment Score /10
EX.No: 7 Dateof
Completion AdditionalCredits

DESIGN OF MENUS AND USER INTERACTION IN MOBILE


PLATFORMS

AIM:
To Design of menus and user interaction in mobile platforms and user interaction in mobile
game development.

ALGORITHM:
Step 1: Introduction to common components like buttons, sliders, discussing functions for user
interaction.
Step 2: Teaching wireframe/prototype creation, vital for iterating and refining UI designs.
Step 3: Provide game dev environment (e.g., Unity) guiding scene creation and linkage for menus.
Step 4: Introduce scripting concepts, offer code snippets for common interactions (e.g., button
clicks, transitions).
Step 5: Encourage testing on mobile devices, gathering feedback for iterative improvements.

PROGRAM:
using UnityEngine;
using UnityEngine.UI;
public class MenuController :MonoBehaviour
{
public GameObjectmainMenuPanel;
public GameObjectoptionsMenuPanel;
void Start()
{
// Show the main menu panel and hide other panels
ShowMainMenu();
}
public void ShowMainMenu()
{
mainMenuPanel.SetActive(true);
optionsMenuPanel.SetActive(false);
}
public void ShowOptionsMenu()
{
mainMenuPanel.SetActive(false);
optionsMenuPanel.SetActive(true);
}
public void StartGame()

53
{
// Add code to start the game
Debug.Log("Starting the game...");
// For simplicity, let's load a new scene for the game
// Replace "GameScene" with the name of your game scene
UnityEngine.SceneManagement.SceneManager.LoadScene("GameScene");
}
public void QuitGame()
{
// Add code to quit the game
Debug.Log("Quitting the game...");
Application.Quit();
}
}

OUTPUT:

54
RESULT:
Thus design of menus and user interaction in mobile platforms verified and executed
Successfully.
55
5
Experiment Score /10
EX.No:8 Dateof
Completion AdditionalCredits

DEVELOPING A 3D GAME USING UNREAL

AIM:
To develop a 3D multiplayer game using Unreal Engine, focusing on implementing basic
player movement.

ALGORITHM:
Step 1: Understand the basics of Unreal Engine and its capabilities for developing 3D games.
Step 2: Launch Unreal Engine and create a new project.
Step 3: Design a simple 3D environment using Unreal Engine's built-in tools or assets from the
marketplace.
Step 4: Import or create a 3D character model to serve as the player character.
Step 5: Write code to handle character movement using Unreal Engine's built-in character
movement component such as walking, running, jumping, and crouching.
Step 6: Test the game to ensure character movement behaves as expected.

PROGRAM:
Header file (.h)
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "MyCharacter.generated.h"
UCLASS()
class YOURPROJECT_API AMyCharacter : public ACharacter
{
GENERATED_BODY()
public:
// Constructor
AMyCharacter();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input

57
virtual void SetupPlayerInputComponent(class UInputComponent*
PlayerInputComponent) override;
// Function for moving the character forward/backward
void MoveForward(float Value);
// Function for moving the character right/left
void MoveRight(float Value);
private:
// Speed for character movement
UPROPERTY(EditAnywhere)
float MoveSpeed = 500.f;
};

Source file (.cpp)


// Source file (.cpp)
#include "MyCharacter.h"
// Sets default values
AMyCharacter::AMyCharacter()
{ // Set this character to call Tick() every frame
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void AMyCharacter::BeginPlay()
{
Super::BeginPlay();
}
// Called to bind functionality to input
void AMyCharacter::SetupPlayerInputComponent(UInputComponent*
PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
// Bind movement functions to input axes
PlayerInputComponent->BindAxis("MoveForward", this,
&AMyCharacter::MoveForward);
PlayerInputComponent->BindAxis("MoveRight", this,
&AMyCharacter::MoveRight);
}
// Function for moving the character right/left
void AMyCharacter::MoveRight(float Value)
{
// Move the character right based on input value
AddMovementInput(GetActorRightVector(), Value * MoveSpeed * GetWorld()-
>GetDeltaSeconds());
}

58
OUTPUT:

RESULT:
Thus the Developing a 3D Game using Unreal is verified and executed successfully.
59
60
Experiment Score /10
EX.No:9 Dateof
Completion AdditionalCredits

DEVELOPING A MULTIPLAYER GAME USING UNITY


DEVELOPING A PUZZLE GAME

AIM:
To develop a real-time multiplayer game in Unity using the NetCode for GameObjects
framework, aiming to synchronize player data, optimize network serialization, and test
multiplayer functionality across multiple clients.

ALGORITHM:

Step 1: Understand Unity's NetCode for GameObjects framework for real-time multiplayer games
and recognize the importance of synchronized player data and efficient network transmission.
Step 2: Launch Unity, create a new project, and install required packages: NetCode for
GameObjects, Multiplayer Samples Utility, and Parallel Sync Helper via the Package Manager.
Step 3: Create a new GameObject named 'Network Manager', add the NetworkManager
component to it, and grasp the NetworkManager's role in managing connections.
Step 4: Design a player GameObject with PlayerController script and Rigidbody component, add
NetworkObject component to make it networked, and assign the player prefab to
NetworkManager for automatic spawning.
Step 5: Explore two methods for syncing player data: use Unity's ClientNetworkTransform for
basic synchronization.
Step 6: Test multiplayer functionality across multiple clients by starting a host server and
connecting as clients to observe synchronized player data.

PROGRAM:

Sample code for PlayerController script


using UnityEngine;
public class PlayerController :MonoBehaviour
{
Rigidbodyrb;
void Start()
{
rb = GetComponent<Rigidbody>();
}
void Update()
{
// Add player movement controls here
}
}
61
Sample code for PlayerNetwork script
using MLAPI;
using MLAPI.NetworkVariable;
using UnityEngine;
public class PlayerNetwork :NetworkBehaviour
{
public NetworkVariable<Vector3> position = new
NetworkVariable<Vector3>(new NetworkVariableSettings{WritePermission =
NetworkVariablePermission.Everyone});
public NetworkVariable<Quaternion> rotation = new
NetworkVariable<Quaternion>(new NetworkVariableSettings{WritePermission =
NetworkVariablePermission.Everyone});
void FixedUpdate()
{
if (IsLocalPlayer)
{ // Update position and rotation variables based on local player input
position.Value = transform.position;
rotation.Value = transform.rotation;
}
}
}

OUTPUT:

62
RESULT:
Thus the Developing a Multiplayer game using unity is verified and executed successfully.

63

You might also like