SlideShare ist ein Scribd-Unternehmen logo
1 von 48
Downloaden Sie, um offline zu lesen
Real life
Johan Lindfors
windows phone for games

•   impressive performance
•   sensors and touch
•   potentially xbox-live
•   ads and trials
kinectimals
harvest
implode
doodle fit
ilomilo
other favorites
xna in 1 minute

•   a comprehensive framework for games
•   integrated management of content
•   games with 2d and ”sprites”
•   games with 3d and ”meshes”
•   shared features for pc, wp, xbox
initialize   update   render
managing content

•   content pipeline
•   import common files
•   leverage compile time
•   optimized binary format
•   extensible
first some 2d

•   x and y (and z)
•   spriteBatch
•   sprites/sprite sheets
•   blending
and then some 3d

• x, y and z
• camera is described with matrices
  • view
  • projection
• world matrix transforms objects relatively
  • movement (translation)
  • rotation
  • size (scale)
demo
effects - shaders

• configurable
  •   basic
  •   skinned
  •   environmentMap
  •   dualTexture
  •   alphaTest
demo
”hardware scaler”

• 800x480       =    384 000 pixels
• 600x360       =    216 000 pixels (56%)
• 400x240       =    96 000 pixels (25%)

 graphics.PreferredBackBufferHeight = 800;
 graphics.PreferredBackBufferWidth = 480;
performance tips

• manage the stack and heap
  • reference types live on the _______!
  • value types live on the _______!
• pass large structures by reference
 Matrix a, b, c;
 c = Matrix.Multiply(a, b); // copies 192 bytes!
 Matrix.Multiply(ref a, ref b, out c);


• don’t foreach or linq (know code cost)
performance tips

• gc is ”simpler” than on pc
  • allocate objects early, reuse
• GC.Collect() can be your friend!
  • after load, while paused
• cpu or gpu based?
  • you can go up to 60 fps (60 hz)
demo
sound and music

•   soundEffect
•   load as content
•   wp handles 64 simultaneously
•   possible to change
    • pitch
    • volume
    • 3d location
orientation
 graphics.SupportedOrientations =
     DisplayOrientation.Portrait |
     DisplayOrientation.LandscapeLeft |
     DisplayOrientation.LandscapeRight;

• default is ”LandscapeLeft”
orientation
 Window.OrientationChanged += (s, e) =>
 {
     switch (Window.CurrentOrientation)
     {
         case DisplayOrientation.Portrait:
             graphics.PreferredBackBufferHeight = 800;
             graphics.PreferredBackBufferWidth = 480;
             break;
         default:
             graphics.PreferredBackBufferHeight = 480;
             graphics.PreferredBackBufferWidth = 800;
             break;
     }
     graphics.ApplyChanges();
 };
accelerometer
    using Microsoft.Devices.Sensors;



•    measures acceleration in X, Y and Z
•    values returned between -1 and +1
•    event based
•    read values in event, store for usage
start accelerometer
 Accelerometer accel;
 private void startAccelerometer() {
     accel = new Accelerometer();

     accel.ReadingChanged += new
         EventHandler
         <AccelerometerReadingEventArgs>
         (accel_ReadingChanged);

     accel.Start();
 }
read the accelerometer
 Vector3 accelReading;
 void accel_ReadingChanged(object sender,
         AccelerometerReadingEventArgs e)
 {
     lock (this)
     {
         accelReading.X = (float)e.X;
         accelReading.Y = (float)e.Y;
         accelReading.Z = (float)e.Z;
     }
 }
touch

• windows phone handles 4 touch points
  • all points have unique id
  • pressed | moved | released

 TouchCollection touches;
 protected override void Update(GameTime gt)
 {
     touches = TouchPanel.GetState();
     ...
 }
gestures

• wp can also handle gestures
  • tap | drag | hold | flick | pinch ...
 TouchPanel.EnabledGestures =
     GestureType.Flick;

 while (TouchPanel.IsGestureAvailable) {
   GestureSample g = TouchPanel.ReadGesture();
   if (g.GestureType == GestureType.Flick)
   { ... }
 }
network

• http, rest, xml, sockets...
 void wc_OpenReadCompleted(object sender,
           OpenReadCompletedEventArgs e) {
   if (e.Error == null)
   {
       mapImage = Texture2D.FromStream(
           graphics.GraphicsDevice,
           e.Result);
   }
 }
xbox live

