SlideShare uma empresa Scribd logo
1 de 37
Effects Conduit

    Technical Presentation



        Insomniac Games
First things
  This is review for some

 I’ll try to make sure there’s fresh material
 I’m shy about talking about my ideas
     (false)




                    Insomniac Games
 
Outline

    What is the Effects                 API
                                   
    Conduit?                            Implementation
                                    
    Terminology                         Future
                                   
    Model                               References
                                   
    Components


                                        Quiz
                                    



                           Insomniac Games
 
What is the Effects Conduit?
    What is it not?

     Not a visual/particle effects system
     Not a sound effects system




                       Insomniac Games
 
What is the Conduit?
    A framework for collaboration

    A collection of components

     Suite of GUI tools for all developers
     Data builder
     Runtime

    Motivation

     In the past, programmers have spent a lot of time 
      “hooking­up” & tweaking effects – not a programming 
      task
     Developers (read: I) have struggled with this problem 
      time and time again.
     It’s solvable!

                          Insomniac Games
 
What is the Effects Conduit?
    Anybody can get effects into the game & iterate


    Separate work

     People who cause effect events
     People to respond to effect events

    Let people focus on what they’re good at

     Reduce busy­work
     Empower content creators

    Rapid prototyping

     Apply generic effects quickly
     Specialize effects as they become available

                           Insomniac Games
 
What is the Effects Conduit?
                                          Published in Game 
    Design used in                    

                                          Developer Magazine, 
     Insomniac Titles
                                          March, 2005
               Ratchet & 
               Clank 
               Future: 
               Tools of 
               Destruction




                             Insomniac Games
 
Outline

    What is the Effects                 API
                                   
    Conduit?                            Implementation
                                    
    Terminology                         Future
                                   
    Model                               References
                                   
    Components





                           Insomniac Games
 
Terminology (revised)
    Effect Event

        Something that happened during game­play
    



    Response

      What should happen in response to the Event
    
     Refer to Effect Specifications (▼)


    Spec

      How/where to play an effect
    
     Which effect to play




                             Insomniac Games
 
Outline

    What is the Effects                 API
                                   
    Conduit?                            Implementation
                                    
    Terminology                         Future
                                   
    Model                               References
                                   
    Components





                           Insomniac Games
 
Model
      Code
    
     Animation
     Game­play (scripts)




                     Insomniac Games
 
Model
    Most events are                  Some happen over 
                                
    instantaneous                    time
     Triggered, e.g.                      Triggered & 
                                            UnTriggered, e.g.
           BOUNCED
       

                                                 BURNING
           DAMAGED                           
       

                                                 HOVERING
           DIED                              
       

                                                 GRINDING
           EXPLODED                          
       

                                                 ROLLING
           LANDED                            
       

                                                 SMOKING
           THROWN                            
       




                        Insomniac Games
 
Outline

    What is the Effects                 API
                                   
    Conduit?                            Implementation
                                    
    Terminology                         Future
                                   
    Model                               References
                                   
    Components





                           Insomniac Games
 
Components

    GUI Tools

     “Conduit Tool”
           > fxconduit
       

           Configure 
       

           responses…




                         Insomniac Games
 
Components

    GUI Tools

     “Conduit Tool”
           … and Specs
       




                         Insomniac Games
 
Components
    GUI Tools

     “The Editor”
          [Un]Trigger events from key­frames of animation
      




                          Insomniac Games
 
Components
    Builder

     > conduitbuilder {level}
     Reads dependencies to determine what 
      Conduit data (responses & specs) is required
     Invokes SubsystemHandlers to build 
      subsystem data referenced by Conduit data



                       Insomniac Games
 
Outline

    What is the Effects                 API
                                   
    Conduit?                            Implementation
                                    
    Terminology                         Future
                                   
    Model                               References
                                   
    Components





                           Insomniac Games
 
API

    API is minimalistic


    Gameplay API in Moby/ControllerBaseUpdate

     void TriggerEffectEvent(type)
     Results TriggerEffectEvent(event&)

    EffectsConduit

     void HandleEvent(event&, results&)
     Subsystem& GetSubsystem(subsystem)
           For playing explicit specs
       




                                Insomniac Games
 
API
    EffectsSubsystem

      public: PlayExplicitSpec(spec, source*, …)
    
     protected: virtual bool ShouldSelect(event&)

     Pure Virtual:
            PlaySpec(spec, response*, source*, …)
        

            SetEffectPosition(handle, location*, facing*)
        

            StopEffect(handle, bool kill)
        




                            Insomniac Games
 
