Your SlideShare is downloading. ×
FGS 2011: Making A Game With Molehill: Zombie Tycoon
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

FGS 2011: Making A Game With Molehill: Zombie Tycoon

4,287
views

Published on

Luc Beaulieu and Jean-Philipe Auclair from Frima Studio share their experience working with Adobe's new Molehill API's in making their new game "Zombie Tycoon".

Luc Beaulieu and Jean-Philipe Auclair from Frima Studio share their experience working with Adobe's new Molehill API's in making their new game "Zombie Tycoon".

Published in: Technology, Art & Photos

0 Comments
12 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,287
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
0
Likes
12
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Here is a quick overview of what we will go through in this session. I will start by looking at the current state of Flash and I will present the Molehill API that Adobe is offering us. JP will then take over and dig deeper in the technical aspects of it all.
  • Is Flash Dead? Look this up in Google and you’ll find many interesting discussions. I have no intention on going into the politics of it, so here are some facts.According to AppData, the top two FB apps attracts close to 150M MAU. Both are Flash games. From known metrics, this amounts to a conservative 30M $ per month, all going to the same company, but still WebGL = Final draft was done a month ago.The Flash player provided advances that « helped » 3D based applications. AS3 was a big one, providing a much faster Virtual Machine, but it’s still non-native software rendering. Molehill provides the jump ahead to real 3D on the browser.35 devices by 2010 – Close to 100 deviceswillshipwithit in 2011Flash Stats based on : http://www.adobe.com/products/player_census/flashplayer/version_penetration.html (December 2010)http://tv.adobe.com/watch/industry-trends/strong-mobile-adoption-of-flash-platform-in-2011/
  • Molehill opens a low-level API to access the GPU. Adobe decided to limit this API to a lowest supported denominator. This decision has been made to keep a consistent experience across all supported platforms.Those are some Pros and Cons, you can probably draw your own list after playing with it No CPU threading API yet on the Flash player. Adobe has been using it more internally and I’m sure they are working on something for us to use soon One thing to note, is the software fallback. Be careful when designing Molehill games, decide if you can afford the software renderer as soon as possible. If you don’t support it, always validate that hardware is used and show a prompt otherwise.I will now let JP discuss the technical aspects of all of this 
  • Starting with the base, the file formatAnd the I Will cover some of the system that we have in ZombieTycoon
  • If you have 1000 quad particles, itmeansyou have to update around 6000 vertex to update, and witharound 10 values soAt the end it’s 60 000 update on yourbytearray.VB: of 64 DWORD
  • If you have 1000 quad particles, itmeansyou have to update around 6000 vertex to update, and witharound 10 values soAt the end it’s 60 000 update on yourbytearray.VB: of 64 DWORD
  • If you have 1000 quad particles, itmeansyou have to update around 6000 vertex to update, and witharound 10 values soAt the end it’s 60 000 update on yourbytearray.VB: of 64 DWORD
  • If you have 1000 quad particles, itmeansyou have to update around 6000 vertex to update, and witharound 10 values soAt the end it’s 60 000 update on yourbytearray.VB: of 64 DWORD
  • Transcript

    • 1. Making a game with Molehill: Zombie Tycoon
      Luc BeaulieuCTO – Frima Studio
      Jean-Philippe AuclairLead R&D Software Architect
    • 2. State of Flash
      Molehill’s API presentation
      Digging deeper into Molehill
      Session Overview
    • 3. Is Flash Dead?
      • FB Top 10 = 250M MAU
      • 4. Desktops: Flash 10 installed on 99%+
      • 5. SmartPhones: Flash/Air 200+M, 100 devices
      • 6. Streaming: 120 petabytes per month
      Advances in Flash for 3D games
      State of Flash
    • 9. Pros:
      GPU Accelerated API
      Relies on DirectX 9, OpenGL 1.3 and OpenGL ES 2.0
      Native Software fallback
      Cons:
      No point sprite support, branching, MRT, depth buffer
      No CPU threading support
      Native Software fallback
      Molehill’s API Presentation
    • 10. This Page Intentionally Left Green
    • 11. Assuming a basic knowledge of 3D development terminology
      Zombie File Format
      Character Animation: Matrix vs Quaternion
      Optimizing the Particle System
      Fast Lights & Shadows
      CPU Post-Processing effects
      Profiling & Debugging tools
      Bonus!
      3D GameDev Lexicon
      The maths explaining all the numbers I’m going to talk about
      Cheat sheets
      Digging deeper into Molehill
    • 12. Frima 3D File Format
      Many 3D engine for flash try to support multiple input format
      …Or try to use generic format such as ColladaXML
      Using a format optimized for 3D game made in Flash
      Small File Size
      Small Memory footprint
      No processing required
    • 13. Frima 3D File Format
      Supporting one Pipe-line for optimized result
      Using a AIR tool to read Collada files, parse them and fill final game Model/Animation objects
      Native object serialization (AMF)
      Native ByteArray Compression
    • 14. Texturing in Molehill
      Adobe Texture Format (ATF)
      Simple PNGs are expended in video memory
      Native support for multi-device publishing
      One file containing 3 encoding: DXT1, ETC1 and PVRTC
      Does not support transparency
      Contain the MipMapping of the texture
      1.3x bigger than original PNG
      Transparency
      Use PNGs with indexed color
      Sample a “alpha mask texture” in the pixel shader
    • 15. Texturing in Molehill
      Texture type image
      Graph videospace
    • 16. Zombie Re-Animation
      Techniques
      Matrix linear blending
      DualQuaternion linear blending
      Molehill Constraint
      Vertex Shader constants limits: 128 Float4
    • 17. Animation techniques
      When using matrix, each bone take 3 constants
      Maximum number of bones is 40
      When using DualQuats, each bone take only 2 constants
      Maximum number of bones is 60
      Matrix linear blending can cause loss of volume when joints are twisted or extremely bent
      Matrix (left) / Dual Quaternion (Right)
    • 18. Transitions & interpolation
      Too Much
      • Animation transition require two sets of bones
      • 19. Idle blending to walk
      • 20. Same thing for frame interpolation (ex: Bullet time Animation)
    • You have to choose
    • 21. Optimizing the Particle System
    • 22. Particle System
      Using a divided workload (CPU/GPU) for better performance
      Each particle property update is computed on the CPU at each frame
      Alpha, Color, Direction, Rotation, frame(If SpriteSheet), etc.
      On the GPU
      Applying theses properties
      Expending billboard vertex to face the screen
    • 23. Particle System : Optimization
      How many particle?
      Due to the VertexBuffer and IndexBuffer limits,
      In ZombieTycoon we were limited to around 16383 particles per draw call
      UsingFastByteArray (alsoknown as Alchemymemory or DomainMemory)
      Using Azoth, properties updates were 10 times faster
      Batching draw calls using the same texture
      Using a 100% GPU particle system
      It’sexpensive on the GPU
      Support onlylinear transformation
      Zero CPU required
    • 24. Particle System
    • 25. Lights & shadows
      Techniques
      ShadowMap & LightMap
      Dynamic lighting
      Fake Volumetric lights
      Fake projected shadows
    • 26. Lights & shadows
      ShadowMap & LightMap
      We used two textures, a “multiplied” ShadowMap and an “additive” LightMap
      Diffuse
      * ShadowMap
      + Lightmap
      = Composite
    • 27. Lights & shadows
      Dynamic lighting
      Lighting required expensive pixel shader, currently limited to 256 instructions
      ZombieTycoon support up to 7-9 lights (spot or points) per object.
    • 28. Lights & shadows
      Fake Volumetric Lights
      Using a few billboard particles, it’s easy to fake a nice and lightweight volumetric lighting
      All object are sampling Shadow and light maps, and since the lights particle are “additive”, if an object is behind the lights, it will look brighter
    • 29. Lights & shadows
    • 30. Lights & shadows
      Fake projected shadows
      We create a particle of a gradient black spot aligned to the ground
      Orientation and scale of the particle depends on light position and intensity
    • 31. CPU Post-Processing
      Possibility of reading the BackBuffer
      Althought not suggested for performance reason, it is possible to draw something and readback in the same frame to work on the final BitmapData with as3 code.
      Effects
      Bloom
      Blur
      Depth of field
      Much more!
      Normal
      With Bloom
    • 32. Profiling and Debuggingtools (CPU)
      FlashDevelop
      Most of the production is using FlashDevelop
      Now with a profiler and a debugger, it’s very easy to work with it
      Flash Builder Profiler
      Profile Function calls
      Profile Memory allocation
      FlashPreloadProfiler
      Profile Function calls
      Profile Memory allocation
      Profile Loaders status
      Can be used in Debug/Release & browser/Projector
      FlashDevelop
      FlashPreloadProfiler
      FlashBuilder Profiler
    • 33. Profiling and Debuggingtools (GPU)
      Pix for windows
      List of API call
      Shaders assembly code
      Pixel debugger
      Texture viewer
      • Intel® Graphics Performance Analyzers (GPA)
      • 34. Render in wireframe
      • 35. Profile Vertex and Pixel shader performance
      • 36. Visuallize overdraw and draw call sequence
      • 37. Save a frame, and make real time experiment
      • 38. Identification of bottle necks
      PIX
      GPA
    • 39. Sources & References
      Geometric Skinning with Approximate Dual Quaternion Blending
      http://isg.cs.tcd.ie/kavanl/papers/sdq-tog08.pdf
      Intel® Graphics Performance Analyzers (GPA)
      http://software.intel.com/en-us/articles/intel-gpa/
      Pix for windows
      http://msdn.microsoft.com/en-us/library/ee417072(v=VS.85).aspx
      • TD-Matt blog
      • 40. http://td-matt.blogspot.com/
      • 41. FlashPreloadProfiler
      • 42. http://jpauclair.net/flashpreloadprofiler/
      • 43. Azoth
      • 44. http://www.buraks.com/azoth/
      • 45. Flash in Facebook
      • 46. AppData.com
      • 47. Flash Stats
      • 48. http://adobe.ly/rwXU
      • 49. http://adobe.ly/gnlUEH
      Contact
      Luc Beaulieuluc@frimastudio.com
      Jean-Philippe Auclairjpauclair@frimastudio.com
      • @jpauclair
      • 50. jpauclair.net
    • VertexBuffer
      IndexBuffer
      Vertex Constants
      MipMapping
      Quaternion
      Billboard
      What?
    • 51. Character animation:
      Matrixlinearblending:
      128 Float4 VertexConstant – WorldMatrix – ViewProjmatrix = 120Float4
      120Float4 / / 3Float4 per bone = 40 bones in the constants
      Bullet time and transitions requiretwo sets of bones: 40/2 = 20 bones per character max
      DualQuaternionlinearblending:
      128 Float4 VertexConstant – WorldMatrix – ViewProjmatrix = 120Float4
      120Float4 / / 2Float4 per bone = 60 bones in the constants
      Bullet time and transitions requiretwo sets of bones: 60/2 = 30 bones per character max
      Max Particle Count
      The VertexBuffer is limited to 65536 vertex, the IndexBuffer is limited to 983040 index of type SHORT
      In theory, you could have up to 327680 triangle in one draw call
      In practice, with no vertex re-use between particles and using quads (4 vertex): 65536/6 = 16383 particle max per draw call
      Lighting
      With the PixelShader limit of 256 instructions, we were able to fit around 7 to 9 dynamic lights per object (point or spot light)
      Bonus Slide: The maths!
    • 52. CheatSheet
      Achievement: Geek
    • 53. Achievement: Super Geek!
    • 54. Thank You!
      Questions?
      Contact
      Luc Beaulieuluc@frimastudio.com
      Jean-Philippe Auclairjpauclair@frimastudio.com
      • @jpauclair
      • 55. jpauclair.net