• avatars and “trials” available for all
• developers with agreements
  •   profile
  •   invites
  •   achievements
  •   leaderboard
  •   gamerServices
• contact: wpgames@microsoft.com
trial mode
 #if DEBUG
     Guide.SimulateTrialMode = true;
 #endif

 bool isTrial = Guide.IsTrialMode;
 ...
 Guide.ShowMarketplace(PlayerIndex.One);

• call to IsTrialMode takes 60 ms, cache!
• be creative in feature set
• trial or free light?
ads

• instead of user paying for app
• not for swedish apps yet*

 using Microsoft.Advertising.Mobile.Xna;
 ...
 AdManager adManager;
 Ad bannerAd;


      *not from Microsoft that is, there are options
marketplace

•   local structure
•   test kit in VS2010
•   updates
•   auto-publish
protect yourself

• ready for obfuscation?

public void d(bp.b A_0)
{
       this.l = A_0;
       this.i = new List<string>();
       this.i.Add(am.a().e("SK_NO"));
       this.i.Add(am.a().e("SK_YES"));
       this.g = bo.a;
       SignedInGamer.SignedIn += new
              EventHandler<SignedInEventArgs>(this.d);
}
news in mango

•   silverlight + xna
•   fast application switching
•   profiling
•   combined api for movement
demo
tripeaks solitaire

• fabrication games
• true 3D
• all code in objective-c
-(BOOL)      animate
{
    if([self animation] == nil)
    {
         [self draw];
         return NO;
    }
    else
    {
         BOOL animationDone = [[self animation] animate];
         [self draw];

        if (animationDone)
        {
            x += [[self animation] currentX];
            y += [[self animation] currentY];
            z += [[self animation] currentZ];
            rotation += [[self animation] currentRotation];
            [animations removeObjectAtIndex:0];
        }
        return animationDone;
    }
}
public bool Animate()
{
    if (this.Animation == null)
    {
         this.Draw();
         return false;
    }
    else
    {
         bool animationDone = this.Animation.Animate();
         this.Draw();

        if (animationDone)
        {
            x += this.Animation.CurrentX;
            y += this.Animation.CurrentY;
            z += this.Animation.CurrentZ;
            rotation += this.Animation.CurrentRotation;
            animations.RemoveAt(0);
        }
        return animationDone;
    }
}
public bool Animate(GraphicsDevice graphics, BasicEffect effect)
{
    if (this.Animation == null)
    {
         this.Draw(graphics, effect);
         return false;
    }
    else
    {
         bool animationDone = this.Animation.Animate();
         this.Draw(graphics, effect);

        if (animationDone)
        {
            x += this.Animation.CurrentX;
            y += this.Animation.CurrentY;
            z += this.Animation.CurrentZ;
            rotation += this.Animation.CurrentRotation;
            animations.RemoveAt(0);
        }
        return animationDone;
    }
}
demo
future of xna?

• silverlight 5.0
  • subset of XNA
  • focused on business apps


• windows 8
  • leverages directx 11
  • likely to attract commercial studios
johan.lindfors@coderox.se
resources

•   create.msdn.com
•   jodegreef.wordpress.com - angry pigs
•   www.xnaresources.com
•   http://msdn.microsoft.com/en-
    us/library/bb417503(XNAGameStudio.41).aspx

• programmeramera.se
• www.coderox.se
Real life XNA

Weitere ähnliche Inhalte

Was ist angesagt?

Pixelplant - WebDev Meetup Salzburg
Pixelplant - WebDev Meetup SalzburgPixelplant - WebDev Meetup Salzburg
Pixelplant - WebDev Meetup Salzburgwolframkriesing
 
14multithreaded Graphics
14multithreaded Graphics14multithreaded Graphics
14multithreaded GraphicsAdil Jafri
 
Computer graphics lab assignment
Computer graphics lab assignmentComputer graphics lab assignment
Computer graphics lab assignmentAbdullah Al Shiam
 
Computational Linguistics week 5
Computational Linguistics  week 5Computational Linguistics  week 5
Computational Linguistics week 5Mark Chang
 
TensorFlow 深度學習快速上手班--電腦視覺應用
TensorFlow 深度學習快速上手班--電腦視覺應用TensorFlow 深度學習快速上手班--電腦視覺應用
TensorFlow 深度學習快速上手班--電腦視覺應用Mark Chang
 
