SlideShare a Scribd company logo
1 of 31
Adventures in Data Compilation
    Uncharted: Drake’s Fortune


           Dan Liebgold

           Naughty Dog, Inc.
           Santa Monica, CA


 Game Developers Conference, 2008
Motivation


      Code is compiled, data is “built”
      What should be code, what should be data? Plenty, right?
          Game logic, geometry, textures...
      What is not clearly either?
          Particle definitions, animation states & blend trees, event &
          gameplay scripting/tuning, more...
Motivation


      Code is compiled, data is “built”
      What should be code, what should be data? Plenty, right?
          Game logic, geometry, textures...
      What is not clearly either?
          Particle definitions, animation states & blend trees, event &
          gameplay scripting/tuning, more...
Motivation


      Code is compiled, data is “built”
      What should be code, what should be data? Plenty, right?
          Game logic, geometry, textures...
      What is not clearly either?
          Particle definitions, animation states & blend trees, event &
          gameplay scripting/tuning, more...
Motivation


      Code is compiled, data is “built”
      What should be code, what should be data? Plenty, right?
          Game logic, geometry, textures...
      What is not clearly either?
          Particle definitions, animation states & blend trees, event &
          gameplay scripting/tuning, more...
Motivation


      Code is compiled, data is “built”
      What should be code, what should be data? Plenty, right?
          Game logic, geometry, textures...
      What is not clearly either?
          Particle definitions, animation states & blend trees, event &
          gameplay scripting/tuning, more...
The in between stuff


      Moving on from GOAL
      Lisp supports the code/data duality
      We will build DC in Scheme, a dialect of LISP!
The in between stuff


      Moving on from GOAL
      Lisp supports the code/data duality
      We will build DC in Scheme, a dialect of LISP!
The in between stuff


      Moving on from GOAL
      Lisp supports the code/data duality
      We will build DC in Scheme, a dialect of LISP!
Architecture
Architecture
Architecture
Architecture
Example




  Let’s define a player start position:
  (define-export *player-start*
   (new locator
        :trans *origin*
        :rot (axis-angle->quaternion *y-axis* 45)
        ))
Start with some types




   (deftype vec4 (:align 16)
     ((x float)
      (y float)
      (z float)
      (w float :default 0)
      )
     )
Start with some types




   (deftype vec4 (:align 16)
     ((x float)
      (y float)
      (z float)
      (w float :default 0)
      )
     )
Start with some types




   (deftype vec4 (:align 16)
     ((x float)
      (y float)
      (z float)
      (w float :default 0)
      )
     )
Start with some types




   (deftype vec4 (:align 16)
     ((x float)
      (y float)
      (z float)
      (w float :default 0)
      )
     )
Start with some types




   (deftype vec4 (:align 16)
     ((x float)
      (y float)
      (z float)
      (w float :default 0)
      )
     )
Start with some types

   (deftype vec4 (:align 16)
     ((x float)
      (y float)
      (z float)
      (w float :default 0)
      )
     )
   struct Vec4
   {
     float m_x;
     float m_y;
     float m_z;
     float m_w;
   };
Types continued


  (deftype quaternion (:parent vec4)
   ())

  (deftype point (:parent vec4)
   ((w float :default 1)
    ))
  (deftype locator ()
   ((trans point :inline #t)
    (rot quaternion :inline #t)
    )
   )
Types continued


  (deftype quaternion (:parent vec4)
   ())

  (deftype point (:parent vec4)
   ((w float :default 1)
    ))
  (deftype locator ()
   ((trans point :inline #t)
    (rot quaternion :inline #t)
    )
   )
Types continued


  (deftype quaternion (:parent vec4)
   ())

  (deftype point (:parent vec4)
   ((w float :default 1)
    ))
  struct Locator
  {
    Point m_trans;
    Quaternion m_rot;
  };
Define a function



  (define (axis-angle->quat axis angle)
   (let ((sin-angle/2 (sin (* 0.5 angle))))
    (new quaternion
         :x (* (-> axis x) sin-angle/2)
         :y (* (-> axis y) sin-angle/2)
         :z (* (-> axis z) sin-angle/2)
         :w (cos (* 0.5 angle))
         )))
Define a function



  (define (axis-angle->quat axis angle)
   (let ((sin-angle/2 (sin (* 0.5 angle))))
    (new quaternion
         :x (* (-> axis x) sin-angle/2)
         :y (* (-> axis y) sin-angle/2)
         :z (* (-> axis z) sin-angle/2)
         :w (cos (* 0.5 angle))
         )))
Define a function



  (define (axis-angle->quat axis angle)
   (let ((sin-angle/2 (sin (* 0.5 angle))))
    (new quaternion
         :x (* (-> axis x) sin-angle/2)
         :y (* (-> axis y) sin-angle/2)
         :z (* (-> axis z) sin-angle/2)
         :w (cos (* 0.5 angle))
         )))
Define a function



  (define (axis-angle->quat axis angle)
   (let ((sin-angle/2 (sin (* 0.5 angle))))
    (new quaternion
         :x (* (-> axis x) sin-angle/2)
         :y (* (-> axis y) sin-angle/2)
         :z (* (-> axis z) sin-angle/2)
         :w (cos (* 0.5 angle))
         )))
Define some instances



  (define *y-axis* (new vec4 :x 0 :y 1 :z 0))
  (define *origin* (new point :x 0 :y 0 :z 0))

  (define-export *player-start*
   (new locator
        :trans *origin*
        :rot (axis-angle->quaternion *y-axis* 45)
        ))
Define some instances



  (define *y-axis* (new vec4 :x 0 :y 1 :z 0))
  (define *origin* (new point :x 0 :y 0 :z 0))

  (define-export *player-start*
   (new locator
        :trans *origin*
        :rot (axis-angle->quaternion *y-axis* 45)
        ))
How we use these definitions in C++ code



    ...
    #include "dc-types.h"
    ...
    const Locator * pLoc =
      DcLookupSymbol("*player-start*");
    Point pos = pLoc->m_trans;
    ...
Build upon this basis


   We build upon this basis to create many many things
       Particle definitions
       Animation states
       Gameplay scripts
       Scripted in-game cinematics
       Weapons tuning
       Sound and voice setup
       Overall game sequencing and control
       ...and more

More Related Content

What's hot

ECMAScript 6 major changes
ECMAScript 6 major changesECMAScript 6 major changes
ECMAScript 6 major changes
hayato
 

What's hot (19)

ES6(ES2015) is beautiful
ES6(ES2015) is beautifulES6(ES2015) is beautiful
ES6(ES2015) is beautiful
 
Funcion matematica
Funcion matematicaFuncion matematica
Funcion matematica
 
Short intro to the Rust language
Short intro to the Rust languageShort intro to the Rust language
Short intro to the Rust language
 
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic LabsTypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
 
Lambda expressions in C++
Lambda expressions in C++Lambda expressions in C++
Lambda expressions in C++
 
Clase de matlab
Clase de matlabClase de matlab
Clase de matlab
 
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
 
Bind me if you can
Bind me if you canBind me if you can
Bind me if you can
 
Низкоуровневые оптимизации .NET-приложений
Низкоуровневые оптимизации .NET-приложенийНизкоуровневые оптимизации .NET-приложений
Низкоуровневые оптимизации .NET-приложений
 
Python speleology
Python speleologyPython speleology
Python speleology
 
Torturing the PHP interpreter
Torturing the PHP interpreterTorturing the PHP interpreter
Torturing the PHP interpreter
 
Writing SOLID C++ [gbgcpp meetup @ Zenseact]
Writing SOLID C++ [gbgcpp meetup @ Zenseact]Writing SOLID C++ [gbgcpp meetup @ Zenseact]
Writing SOLID C++ [gbgcpp meetup @ Zenseact]
 
Hidden Gems in Swift
Hidden Gems in SwiftHidden Gems in Swift
Hidden Gems in Swift
 
ECMAScript 6 major changes
ECMAScript 6 major changesECMAScript 6 major changes
ECMAScript 6 major changes
 
شرح مقرر البرمجة 2 لغة جافا - الوحدة الثالثة
شرح مقرر البرمجة 2   لغة جافا - الوحدة الثالثةشرح مقرر البرمجة 2   لغة جافا - الوحدة الثالثة
شرح مقرر البرمجة 2 لغة جافا - الوحدة الثالثة
 
The Macronomicon
The MacronomiconThe Macronomicon
The Macronomicon
 
شرح مقرر البرمجة 2 لغة جافا - الوحدة الرابعة
شرح مقرر البرمجة 2   لغة جافا - الوحدة الرابعةشرح مقرر البرمجة 2   لغة جافا - الوحدة الرابعة
شرح مقرر البرمجة 2 لغة جافا - الوحدة الرابعة
 
Gunplot
GunplotGunplot
Gunplot
 
Objective-Cひとめぐり
Objective-CひとめぐりObjective-Cひとめぐり
Objective-Cひとめぐり
 

Viewers also liked

Multiprocessor Game Loops: Lessons from Uncharted 2: Among Thieves
Multiprocessor Game Loops: Lessons from Uncharted 2: Among ThievesMultiprocessor Game Loops: Lessons from Uncharted 2: Among Thieves
Multiprocessor Game Loops: Lessons from Uncharted 2: Among Thieves
Naughty Dog
 
Amazing Feats of Daring - Uncharted Post Mortem
Amazing Feats of Daring - Uncharted Post MortemAmazing Feats of Daring - Uncharted Post Mortem
Amazing Feats of Daring - Uncharted Post Mortem
Naughty Dog
 
Creating A Character in Uncharted: Drake's Fortune
Creating A Character in Uncharted: Drake's FortuneCreating A Character in Uncharted: Drake's Fortune
Creating A Character in Uncharted: Drake's Fortune
Naughty Dog
 
Uncharted Animation Workflow
Uncharted Animation WorkflowUncharted Animation Workflow
Uncharted Animation Workflow
Naughty Dog
 
Uncharted 2: Character Pipeline
Uncharted 2: Character PipelineUncharted 2: Character Pipeline
Uncharted 2: Character Pipeline
Naughty Dog
 
The Technology of Uncharted: Drake’s Fortune
The Technology of Uncharted: Drake’s FortuneThe Technology of Uncharted: Drake’s Fortune
The Technology of Uncharted: Drake’s Fortune
Naughty Dog
 
Practical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT MethodsPractical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT Methods
Naughty Dog
 
Lighting Shading by John Hable
Lighting Shading by John HableLighting Shading by John Hable
Lighting Shading by John Hable
Naughty Dog
 
SPU Optimizations-part 1
SPU Optimizations-part 1SPU Optimizations-part 1
SPU Optimizations-part 1
Naughty Dog
 
SPU Optimizations - Part 2
SPU Optimizations - Part 2SPU Optimizations - Part 2
SPU Optimizations - Part 2
Naughty Dog
 
State-Based Scripting in Uncharted 2: Among Thieves
State-Based Scripting in Uncharted 2: Among ThievesState-Based Scripting in Uncharted 2: Among Thieves
State-Based Scripting in Uncharted 2: Among Thieves
Naughty Dog
 

Viewers also liked (13)

Multiprocessor Game Loops: Lessons from Uncharted 2: Among Thieves
Multiprocessor Game Loops: Lessons from Uncharted 2: Among ThievesMultiprocessor Game Loops: Lessons from Uncharted 2: Among Thieves
Multiprocessor Game Loops: Lessons from Uncharted 2: Among Thieves
 
Amazing Feats of Daring - Uncharted Post Mortem
Amazing Feats of Daring - Uncharted Post MortemAmazing Feats of Daring - Uncharted Post Mortem
Amazing Feats of Daring - Uncharted Post Mortem
 
Creating A Character in Uncharted: Drake's Fortune
Creating A Character in Uncharted: Drake's FortuneCreating A Character in Uncharted: Drake's Fortune
Creating A Character in Uncharted: Drake's Fortune
 
Uncharted Animation Workflow
Uncharted Animation WorkflowUncharted Animation Workflow
Uncharted Animation Workflow
 
Uncharted 2: Character Pipeline
Uncharted 2: Character PipelineUncharted 2: Character Pipeline
Uncharted 2: Character Pipeline
 
The Technology of Uncharted: Drake’s Fortune
The Technology of Uncharted: Drake’s FortuneThe Technology of Uncharted: Drake’s Fortune
The Technology of Uncharted: Drake’s Fortune
 
Practical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT MethodsPractical Spherical Harmonics Based PRT Methods
Practical Spherical Harmonics Based PRT Methods
 
Autodesk Mudbox
Autodesk MudboxAutodesk Mudbox
Autodesk Mudbox
 
Lighting Shading by John Hable
Lighting Shading by John HableLighting Shading by John Hable
Lighting Shading by John Hable
 
SPU Optimizations-part 1
SPU Optimizations-part 1SPU Optimizations-part 1
SPU Optimizations-part 1
 
SPU Optimizations - Part 2
SPU Optimizations - Part 2SPU Optimizations - Part 2
SPU Optimizations - Part 2
 
State-Based Scripting in Uncharted 2: Among Thieves
State-Based Scripting in Uncharted 2: Among ThievesState-Based Scripting in Uncharted 2: Among Thieves
State-Based Scripting in Uncharted 2: Among Thieves
 
Naughty Dog Vertex
Naughty Dog VertexNaughty Dog Vertex
Naughty Dog Vertex
 

Similar to Adventures In Data Compilation

Python 2.5 reference card (2009)
Python 2.5 reference card (2009)Python 2.5 reference card (2009)
Python 2.5 reference card (2009)
gekiaruj
 
Need help with questions 2-4. Write assembly code to find absolute v.pdf
Need help with questions 2-4. Write assembly code to find absolute v.pdfNeed help with questions 2-4. Write assembly code to find absolute v.pdf
Need help with questions 2-4. Write assembly code to find absolute v.pdf
feelinggifts
 
XNA L04–Primitives, IndexBuffer and VertexBuffer
XNA L04–Primitives, IndexBuffer and VertexBufferXNA L04–Primitives, IndexBuffer and VertexBuffer
XNA L04–Primitives, IndexBuffer and VertexBuffer
Mohammad Shaker
 
Clojure for Java developers - Stockholm
Clojure for Java developers - StockholmClojure for Java developers - Stockholm
Clojure for Java developers - Stockholm
Jan Kronquist
 

Similar to Adventures In Data Compilation (20)

Abstracting Vector Architectures in Library Generators: Case Study Convolutio...
Abstracting Vector Architectures in Library Generators: Case Study Convolutio...Abstracting Vector Architectures in Library Generators: Case Study Convolutio...
Abstracting Vector Architectures in Library Generators: Case Study Convolutio...
 
Soft Shake Event / A soft introduction to Neo4J
Soft Shake Event / A soft introduction to Neo4JSoft Shake Event / A soft introduction to Neo4J
Soft Shake Event / A soft introduction to Neo4J
 
A Few of My Favorite (Python) Things
A Few of My Favorite (Python) ThingsA Few of My Favorite (Python) Things
A Few of My Favorite (Python) Things
 
Gems of GameplayKit. UA Mobile 2017.
Gems of GameplayKit. UA Mobile 2017.Gems of GameplayKit. UA Mobile 2017.
Gems of GameplayKit. UA Mobile 2017.
 
Continuation Passing Style and Macros in Clojure - Jan 2012
Continuation Passing Style and Macros in Clojure - Jan 2012Continuation Passing Style and Macros in Clojure - Jan 2012
Continuation Passing Style and Macros in Clojure - Jan 2012
 
Developing High Performance Websites and Modern Apps with JavaScript and HTML5
Developing High Performance Websites and Modern Apps with JavaScript and HTML5Developing High Performance Websites and Modern Apps with JavaScript and HTML5
Developing High Performance Websites and Modern Apps with JavaScript and HTML5
 
DevFest Istanbul - a free guided tour of Neo4J
DevFest Istanbul - a free guided tour of Neo4JDevFest Istanbul - a free guided tour of Neo4J
DevFest Istanbul - a free guided tour of Neo4J
 
SVGo workshop
SVGo workshopSVGo workshop
SVGo workshop
 
Python 2.5 reference card (2009)
Python 2.5 reference card (2009)Python 2.5 reference card (2009)
Python 2.5 reference card (2009)
 
ES6 is Nigh
ES6 is NighES6 is Nigh
ES6 is Nigh
 
Swift for tensorflow
Swift for tensorflowSwift for tensorflow
Swift for tensorflow
 
Need help with questions 2-4. Write assembly code to find absolute v.pdf
Need help with questions 2-4. Write assembly code to find absolute v.pdfNeed help with questions 2-4. Write assembly code to find absolute v.pdf
Need help with questions 2-4. Write assembly code to find absolute v.pdf
 
The best language in the world
The best language in the worldThe best language in the world
The best language in the world
 
The Curious Clojurist - Neal Ford (Thoughtworks)
The Curious Clojurist - Neal Ford (Thoughtworks)The Curious Clojurist - Neal Ford (Thoughtworks)
The Curious Clojurist - Neal Ford (Thoughtworks)
 
XNA L04–Primitives, IndexBuffer and VertexBuffer
XNA L04–Primitives, IndexBuffer and VertexBufferXNA L04–Primitives, IndexBuffer and VertexBuffer
XNA L04–Primitives, IndexBuffer and VertexBuffer
 
Clojure for Java developers - Stockholm
Clojure for Java developers - StockholmClojure for Java developers - Stockholm
Clojure for Java developers - Stockholm
 
Леонид Шевцов «Clojure в деле»
Леонид Шевцов «Clojure в деле»Леонид Шевцов «Clojure в деле»
Леонид Шевцов «Clojure в деле»
 
Fact, Fiction, and FP
Fact, Fiction, and FPFact, Fiction, and FP
Fact, Fiction, and FP
 
Python과 node.js기반 데이터 분석 및 가시화
Python과 node.js기반 데이터 분석 및 가시화Python과 node.js기반 데이터 분석 및 가시화
Python과 node.js기반 데이터 분석 및 가시화
 
Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 

Adventures In Data Compilation

  • 1. Adventures in Data Compilation Uncharted: Drake’s Fortune Dan Liebgold Naughty Dog, Inc. Santa Monica, CA Game Developers Conference, 2008
  • 2. Motivation Code is compiled, data is “built” What should be code, what should be data? Plenty, right? Game logic, geometry, textures... What is not clearly either? Particle definitions, animation states & blend trees, event & gameplay scripting/tuning, more...
  • 3. Motivation Code is compiled, data is “built” What should be code, what should be data? Plenty, right? Game logic, geometry, textures... What is not clearly either? Particle definitions, animation states & blend trees, event & gameplay scripting/tuning, more...
  • 4. Motivation Code is compiled, data is “built” What should be code, what should be data? Plenty, right? Game logic, geometry, textures... What is not clearly either? Particle definitions, animation states & blend trees, event & gameplay scripting/tuning, more...
  • 5. Motivation Code is compiled, data is “built” What should be code, what should be data? Plenty, right? Game logic, geometry, textures... What is not clearly either? Particle definitions, animation states & blend trees, event & gameplay scripting/tuning, more...
  • 6. Motivation Code is compiled, data is “built” What should be code, what should be data? Plenty, right? Game logic, geometry, textures... What is not clearly either? Particle definitions, animation states & blend trees, event & gameplay scripting/tuning, more...
  • 7. The in between stuff Moving on from GOAL Lisp supports the code/data duality We will build DC in Scheme, a dialect of LISP!
  • 8. The in between stuff Moving on from GOAL Lisp supports the code/data duality We will build DC in Scheme, a dialect of LISP!
  • 9. The in between stuff Moving on from GOAL Lisp supports the code/data duality We will build DC in Scheme, a dialect of LISP!
  • 14. Example Let’s define a player start position: (define-export *player-start* (new locator :trans *origin* :rot (axis-angle->quaternion *y-axis* 45) ))
  • 15. Start with some types (deftype vec4 (:align 16) ((x float) (y float) (z float) (w float :default 0) ) )
  • 16. Start with some types (deftype vec4 (:align 16) ((x float) (y float) (z float) (w float :default 0) ) )
  • 17. Start with some types (deftype vec4 (:align 16) ((x float) (y float) (z float) (w float :default 0) ) )
  • 18. Start with some types (deftype vec4 (:align 16) ((x float) (y float) (z float) (w float :default 0) ) )
  • 19. Start with some types (deftype vec4 (:align 16) ((x float) (y float) (z float) (w float :default 0) ) )
  • 20. Start with some types (deftype vec4 (:align 16) ((x float) (y float) (z float) (w float :default 0) ) ) struct Vec4 { float m_x; float m_y; float m_z; float m_w; };
  • 21. Types continued (deftype quaternion (:parent vec4) ()) (deftype point (:parent vec4) ((w float :default 1) )) (deftype locator () ((trans point :inline #t) (rot quaternion :inline #t) ) )
  • 22. Types continued (deftype quaternion (:parent vec4) ()) (deftype point (:parent vec4) ((w float :default 1) )) (deftype locator () ((trans point :inline #t) (rot quaternion :inline #t) ) )
  • 23. Types continued (deftype quaternion (:parent vec4) ()) (deftype point (:parent vec4) ((w float :default 1) )) struct Locator { Point m_trans; Quaternion m_rot; };
  • 24. Define a function (define (axis-angle->quat axis angle) (let ((sin-angle/2 (sin (* 0.5 angle)))) (new quaternion :x (* (-> axis x) sin-angle/2) :y (* (-> axis y) sin-angle/2) :z (* (-> axis z) sin-angle/2) :w (cos (* 0.5 angle)) )))
  • 25. Define a function (define (axis-angle->quat axis angle) (let ((sin-angle/2 (sin (* 0.5 angle)))) (new quaternion :x (* (-> axis x) sin-angle/2) :y (* (-> axis y) sin-angle/2) :z (* (-> axis z) sin-angle/2) :w (cos (* 0.5 angle)) )))
  • 26. Define a function (define (axis-angle->quat axis angle) (let ((sin-angle/2 (sin (* 0.5 angle)))) (new quaternion :x (* (-> axis x) sin-angle/2) :y (* (-> axis y) sin-angle/2) :z (* (-> axis z) sin-angle/2) :w (cos (* 0.5 angle)) )))
  • 27. Define a function (define (axis-angle->quat axis angle) (let ((sin-angle/2 (sin (* 0.5 angle)))) (new quaternion :x (* (-> axis x) sin-angle/2) :y (* (-> axis y) sin-angle/2) :z (* (-> axis z) sin-angle/2) :w (cos (* 0.5 angle)) )))
  • 28. Define some instances (define *y-axis* (new vec4 :x 0 :y 1 :z 0)) (define *origin* (new point :x 0 :y 0 :z 0)) (define-export *player-start* (new locator :trans *origin* :rot (axis-angle->quaternion *y-axis* 45) ))
  • 29. Define some instances (define *y-axis* (new vec4 :x 0 :y 1 :z 0)) (define *origin* (new point :x 0 :y 0 :z 0)) (define-export *player-start* (new locator :trans *origin* :rot (axis-angle->quaternion *y-axis* 45) ))
  • 30. How we use these definitions in C++ code ... #include "dc-types.h" ... const Locator * pLoc = DcLookupSymbol("*player-start*"); Point pos = pLoc->m_trans; ...
  • 31. Build upon this basis We build upon this basis to create many many things Particle definitions Animation states Gameplay scripts Scripted in-game cinematics Weapons tuning Sound and voice setup Overall game sequencing and control ...and more