Outline

    What is the Effects                 API
                                   
    Conduit?                            Implementation
                                    
    Terminology                         Future
                                   
    Model                               References
                                   
    Components





                           Insomniac Games
 
Implementation
    ­ Block Diagram




Note: Some details are out­of­date


                                     Insomniac Games
 
Implementation ­ Data Structures




              Insomniac Games
 
Implementation ­ Selection
    Selection Criteria

     Mandatory (every Event and every Response specifies these)
           Update Class
       

           Event Type
       

     Optional (to further specialize Responses)
           Art Class                        Score = 1 << 0xF
       

           Other (Update Class)             Score = 1 << 0xE
       

           Tag                              Score = 1 << 0xD
       

           Gore                             Score = 1 << 0xC
       

           Material                         Score = 1 << 0x9/A/B
       

           Value                            Score = 1 * range
       



                              Insomniac Games
 
Implementation ­ Selection
    Effect Event triggered (from code, gp, anim, etc.)

    Each Subsystem (visual, sound, dialogue, etc.)

    EffectsSubsystem::HandleEvent(event&, results&)
      Each class from source to IGG::GameObjectUpdate
            Consider Responses to Event Type
        

                  Compare Event with Response for each criterion:
              
                     Unspecified:  ignore criteria
                     Don’t match: reject response
                     Match:        add criteria score to response
     Until a Response matches
     All highest scoring Responses (for the class) are selected
     Each selected response
            Call effects system (visual, sound, etc.) to play Specs
        

    The same Event can match at different Classes in 

    different Subsystems!
                                   Insomniac Games
 
Implementation ­ Responses
    Structurally similar to Effect Event

     Where Event may identify only a material id, 
      Response can identify class, subclass, or id.
     Where Event may identify a value, Response 
      identifies a range of values.
  Contains a list of Specs to be played if 

  Response is selected
 Play on Other


                      Insomniac Games
 
Implementation – Specs
    Specs configure effects


    Subsystem Specs extend base Spec

     Base Spec includes
           AttachType
       

           UpdateMode
       

           Refractory period
       

     Derived Spec contains subsystem­specific 
      configuration data, for example:
           Volume (for Sound)
       

           FxPackage (for Visual)
       

           Priority (for Dialogue)
       




                               Insomniac Games
 
Implementation ­ TrackedEffects
    TrackedEffect::Collection is a member of 

    EffectEventResults, returned by 
    TriggerEffectEvent
    Operate on the Collection as a whole…

      EffectEventResults::Untrigger(bool kill)
    
     TrackedEffect::Collection::SetPosition(…)

    … Or modify individual effects

     Iterate over TrackedEffects
     Optionally filter by Subsystem



                         Insomniac Games
 
Outline

    What is the Effects                 API
                                   
    Conduit?                            Implementation
                                    
    Terminology                         Future
                                   
    Model                               References
                                   
    Components





                           Insomniac Games
 
Future
    Optimizations

     Never untrigger events… only results
           Remains only in animation
       

     Multi­level jump table for responses
     Hint selected responses in results
     Cache responses or specs in results

    In practice, performance impact is small



                          Insomniac Games
 
Future
    Features

     Contexts
     Better searching in tool
     Tool & Editor integrated into Luna




                       Insomniac Games
 
Outline

    What is the Effects                 API
                                   
    Conduit?                            Implementation
                                    
    Terminology                         Future
                                   
    Model                               References
                                   
    Components





                           Insomniac Games
 
References & More Info
    Game Developer Magazine

     “Moment of Impact”, March 2005.




                     Insomniac Games
 
Quiz – Question 1
    Matt found that rifle bullet hits weren’t playing material­specific 

    effects.
    Here were the responses to Projectile_Rifle_Bullet_HIT in the 

    VisualEffectsSubsystem:




    When a rifle bullet hit the ground, Matt expected the Conduit to play a 

    spec under the Projectile_Rifle_Bullet_HIT {materials={Ground}} 
    response, but it didn’t.
    Why not?  How should you fix it?  (The answer is on the next page.)


                                  Insomniac Games
 