Cg my own programs
Cg my own programsCg my own programs
Cg my own programsAmit Kapoor
 
The Ring programming language version 1.8 book - Part 59 of 202
The Ring programming language version 1.8 book - Part 59 of 202The Ring programming language version 1.8 book - Part 59 of 202
The Ring programming language version 1.8 book - Part 59 of 202Mahmoud Samir Fayed
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame AnimationJussi Pohjolainen
 
Computational Linguistics week 10
 Computational Linguistics week 10 Computational Linguistics week 10
Computational Linguistics week 10Mark Chang
 
Computer Graphics Lab File C Programs
Computer Graphics Lab File C ProgramsComputer Graphics Lab File C Programs
Computer Graphics Lab File C ProgramsKandarp Tiwari
 
Maximizing performance of 3 d user generated assets in unity
Maximizing performance of 3 d user generated assets in unityMaximizing performance of 3 d user generated assets in unity
Maximizing performance of 3 d user generated assets in unityWithTheBest
 
Introduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from ScratchIntroduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from ScratchAhmed BESBES
 
Numerical Method Assignment
Numerical Method AssignmentNumerical Method Assignment
Numerical Method Assignmentashikul akash
 
HTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web GamesHTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web Gameslivedoor
 
The Ring programming language version 1.7 book - Part 57 of 196
The Ring programming language version 1.7 book - Part 57 of 196The Ring programming language version 1.7 book - Part 57 of 196
The Ring programming language version 1.7 book - Part 57 of 196Mahmoud Samir Fayed
 
Mobile Game and Application with J2ME - Collision Detection
Mobile Gameand Application withJ2ME  - Collision DetectionMobile Gameand Application withJ2ME  - Collision Detection
Mobile Game and Application with J2ME - Collision DetectionJenchoke Tachagomain
 

Was ist angesagt? (20)

Pixelplant - WebDev Meetup Salzburg
Pixelplant - WebDev Meetup SalzburgPixelplant - WebDev Meetup Salzburg
Pixelplant - WebDev Meetup Salzburg
 
14multithreaded Graphics
14multithreaded Graphics14multithreaded Graphics
14multithreaded Graphics
 
Computer graphics lab assignment
Computer graphics lab assignmentComputer graphics lab assignment
Computer graphics lab assignment
 
Computational Linguistics week 5
Computational Linguistics  week 5Computational Linguistics  week 5
Computational Linguistics week 5
 
TensorFlow 深度學習快速上手班--電腦視覺應用
TensorFlow 深度學習快速上手班--電腦視覺應用TensorFlow 深度學習快速上手班--電腦視覺應用
TensorFlow 深度學習快速上手班--電腦視覺應用
 
Scala.io
Scala.ioScala.io
Scala.io
 
Cg my own programs
Cg my own programsCg my own programs
Cg my own programs
 
The Ring programming language version 1.8 book - Part 59 of 202
The Ring programming language version 1.8 book - Part 59 of 202The Ring programming language version 1.8 book - Part 59 of 202
The Ring programming language version 1.8 book - Part 59 of 202
 
662305 LAB13
662305 LAB13662305 LAB13
662305 LAB13
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame Animation
 
Computational Linguistics week 10
 Computational Linguistics week 10 Computational Linguistics week 10
Computational Linguistics week 10
 
Computer Graphics Lab File C Programs
Computer Graphics Lab File C ProgramsComputer Graphics Lab File C Programs
Computer Graphics Lab File C Programs
 
Maximizing performance of 3 d user generated assets in unity
Maximizing performance of 3 d user generated assets in unityMaximizing performance of 3 d user generated assets in unity
Maximizing performance of 3 d user generated assets in unity
 
Introduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from ScratchIntroduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from Scratch
 
Computer graphics
Computer graphics   Computer graphics
Computer graphics
 
Numerical Method Assignment
Numerical Method AssignmentNumerical Method Assignment
Numerical Method Assignment
 
HTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web GamesHTML5 Animation in Mobile Web Games
HTML5 Animation in Mobile Web Games
 
The Ring programming language version 1.7 book - Part 57 of 196
The Ring programming language version 1.7 book - Part 57 of 196The Ring programming language version 1.7 book - Part 57 of 196
The Ring programming language version 1.7 book - Part 57 of 196
 
Advance java
Advance javaAdvance java
Advance java
 
Mobile Game and Application with J2ME - Collision Detection
Mobile Gameand Application withJ2ME  - Collision DetectionMobile Gameand Application withJ2ME  - Collision Detection
Mobile Game and Application with J2ME - Collision Detection
 

Andere mochten auch

NCU EMBA Mentorship Program
NCU EMBA Mentorship ProgramNCU EMBA Mentorship Program
NCU EMBA Mentorship Programguest6234580
 
Tasplan Digital Presentation
Tasplan Digital PresentationTasplan Digital Presentation
Tasplan Digital Presentationscottywoodhouse
 
Tourism Tasmania Digital Coach Live Sessions - Digital Marketing
Tourism Tasmania Digital Coach Live Sessions - Digital MarketingTourism Tasmania Digital Coach Live Sessions - Digital Marketing
Tourism Tasmania Digital Coach Live Sessions - Digital Marketingscottywoodhouse
 
2009 NCU EMBA Mentorship Program
2009 NCU EMBA Mentorship Program2009 NCU EMBA Mentorship Program
2009 NCU EMBA Mentorship Programguest6234580
 
Effektiva gränssnitt med WM 6.5
Effektiva gränssnitt med WM 6.5Effektiva gränssnitt med WM 6.5
Effektiva gränssnitt med WM 6.5Johan Lindfors
 
Social Media For Public Libraries: Basics and Beyond
Social Media For Public Libraries: Basics and BeyondSocial Media For Public Libraries: Basics and Beyond
Social Media For Public Libraries: Basics and BeyondElise C. Cole
 
Windows Phone 7.5 (Mango)
Windows Phone 7.5 (Mango)Windows Phone 7.5 (Mango)
Windows Phone 7.5 (Mango)Johan Lindfors
 
Strategy Plus Execution - AMI Smart Marketer Series, 16/6/2011
Strategy Plus Execution - AMI Smart Marketer Series, 16/6/2011Strategy Plus Execution - AMI Smart Marketer Series, 16/6/2011
Strategy Plus Execution - AMI Smart Marketer Series, 16/6/2011scottywoodhouse
 
Digital marketing - Liberal Party Presentation
Digital marketing - Liberal Party PresentationDigital marketing - Liberal Party Presentation
Digital marketing - Liberal Party Presentationscottywoodhouse
 
Heritage Tourism Presentation
Heritage Tourism Presentation Heritage Tourism Presentation
Heritage Tourism Presentation scottywoodhouse
 
Metro and Windows Phone 7
Metro and Windows Phone 7Metro and Windows Phone 7
Metro and Windows Phone 7Johan Lindfors
 
An analysis of Ulrich's HR Model
An analysis of Ulrich's HR ModelAn analysis of Ulrich's HR Model
An analysis of Ulrich's HR Modelpuresona24k
 

Andere mochten auch (18)

Windows phone 7
Windows phone 7Windows phone 7
Windows phone 7
 
NCU EMBA Mentorship Program
NCU EMBA Mentorship ProgramNCU EMBA Mentorship Program
NCU EMBA Mentorship Program
 
Tasplan Digital Presentation
Tasplan Digital PresentationTasplan Digital Presentation
Tasplan Digital Presentation
 
Tourism Tasmania Digital Coach Live Sessions - Digital Marketing
Tourism Tasmania Digital Coach Live Sessions - Digital MarketingTourism Tasmania Digital Coach Live Sessions - Digital Marketing
Tourism Tasmania Digital Coach Live Sessions - Digital Marketing
 
D4
D4D4
D4
 
2009 NCU EMBA Mentorship Program
2009 NCU EMBA Mentorship Program2009 NCU EMBA Mentorship Program
2009 NCU EMBA Mentorship Program
 
Tvin conference wrap up
Tvin conference wrap upTvin conference wrap up
Tvin conference wrap up
 
Effektiva gränssnitt med WM 6.5
Effektiva gränssnitt med WM 6.5Effektiva gränssnitt med WM 6.5
Effektiva gränssnitt med WM 6.5
 
Social Media For Public Libraries: Basics and Beyond
Social Media For Public Libraries: Basics and BeyondSocial Media For Public Libraries: Basics and Beyond
Social Media For Public Libraries: Basics and Beyond
 
Windows Phone 7.5 (Mango)
Windows Phone 7.5 (Mango)Windows Phone 7.5 (Mango)
Windows Phone 7.5 (Mango)
 
