Guide to Developing Video Games

download Guide to Developing Video Games

of 23

Transcript of Guide to Developing Video Games

  • 7/29/2019 Guide to Developing Video Games

    1/23

    Video Games

    VGD 2012-2013

    Francis Joseph Seria

  • 7/29/2019 Guide to Developing Video Games

    2/23

    Goals

    To understand the fundamental modules running in agame

    To understand the fundamental structure of all videogames

  • 7/29/2019 Guide to Developing Video Games

    3/23

    Objectives

    Identify and implement the fundamental structure of allvideo games in C++

    Identify and implement the different modules in a videogame

  • 7/29/2019 Guide to Developing Video Games

    4/23

    Core Values

    Creativity Free your mind

    Curiosity Your thirst for knowledge can never be quenched

    Patience Everything will turn out just right

  • 7/29/2019 Guide to Developing Video Games

    5/23

    As a Software

    Video Games are fundamentally, software.Development of Video Games follow SoftwareEngineering Practices and Methods.

    Unlike Business applications, a Video Game shouldcontinue with or without User Input.

    A major difference between Video Games and othersoftware is that development teams include more than

    just programmers. They include artists, level designers,writers, etc. similar to movie production.

  • 7/29/2019 Guide to Developing Video Games

    6/23

    Video Games

    Video Games always require a computer to receiveplayer input, perform logic and return feedback to theplayer.

    Thus, card games and board games are not consideredVideo Games (even if they have Video Game versions).

  • 7/29/2019 Guide to Developing Video Games

    7/23

    Modules & Managers

    Elements of a Video Game

  • 7/29/2019 Guide to Developing Video Games

    8/23

    Sample Modules

  • 7/29/2019 Guide to Developing Video Games

    9/23

    Sample Modules

    A Video Game is comprised of different systems workingtogether

    Each system is further divided into subsystems. For example: Game Logic may consist of Physics and AI Graphics may include 2D and 3D Resources may handle images, meshes, audio sources, etc.

    Each module may have a Manager that would handle allthe subsystems and their interactions between other systems

    Most of the modules correspond to specific hardware types

  • 7/29/2019 Guide to Developing Video Games

    10/23

    Specialized Modules

    There are devices which have specialized hardware forspecific modules. For example: Physics Modules (Physics Processing Units) Post Rendering Effects (Digital Signal Processor) Network Module Logging (Debugging)

  • 7/29/2019 Guide to Developing Video Games

    11/23

    Game Manager

    The Game Manager is the core of a Video Game.Ideally, it is the entry and exit point of the program. Thegame manager initializes the other modules in the game.

    All objects in the scene that are either visible, has logic orboth is managed by the Game Manager. These objectsare commonly called Game Objects.

    Game Objects are anything that is visible or has logic The Game Manager handles the Game Loop

  • 7/29/2019 Guide to Developing Video Games

    12/23

    Time Manager

    The Time Manager (or Timer) keeps track of the amountof time between iterations of the game loop

    Usually measured in milliseconds Other information that the Timer may keep track of: Time elapsed since the Video Game started Time elapsed between video output (to determine or

    control frames per second)

  • 7/29/2019 Guide to Developing Video Games

    13/23

    Input Manager

    The Input Manager (or simply Input) records the states of allavailable input devices to be used

    Input devices may differ per platform as listed: For Desktop/Laptops; keyboard, joystick, mouse, webcam,

    microphone, etc.

    For Consoles/Handhelds; game pad buttons, joystick, IR, deviceorientation or motion, multi-touchscreen, camera, microphone,etc.

    Other information the Input may record: Duration of an input state (ex: charging of a weapon) Events or Change of state of an input (ex: on press, on release) Order of consecutive events (ex: combo, double click)

  • 7/29/2019 Guide to Developing Video Games

    14/23

    Output Manager

    The Output Manager (or simply Output) handlesfeedback to the player

    Output is usually split into Audio and Video subsystems The Audio subsystem control the playing of music and

    sound effects

    The Video subsystem manages the visual feedback tothe player, which may be in 2D, 3D or both

  • 7/29/2019 Guide to Developing Video Games

    15/23

    The Game Loop

    Fundamental Structure for all Video Games

  • 7/29/2019 Guide to Developing Video Games

    16/23

    The Game Loop

  • 7/29/2019 Guide to Developing Video Games

    17/23

    The Game Loop

    As mentioned before, Video Games should continueprocessing whether the user has entered any input or not

    Thus, we cannot use blocking input functions such asscanf() orcin to receive input. Instead, we save thestates of all input devices to be used later on

    Then, we update the logic of the game and return anoutput before we repeat the cycle

    Each cycle in the game loop is called a frame, similar tothe frames of a movie. After all, a video game is aninteractive movie J

  • 7/29/2019 Guide to Developing Video Games

    18/23

    The Game Loop

    bool isPlaying = true;

    if (!Init()) return -1;

    // Enter the game loop

    while (isPlaying) {

    Input();

    Update();Output();

    }

    CleanUp();

  • 7/29/2019 Guide to Developing Video Games

    19/23

    Init() and CleanUp()

    Init() is used for initializing the video game, initializing themodules and loading resources

    CleanUp() is used for releasing resources and shuttingdown the other modules

    Note: The constructor and destructor may be used instead of Init()

    and CleanUp()

    These 2 functions are not part of the game loop

  • 7/29/2019 Guide to Developing Video Games

    20/23

    Input()

    Input() calls the Input Manager to recheck all the statesfrom the input devices

  • 7/29/2019 Guide to Developing Video Games

    21/23

    Update()

    Update() contains thelogic of the Video Game

    Objects react to playerinput or collisions

    Collision Tests, Physics andAI are also executed in the

    Update

    May not exactly be in theorder as shown

  • 7/29/2019 Guide to Developing Video Games

    22/23

    Output()

    Output() gives the playerfeedback

    Output devices differ perplatform but they generally

    involve both Video and

    Audio

    Rather than displayingdirectly to the screen, weput the output in a buffer

  • 7/29/2019 Guide to Developing Video Games

    23/23

    Exiting the Game Loop

    The Game Loop, and eventually the game itself, exitswhen the condition (

    isPlaying) becomes false