Quiz – A1
    The Conduit was selecting the 

    Projectile_Rifle_Bullet_HIT 
    {tag=NOT_PLAYER} response 
    instead of the 
    Projectile_Rifle_Bullet_HIT 
    {materials={Ground}} response.  
    Both responses matched the 
    event since both of them correctly 
    describe the event that happened.  
    (The bullet did hit a “not player”, 
    and the bullet also hit a material 
    ground.)  But the 
    tag=NOT_PLAYER response got 
    a higher score, and therefore beat 
    the materials={Ground} response.
    So how should he fix it?

    Well, the answer is to delete the 

    tag=NOT_PLAYER response.  
    That way, the Conduit will select 
    the next­best match… the 
    materials={Ground} response!

                                  Insomniac Games
 
Quiz – Question 2
    Okay, so now the responses to Projectile_Rifle_Bullet_HIT in the 

    VisualEffectsSubsystem are:
    When a bullet hits the ground, the Conduit plays the effects that Matt wants.





    But when a bullet hits metal, there are no visual effects at all!

    How can Matt get everything he wants… ground effects on ground, and 

    generic effects on metal?

                                  Insomniac Games
 
Quiz – Answer 2
    The reason Matt was getting no visual effects when the rifle bullet hit 

    metal, was because none of the responses matched that event.  
    What Matt needs is a response that will always match when a rifle 
    bullet hits anything.  Remember that the Conduit always selects the 
    most specific response(s) to any event.  So even if there’s a 
    response that always matches, others may play instead because 
    they’re more specific.




                                Insomniac Games
 

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Qt Workshop
Qt WorkshopQt Workshop
Qt Workshop
 
Telegram Bot
Telegram BotTelegram Bot
Telegram Bot
 
C# Loops
C# LoopsC# Loops
C# Loops
 
Clean coding-practices
Clean coding-practicesClean coding-practices
Clean coding-practices
 
A simple snake game project
A simple snake game projectA simple snake game project
A simple snake game project
 
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...Python Programming Language | Python Classes | Python Tutorial | Python Train...
Python Programming Language | Python Classes | Python Tutorial | Python Train...
 
Introduction to python 3
Introduction to python 3Introduction to python 3
Introduction to python 3
 
Python Workshop
Python WorkshopPython Workshop
Python Workshop
 
02 - Basics of Qt
02 - Basics of Qt02 - Basics of Qt
02 - Basics of Qt
 
Matplotlib Review 2021
Matplotlib Review 2021Matplotlib Review 2021
Matplotlib Review 2021
 
Python programming : Control statements
Python programming : Control statementsPython programming : Control statements
Python programming : Control statements
 
NLP
NLPNLP
NLP
 
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
Tkinter Python Tutorial | Python GUI Programming Using Tkinter Tutorial | Pyt...
 
Kotlin
KotlinKotlin
Kotlin
 
Unsupervised learning represenation with DCGAN
Unsupervised learning represenation with DCGANUnsupervised learning represenation with DCGAN
Unsupervised learning represenation with DCGAN
 
JavaScript Data Types
JavaScript Data TypesJavaScript Data Types
JavaScript Data Types
 
Clean code
Clean codeClean code
Clean code
 
What is Multithreading In Python | Python Multithreading Tutorial | Edureka
What is Multithreading In Python | Python Multithreading Tutorial | EdurekaWhat is Multithreading In Python | Python Multithreading Tutorial | Edureka
What is Multithreading In Python | Python Multithreading Tutorial | Edureka
 
20151205フルスクラッチcms作成のノウハウ With Laravel
20151205フルスクラッチcms作成のノウハウ With Laravel20151205フルスクラッチcms作成のノウハウ With Laravel
20151205フルスクラッチcms作成のノウハウ With Laravel
 
Python PPT
Python PPTPython PPT
Python PPT
 

Destaque

Conduit Aug 2010
Conduit Aug 2010Conduit Aug 2010
Conduit Aug 2010
Guy Malachi
 
17th Edition Part 5 1
17th  Edition  Part 5 117th  Edition  Part 5 1
17th Edition Part 5 1
Paul Holden
 
631 earthing-systems-fundamentals-of-calculation
631 earthing-systems-fundamentals-of-calculation631 earthing-systems-fundamentals-of-calculation
631 earthing-systems-fundamentals-of-calculation
ursharji
 
Max demand
Max demandMax demand
Max demand
popet
 

Destaque (20)

Review of Previous ETAP Forums - Deepak Maheshwari
Review of Previous ETAP Forums - Deepak MaheshwariReview of Previous ETAP Forums - Deepak Maheshwari
Review of Previous ETAP Forums - Deepak Maheshwari
 
Solid copper earthing grounding rods
Solid copper earthing grounding rodsSolid copper earthing grounding rods
Solid copper earthing grounding rods
 
Miniature Circuit Breakers BC-E Series - Fuji Electric
Miniature Circuit Breakers BC-E Series - Fuji ElectricMiniature Circuit Breakers BC-E Series - Fuji Electric
Miniature Circuit Breakers BC-E Series - Fuji Electric
 
How to remove conduit search and other toolbars — extended guide
How to remove conduit search and other toolbars — extended guideHow to remove conduit search and other toolbars — extended guide
How to remove conduit search and other toolbars — extended guide
 
Cable lugs-lv-lugs-cembre
Cable lugs-lv-lugs-cembreCable lugs-lv-lugs-cembre
Cable lugs-lv-lugs-cembre
 
Conduit Aug 2010
Conduit Aug 2010Conduit Aug 2010
Conduit Aug 2010
 
GDC2011 - Level Design: The Design Conduit
GDC2011 - Level Design: The Design ConduitGDC2011 - Level Design: The Design Conduit
GDC2011 - Level Design: The Design Conduit
 
Catalog thiết bị điện Fuji MCB BC E Series
Catalog thiết bị điện Fuji MCB BC E SeriesCatalog thiết bị điện Fuji MCB BC E Series
Catalog thiết bị điện Fuji MCB BC E Series
 
Supermarket Rack Systems
Supermarket Rack SystemsSupermarket Rack Systems
Supermarket Rack Systems
 
Nota
NotaNota
Nota
 
Catalogue MCB Fuji- Miniature Circuit Breaker Fuji - Beeteco.com
Catalogue MCB Fuji- Miniature Circuit Breaker Fuji - Beeteco.comCatalogue MCB Fuji- Miniature Circuit Breaker Fuji - Beeteco.com
Catalogue MCB Fuji- Miniature Circuit Breaker Fuji - Beeteco.com
 
17th Edition Part 5 1
17th  Edition  Part 5 117th  Edition  Part 5 1
17th Edition Part 5 1
 
Catalog Nichifu - www.haophuong.com
Catalog Nichifu - www.haophuong.comCatalog Nichifu - www.haophuong.com
Catalog Nichifu - www.haophuong.com
 
631 earthing-systems-fundamentals-of-calculation
631 earthing-systems-fundamentals-of-calculation631 earthing-systems-fundamentals-of-calculation
631 earthing-systems-fundamentals-of-calculation
 
Contents sre cable tray
Contents sre cable trayContents sre cable tray
Contents sre cable tray
 
Improving energy efficiency in electrical system
Improving energy efficiency in electrical systemImproving energy efficiency in electrical system
Improving energy efficiency in electrical system
 
Max demand
Max demandMax demand
Max demand
 
AUDI A4 B5 1.8L 1996 ELECTRICAL EQUIPMENT 01 84 multi-function steering wheel...
AUDI A4 B5 1.8L 1996 ELECTRICAL EQUIPMENT 01 84 multi-function steering wheel...AUDI A4 B5 1.8L 1996 ELECTRICAL EQUIPMENT 01 84 multi-function steering wheel...
AUDI A4 B5 1.8L 1996 ELECTRICAL EQUIPMENT 01 84 multi-function steering wheel...
 
AUTOMATED ELECTRICAL PROTECTION SYSTEM FOR DOMESTIC APPLICATION
AUTOMATED ELECTRICAL PROTECTION SYSTEM FOR DOMESTIC APPLICATIONAUTOMATED ELECTRICAL PROTECTION SYSTEM FOR DOMESTIC APPLICATION
AUTOMATED ELECTRICAL PROTECTION SYSTEM FOR DOMESTIC APPLICATION
 
TRITECH DESIGN ACADEMY
TRITECH DESIGN ACADEMYTRITECH DESIGN ACADEMY
TRITECH DESIGN ACADEMY
 

Semelhante a Effects Conduit

„Emotional Flowers“ User Centered Game Design
„Emotional Flowers“ User Centered Game Design„Emotional Flowers“ User Centered Game Design
„Emotional Flowers“ User Centered Game Design
Martin Ortner
 
Inside Picnik: How We Built Picnik (and What We Learned Along the Way)
Inside Picnik: How We Built Picnik (and What We Learned Along the Way)Inside Picnik: How We Built Picnik (and What We Learned Along the Way)
Inside Picnik: How We Built Picnik (and What We Learned Along the Way)
jjhuff
 
Os Grouchnikov
Os GrouchnikovOs Grouchnikov
Os Grouchnikov
oscon2007
 
Metadata to create and collect
Metadata to create and collectMetadata to create and collect
Metadata to create and collect
vrt-medialab
 
2009 05 01 How To Build A Lean Startup Step By Step
2009 05 01 How To Build A Lean Startup Step By Step2009 05 01 How To Build A Lean Startup Step By Step
2009 05 01 How To Build A Lean Startup Step By Step
Eric Ries
 
Product Management In Scrum Kozlov
Product Management In Scrum KozlovProduct Management In Scrum Kozlov
Product Management In Scrum Kozlov
Alexey Krivitsky
 
InfinitySheep
InfinitySheepInfinitySheep
InfinitySheep
atmarkit
 
The Lean Startup at Web 2.0 Expo
The Lean Startup at Web 2.0 ExpoThe Lean Startup at Web 2.0 Expo
The Lean Startup at Web 2.0 Expo
Venture Hacks
 
Unobtrusive Javascript
Unobtrusive Javascript Unobtrusive Javascript
Unobtrusive Javascript
guest3c5779
 

Semelhante a Effects Conduit (20)

Prototyping Adobe AIR Applications with Fireworks CS4
Prototyping Adobe AIR Applications with Fireworks CS4Prototyping Adobe AIR Applications with Fireworks CS4
Prototyping Adobe AIR Applications with Fireworks CS4
 
„Emotional Flowers“ User Centered Game Design
„Emotional Flowers“ User Centered Game Design„Emotional Flowers“ User Centered Game Design
„Emotional Flowers“ User Centered Game Design
 
Vision08v7
Vision08v7Vision08v7
Vision08v7
 
Java/Swing
Java/SwingJava/Swing
Java/Swing
 
Inside Picnik: How We Built Picnik (and What We Learned Along the Way)
Inside Picnik: How We Built Picnik (and What We Learned Along the Way)Inside Picnik: How We Built Picnik (and What We Learned Along the Way)
Inside Picnik: How We Built Picnik (and What We Learned Along the Way)
 
Pc54
Pc54Pc54
Pc54
 
Os Grouchnikov
Os GrouchnikovOs Grouchnikov
Os Grouchnikov
 
Metadata to create and collect
Metadata to create and collectMetadata to create and collect
Metadata to create and collect
 
2009 05 01 How To Build A Lean Startup Step By Step
2009 05 01 How To Build A Lean Startup Step By Step2009 05 01 How To Build A Lean Startup Step By Step
2009 05 01 How To Build A Lean Startup Step By Step
 
iPhone - How To Brand - Web Tuesday
iPhone - How To Brand - Web TuesdayiPhone - How To Brand - Web Tuesday
iPhone - How To Brand - Web Tuesday
 
Product Management In Scrum Kozlov
Product Management In Scrum KozlovProduct Management In Scrum Kozlov
Product Management In Scrum Kozlov
 
Tesi Laurea Specialistica
Tesi Laurea SpecialisticaTesi Laurea Specialistica
Tesi Laurea Specialistica
 
Understanding Customer Choice May 09 Rwg
Understanding Customer Choice May 09 RwgUnderstanding Customer Choice May 09 Rwg
Understanding Customer Choice May 09 Rwg
 
Conquering Gef Part 1: Effectively creating a well designed graphical editor
Conquering Gef Part 1: Effectively creating a well designed graphical editorConquering Gef Part 1: Effectively creating a well designed graphical editor
Conquering Gef Part 1: Effectively creating a well designed graphical editor
 
InfinitySheep
InfinitySheepInfinitySheep
InfinitySheep
 
The Lean Startup at Web 2.0 Expo
The Lean Startup at Web 2.0 ExpoThe Lean Startup at Web 2.0 Expo
The Lean Startup at Web 2.0 Expo
 
S is for Spec
S is for SpecS is for Spec
S is for Spec
 
My History with Atlassian Tools, and Why I'm Moving to Studio
My History with Atlassian Tools, and Why I'm Moving to StudioMy History with Atlassian Tools, and Why I'm Moving to Studio
My History with Atlassian Tools, and Why I'm Moving to Studio
 