Strategy Plus Execution - AMI Smart Marketer Series, 16/6/2011
Strategy Plus Execution - AMI Smart Marketer Series, 16/6/2011Strategy Plus Execution - AMI Smart Marketer Series, 16/6/2011
Strategy Plus Execution - AMI Smart Marketer Series, 16/6/2011
 
ADMA Digital Launch
ADMA Digital Launch ADMA Digital Launch
ADMA Digital Launch
 
Jolasaaaa
JolasaaaaJolasaaaa
Jolasaaaa
 
Digital marketing - Liberal Party Presentation
Digital marketing - Liberal Party PresentationDigital marketing - Liberal Party Presentation
Digital marketing - Liberal Party Presentation
 
Heritage Tourism Presentation
Heritage Tourism Presentation Heritage Tourism Presentation
Heritage Tourism Presentation
 
MVVM
MVVMMVVM
MVVM
 
Metro and Windows Phone 7
Metro and Windows Phone 7Metro and Windows Phone 7
Metro and Windows Phone 7
 
An analysis of Ulrich's HR Model
An analysis of Ulrich's HR ModelAn analysis of Ulrich's HR Model
An analysis of Ulrich's HR Model
 

Ähnlich wie Real life XNA

Pointer Events in Canvas
Pointer Events in CanvasPointer Events in Canvas
Pointer Events in Canvasdeanhudson
 
Stupid Canvas Tricks
Stupid Canvas TricksStupid Canvas Tricks
Stupid Canvas Tricksdeanhudson
 
Game Development for Nokia Asha Devices with Java ME #2
Game Development for Nokia Asha Devices with Java ME #2Game Development for Nokia Asha Devices with Java ME #2
Game Development for Nokia Asha Devices with Java ME #2Marlon Luz
 
Swift for tensorflow
Swift for tensorflowSwift for tensorflow
Swift for tensorflow규영 허
 
HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?Ankara JUG
 
SwiftUI Animation - The basic overview
SwiftUI Animation - The basic overviewSwiftUI Animation - The basic overview
SwiftUI Animation - The basic overviewWannitaTolaema
 
玉転がしゲームで学ぶUnity入門
玉転がしゲームで学ぶUnity入門玉転がしゲームで学ぶUnity入門
玉転がしゲームで学ぶUnity入門nakamura001
 
Intro to computer vision in .net
Intro to computer vision in .netIntro to computer vision in .net
Intro to computer vision in .netStephen Lorello
 
Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)Marakana Inc.
 
Emerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonEmerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonAlex Payne
 
Processing and Processing.js
Processing and Processing.jsProcessing and Processing.js
Processing and Processing.jsjeresig
 
Computer graphics
Computer graphicsComputer graphics
Computer graphicsamitsarda3
 
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...Sencha
 
SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)Oswald Campesato
 

Ähnlich wie Real life XNA (20)

Pointer Events in Canvas
Pointer Events in CanvasPointer Events in Canvas
Pointer Events in Canvas
 
Stupid Canvas Tricks
Stupid Canvas TricksStupid Canvas Tricks
Stupid Canvas Tricks
 
CreateJS
CreateJSCreateJS
CreateJS
 
Intro to HTML5
Intro to HTML5Intro to HTML5
Intro to HTML5
 
Game Development for Nokia Asha Devices with Java ME #2
Game Development for Nokia Asha Devices with Java ME #2Game Development for Nokia Asha Devices with Java ME #2
Game Development for Nokia Asha Devices with Java ME #2
 
A More Flash Like Web?
A More Flash Like Web?A More Flash Like Web?
A More Flash Like Web?
 
Of class1
Of class1Of class1
Of class1
 
Swift for tensorflow
Swift for tensorflowSwift for tensorflow
Swift for tensorflow
 
HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?
 
SwiftUI Animation - The basic overview
SwiftUI Animation - The basic overviewSwiftUI Animation - The basic overview
SwiftUI Animation - The basic overview
 
玉転がしゲームで学ぶUnity入門
玉転がしゲームで学ぶUnity入門玉転がしゲームで学ぶUnity入門
玉転がしゲームで学ぶUnity入門
 
Intro to computer vision in .net
Intro to computer vision in .netIntro to computer vision in .net
Intro to computer vision in .net
 
Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)
 
Emerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonEmerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the Horizon
 
Abc2011 yagi
Abc2011 yagiAbc2011 yagi
Abc2011 yagi
 
