User Tools

Site Tools


cs498gd:games_engines_mobile_3d

Game Engines, Mobile, 3D


Putting It All Together: The Game Engine

  • The core of a game: it handles everything from input to graphics rendering
  • The point: reusability
    • E.g., Half-Life, Counter-Strike, Natural Selection, Opposing Forces, Blueshift are all essentially the same games.
      • Most of the source from each game is exactly the same.
      • They all use the Half-Life game engine.
      • Old example: HeXen using the DOOM game engine.
  • The game itself is not the same as the game engine.
    • car vs. engine

A typical game engine design, the components:

  • Input
  • Game logic
  • World database
  • Audio subsystem
  • World objects
  • Texture handling
  • Physics subsystem
  • Particle subsystem

Game engine design principles:

  • Should be as cross-platform as possible
  • Should be reusable
  • Should support cross-platform networking (e.g., games on Linux can network with games on Windows, and so on)
  • Should be extensible (e.g. should be simple to add new components or replace existing ones on a project-by-project basis)
  • Should run at adequate speeds on hardware that meets the “bare minimum” requirements
  • Should be designed in a way that is fairly simple to understand and teach

Professional-quality game engines:

(Note: Not an exhaustive list. The following are all C++-based.)


Mobile and Tablet Development

  • Mobile applications are not portable desktop (traditional) applications
  • Factors that differentiate mobile platforms from desktop platforms:
    • Limited memory
    • CPU speed
    • Display capabilities (screen size limit)
    • Apps vs. applications
    • Mobile internet access
    • User input (i.e., touch, multitouch, accelerometer)
    • Built-in capabilities (phone, GPS, camera)
    • Limited battery life

3D Space

  • x, y, and z coordinates
  • Determining +x, +y and +z directions
    • Right-hand system
      • +x to the right, +y up, +z out of the screen
        • determining positive rotation around axes
          • Open your right hand
          • Stick out the thumb
          • Point your thumb along one of the axes in a positive direction
          • Curl your fingers around the axis
          • A positive rotation around that axis will be in the same direction that your fingers curl
      • OpenGL, the industry's most widely used and supported 3D graphics application programming interface (API), uses the right-hand system by default.

3D Primitives

  • Points (x, y, z)
  • Lines
  • Line strip (connected)

image004.jpg

  • Line loop
  • Triangles
  • Triangle strip

image007.jpg

  • Triangle fan

image008.jpg

  • Quads (Quadrilaterals)
  • Quad strip (series of connected quadrilaterals)

  • Polygon (Polygon with an arbitrary number of vertices)

apple-fruit-wire.jpg

Transformations

  • Translation - moving a point from one coordinate in 3D space to another (uses matrix addition)
  • Scaling (uses matrix multiplication)
  • Rotation (uses matrix multiplcation; ugh)

Projections

  • Displaying the 3D world onto a 2D display
  • Like a camera, but think of a “Synthetic camera”.
    • Projection plane - the camera lens of the 3D world
      • Parallel projection:
        • Often used by CAD engineers
      • Orthogonal projections: top, front, and side views
        • Not meant to be realistic, i.e., there is loss of depth information

OpenGL

  • Open Graphics Library
  • Developed by Silicon Graphics, Inc. (SGI) in 1992
  • The industry's most widely used and supported 2D and 3D graphics application programming interface (API)
  • hardware and software independent
  • vendor neutral
  • Allows direct access to graphics hardware
    • Designed using a client/server paradigm, allowing the client application and the graphics server controlling the display hardware to exist on the same or separate machines
  • Windowing system independent, therefore contains no windowing operations or mechanisms for user input.
  • Uses a right-handed coordinate system by default for viewing transformations (hence, +x to the right, +y up, +z out of the screen)
  • One library that is provided with OpenGL that is used quite frequently: OpenGL Utility Library (GLU)
    • Contains several routines that use lower-level OpenGL commands to perform such tasks as setting up matrices for specific viewing orientations and projections, and rendering surfaces.
  • Does not provide direct support for complex geometrical shapes, such as cubes or spheres
    • must be built up from supported 3D primitives

3D Demos

  • The following must use eclipse with the Lightweight Java Game Library (lwjgl.org).
    • Download the zip archive containing the stable version of lwlgl to your ~/Downloads directory.
    • For each LWJGL program you run, you will need to add something like the following native library path argument to the “VM arguments” field in the “Run Configurations” for each class: -Djava.library.path=/export/home/hawkdom2/jchung/Downloads/lwjgl-2.9.0/native/linux
      • Substitute your userid for 'jchung' in the above line

Mobile Development (Android) Demo

  • First, in a Terminal run /usr/local/android/eclipse/eclipse.
  • Second, create a new Android Virtual Device (AVD) using the Android Virtual Device Manager from eclipse (see eclipse Window menu).

cs498gd/games_engines_mobile_3d.txt · Last modified: 2013/11/27 19:34 by jchung

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki