CSE 380 – Computer Game Programming GUIs for Games.

Slides:



Advertisements
Similar presentations
Instructors: Connie Hutchison & Christopher McCoy
Advertisements

Understanding an Apps Architecture ASFA Computer Science: Principles Fall 2013.
Working with Profiles in IX1D v 3 – A Tutorial © 2006 Interpex Limited All rights reserved Version 1.0.
Chapter 3 Creating a Business Letter with a Letterhead and Table
Introduction to Microsoft Excel 2010 Chapter Extension 3.
FireMonkey Deep Dive The Next Generation of Business Application Development.
1 Computer Graphics Chapter 2 Input Devices. RM[2]-2 Input Devices Logical Input Devices  Categorized based on functional characteristics.  Each device.
DESCRIBING INPUT DEVICES
Creating Rout Paths Using CAMMaster. Step 1 Import Gerber File. Import Gerber File. User Ctrl+W to window around data. User Ctrl+W to window around data.
OOP Design Patterns Chapters Design Patterns The main idea behind design patterns is to extract the high level interactions between objects and.
How to prepare a PowerPoint presentation
A graphical user interface (GUI) is a pictorial interface to a program. A good GUI can make programs easier to use by providing them with a consistent.
CS 376 Introduction to Computer Graphics 04 / 09 / 2007 Instructor: Michael Eckmann.
IS 1181 IS 118 Introduction to Development Tools VB Chapter 03.
Graphics Programming. In this class, we will cover: The difference between AWT and Swing Creating a frame Frame positioning Displaying information in.
Flowchart Start Input weight and height
Building Memory… Day 2 – November 15, What do we want the game to look like? Window to appear Start game button Difficulty level selection Number.
1 Chapter 5: Introduction To Form Builder. 2 Forms  Why Do We Use Form Builder?  Why Don’t We Use SQL Only?!
Chapter 2: Exploring the Desktop The Complete Guide to Linux System Administration.
AGD: 5. Game Arch.1 Objective o to discuss some of the main game architecture elements, rendering, and the game loop Animation and Games Development.
CHAPTER 17 Creating an Interactive 3D Environment © 2008 Cengage Learning EMEA.
User Interface Programming in C#: Direct Manipulation Chris North CS 3724: HCI.
Operating Systems Day 7. Status Bar in Notepad 1.Open notepad and type a document or file 2.Click on view menu 3.Select status bar to display the status.
GameMaker.  A lot of Different Definitions  Easier to Say What is NOT a Game  Movie is Not a Game  No Active Participation  Final Outcome is Fixed.
Created in 2011 at Liberty High School. Getting Started Overview on Magnet Tool – Graphics – Text – Image – Video – Sound – Wall A Sample Glog How to.
Guide to Programming with Python
PacMan by Midway, released 1980 CSE 380 – Computer Game Programming Real-Time Game Architecture.
CSE 380 – Computer Game Programming Render Threading Portal, by Valve,
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 16: Java Applets & AWT Fundamentals of Web Programming.
Word Processing Understanding Microsoft Word 10. Benefits of a Word Processor Word Processing Is the use of a computer and software to produce written.
Tennis for Two, 1958, by William Higinbotham, Brookhaven National Lab CSE 380 – Computer Game Programming Graphics Device Management.
WELCOME EF 105 Spring EF 105 Computer Methods in Engineering Problem Solving Week 2: FrontPage Introduction to Software Use to create Web Pages.
1 Goals and Objectives Goals Goals Understand how JavaScript makes it possible to interact with web pages, minimizes client/server traffic, enables verification.
Exploring Your Desktop To run presentation, please click on bottom arrow to right to change to next frame.
ArcGIS: ArcMap Layout View. Agenda Layout interface Using templates Page properties Data frame properties Toolbars Layout elements Fine-tuning Finishing.
1 k Jarek Rossignac,  2008 Processing  Install Processing  Learn how to edit, run, save, export, post programs  Understand.
Chapter 10 Fireworks: Part II The Web Warrior Guide to Web Design Technologies.
SE 320 – Introduction to Game Development Lecture 8: Animations, GUIs, Debugging and IDEs Lecturer: Gazihan Alankuş Please look at the last two slides.
Creating a Logo – Lesson 3 1 Creating a Logo Lesson 3.
Linux+ Guide to Linux Certification Chapter Ten The X Window System.
Computer Graphics, KKU. Lecture 101 Introduction to OpenGL.
Laboratory Exercise # 9 – Inserting Graphics to Documents Office Productivity Tools 1 Laboratory Exercise # 9 Inserting Graphics to Documents Objectives:
“The perfect project plan is possible if one first documents a list of all the unknowns.” Bill Langley.
Reference: The Game Loop Animation / Game loop 1. Update variables 2. [Get input from the user] (GameLoop only) 3. Draw (using variables)
Visual Basic Programming Introduction VB is one of the High level language VB has evolved from the BASIC language. BASIC stands for Beginners All-purpose.
SEEM3460 Tutorial GUI in Java. Some Basic GUI Terms Component (Control in some languages) the basic GUI unit something visible something that user can.
CSE 380 – Computer Game Programming Player Controls & Scrolling Mega Man, by Capcom, released 1988.
Programming games Problems. Schedule Various examples. Homework: rps, bo (don't go back to do this), cannonball, Video or Audio should be complete. Now.
CSE 380 – Computer Game Programming Tile Based Graphics & Scrolling Legend of Zelda, by Nintendo, released 1987.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al- ajmi Chapter 3 Some Visual Basic Controls and Events Visual Basic. NET.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Starting Out with Games & Graphics in C++ Tony Gaddis Chapter 8 The.
Computer Science I Animations. Bouncing ball. The if statement. Classwork/homework: bouncing something. Compress and upload work to Moodle.
>>0 >>1 >> 2 >> 3 >> 4 >>
(More) Event handling. Input and Windowed-OS’s Windowed OS’s (Windows, OSX, GUI-linux’s) send messages (events) when the user does something “on” the.
1 Chapter 6: Creating Oracle Data Block Forms. 2 Forms  Application with a graphical user interface that looks like a paper form  Used to insert, update,
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Reference: What is it? A multimedia python library – Window Management – Graphics geometric shapes bitmaps (sprites) – Input Mouse Keyboard.
Chapter 1: An Introduction to Visual Basic .NET
5.2 Microsoft Excel.
Weebly Elements, Continued
PYGAME.
Lecture 8: Graphics By: Eliav Menachi.
Using PowerPoint to Present Research Results
Introduction to Computers
Chapter 2 Visual Basic Interface
5.2 Microsoft Excel.
Game Loop Update & Draw.
Lecture 8: Graphics By: Eliav Menachi.
Presentation transcript:

CSE 380 – Computer Game Programming GUIs for Games

Game GUI Controls Stylistically fit in with game theme –drawn as artwork –careful font/color selection Same rules should apply as with other GUIs –align components –uniform style –balance –clarity (single word options are best) –keep it simple –minimize depth –don’t make assumptions about your player’s IQ

What are Game GUIs for? Starting/Stopping games –New Game, Save Game, Load Game, Pause, Continue, Quit Game Options –level of difficulty –character selection & properties (RPG in particular) –chapter selection Custom Controls Setup In-game Decisions (strategy in particular) Providing Help

Menu vs. In Game Controls Menu controls, typically –simple, elegant –textual –centered on screen –allows for menu tabbling –tied to game controllers as well In-game controls, typically –graphical –at bottom of screen –carefully grouped –tied to keystrokes for PC gaming (very important)

Halo’s Menu GUI

Starcraft’s In-game GUI

How might we make a GUI? We’ll build our own buttons

We know how do render images Use images to render: –buttons –cursor –other GUI images For buttons, use 2 images –mouse over –normal –each frame update the state based on mouse position

How do we test if the mouse is over a button? void Button::updateMouseOver(POINT *mousePoint) { // IS THE CURSOR OVER THIS BUTTON? if ((mousePoint->x >= x) && (mousePoint->x <= x + width) && (mousePoint->y >= y) && (mousePoint->y <= y + height) ) { mouseOver = true; } else { mouseOver = false; }

Render Lists Common approach in games Each frame: –make a list of items to render –iterate through the list and render each item –throw out the list RenderList is built and destroyed each frame We’ll use 2 render lists: –one for the GUI –one for the game world

Render List Cheating We’re not really going to use a list Why? –we don’t want to allocate memory dynamically Instead, we’ll use a giant array and pretend it’s a list –give the array a max size –don’t exceed that max size

A note about platform independence Today our game’s graphics are drawn using DirectX Tomorrow we may wish to use OpenGL How can we minimize the difficulty of switching? –virtual functions –See: GameGraphics & DirectXGameGraphics TextureManager & DirectXTextureManager

To maximize platform independence Confine technology-specific types and methods to technology-specific classes Don’t let DirectX spill over into your data management classes

How do we respond to input? 1.Get Input 1.If game state is in main menu Process input for main menu screen components Draw main menu screen Main Menu GUI 2.If game state is in game Process input for game screen components Draw game screen Game GUI & Game World

Getting Input We’ll use Windows methods To test if a key is currently pressed: –GetAsyncKeyState(key) & 0X8000 To get the current mouse position: –GetCursorPos(mousePoint); To test if a mouse button is currently pressed: –GetAsyncKeyState(VK_LBUTTON) & 0X8000

Each Frame We update data for: –all keys first key press? fill out struct for each key –mouse/cursor position –is mouse over buttons?

GameInput Each frame: void GameInput::processInput(Game *game, WINDOWINFO wi) { updateCursorPosition(wi, game->getGUI()->getCursor()); updateInputState(); respondToKeyboardInput(game); respondToMouseInput(game); }

Custom Behavior In the example I’ve given you, I have: –a core library –a custom example game Customized behavior is loaded by key child classes: –DirectXGraphics –XButtonEventHandler –XKeyEventHandler –XTextGenerator

Questions for you to figure out Where is the programmed response to hitting SHIFT-C? In what order are the GUI items rendered? How can I speed up or slow down the frame rate? How can you render something as more transparent? How can we render changing text? How can we render a Mini Map?

Mini-Map Rendering Naive Approach 1: –scale and render images on the fly Naive Approach 2: –pre scale images, render individually on the fly Improved Approach –pre build mini-map image for each level –render as single image

Mini-Map Rendering – How? Build off-screen surface as render target – CreateRenderTarget Render scaled version of world to surface – StretchRect Save to File as Image – D3DXSaveSurfaceToFileA Refs: see schedule page for DirectX9 & Util APIs