Processing and Processing.js
Processing and Processing.jsProcessing and Processing.js
Processing and Processing.js
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
 
Svcc 2013-d3
Svcc 2013-d3Svcc 2013-d3
Svcc 2013-d3
 
SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)SVCC 2013 D3.js Presentation (10/05/2013)
SVCC 2013 D3.js Presentation (10/05/2013)
 

Mehr von Johan Lindfors

Being a game developer with the skills you have
Being a game developer with the skills you haveBeing a game developer with the skills you have
Being a game developer with the skills you haveJohan Lindfors
 
Säker utveckling med SDL
Säker utveckling med SDLSäker utveckling med SDL
Säker utveckling med SDLJohan Lindfors
 
Windows Azure - Windows In The Cloud
Windows Azure - Windows In The CloudWindows Azure - Windows In The Cloud
Windows Azure - Windows In The CloudJohan Lindfors
 
Att hålla presentationer
Att hålla presentationerAtt hålla presentationer
Att hålla presentationerJohan Lindfors
 

Mehr von Johan Lindfors (8)

Being a game developer with the skills you have
Being a game developer with the skills you haveBeing a game developer with the skills you have
Being a game developer with the skills you have
 
Introduktion till XNA
Introduktion till XNAIntroduktion till XNA
Introduktion till XNA
 
Develop for WP7 IRL
Develop for WP7 IRLDevelop for WP7 IRL
Develop for WP7 IRL
 
Säker utveckling med SDL
Säker utveckling med SDLSäker utveckling med SDL
Säker utveckling med SDL
 
Windows Mobile 6.5
Windows Mobile 6.5Windows Mobile 6.5
Windows Mobile 6.5
 
Microsoft Net 4.0
Microsoft Net 4.0Microsoft Net 4.0
Microsoft Net 4.0
 
Windows Azure - Windows In The Cloud
Windows Azure - Windows In The CloudWindows Azure - Windows In The Cloud
Windows Azure - Windows In The Cloud
 
Att hålla presentationer
Att hålla presentationerAtt hålla presentationer
Att hålla presentationer
 

