Summary

This document provides a brief overview of game development, discussing the process, design documents, different art styles, and technical considerations. It also touches on the importance of design documents and the various aspects involved in creating a game.

Full Transcript

Game Development Introduction to Game Development  Game Development is the process of designing, developing and releasing of a game. Game Development may involve concept generation, design, build, test and release.  Traditional commercial PC and console games are usually funded by...

Game Development Introduction to Game Development  Game Development is the process of designing, developing and releasing of a game. Game Development may involve concept generation, design, build, test and release.  Traditional commercial PC and console games are usually funded by a publisher and can take several years to complete.  Independent game developers can create indie games, which typically take less time and money to make.  Indie games are video games made by small, independent developers, often with a smaller budget and shorter development time compared to big studio games.  The early video games, created in the 1960s, were not frequently made available for purchase. They were not accessible to the general public and needed mainframe computers to function.  Spacewar! is a space combat video game. "Spacewar!" is significant because it was one of the first games to gain popularity in the computer science  The first consumer video game hardware was released in the early 1970s. The first home video game console is the Magnavox Odyssey, and the first arcade video games are Computer Space and Pong.  Pong is a table tennis–themed twitch arcade sports video game  The development of a complete game usually involves a team of 20–100 individuals with various responsibilities, including designers, artists, programmers, and testers. Game Design Documents  A game design document (GDD) is a detailed plan and blueprint for the development of a video game.  It is a detailed document that outlines all aspects of the game, including the gameplay mechanics, storyline, characters, environments, levels, and more.  The purpose of a GDD is to provide a clear and complete vision for the game development team, ensuring that everyone is on the same page and working towards the same goals.  The document is created by the development team. Collaboration between their designers, artists and programmers. When a game is commissioned by a game publisher to the development team, the document must be created by the development team and it is often attached to the agreement between publisher and developer. A typical game design document includes information on the following 1. Game Overview: This section provides an overview of the game, including the genre, target audience, and the main gameplay mechanics. 2. Story and Characters: This section outlines the game's story and the characters involved, including their personalities, motivations, and relationships. 3. Gameplay: This section describes the core gameplay mechanics, such as the controls, game objectives, challenges, and rewards. 4. Levels and Environments: This section provides details on the game's levels, environments, and the obstacles the player will face in each level. 5. Art and Sound: This section outlines the game's art style, sound effects, and music. 6. Technical Requirements: This section outlines the technical requirements for the game, including the platforms it will be released on, hardware requirements, and software requirements. 7. Marketing and Promotion: This section outlines the marketing and promotion strategy for the game, including advertising, social media, and public relations. Examples for genre of games: Action Games, Sports, Adventure Games, Fighting, puzzle, racing 3D game art styles 1. Realism: This style aims to make everything look as close to real life as possible. The textures, lighting, and environments are designed with lots of detail to create a lifelike appearance. The goal is to make the game world look realistic, as if it could exist in the real world. Examples of games with realistic art are The Last of Us and Gran Turismo 2. Fantasy Realism: Fantasy realism combines realistic visuals with elements of fantasy. While the characters, environments, and objects are designed with realistic details, they include magical or mythical elements, such as dragons, castles, or supernatural creatures. The style balances real-world aesthetics with imaginative, otherworldly features. Games like The Witcher 3 or Skyrim use fantasy realism. 3. Low Poly: Low poly art uses fewer polygons to create simple, blocky shapes and structures. This style is often used to give a game a more retro, minimalist feel. It focuses on basic, geometric shapes rather than detailed models. The game world looks simpler and more abstract, but still fun and engaging. Examples include games like Poly Bridge or Monument Valley. 4. Cartoon: Displaying characters and environment using low poly and hand painted techniques. Cartoon style focuses on bright colors, bold outlines. Characters and objects are designed to look playful and imaginative Games like Rayman Legends and Super Mario Odyssey have cartoon-style graphics. 5. Hand-Painted: Hand-painted style makes the game world look like it was painted by an artist. It often uses soft textures and rich colors, creating a warm, artistic atmosphere. The look resembles paintings, with brushstroke-like effects and a lot of creativity in the designs. It feels like stepping into a living painting. Examples of hand-painted games include World of Warcraft (early versions) and The Banner Saga. 2D game art styles 1. Flat: Flat design uses simple shapes, bold colors, and minimal detail. It avoids using shadows or depth, making everything look like it's drawn on a flat surface. The style is clean and modern, often used for games with a sleek, minimalistic look. Examples include Monument Valley or Super Hexagon. 2. Pixel Art: Pixel art is a retro style where the game’s visuals are created with small, square pixels, similar to the graphics in old video games. The characters and environments often have a blocky, low-resolution appearance. Pixel art is popular for its nostalgic feel and simplicity, seen in games like Super Mario Bros. or Stardew Valley. 3. Vector: Vector art is made using lines and shapes defined by mathematical equations, making the images smooth and scalable. It’s often used for clean, sharp designs without pixelation, and can be resized without losing quality. Games like Geometry Wars or Angry Birds use vector- style art. 4. Cel Shading: Cel shading gives the game a cartoon-like look, with bold outlines and flat, solid colors. It creates a 2D appearance with shading that mimics traditional hand-drawn animation. This style makes characters and environments look like they came from a comic book or animated series. Games like The Legend of Zelda: The Wind Waker or Borderlands use cel shading. 5. Realism: While often more common in 3D games, realism in 2D games focuses on detailed, lifelike graphics. It uses realistic colors, textures, and shadows to create a more natural world. The style aims for a high level of detail to make everything look true to life, as seen in games like The Last of Us (though 2D-inspired). 6. Monochromatic: Monochromatic art uses different shades and tones of a single color, giving the game a unique, unified look. The focus is on using variations of one color rather than multiple colors, often giving the game a more artistic or minimalist feel. Games like Limbo or Inside use monochromatic or limited color schemes for a striking, atmospheric effect. What is the purpose of having a VGA card in a Computer? To display computer generated output on Monitor/ projector. To play games. To perform Video Editing To Create 3D models/ 3D animations To Render 3D models/ 3D animations and edited videos To Process data (Train Artificial Intelligence/ Bitcoin Mining) TYPICAL GAME ENGINES  A game engine is software that helps developers create and build video games. It provides the tools and features needed to design the game world, control how characters and objects move, handle game physics (like gravity), and manage graphics and sound, and more.  Using a game engine has many benefits. You can create a game directly for the engine, and if the engine works on different platforms, your game will automatically work on them too. Advanced game engines also make it easier for teams to work together, letting multiple developers build the game in the same way. CryEngine Unreal Engine Unity Game Engine Game Maker (2D) Construct 2 or 3 (2D) Twine Source (3D) Frostbite (3D) HOW TO CHOOSE A FRAMEWORK  A game framework could be as simple as a collection of code packed into a library in a specific language to help you with the game development process.  With game development frameworks, you can shorten development time using premade templates for game dev purposes.  A framework should help speed up the development of a game  Make sure that the framework has good documentation and an active community to help answer questions  Make sure that it's easy to pick up and matches your skill level. Eg: Allegro, monogame, Phaser, SFML  In video games, artificial intelligence (AI) is used to create smart and adaptable behavior in non-player characters (NPCs). These NPCs act like human players, with their actions guided by AI algorithms that help them respond and adjust to the game environment.  Efficient Testing and Bug Detection: AI can test games by simulating hundreds of gameplay scenarios. This helps find bugs, glitches, and balancing problems faster and more effectively than manual testing.  One of the earliest examples of successful game playing AI is the chess program Deep Blue, developed by IBM GAME MECHANICS A game mechanics refers to a specific interactions, rules, or procedures that guide players through the game. It says how players engage with and progress through the game. Game mechanics are the features that make a game fun, engaging, and meaningful for players. Here are some common game mechanics:  Movement and Controls: How players move and interact with the game, like running, jumping, or shooting.  Objectives and Goals: Tasks or challenges players need to complete to progress or win the game.  Progression and Leveling: Systems that let players grow, unlock new content, or gain abilities as they achieve goals or earn experience points.  Feedback and Rewards: Information on player progress or performance, often with rewards like points, virtual money, or items.  Chance and Randomness: Random events, like rolling dice or finding random items, to make the game unpredictable and exciting.  Resource Management: Managing limited resources, like health, ammo, or money, to make strategic decisions.  Puzzles and Problem-Solving: Challenges that require logical thinking or creativity to solve and progress.  Social Interactions: Features that allow players to work together, compete, or trade with each other.  Time Pressure and Timers: Challenges with time limits, like timed missions or countdowns, to create urgency.  Feedback Loops: Systems where actions have consequences, helping players learn and improve as they play 2D Ship Game Development – Practical Overview 1. Setting Up the Game Environment  Project Creation: Start a 2D project named 2D Ship Game. Adjust the resolution to 1280x720 for consistency.  Asset Management: Import game assets, organize them into folders, and update their Texture Type to Sprite for proper rendering.  Scene Setup: Create a new scene named Level 01 and replace the default Sample Scene. 2. Level Design and Tiling  Tiling Graphics: Use tiled sprites to prevent image blurring when enlarged. Adjust Draw Mode to Tiled and Mesh Type to Full Rect for clarity.  Creating Boundaries: Add walls (top, bottom, left, and right) as child objects of a parent object named Level. Set their Order in Layer to stack them correctly.  Sprites are 2D graphic objects 3. Adding and Programming the Main Ship  Main Ship Setup: Import the ship sprite, assign a Rigidbody2D component (set to Kinematic), and add a Box Collider 2D for interaction.  Scripting Movement: Create a MovableObject C# script for controlling the ship's movement. The script references Unity's physics engine via Rigidbody2D. Rigidbody2D rb; 4. Physics and Interaction  Physics Components: Learn to manage Rigidbody settings (e.g., Dynamic vs. Kinematic) to control object behavior.  Mouse Interaction: Implement the OnMouseDrag method to detect mouse input and calculate the ship's movement using screen-to-world coordinates.  Force Application: Use Rigidbody2D.AddForce() to move the ship dynamically, influenced by the calculated direction vector and a configurable speed variable. void Start() { rb = GetComponent(); } GetComponent(); function is commonly used in Unity, to access components attached to a game object. Objects are entities in a scene that can have various components attached to them, such as scripts, colliders, renderers, Rigidbodies or audio sources. The GetComponent(); function allows you to retrieve a specific component attached to a game object by specifying its type. The type is specified within the angle brackets () using the desired component class or script name. with the Rigidbody component reference stored in rb, you can modify the object's physics properties or apply forces to it. GetComponent(); function is used to retrieve a specific 2D physics component called Rigidbody2D attached to a game object. (change the object's position, rotation, velocity, or apply forces like impulses or torques.) Rigidbody2D is a component that allows you to apply physics-based behavior to a 2D object in your game. It is commonly used for simulating realistic movement, collisions, and interactions of 2D objects. private void OnMouseDrag() { } // This method gets called when we are dragging the mouse over our ship This method gets called when we are dragging the mouse over our ship. So, make a comment just before the function saying, The Rigidbody2D class works like the Rigidbody class but for 2D games. When you add a Rigidbody2D to a sprite, it lets the physics engine control the sprite. This means the sprite will be affected by gravity and you can move it in scripts using forces. If you also add a collider, the sprite can detect and respond to collisions with other sprites. To drag the ship, we need to add Collider to the Ship object The BoxCollider2D is used in 2D games to create a rectangular area for detecting collisions. It's attached to game objects that need collision detection or physics interactions. When it touches or overlaps with other colliders (like box, circle, or polygon colliders), Unity's physics engine detects and handles the collision. You can adjust its size and position to fit your object. The EventSystem is a fundamental component used for handling user input events and interactions in a user interface (UI). (Handling input events from various input sources, such as mouse, keyboard, or touch.) Turns our mouse pointer into usable 2D coordinates private void OnMouseDrag() { //This turns our mouse pointer into usable 2D coordinates. Vector3 touchPoint = Camera.main.ScreenToWorldPoint(Input.mousePosition); } Retrieve the current position of a game object private void OnMouseDrag() { //This turns our mouse pointer into usable 2D coordinates. Vector3 touchPoint = Camera.main.ScreenToWorldPoint(Input.mousePosition); Vector3 shipPosition = transform.position; // This is current ship position in coordinates. } To move a game object to a specific position Vector2 directionToMove = new Vector2(0,0); Check if the mouse's Y coordinate is greater than the ship's Y coordinate, and if true, increase the Y coordinate of the directionToMove object: // if our mouse curser is above the ship if(shipPosition.y < touchPoint.y) { //We are going up directionToMove.y += touchPoint.y - shipPosition.y; } Here's how to write the if-else condition to move the ship downward when the mouse pointer is below the ship: // if our mouse curser is above the ship if(shipPosition.y < touchPoint.y) { //We are going up directionToMove.y += touchPoint.y - shipPosition.y; } else if(shipPosition.y > touchPoint.y) // if the curser is below the ship { // we are going down directionToMove.y -= shipPosition.y - touchPoint.y ; } Rigidbody to apply force to the Game Object (Ship). Regidbody object we can call AddForce() method to apply a force to a game object. The method takes two parameters: the force vector and the ForceMode. // if our mouse curser is above the ship if(shipPosition.y < touchPoint.y) { //We are going up directionToMove.y += touchPoint.y - shipPosition.y; } else if(shipPosition.y > touchPoint.y) // if the curser is below the ship { // we are going down directionToMove.y -= shipPosition.y - touchPoint.y ; } // Tells the rigidbody/Physics calculator to move us in the direction we want rb.AddForce(directionToMove * movementSpeed, ForceMode2D.Force); The directionToMove vector is multiplied by movementSpeed to determine the magnitude of the force applied ForceMode2D.Force: This parameter specifies the type of force to apply. In this case, ForceMode2D.Force indicates that the force should be applied continuously over time Rigidbody.AddForce() is a powerful method for applying forces to objects with Rigidbody components in Unity, enabling dynamic and realistic movement within the physics simulation of your game or application. 5. Testing and Debugging  Error Handling: Verify the presence of required components (e.g., Rigidbody2D) in scripts and handle errors gracefully.  Game Testing: Run the game to ensure the ship responds to mouse movements. Experiment with Rigidbody settings to observe their effects on gameplay. Key Takeaways  Unity Basics: Understand Unity's scene hierarchy, components, and Inspector settings.  Physics and Scripting: Leverage Rigidbody2D for physics-based interactions and use scripting for dynamic behaviors.  Game Design: Learn to create a seamless 2D game environment with tiled graphics and interactive elements. Fixing Ship Up & Down Movement Allow us to move the ship // This runs when we click the mouse button on the ship private void OnMouseDown() { rb.isKinematic = false; //allow us to move the ship } Stop moving the ship when you stop moving the mouse. To do that you need to create a new function named OnMouseUp. //This runs when we stop moving the ship private void OnMouseUp() { rb.isKinematic = true; // stop moving the ship } OnMouseDown() - a callback function that is triggered when the user clicks the mouse button while hovering over the object. OnMouseUp() - method is another event handler that is triggered when the user releases the mouse button after clicking it. It is a built-in method in Unity's MonoBehaviour class and can be overridden to perform custom actions when the mouse button is released. //This runs when we stop moving the ship private void OnMouseUp() { rb.isKinematic = true; // stop moving the ship rb.velocity = new Vector2(0,0); // stop moving completely } Ship Left and Right Movement When the mouse moves to the right, the X coordinate increases. If the mouse moves to the left past the ship, the mouse's X coordinate becomes larger than the ship's X. In that case, you can move the ship towards the mouse. Use an if condition to check if the mouse's X coordinate is greater than the ship's X coordinate. If it is, increase the ship's X value. // if our mouse curser goes right side of the ship if (shipPosition.x < touchPoint.x) { //We are going to right side directionToMove.x += touchPoint.x - shipPosition.x; } Write an if condition to check whether the mouse X coordinate value is less than Ship’s X coordinate value and if it is a lesser value then decrease the X coordinate value of the directionToMove object // if our mouse curser goes right side of the ship if (shipPosition.x < touchPoint.x) { //We are going to right side directionToMove.x += touchPoint.x - shipPosition.x; } else if (shipPosition.x > touchPoint.x) // if the curser goes left to the ship { // we are going left directionToMove.x -= shipPosition.x - touchPoint.x; } MoveOptions enumeration Can hold two possible values public float movementSpeed = 125f; Rigidbody2D rb; public enum MoveOptions { UpDown, LeftRight}; public MoveOptions movementOptions; Movement Options can have two different values. Up Down/ Left Write. If we move the ship only up and down. if (movementOptions == MoveOptions.UpDown) { // if our mouse curser is above the ship if (shipPosition.y < touchPoint.y) { //We are going up directionToMove.y += touchPoint.y - shipPosition.y; } else if (shipPosition.y > touchPoint.y) // if the curser is below the ship { // we are going down directionToMove.y -= shipPosition.y - touchPoint.y; } } In the else part of the if condition, include the code related to move the ship left and right. else { // if our mouse curser goes right side of the ship if (shipPosition.x < touchPoint.x) { //We are going to right side directionToMove.x += touchPoint.x - shipPosition.x; } else if (shipPosition.x > touchPoint.x) // if the curser goes left to the ship { // we are going left directionToMove.x -= shipPosition.x - touchPoint.x; } } To fix the issue of the ship slowly moving down when moving left and right: 1. Exit Game Mode. 2. Set the ship's Rigidbody Body Type to Dynamic. 3. Set the Gravity Scale to 0 to disable gravity. 4. Change the Body Type back to Kinematic. Handling Collisions and Rotations Set the constraint of Rigidbody to stop rotating and stop moving up & down if (movementOptions == MoveOptions.LeftRight) { //Freeze rotation and Up & Down movement if ship goes Left & Right. rb.constraints = RigidbodyConstraints2D.FreezePositionY | RigidbodyConstraints2D.FreezeRotation; } The RigidbodyConstraints2D.FreezePositionY constraint prevents the game object from moving along the Y-axis RigidbodyConstraints2D.FreezeRotation constraint prevents the game object from rotating Prevents the game object from moving along the X-axis and to prevent the rotation when the ship is moving Up & Down. if (movementOptions == MoveOptions.LeftRight) { //Freeze rotation and Up & Down movement if ship goes Left & Right. rb.constraints = RigidbodyConstraints2D.FreezePositionY | RigidbodyConstraints2D.FreezeRotation; } else { //Freeze rotation and Left & Right movement rb.constraints = RigidbodyConstraints2D.FreezePositionX | RigidbodyConstraints2D.FreezeRotation; } At the end your MovableObject C# file should look like this. Moving to Next Level  Create an exit point to this level to enter into Next Level.  We need something to hit by a ship and if a particular ship hit that object, then we can move to next level.  Create an Empty Object. Add a Box Collider 2D component to the Empty Object.  Expand the Box Collider through the X axis and make a top border as the exit point.  Create a C# script in the Scripts folder as GoToNextLevel.  Select Level Exit object and click Add Component button and select GoToNextLevel script.  Double Click the script and it will open the C# script file in Visual Studio.  Remove Start() and Update() methods from the GoToNextLevel class. Create OnTriggerEnter2D method passing Collider2D type object, in the GoToNextLevel class. private void OnTriggerEnter2D(Collider2D collision) { } This function is automatically called by the engine when a 2D collider attached to the GameObject this script is on makes contact with another collider marked as a trigger. The primary purpose of this function is to handle events that occur when a collision between the trigger collider and another collider happens. Create a global variable in the class to store the name of the next Scene which represent the next level of the game. public class GoToNextLevel : MonoBehaviour { public string nextLevelSceneName = "Level 02"; private void OnTriggerEnter2D(Collider2D collision) { } } Import/ link UnityEngine.SceneManagement to the C# file. using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; In Unity, the UnityEngine.SceneManagement namespace contains classes that allow you to work with scenes. UnityEngine.SceneManagement namespace can perform, load a new scene, switch between different scenes, get information about the currently loaded scenes and handle events related to scene loading. Create an if condition to check if the colliding object has a specific tag, like ‘MainShip’ private void OnTriggerEnter2D(Collider2D collision) { if(collision.CompareTag("MainShip")) { SceneManager.LoadScene(nextLevelSceneName); } } Game Development and Programming THE GAME STUDIO MODEL/ COMPANY STRUCTURE A producer's job includes understanding player expectations and making sure marketing targets the right audience. They report to the studio head, who could be the owner or the CEO. Game studios, like other companies, have teams like HR, IT, and admin to help run the business. These teams handle hiring, ensure equipment and networks work well, and manage daily office tasks. PHASES OF GAME DEVELOPMENT  Most game projects will go through a pre-production process at the start of a development cycle.  The first steps of pre-production focus on making sure the game should even be made.  The first step is often making a prototype. Usually prototypes show what your game will look and play like  Next, a market report is made to research if there is a market and player base for the game.  Then, money or resources are secured to start development and pay the team.  Choosing the right game engine is important, as some are free and others can be expensive. This decision affects the overall cost.  Finally, a timeline is created to show funders how long the game will take to complete PRE-PRODUCTION  A marketing plan is made alongside the timeline to show funders how the game will be promoted during development.  The team also decides on the tools and code needed to help create the game efficiently.  During pre-production, concept art and mock-up screens are created to visualize the game's look.  However, not all game ideas make it past pre-production. Sometimes investors aren't interested, and despite the effort, the game might not get funding or approval. A game concept is the basic idea or blueprint for a video game. It includes:  Core Idea: The main theme or story of the game.  Gameplay Mechanics: How the game is played, including controls and objectives.  Genre and Style: The game type (e.g., action, RPG) and its visual style (e.g., realistic, cartoonish).  Target Audience: The intended players, including age and platform.  Visual and Audio Style: The game's art, colors, and music.  Unique Selling Points (USPs): What makes the game stand out.  Platform: Where the game will be played (e.g., PC, console, mobile) PRODUCTION  Once the prototype is done and the concept is approved, production can start. The production cycle is when the game is actually created.  The team will begin by hiring specialists and setting up office space.  By now, a game design document should be in place. This document outlines how the game will be developed, who will do each task, and the deadlines.  The game design document is like a project management plan.  Remember, making a game is complex, and things may not always go as planned. There could be problems or cost overruns that need to be prepared for. POST-PRODUCTION  Post-production is the final stage of game development. It includes testing, reviews, marketing, and fixing bugs. During this phase, developers must show that everything promised in pre-production is complete.  Each game production is different, but the goal is always to finish the game on time, within budget, and keep the funders happy. DEVELOPERS AND PUBLISHERS The two main parties responsible for creating a game are the developer and publisher. Xbox and PlayStation need new games to keep players interested in their systems and prevent them from switching to other consoles.Even companies like NASCAR, Major League Baseball, and LEGO need new games to introduce their brands to new audiences. Developer: The developer creates the game. It can be a company or an individual. Big or online games often have multiple developers. Publisher: The publisher distributes the game to players, usually by selling it in stores or online. Packaging the game, sending the game to retailers, and shipping the game to places where the player can buy the game. Games can be made exclusively for one publisher, but in some cases, multiple publishers can be involved. It is possible that the publisher and developer are one and the same. Sometimes the publisher owns the developer Sometimes the developer hires another developer to help them make the game. These are called second-party developers. If you make and publish your own game, you are both the developer and publisher. However, funding and getting your game on major sales platforms can be challenging. Crowdfunding platforms like Kickstarter or Indiegogo can help. Developers share their game idea, artwork, videos, or demos to attract support. Console companies often act as developers, publishers, and distributors for their own games

Use Quizgecko on...
Browser
Browser