Act! Technical Training
Act! Technical TrainingAct! Technical Training
Act! Technical Training
 
Unobtrusive Javascript
Unobtrusive Javascript Unobtrusive Javascript
Unobtrusive Javascript
 

Effects Conduit

  • 1. Effects Conduit Technical Presentation   Insomniac Games
  • 2. First things This is review for some   I’ll try to make sure there’s fresh material  I’m shy about talking about my ideas  (false) Insomniac Games  
  • 3. Outline What is the Effects  API   Conduit? Implementation  Terminology  Future   Model References   Components  Quiz  Insomniac Games  
  • 4. What is the Effects Conduit? What is it not?   Not a visual/particle effects system  Not a sound effects system Insomniac Games  
  • 5. What is the Conduit? A framework for collaboration  A collection of components   Suite of GUI tools for all developers  Data builder  Runtime Motivation   In the past, programmers have spent a lot of time  “hooking­up” & tweaking effects – not a programming  task  Developers (read: I) have struggled with this problem  time and time again.  It’s solvable! Insomniac Games  
  • 6. What is the Effects Conduit? Anybody can get effects into the game & iterate  Separate work   People who cause effect events  People to respond to effect events Let people focus on what they’re good at   Reduce busy­work  Empower content creators Rapid prototyping   Apply generic effects quickly  Specialize effects as they become available Insomniac Games  
  • 7. What is the Effects Conduit? Published in Game  Design used in   Developer Magazine,   Insomniac Titles March, 2005 Ratchet &  Clank  Future:  Tools of  Destruction Insomniac Games  
  • 8. Outline What is the Effects  API   Conduit? Implementation  Terminology  Future   Model References   Components  Insomniac Games  
  • 9. Terminology (revised) Effect Event  Something that happened during game­play  Response  What should happen in response to the Event   Refer to Effect Specifications (▼) Spec  How/where to play an effect   Which effect to play Insomniac Games  
  • 10. Outline What is the Effects  API   Conduit? Implementation  Terminology  Future   Model References   Components  Insomniac Games  
  • 11. Model Code   Animation  Game­play (scripts) Insomniac Games  
  • 12. Model Most events are  Some happen over    instantaneous time  Triggered, e.g.  Triggered &  UnTriggered, e.g. BOUNCED  BURNING DAMAGED   HOVERING DIED   GRINDING EXPLODED   ROLLING LANDED   SMOKING THROWN   Insomniac Games  
  • 13. Outline What is the Effects  API   Conduit? Implementation  Terminology  Future   Model References   Components  Insomniac Games  
  • 14. Components GUI Tools   “Conduit Tool” > fxconduit  Configure   responses… Insomniac Games  
  • 15. Components GUI Tools   “Conduit Tool” … and Specs  Insomniac Games  
  • 16. Components GUI Tools   “The Editor” [Un]Trigger events from key­frames of animation  Insomniac Games  
  • 17. Components Builder   > conduitbuilder {level}  Reads dependencies to determine what  Conduit data (responses & specs) is required  Invokes SubsystemHandlers to build  subsystem data referenced by Conduit data Insomniac Games  
  • 18. Outline What is the Effects  API   Conduit? Implementation  Terminology  Future   Model References   Components  Insomniac Games  
  • 19. API API is minimalistic  Gameplay API in Moby/ControllerBaseUpdate   void TriggerEffectEvent(type)  Results TriggerEffectEvent(event&) EffectsConduit   void HandleEvent(event&, results&)  Subsystem& GetSubsystem(subsystem) For playing explicit specs  Insomniac Games  
  • 20. API EffectsSubsystem  public: PlayExplicitSpec(spec, source*, …)   protected: virtual bool ShouldSelect(event&)  Pure Virtual: PlaySpec(spec, response*, source*, …)  SetEffectPosition(handle, location*, facing*)  StopEffect(handle, bool kill)  Insomniac Games  
  • 21. Outline What is the Effects  API   Conduit? Implementation  Terminology  Future   Model References   Components  Insomniac Games  
  • 22. Implementation ­ Block Diagram Note: Some details are out­of­date Insomniac Games  
  • 24. Implementation ­ Selection Selection Criteria   Mandatory (every Event and every Response specifies these) Update Class  Event Type   Optional (to further specialize Responses) Art Class Score = 1 << 0xF  Other (Update Class) Score = 1 << 0xE  Tag Score = 1 << 0xD  Gore Score = 1 << 0xC  Material Score = 1 << 0x9/A/B  Value Score = 1 * range  Insomniac Games  
  • 25. Implementation ­ Selection Effect Event triggered (from code, gp, anim, etc.)  Each Subsystem (visual, sound, dialogue, etc.)  EffectsSubsystem::HandleEvent(event&, results&)  Each class from source to IGG::GameObjectUpdate Consider Responses to Event Type  Compare Event with Response for each criterion:   Unspecified: ignore criteria  Don’t match: reject response  Match: add criteria score to response  Until a Response matches  All highest scoring Responses (for the class) are selected  Each selected response Call effects system (visual, sound, etc.) to play Specs  The same Event can match at different Classes in   different Subsystems! Insomniac Games  
  • 26. Implementation ­ Responses Structurally similar to Effect Event   Where Event may identify only a material id,  Response can identify class, subclass, or id.  Where Event may identify a value, Response  identifies a range of values. Contains a list of Specs to be played if   Response is selected  Play on Other Insomniac Games  
  • 27. Implementation – Specs Specs configure effects  Subsystem Specs extend base Spec   Base Spec includes AttachType  UpdateMode  Refractory period   Derived Spec contains subsystem­specific  configuration data, for example: Volume (for Sound)  FxPackage (for Visual)  Priority (for Dialogue)  Insomniac Games  
  • 28. Implementation ­ TrackedEffects TrackedEffect::Collection is a member of   EffectEventResults, returned by  TriggerEffectEvent Operate on the Collection as a whole…  EffectEventResults::Untrigger(bool kill)   TrackedEffect::Collection::SetPosition(…) … Or modify individual effects   Iterate over TrackedEffects  Optionally filter by Subsystem Insomniac Games  
  • 29. Outline What is the Effects  API   Conduit? Implementation  Terminology  Future   Model References   Components  Insomniac Games  
  • 30. Future Optimizations   Never untrigger events… only results Remains only in animation   Multi­level jump table for responses  Hint selected responses in results  Cache responses or specs in results In practice, performance impact is small  Insomniac Games  
  • 31. Future Features   Contexts  Better searching in tool  Tool & Editor integrated into Luna Insomniac Games  
  • 32. Outline What is the Effects  API   Conduit? Implementation  Terminology  Future   Model References   Components  Insomniac Games  
  • 33. References & More Info Game Developer Magazine   “Moment of Impact”, March 2005. Insomniac Games  
  • 34. Quiz – Question 1 Matt found that rifle bullet hits weren’t playing material­specific   effects. Here were the responses to Projectile_Rifle_Bullet_HIT in the   VisualEffectsSubsystem: When a rifle bullet hit the ground, Matt expected the Conduit to play a   spec under the Projectile_Rifle_Bullet_HIT {materials={Ground}}  response, but it didn’t. Why not?  How should you fix it?  (The answer is on the next page.)  Insomniac Games  
  • 35. Quiz – A1 The Conduit was selecting the   Projectile_Rifle_Bullet_HIT  {tag=NOT_PLAYER} response  instead of the  Projectile_Rifle_Bullet_HIT  {materials={Ground}} response.   Both responses matched the  event since both of them correctly  describe the event that happened.   (The bullet did hit a “not player”,  and the bullet also hit a material  ground.)  But the  tag=NOT_PLAYER response got  a higher score, and therefore beat  the materials={Ground} response. So how should he fix it?  Well, the answer is to delete the   tag=NOT_PLAYER response.   That way, the Conduit will select  the next­best match… the  materials={Ground} response! Insomniac Games  
  • 36. Quiz – Question 2 Okay, so now the responses to Projectile_Rifle_Bullet_HIT in the   VisualEffectsSubsystem are: When a bullet hits the ground, the Conduit plays the effects that Matt wants.  But when a bullet hits metal, there are no visual effects at all!  How can Matt get everything he wants… ground effects on ground, and   generic effects on metal? Insomniac Games  
  • 37. Quiz – Answer 2 The reason Matt was getting no visual effects when the rifle bullet hit   metal, was because none of the responses matched that event.   What Matt needs is a response that will always match when a rifle  bullet hits anything.  Remember that the Conduit always selects the  most specific response(s) to any event.  So even if there’s a  response that always matches, others may play instead because  they’re more specific. Insomniac Games