430 likes | 640 Views
CSC 343/642. Interactive 3D Game Development George J. Grevera, Ph.D. Game developer roles. Game developer roles. Producer Designer Programmer Visual artist Audio artist QA specialist. Game developer roles. Producer project leader scheduling, management, budget nontechnical.
E N D
CSC 343/642 Interactive 3D Game Development George J. Grevera, Ph.D.
Game developer roles • Producer • Designer • Programmer • Visual artist • Audio artist • QA specialist
Game developer roles • Producer • project leader • scheduling, management, budget • nontechnical
Game developer roles • Designer • decides theme and rules of game • lead designer, level designer, designer-writer, character designer, etc. • good communicators • design document: • maps, sketches of game objects, descriptions of plot devices, flow charts, tables of characteristics • narrative text of how all this fits together
Game developer roles • Programmer • combines ideas, artwork, sound, and music into game • translate user input into visual and audio experiences • game rules, character control, game event management, scoring • online games involve client and server code
Game developer roles • Visual artist • draws sketches and storyboards • creates models and texture artwork for characters, buildings, vehicles, icons • three principle types of 3D art: • models (created by modelers) • animations (created by animators) • textures (created by texture artists)
Three principle types of 3D art • 3D modeler • designs and builds player-characters, creatures, vehicles, etc. • tradeoff between realism and performance • Animator makes models move. • Texture artist wraps (2D) images around (3D) models.
Game developer roles • Audio artist • composes music and creates sound • intensifies game experience
Game developer roles • QA specialist • tester • Most problems (bugs) are visual or behavioral.
Elements of a 3D game • Game engine • Scripts (code) • GUI • Models • Textures • Sound • Music • Support infrastructure
Elements of a 3D game • Game engine • provides 3D scene rendering, networking, graphics, scripting, etc. • sophisticated rendering of game environments • textured polygon rendering • physics (time, motion, gravity, etc.) • collision detection
User input Graphics Audio Event timing and synchronization Scene graph Networking Scripting Objects and resources File I/O Elements of a 3D game:Game engine components
Elements of a 3D game • Scripts (code) • used to bring different parts of engine together • provide game play functions • enable the game world rules • examples: • scoring, managing players, defining player and vehicle behaviors, controlling GUI elements • Unity supports Javascript, C#, and Boo (similar to Python).
Elements of a 3D game: Scripts //PlatformMover.js vartargetA : GameObject; vartargetB : GameObject; var speed : float = 0.1; function FixedUpdate ( ) { var weight = Mathf.Cos(Time.time * speed * 2 * Mathf.PI) * 0.5 + 0.5; transform.position = targetA.transform.position * weight + targetB.transform.position * (1-weight); }
C# Example using UnityEngine; using System.Collections; public class GameObjectScript : MonoBehaviour { void DoMyWindow ( intwindowID ) { if (GUI.Button(new Rect(10, 20, 100, 20), "Hello World")) print( "Got a click" ); } private RectwindowRect = new Rect( 20, 300, 120, 50 ); void OnGUI ( ) { print( "in GameObjectScrip.cs:OnGUI()" ); GUI.Box( new Rect(10,10,100,90), "Menu" ); if (Input.GetKey(KeyCode.Escape) || GUI.Button( new Rect(20,40,80,20), "Quit" )) { Application.Quit(); //only works when game.exe is running Debug.Break(); //only works when debugging } GUI.Window( 59, windowRect, DoMyWindow, "My Window" ); } }
Elements of a 3D game • GUI (graphical user interface) • a combination of graphics and scripts that carries the visual appearance of the game and accepts the user’s control inputs • examples: • buttons, menus, messages, dialog boxes, etc.
Elements of a 3D game • Models • 3D models such as player’s character, buildings, trees, lampposts, vehicles, world, etc.
Elements of a 3D game • Textures • a.k.a. skins • define visually rendered appearance of all models • enhance performance (by reducing the need for geometric detail) • basically 2D images mapped onto 3D geometry (polygons)
Elements of a 3D game • Sounds • provide contextual flavoring • provide audio cues to events (you shoot) • provide audio cues to environment (twigs snap as you run in the forest) • background sounds (birds in a forest)
Elements of a 3D game • Music • used to establish a mood • used to establish context (you enter a dance hall) • examples: • http://www.youtube.com/watch?v=pKf4Dk80E94 • http://youtube.com/watch?v=zFEepARd81g • http://youtube.com/watch?v=h5fYwiXZeFU • http://youtube.com/watch?v=aZpD0btOZx8 • http://www.youtube.com/watch?v=zD-aeaE8lJs • http://www.youtube.com/watch?v=LetrpQ5m9Hw
Elements of a 3D game • Support infrastructure • important for persistent multiplayer games • game servers • web sites • updates and support • administrative tools • database
How to pick a game engine? • Top game engines: • http://www.devmaster.net/engines/
Basic control flow Platform layer Console Input model Simulation Resource manager Graphics 3D rendering Terrain Interiors Shapes and animation Networking Game engine concepts
Game engine concepts • Basic control flow • Mouse movement • Other input-related events • Elapsed time • Manages server and client objects • Network packets • Render current frame
Game engine concepts • Platform layer • Cross platform interface to game engine • Linux, Mac, Windows, Wii, Xbox 360, etc. • Responsible for: • File I/O • Network I/O • Graphics • User input • Events
Game engine concepts • Console • Compiler and/or interpreter • Handle GUI, game objects, game logic, and interfaces • Languages such as Javascript, C#, and Boo
Game engine concepts • Input model • translates Win32, X Windows, or Mac events into Torque events • action maps translate platform input events to specific function calls
Game engine concepts • Simulation • Game is driven by a stream of events. • Some engines allow the events to be journaled and replayed for debugging or demos.
Game engine concepts • Resource manager • Resource: terrain files, bitmaps (images), shapes, material lists, fonts, interiors, etc. • Managed by Resource Manager so only one instance of each is present.
Game engine concepts • Graphics • Rasterization via OpenGL • Texture Manager
Game engine concepts • 3D rendering • 3D world rendering system • camera orientation, FOV, and then render • Scene graph library traverses the world scene to determine which objects need to be rendered. • zones: • World is divided into zones and/or levels (volumes of space bounded by solid areas and portals) • The outside world is one zone. • Interior objects can have multiple interior zones.
Game engine concepts • Terrain library • outside world • skybox, animates and renders cloud layers, fog, etc. • Water is often rendered with LODs based on distance.
Game engine concepts • Interiors • Loading, rendering, and collision services need to be managed by the game engine for interior objects such as buildings.
Game engine concepts • Shapes and animation • manage the display and animation of shape models in the world • manage mesh data, animation keyframes, material lists, decal information, triggers, and LODs • multithreaded animations
Game engine concepts • Networking • Client/server framework is typical. • Some engine allow an instance of a game to be a client, a dedicated server, or both. • Some support up to 128 or more clients per server. • Packet loss, latency, and bandwidth can be a problem. • interpolation = smoothly move an object from where the client believes it is to where the server says it is. • extrapolation = guess where object is going • prediction = educated guess where object is going (more “intelligent” than extrapolation)
Next: Installing Unity3d assigment http://vimeo.com/10879508 http://unity3d.com/ Then email a screen dump of Unity running on your computer to me.