Kürzlich hochgeladen

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Kürzlich hochgeladen (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Real life XNA

  • 1.
  • 3.
  • 4. windows phone for games • impressive performance • sensors and touch • potentially xbox-live • ads and trials
  • 11. xna in 1 minute • a comprehensive framework for games • integrated management of content • games with 2d and ”sprites” • games with 3d and ”meshes” • shared features for pc, wp, xbox
  • 12. initialize update render
  • 13. managing content • content pipeline • import common files • leverage compile time • optimized binary format • extensible
  • 14. first some 2d • x and y (and z) • spriteBatch • sprites/sprite sheets • blending
  • 15. and then some 3d • x, y and z • camera is described with matrices • view • projection • world matrix transforms objects relatively • movement (translation) • rotation • size (scale)
  • 16. demo
  • 17. effects - shaders • configurable • basic • skinned • environmentMap • dualTexture • alphaTest
  • 18. demo
  • 19. ”hardware scaler” • 800x480 = 384 000 pixels • 600x360 = 216 000 pixels (56%) • 400x240 = 96 000 pixels (25%) graphics.PreferredBackBufferHeight = 800; graphics.PreferredBackBufferWidth = 480;
  • 20. performance tips • manage the stack and heap • reference types live on the _______! • value types live on the _______! • pass large structures by reference Matrix a, b, c; c = Matrix.Multiply(a, b); // copies 192 bytes! Matrix.Multiply(ref a, ref b, out c); • don’t foreach or linq (know code cost)
  • 21. performance tips • gc is ”simpler” than on pc • allocate objects early, reuse • GC.Collect() can be your friend! • after load, while paused • cpu or gpu based? • you can go up to 60 fps (60 hz)
  • 22. demo
  • 23. sound and music • soundEffect • load as content • wp handles 64 simultaneously • possible to change • pitch • volume • 3d location
  • 24. orientation graphics.SupportedOrientations = DisplayOrientation.Portrait | DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight; • default is ”LandscapeLeft”
  • 25. orientation Window.OrientationChanged += (s, e) => { switch (Window.CurrentOrientation) { case DisplayOrientation.Portrait: graphics.PreferredBackBufferHeight = 800; graphics.PreferredBackBufferWidth = 480; break; default: graphics.PreferredBackBufferHeight = 480; graphics.PreferredBackBufferWidth = 800; break; } graphics.ApplyChanges(); };
  • 26. accelerometer using Microsoft.Devices.Sensors; • measures acceleration in X, Y and Z • values returned between -1 and +1 • event based • read values in event, store for usage
  • 27. start accelerometer Accelerometer accel; private void startAccelerometer() { accel = new Accelerometer(); accel.ReadingChanged += new EventHandler <AccelerometerReadingEventArgs> (accel_ReadingChanged); accel.Start(); }
  • 28. read the accelerometer Vector3 accelReading; void accel_ReadingChanged(object sender, AccelerometerReadingEventArgs e) { lock (this) { accelReading.X = (float)e.X; accelReading.Y = (float)e.Y; accelReading.Z = (float)e.Z; } }
  • 29. touch • windows phone handles 4 touch points • all points have unique id • pressed | moved | released TouchCollection touches; protected override void Update(GameTime gt) { touches = TouchPanel.GetState(); ... }
  • 30. gestures • wp can also handle gestures • tap | drag | hold | flick | pinch ... TouchPanel.EnabledGestures = GestureType.Flick; while (TouchPanel.IsGestureAvailable) { GestureSample g = TouchPanel.ReadGesture(); if (g.GestureType == GestureType.Flick) { ... } }
  • 31. network • http, rest, xml, sockets... void wc_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e) { if (e.Error == null) { mapImage = Texture2D.FromStream( graphics.GraphicsDevice, e.Result); } }
  • 32. xbox live • avatars and “trials” available for all • developers with agreements • profile • invites • achievements • leaderboard • gamerServices • contact: wpgames@microsoft.com
  • 33. trial mode #if DEBUG Guide.SimulateTrialMode = true; #endif bool isTrial = Guide.IsTrialMode; ... Guide.ShowMarketplace(PlayerIndex.One); • call to IsTrialMode takes 60 ms, cache! • be creative in feature set • trial or free light?
  • 34. ads • instead of user paying for app • not for swedish apps yet* using Microsoft.Advertising.Mobile.Xna; ... AdManager adManager; Ad bannerAd; *not from Microsoft that is, there are options
  • 35. marketplace • local structure • test kit in VS2010 • updates • auto-publish
  • 36. protect yourself • ready for obfuscation? public void d(bp.b A_0) { this.l = A_0; this.i = new List<string>(); this.i.Add(am.a().e("SK_NO")); this.i.Add(am.a().e("SK_YES")); this.g = bo.a; SignedInGamer.SignedIn += new EventHandler<SignedInEventArgs>(this.d); }
  • 37.
  • 38. news in mango • silverlight + xna • fast application switching • profiling • combined api for movement
  • 39. demo
  • 40. tripeaks solitaire • fabrication games • true 3D • all code in objective-c
  • 41. -(BOOL) animate { if([self animation] == nil) { [self draw]; return NO; } else { BOOL animationDone = [[self animation] animate]; [self draw]; if (animationDone) { x += [[self animation] currentX]; y += [[self animation] currentY]; z += [[self animation] currentZ]; rotation += [[self animation] currentRotation]; [animations removeObjectAtIndex:0]; } return animationDone; } }
  • 42. public bool Animate() { if (this.Animation == null) { this.Draw(); return false; } else { bool animationDone = this.Animation.Animate(); this.Draw(); if (animationDone) { x += this.Animation.CurrentX; y += this.Animation.CurrentY; z += this.Animation.CurrentZ; rotation += this.Animation.CurrentRotation; animations.RemoveAt(0); } return animationDone; } }
  • 43. public bool Animate(GraphicsDevice graphics, BasicEffect effect) { if (this.Animation == null) { this.Draw(graphics, effect); return false; } else { bool animationDone = this.Animation.Animate(); this.Draw(graphics, effect); if (animationDone) { x += this.Animation.CurrentX; y += this.Animation.CurrentY; z += this.Animation.CurrentZ; rotation += this.Animation.CurrentRotation; animations.RemoveAt(0); } return animationDone; } }
  • 44. demo
  • 45. future of xna? • silverlight 5.0 • subset of XNA • focused on business apps • windows 8 • leverages directx 11 • likely to attract commercial studios
  • 47. resources • create.msdn.com • jodegreef.wordpress.com - angry pigs • www.xnaresources.com • http://msdn.microsoft.com/en- us/library/bb417503(XNAGameStudio.41).aspx • programmeramera.se • www.coderox.se