26
User Interface Dr. Scott Schaefer

User Interface

  • Upload
    morrie

  • View
    23

  • Download
    0

Embed Size (px)

DESCRIPTION

User Interface. Dr. Scott Schaefer. User Interface. Make it simple/easy to do common tasks Don’t obscure the FOV Simpler is typically better Consistency is important!. Diablo. Warcraft 3. Starcraft 2. World of Warcraft. Quake 3. Quake 4. Madden ‘09. Game Control. - PowerPoint PPT Presentation

Citation preview

Page 1: User Interface

User Interface

Dr. Scott Schaefer

Page 2: User Interface

User Interface

• Make it simple/easy to do common tasks

• Don’t obscure the FOV

• Simpler is typically better

• Consistency is important!

Page 3: User Interface

Diablo

Page 4: User Interface

Warcraft 3

Page 5: User Interface

Starcraft 2

Page 6: User Interface

World of Warcraft

Page 7: User Interface

Quake 3

Page 8: User Interface

Quake 4

Page 9: User Interface

Madden ‘09

Page 10: User Interface

Game Control

• Must consider single/multi-player aspect• Single player?• Networked multi-player?• Multi-player same machine?

• Platform limitations

Page 11: User Interface

Game Control: Keyboard/Mouse

• Connected to every PC but lacking on most other platforms

• Fine for single player or

multi-player networked

• Lots of buttons!

Page 12: User Interface

Game Control: Joystick

• Found on most consoles• Can also be connect to

PC via USB• Win NT supports 2 joysticks• Later versions support 16 joysticks• If you want to use joysticks for your game,

you can check out Xbox controllers from me for the semester. I only have 16 though.

Page 13: User Interface

Game Control: Others

Page 14: User Interface

Joystick Programming with Win32

#include <windows.h>

#include <mmsystem.h>

int joyGetNumDevs ( void )• Returns: number of joysticks supported by driver

(not number connected to machine)

Page 15: User Interface

Joystick Programming with Win32

MMResult joyGetDevCaps ( int id, JOYCAPS* cap, int size )

• id: id of the joystick being tested (-1 through 15)• cap: pointer to a JOYCAP structure• size: size of structure pointed to by cap• Returns: JOYERR_NOERROR if no error

Page 16: User Interface

Joystick Programming with Win32

• typedef struct { short wMid; short wPid; char szPname[MAXPNAMELEN]; unsigned int wXmin, wXmax, wYmin, wYmax, wZmin, wZmax; unsigned int wNumButtons; unsigned int wPeriodMin, wPeriodMax; unsigned int wRmin, wRmax, wUmin, wUmax, wVmin, wVmax; unsigned int wCaps; unsigned int wMaxAxes; unsigned int wNumAxes; unsigned int wMaxButtons; char szRegKey[MAXPNAMELEN]; char szOEMVxD[MAX_JOYSTICKOEMVXDNAME];

} JOYCAPS;

Page 17: User Interface

Joystick Programming with Win32

• typedef struct { short wMid; short wPid; char szPname[MAXPNAMELEN]; unsigned int wXmin, wXmax, wYmin, wYmax, wZmin, wZmax; unsigned int wNumButtons; unsigned int wPeriodMin, wPeriodMax; unsigned int wRmin, wRmax, wUmin, wUmax, wVmin, wVmax; unsigned int wCaps; unsigned int wMaxAxes; unsigned int wNumAxes; unsigned int wMaxButtons; char szRegKey[MAXPNAMELEN]; char szOEMVxD[MAX_JOYSTICKOEMVXDNAME];

} JOYCAPS;

number of buttons

Page 18: User Interface

Joystick Programming with Win32

• typedef struct { short wMid; short wPid; char szPname[MAXPNAMELEN]; unsigned int wXmin, wXmax, wYmin, wYmax, wZmin, wZmax; unsigned int wNumButtons; unsigned int wPeriodMin, wPeriodMax; unsigned int wRmin, wRmax, wUmin, wUmax, wVmin, wVmax; unsigned int wCaps; unsigned int wMaxAxes; unsigned int wNumAxes; unsigned int wMaxButtons; char szRegKey[MAXPNAMELEN]; char szOEMVxD[MAX_JOYSTICKOEMVXDNAME];

} JOYCAPS;

min/max bounds for “hat” controllers

Page 19: User Interface

Joystick Programming with Win32

MMResult joyGetPosEx ( int id, JOYINFOEX* info)

• id: id of the joystick being tested (-1 through 15)• info: pointer to a JOYINFOEX structure• Returns: JOYERR_NOERROR if no error

JOYERR_UNPLUGGED if joystick not connected

Page 20: User Interface

Joystick Programming with Win32

• typedef struct { int dwSize; int dwFlags; int dwXpos, dwYpos, dwZpos;int dwRpos, dwUpos, dwVpos;int dwButtons; int dwButtonNumber; int dwPOV; int dwReserved1; int dwReserved2;

} JOYINFOEX;

Page 21: User Interface

Joystick Programming with Win32

• typedef struct { int dwSize; int dwFlags; int dwXpos, dwYpos, dwZpos;int dwRpos, dwUpos, dwVpos;int dwButtons; int dwButtonNumber; int dwPOV; int dwReserved1; int dwReserved2;

} JOYINFOEX;

MUST be sizeof( JOYINFOEX)

Page 22: User Interface

Joystick Programming with Win32

• typedef struct { int dwSize; int dwFlags; int dwXpos, dwYpos, dwZpos;int dwRpos, dwUpos, dwVpos;int dwButtons; int dwButtonNumber; int dwPOV; int dwReserved1; int dwReserved2;

} JOYINFOEX;

SHOULD be JOY_RETURNALL

Page 23: User Interface

Joystick Programming with Win32

• typedef struct { int dwSize; int dwFlags; int dwXpos, dwYpos, dwZpos;int dwRpos, dwUpos, dwVpos;int dwButtons; int dwButtonNumber; int dwPOV; int dwReserved1; int dwReserved2;

} JOYINFOEX;

position of “hat” controllers

Page 24: User Interface

Joystick Programming with Win32

• typedef struct { int dwSize; int dwFlags; int dwXpos, dwYpos, dwZpos;int dwRpos, dwUpos, dwVpos;int dwButtons; int dwButtonNumber; int dwPOV; int dwReserved1; int dwReserved2;

} JOYINFOEX;

bit array with bit set if button currently pressed

Page 25: User Interface

Joystick Programming with Win32

• typedef struct { int dwSize; int dwFlags; int dwXpos, dwYpos, dwZpos;int dwRpos, dwUpos, dwVpos;int dwButtons; int dwButtonNumber; int dwPOV; int dwReserved1; int dwReserved2;

} JOYINFOEX;

number of buttons pressed

Page 26: User Interface

Joystick Programming with Win32

• typedef struct { int dwSize; int dwFlags; int dwXpos, dwYpos, dwZpos;int dwRpos, dwUpos, dwVpos;int dwButtons; int dwButtonNumber; int dwPOV; int dwReserved1; int dwReserved2;

} JOYINFOEX;

angle of POV controller