Half life 2 and source
Download
1 / 18

Half-Life 2 and Source - PowerPoint PPT Presentation


  • 112 Views
  • Updated On :

Half-Life 2 and Source. Presented by Jay Stelly. Tech lead decisions. Design a better structure for code development Investments in scripting Improve iterative creative processes Investments in distributed computing Investments in optimization. Code development. Larger group of engineers

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Half-Life 2 and Source' - nirav


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Half life 2 and source l.jpg

Half-Life 2 and Source

Presented by Jay Stelly


Tech lead decisions l.jpg
Tech lead decisions

  • Design a better structure for code development

  • Investments in scripting

  • Improve iterative creative processes

  • Investments in distributed computing

  • Investments in optimization


Code development l.jpg
Code development

  • Larger group of engineers

  • Larger code base

  • Lots of dependency

  • System coding vs. leaf coding

  • Lots of new technology, new interactions


Code development solutions l.jpg
Code development solutions

  • Reduce scope of programming decisions

  • Dynamic linking

    • Binary compatibility through interfaces

    • Similar to COM in theory, lighter weight in practice

    • Versioning system

    • Lots of changes behind layers

    • Build & deploy only changed components

  • One file leaf coding

    • Auto-registration systems

    • Systematic approaches to behavior, serialization, networking, hooks


Code development solutions5 l.jpg
Code development solutions

  • Faster compiles

    • DLLs are smaller

    • Reduced dependencies

    • Use incredibuild distributed to 12 machines

      • 4:1 - 8:1 improvement in most cases

    • Use VMPI

    • Many leaf coders use edit & continue

    • Console variables


Example shaders l.jpg
Example: Shaders

  • Graphics API isolated in a component (Shaderapi.dll)

    • Reduced dependency on dx9

    • Moved from dx8 to dx9 with almost no code changes outside this layer

  • Materials system isolated in a component

    • Allows mod authors to plug-in HLSL code

    • Leaf code uses material abstraction

  • Lots of custom shaders needed for speed

    • Unrolled into light/bone/state combinations

    • Used perl scripts to automate this metaprogramming

    • Write one, generate thousands

    • Use VMPI to distribute compilation of shaders

    • Incremental loading system

      • fast iteration by a single developer


Investments in scripting l.jpg
Investments in scripting

  • General scripting languages failed for us

    • Shader language

    • AI behavior language

    • Animation description language (shipped)

  • Simple hierarchical text blocks

    • Simple

    • Easy to parse

    • Extensible

    • No conditionals, no state

    • Tools that operate on all scripts

    • Maps, soundscapes, materials, surfaceproperties, scenes, ragdolls, game_sounds, etc.


Improve iterative creative processes l.jpg
Improve iterative creative processes

  • Reduce scope of creative work

    • Decrease cost of iterations

    • Improve quality of iterations

    • Dynamic linking

    • Symbolic linking

  • Add layers of abstraction

    • Architect around workflow

  • Re-examined core production processes

    • Level design

    • Animation

    • Localization

    • Audio

  • Allow creative people to iterate in isolation

    • Also in parallel


Example level design l.jpg
Example: Level design

  • Symbolic links to audio, scenes, animations, code

  • Some embedded structures remain

    • Prefabs

    • templates

  • Entity I/O

    • Visual scripting language

    • Connect named inputs to outputs

    • Symbolic link to code

    • Extensible and backwards compatible

    • Create specialized inputs & outputs as needed


Example level design continued l.jpg
Example: Level design (continued)

  • Response system

    • Contextual symbolic links

    • Entity I/O can trigger concept

    • Set of contextual choices results in symbolic link

      • Example: male/female speech

      • Chooses an appropriate thing to say given the character and the current game context

  • Shaders instead of textures

    • Symbolic link to rendering code

    • Symbolic link to proxy code

      • Procedurally modify shader variables

    • Symbolic link to actual textures


Example animation l.jpg
Example: Animation

  • Symbolic link to animation

    • Can also be a blended set

    • Serialization uses symbols

    • Named blend parameters

    • Models share animation, can override by name

  • Symbolic links to bones

    • Add new bones to specific animations & characters

    • Share animation among models

    • Named attachments for code & levels

    • Named skeleton merges for models

    • Dynamically linked


Example animation continued l.jpg
Example: Animation (continued)

  • A composite model for animation

    • N-way blend matrix

    • Partial skeleton animations

      • Gestures

    • Facial animation + procedural eye movement

    • Lip sync

    • IK

  • All are independent layers

  • Author characteristic gestures & postures for characters

    • Build tons of higher-level animations out of these building blocks

  • Shipped ~3 hours of scenes in HL2 vs. ~10 minutes in HL1


Example scenes l.jpg
Example: Scenes

  • Symbolic link to marks, objects, characters

    • Independently editable in the level

  • Link to AI commands

    • MoveTo, FaceTo, LookAt

  • Interactive with player

  • Link to animations, gestures, speech

    • Change gesture timing per-instance

  • Animation system builds composite from all of the above


Example audio l.jpg
Example: Audio

  • Game_sounds.txt

    • Simple config file for each sound effect

      • Allows single wave or set of random waves

      • Edit parameters (volume, attenuation, voice stealing, pitch shift, etc) per wave file

  • Soundscapes.txt

    • Position-based environmental sound

    • Also controls mixing

  • Soundmixers.txt

    • Classifies sound effects into groups across entire game

    • Named mixes of sound groups that can be linked into soundscapes

  • Dsp_presets.txt

    • DSP effect parameters, parametric algorithms

    • Automatic DSP tuning parameters


Example audio continued l.jpg
Example: Audio (continued)

  • Surfaceproperties.txt

    • Primarily for physics properties

    • Physically based sounds

      • Impacts

      • scrapes

      • footsteps

    • Audio reflectance properties

    • Audio hardness/softness for modifying physically based sounds

    • Symbolic links to actual sounds


Distributed computing l.jpg
Distributed computing

  • Half-Life used SMP/threaded systems for offline pre-processing

  • Source uses distributed systems instead (VMPI)

    • Scales higher

    • Cheaper

    • Better long-term (keep old machines)

    • Good for high latency jobs

  • Incredibuild

  • VMPI

    • Radiosity, hours in Half-Life, minutes in HL2

    • Visibilty

    • Shader re-compile

    • Scales to 32 machines

  • Upgraded to 1Gb/s network

  • Use idle workstations as slaves


Optimization l.jpg
Optimization

  • Lots of future work

  • Memory bound more often than instruction bound

    • Much easier for leaf coders to get memory bound

  • Otherwise fill bound, or I/O bound usually


Summary l.jpg
Summary

  • Isolate creative tasks, remove dependencies

  • Some architecture should be based on workflow & personnel

  • Programming in C++, scripting with simple text configuration files

  • Faster, higher quality iteration through focus, isolation, dynamic linking, reduced dependency, reduced compilation steps

  • Can use a larger team in a more parallel fashion


ad