SlideShare a Scribd company logo
Tools for Android Games




Raul Portales
@sla_shalafi          @thepilltree
raul@plattysoft.com   http://thepilltree.com
Summary
●   Introduction to game development
●   Engines
       ●   AndEngine
       ●   jPCT-AE
●   Scores / Achievements
●   Monetization systems
Game Architecture (Simplified)

               Game Engine




 Draw Thread   Game Objects   Update Thread
Performance Tips
●   Avoid object creations
       ●   Use pools and pre create them
●   Avoid getters and setters
       ●   Public attributes instead
●   Avoid collections
●   Avoid interfaces
●   Use a single Activity
Why use OpenGL?




   Performance
Why use OpenGL?




   Performance
Why use any Engine




You don’t want to start from scratch
AndEngine
AndEngine
●   http://www.andengine.org/
●   2D Graphics Engine
●   LGPL
●   Extensions
       ●   Physics Engine (Box2D)
       ●   Live Wallpapers
       ●   etc
Games built with AndEngine
●   Chalk Ball
●   Bunny Shooter
●   Greedy Spiders
●   Wheelz
●   Farm Tower
●   ...
Games built with AndEngine
Project setup
●   Put the jar under libs
        ●   Add them to the build
             path
●   Don’t forget “armeabi”
●   Get the source
        ●   Import project
        ●   Create res dir
Concepts
●   Engine
●   Scene
       ●   Sprites + Handlers
●   Texture / Texture Atlas
●   Sprite
●   Body
       ●   Fixture
Game Architecture / AndEngine
                Game Engine




  Draw Thread   Game Objects   Update Thread



                   Scene       UpdateHandler



                   Sprites
Activity creation flow
●   BaseGameActivity
       ●   onLoadEngine
       ●   onLoadResources
       ●   onLoadScene
       ●   onLoadComplete
Creating the Engine (1/2)
public Engine onLoadEngine() {
DisplayMetrics om = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(om);
camWidth = 480;
camHeight = (int) (om.heightPixels*480f / om.widthPixels);
RatioResolutionPolicy rrp = new
RatioResolutionPolicy(camWidth, camHeight);
Camera camera = new Camera(0, 0, camWidth, camHeight);
Creating the Engine (2/2)
EngineOptions options = new EngineOptions(true,
ScreenOrientation.LANDSCAPE, rrp, camera);


options.getRenderOptions()
.disableExtensionVertexBufferObjects();


return new Engine(options);
}
Loading Resources
public void onLoadResources() {
BitmapTextureAtlas bitmapTextureAtlas = new
BitmapTextureAtlas(64, 64,
TextureOptions.BILINEAR_PREMULTIPLYALPHA);
mBoxTextureRegion =
BitmapTextureAtlasTextureRegionFactory
.createFromAsset(bitmapTextureAtlas, this,
"box_icon.png", 0, 0);
mEngine.getTextureManager()
.loadTexture(bitmapTextureAtlas);
}
Texture Atlas
●   Quite a pain for AndEngine
       ●   Built by hand
       ●   Size must be a power of 2
       ●   One big or many small ones?
Creating the Scene (1/3)
public Scene onLoadScene() {
Scene scene = new Scene();
PhysicsWorld physicsWorld = new PhysicsWorld(new
Vector2(0, SensorManager.GRAVITY_EARTH), false);
Shape ground = new Rectangle(0, camHeight - 2,
camWidth, 2);
FixtureDef wallFixtureDef =
PhysicsFactory.createFixtureDef(0, 0.5f, 0.5f);
PhysicsFactory.createBoxBody(physicsWorld, ground,
BodyType.StaticBody, wallFixtureDef);
scene.attachChild(ground);
Creating the Scene (2/3)
Sprite box = new Sprite(0, 0, mBoxTextureRegion);
FixtureDef boxFixture =
PhysicsFactory.createFixtureDef(1, 0.5f, 0.5f);
Body boxBody =
PhysicsFactory.createBoxBody(physicsWorld, box,
BodyType.DynamicBody, boxFixture);
physicsWorld.registerPhysicsConnector(new
PhysicsConnector(box, boxBody, true, true));


scene.attachChild(box);
Creating the Scene (3/3)
scene.registerUpdateHandler(physicsWorld);
scene.registerUpdateHandler(mUpdateHandler);
return scene;
}
Types of bodies
●   Dynamic
        ●   It is affected by physics like gravity
●   Kinematic
        ●   It moves in a specified way
●   Static
        ●   It does not move
More Interesting things
●   TiledTextures / Animated Sprites
●   Animations
●   Sound Engine
●   Particle Systems
●   Collision Detect
●   Polygonal Bodies
●   Menus
Intermission



     ← AndEngine Example apk
jPCT-AE
jPCT-AE
●   http://www.jpct.net/jpct-ae/
●   3D Engine
        ●   3DObjects
        ●   Lights
        ●   etc
●   No physics
        ●   It has collision detection
Games built with jPCT-AE
●   SpaceCat
●   SkyFrontier
●   Forgotten Elements
●   Mobialia Chess
●   Freddy Budgett
●   Alien Runner
●   ...
Games built with jPCT-AE
Project setup




Add jpct-ae.jar to libs / Build path
Concepts / Classes
●   Renderer / FrameBuffer
●   World
●   Texture / TextureManager
●   Object3D
●   Light
●   Camera
Game Architecture / jPCT-AE
              Game Engine




Draw Thread   Game Objects   Update Thread




 Renderer        World



                3DObject
Preparing the GLSurfaceView
mGlView = (GLSurfaceView) findViewById(R.id.glview);
mGlView.setKeepScreenOn(true);
mViewRenderer = new MyRenderer(mGlView, mWorld);
mGlView.setRenderer(mViewRenderer);
Renderer setup
public void onDrawFrame(GL10 gl) {
    buffer.clear(back);
    synchronized (mWorld) {
        mWorld.renderScene(buffer);
        mWorld.draw(buffer);
    }
    buffer.display();
}
Setup the World
mWorld = new World();
mWorld.setAmbientLight(150, 150, 150);
Loading Textures
Resources res = getResources();
Texture texture =
   new Texture(res.getDrawable(R.raw.texture));
TextureManager.getInstance()
   .addTexture("texture", texture);
Loading Objects
mModel = Loader.load3DS(getResources()
   .openRawResource(R.raw.model), 1)[0];
mModel.setTexture("texture");


mWorld.addObject(mModel);
mWorld.buildAllObjects();
Creating Lights
Light sun = new Light(mWorld);
sun.setIntensity(250, 250, 250);
SimpleVector sv = new SimpleVector(0, -100, -100);
sun.setPosition(sv);
Handling the camera
Camera cam = mWorld.getCamera();
cam.setPosition(new SimpleVector(0, 0,-100));
cam.lookAt(mModel.getTransformedCenter());
More about the camera
●   It has a position
        ●   Camera.setPosition
●   It has a target
        ●   Camera.lookAt
●   It has a rotation
        ●   Camera.setRotation
The 3D axis
Operations with objects
●   Hierarchy
       ●   addChild
●   Move
       ●   setPosition / translate
●   Rotation
       ●   rotateX, rotateY, rotateZ
More Interesting Things
●   Keyframe Animations
●   Collision detect (Ellipsoids)
●   Billboards
●   Transparency
●   Culling
●   Primitive Objects
And a workaround
●   Overlay native layouts
       ●   Menus
       ●   Dialogs
Another Intermission



          ← jPCT-AE Example apk
Bonus: Other Engines
●   PlayN
       ●    https://developers.google.com/playn/
●   NME
       ●    http://www.haxenme.org/
●   Unity
       ●    http://unity3d.com/
●   Game Maker
       ●    http://www.yoyogames.com/make
Scores / Achievements
Why use a Library?
●   Not reinventing the wheel
        ●   It is proven that works
●   Familiarity for users
        ●   Other games use them
●   You do not own the servers
        ●   You don’t, and that is good
Available libraries
●   ScoreLoop        ●   OpenFeint
What do you get?
●   Achievements
       ●   Not very impressive
●   Leaderboards
       ●   That is interesting
●   News Feed
●   Friends management
●   Improved engagement
Easy to integrate
●   Android Library Project
●   Initialize with the Application
●   Open a specific screen
        ●   2 lines of code
●   Submit a score or achievement
        ●   2 lines of code
Monetization




Too much to say for a single slide
And now...
●   Lunch
●   Pitch your game idea
       ●   Gather a team
●   Hackaton
●   Demos, Pizza & Beer
Tools for Android Games




Raul Portales
@sla_shalafi          @thepilltree
raul@plattysoft.com   http://thepilltree.com
Ad

More Related Content

What's hot (20)

The Ring programming language version 1.6 book - Part 56 of 189
The Ring programming language version 1.6 book - Part 56 of 189The Ring programming language version 1.6 book - Part 56 of 189
The Ring programming language version 1.6 book - Part 56 of 189
Mahmoud Samir Fayed
 
Cross platform game development
Cross platform game developmentCross platform game development
Cross platform game development
Jerel Hass
 
The Ring programming language version 1.5.2 book - Part 53 of 181
The Ring programming language version 1.5.2 book - Part 53 of 181The Ring programming language version 1.5.2 book - Part 53 of 181
The Ring programming language version 1.5.2 book - Part 53 of 181
Mahmoud Samir Fayed
 
WP7 HUB_XNA overview
WP7 HUB_XNA overviewWP7 HUB_XNA overview
WP7 HUB_XNA overview
MICTT Palma
 
Academy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. EnvironmentAcademy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. Environment
Binary Studio
 
WP7 HUB_XNA
WP7 HUB_XNAWP7 HUB_XNA
WP7 HUB_XNA
MICTT Palma
 
The Ring programming language version 1.8 book - Part 56 of 202
The Ring programming language version 1.8 book - Part 56 of 202The Ring programming language version 1.8 book - Part 56 of 202
The Ring programming language version 1.8 book - Part 56 of 202
Mahmoud Samir Fayed
 
Денис Ковалев «Python в игровой индустрии»
Денис Ковалев «Python в игровой индустрии»Денис Ковалев «Python в игровой индустрии»
Денис Ковалев «Python в игровой индустрии»
DataArt
 
Introducing perf budgets on CI with puppeteer - perf.now()
Introducing perf budgets on CI with puppeteer - perf.now()Introducing perf budgets on CI with puppeteer - perf.now()
Introducing perf budgets on CI with puppeteer - perf.now()
Önder Ceylan
 
Programmers guide
Programmers guideProgrammers guide
Programmers guide
Karla Paz Enamorado
 
The Ring programming language version 1.8 book - Part 122 of 202
The Ring programming language version 1.8 book - Part 122 of 202The Ring programming language version 1.8 book - Part 122 of 202
The Ring programming language version 1.8 book - Part 122 of 202
Mahmoud Samir Fayed
 
iOS Training Session-3
iOS Training Session-3iOS Training Session-3
iOS Training Session-3
Hussain Behestee
 
UIImageView vs Metal #tryswiftconf
UIImageView vs Metal #tryswiftconfUIImageView vs Metal #tryswiftconf
UIImageView vs Metal #tryswiftconf
Shuichi Tsutsumi
 
Pygame presentation
Pygame presentationPygame presentation
Pygame presentation
Felix Z. Hoffmann
 
Cocos2d-x C++ Windows 8 &Windows Phone 8
Cocos2d-x C++ Windows 8 &Windows Phone 8Cocos2d-x C++ Windows 8 &Windows Phone 8
Cocos2d-x C++ Windows 8 &Windows Phone 8
Troy Miles
 
2d game engine workflow
2d game engine workflow2d game engine workflow
2d game engine workflow
luisfvazquez1
 
Test Driven Cocos2d
Test Driven Cocos2dTest Driven Cocos2d
Test Driven Cocos2d
Eric Smith
 
The Ring programming language version 1.5.1 book - Part 48 of 180
The Ring programming language version 1.5.1 book - Part 48 of 180The Ring programming language version 1.5.1 book - Part 48 of 180
The Ring programming language version 1.5.1 book - Part 48 of 180
Mahmoud Samir Fayed
 
Game development with Cocos2d-x Engine
Game development with Cocos2d-x EngineGame development with Cocos2d-x Engine
Game development with Cocos2d-x Engine
Duy Tan Geek
 
libGDX: Screens, Fonts and Preferences
libGDX: Screens, Fonts and PreferenceslibGDX: Screens, Fonts and Preferences
libGDX: Screens, Fonts and Preferences
Jussi Pohjolainen
 
The Ring programming language version 1.6 book - Part 56 of 189
The Ring programming language version 1.6 book - Part 56 of 189The Ring programming language version 1.6 book - Part 56 of 189
The Ring programming language version 1.6 book - Part 56 of 189
Mahmoud Samir Fayed
 
Cross platform game development
Cross platform game developmentCross platform game development
Cross platform game development
Jerel Hass
 
The Ring programming language version 1.5.2 book - Part 53 of 181
The Ring programming language version 1.5.2 book - Part 53 of 181The Ring programming language version 1.5.2 book - Part 53 of 181
The Ring programming language version 1.5.2 book - Part 53 of 181
Mahmoud Samir Fayed
 
WP7 HUB_XNA overview
WP7 HUB_XNA overviewWP7 HUB_XNA overview
WP7 HUB_XNA overview
MICTT Palma
 
Academy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. EnvironmentAcademy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. Environment
Binary Studio
 
The Ring programming language version 1.8 book - Part 56 of 202
The Ring programming language version 1.8 book - Part 56 of 202The Ring programming language version 1.8 book - Part 56 of 202
The Ring programming language version 1.8 book - Part 56 of 202
Mahmoud Samir Fayed
 
Денис Ковалев «Python в игровой индустрии»
Денис Ковалев «Python в игровой индустрии»Денис Ковалев «Python в игровой индустрии»
Денис Ковалев «Python в игровой индустрии»
DataArt
 
Introducing perf budgets on CI with puppeteer - perf.now()
Introducing perf budgets on CI with puppeteer - perf.now()Introducing perf budgets on CI with puppeteer - perf.now()
Introducing perf budgets on CI with puppeteer - perf.now()
Önder Ceylan
 
The Ring programming language version 1.8 book - Part 122 of 202
The Ring programming language version 1.8 book - Part 122 of 202The Ring programming language version 1.8 book - Part 122 of 202
The Ring programming language version 1.8 book - Part 122 of 202
Mahmoud Samir Fayed
 
UIImageView vs Metal #tryswiftconf
UIImageView vs Metal #tryswiftconfUIImageView vs Metal #tryswiftconf
UIImageView vs Metal #tryswiftconf
Shuichi Tsutsumi
 
Cocos2d-x C++ Windows 8 &Windows Phone 8
Cocos2d-x C++ Windows 8 &Windows Phone 8Cocos2d-x C++ Windows 8 &Windows Phone 8
Cocos2d-x C++ Windows 8 &Windows Phone 8
Troy Miles
 
2d game engine workflow
2d game engine workflow2d game engine workflow
2d game engine workflow
luisfvazquez1
 
Test Driven Cocos2d
Test Driven Cocos2dTest Driven Cocos2d
Test Driven Cocos2d
Eric Smith
 
The Ring programming language version 1.5.1 book - Part 48 of 180
The Ring programming language version 1.5.1 book - Part 48 of 180The Ring programming language version 1.5.1 book - Part 48 of 180
The Ring programming language version 1.5.1 book - Part 48 of 180
Mahmoud Samir Fayed
 
Game development with Cocos2d-x Engine
Game development with Cocos2d-x EngineGame development with Cocos2d-x Engine
Game development with Cocos2d-x Engine
Duy Tan Geek
 
libGDX: Screens, Fonts and Preferences
libGDX: Screens, Fonts and PreferenceslibGDX: Screens, Fonts and Preferences
libGDX: Screens, Fonts and Preferences
Jussi Pohjolainen
 

Similar to Tools for developing Android Games (20)

Android game development
Android game developmentAndroid game development
Android game development
dmontagni
 
How to build Kick Ass Games in the Cloud
How to build Kick Ass Games in the CloudHow to build Kick Ass Games in the Cloud
How to build Kick Ass Games in the Cloud
Chris Schalk
 
3D Programming Basics: WebGL
3D Programming Basics: WebGL3D Programming Basics: WebGL
3D Programming Basics: WebGL
Globant
 
Introduction to Unity
Introduction to UnityIntroduction to Unity
Introduction to Unity
University of Auckland
 
Introduction to threejs
Introduction to threejsIntroduction to threejs
Introduction to threejs
Gareth Marland
 
Virtual Reality in Android
Virtual Reality in AndroidVirtual Reality in Android
Virtual Reality in Android
Mario Bodemann
 
Webrender 1.0
Webrender 1.0Webrender 1.0
Webrender 1.0
Daosheng Mu
 
Ujug07presentation
Ujug07presentationUjug07presentation
Ujug07presentation
Bill Adams
 
Introduction to Unity by Purdue university
Introduction to Unity by Purdue universityIntroduction to Unity by Purdue university
Introduction to Unity by Purdue university
asdf936939
 
WebGL 3D player
WebGL 3D playerWebGL 3D player
WebGL 3D player
Vasilika Klimova
 
JS digest. February 2017
JS digest. February 2017JS digest. February 2017
JS digest. February 2017
ElifTech
 
Transitioning to Native
Transitioning to NativeTransitioning to Native
Transitioning to Native
Robbie Litchfield
 
a friend in need-a js indeed / Yonatan levin
a friend in need-a js indeed / Yonatan levina friend in need-a js indeed / Yonatan levin
a friend in need-a js indeed / Yonatan levin
geektimecoil
 
A friend in need - A JS indeed
A friend in need - A JS indeedA friend in need - A JS indeed
A friend in need - A JS indeed
Yonatan Levin
 
Rendering Techniques for Augmented Reality and a Look Ahead at AR Foundation
Rendering Techniques for Augmented Reality and a Look Ahead at AR FoundationRendering Techniques for Augmented Reality and a Look Ahead at AR Foundation
Rendering Techniques for Augmented Reality and a Look Ahead at AR Foundation
Unity Technologies
 
Customizing a production pipeline
Customizing a production pipelineCustomizing a production pipeline
Customizing a production pipeline
Felipe Lira
 
Animations in Flutter - FlutterConf LATAM 2024
Animations in Flutter - FlutterConf LATAM 2024Animations in Flutter - FlutterConf LATAM 2024
Animations in Flutter - FlutterConf LATAM 2024
johnpryan
 
Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5
Takao Wada
 
Building Kick Ass Video Games for the Cloud
Building Kick Ass Video Games for the CloudBuilding Kick Ass Video Games for the Cloud
Building Kick Ass Video Games for the Cloud
Chris Schalk
 
Game development with Cocos2d
Game development with Cocos2dGame development with Cocos2d
Game development with Cocos2d
Vinsol
 
Android game development
Android game developmentAndroid game development
Android game development
dmontagni
 
How to build Kick Ass Games in the Cloud
How to build Kick Ass Games in the CloudHow to build Kick Ass Games in the Cloud
How to build Kick Ass Games in the Cloud
Chris Schalk
 
3D Programming Basics: WebGL
3D Programming Basics: WebGL3D Programming Basics: WebGL
3D Programming Basics: WebGL
Globant
 
Introduction to threejs
Introduction to threejsIntroduction to threejs
Introduction to threejs
Gareth Marland
 
Virtual Reality in Android
Virtual Reality in AndroidVirtual Reality in Android
Virtual Reality in Android
Mario Bodemann
 
Ujug07presentation
Ujug07presentationUjug07presentation
Ujug07presentation
Bill Adams
 
Introduction to Unity by Purdue university
Introduction to Unity by Purdue universityIntroduction to Unity by Purdue university
Introduction to Unity by Purdue university
asdf936939
 
JS digest. February 2017
JS digest. February 2017JS digest. February 2017
JS digest. February 2017
ElifTech
 
a friend in need-a js indeed / Yonatan levin
a friend in need-a js indeed / Yonatan levina friend in need-a js indeed / Yonatan levin
a friend in need-a js indeed / Yonatan levin
geektimecoil
 
A friend in need - A JS indeed
A friend in need - A JS indeedA friend in need - A JS indeed
A friend in need - A JS indeed
Yonatan Levin
 
Rendering Techniques for Augmented Reality and a Look Ahead at AR Foundation
Rendering Techniques for Augmented Reality and a Look Ahead at AR FoundationRendering Techniques for Augmented Reality and a Look Ahead at AR Foundation
Rendering Techniques for Augmented Reality and a Look Ahead at AR Foundation
Unity Technologies
 
Customizing a production pipeline
Customizing a production pipelineCustomizing a production pipeline
Customizing a production pipeline
Felipe Lira
 
Animations in Flutter - FlutterConf LATAM 2024
Animations in Flutter - FlutterConf LATAM 2024Animations in Flutter - FlutterConf LATAM 2024
Animations in Flutter - FlutterConf LATAM 2024
johnpryan
 
Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5Trident International Graphics Workshop 2014 1/5
Trident International Graphics Workshop 2014 1/5
Takao Wada
 
Building Kick Ass Video Games for the Cloud
Building Kick Ass Video Games for the CloudBuilding Kick Ass Video Games for the Cloud
Building Kick Ass Video Games for the Cloud
Chris Schalk
 
Game development with Cocos2d
Game development with Cocos2dGame development with Cocos2d
Game development with Cocos2d
Vinsol
 
Ad

More from Platty Soft (6)

Integrating Google Play Games
Integrating Google Play GamesIntegrating Google Play Games
Integrating Google Play Games
Platty Soft
 
The Indie Game Developer Survival Guide
The Indie Game Developer Survival GuideThe Indie Game Developer Survival Guide
The Indie Game Developer Survival Guide
Platty Soft
 
Continuous integration for Android
Continuous integration for AndroidContinuous integration for Android
Continuous integration for Android
Platty Soft
 
Android design patterns
Android design patternsAndroid design patterns
Android design patterns
Platty Soft
 
Piracy on Apps
Piracy on AppsPiracy on Apps
Piracy on Apps
Platty Soft
 
Road to Publishing
Road to PublishingRoad to Publishing
Road to Publishing
Platty Soft
 
Integrating Google Play Games
Integrating Google Play GamesIntegrating Google Play Games
Integrating Google Play Games
Platty Soft
 
The Indie Game Developer Survival Guide
The Indie Game Developer Survival GuideThe Indie Game Developer Survival Guide
The Indie Game Developer Survival Guide
Platty Soft
 
Continuous integration for Android
Continuous integration for AndroidContinuous integration for Android
Continuous integration for Android
Platty Soft
 
Android design patterns
Android design patternsAndroid design patterns
Android design patterns
Platty Soft
 
Road to Publishing
Road to PublishingRoad to Publishing
Road to Publishing
Platty Soft
 
Ad

Recently uploaded (20)

Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 

Tools for developing Android Games

  • 1. Tools for Android Games Raul Portales @sla_shalafi @thepilltree [email protected] http://thepilltree.com
  • 2. Summary ● Introduction to game development ● Engines ● AndEngine ● jPCT-AE ● Scores / Achievements ● Monetization systems
  • 3. Game Architecture (Simplified) Game Engine Draw Thread Game Objects Update Thread
  • 4. Performance Tips ● Avoid object creations ● Use pools and pre create them ● Avoid getters and setters ● Public attributes instead ● Avoid collections ● Avoid interfaces ● Use a single Activity
  • 5. Why use OpenGL? Performance
  • 6. Why use OpenGL? Performance
  • 7. Why use any Engine You don’t want to start from scratch
  • 9. AndEngine ● http://www.andengine.org/ ● 2D Graphics Engine ● LGPL ● Extensions ● Physics Engine (Box2D) ● Live Wallpapers ● etc
  • 10. Games built with AndEngine ● Chalk Ball ● Bunny Shooter ● Greedy Spiders ● Wheelz ● Farm Tower ● ...
  • 11. Games built with AndEngine
  • 12. Project setup ● Put the jar under libs ● Add them to the build path ● Don’t forget “armeabi” ● Get the source ● Import project ● Create res dir
  • 13. Concepts ● Engine ● Scene ● Sprites + Handlers ● Texture / Texture Atlas ● Sprite ● Body ● Fixture
  • 14. Game Architecture / AndEngine Game Engine Draw Thread Game Objects Update Thread Scene UpdateHandler Sprites
  • 15. Activity creation flow ● BaseGameActivity ● onLoadEngine ● onLoadResources ● onLoadScene ● onLoadComplete
  • 16. Creating the Engine (1/2) public Engine onLoadEngine() { DisplayMetrics om = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(om); camWidth = 480; camHeight = (int) (om.heightPixels*480f / om.widthPixels); RatioResolutionPolicy rrp = new RatioResolutionPolicy(camWidth, camHeight); Camera camera = new Camera(0, 0, camWidth, camHeight);
  • 17. Creating the Engine (2/2) EngineOptions options = new EngineOptions(true, ScreenOrientation.LANDSCAPE, rrp, camera); options.getRenderOptions() .disableExtensionVertexBufferObjects(); return new Engine(options); }
  • 18. Loading Resources public void onLoadResources() { BitmapTextureAtlas bitmapTextureAtlas = new BitmapTextureAtlas(64, 64, TextureOptions.BILINEAR_PREMULTIPLYALPHA); mBoxTextureRegion = BitmapTextureAtlasTextureRegionFactory .createFromAsset(bitmapTextureAtlas, this, "box_icon.png", 0, 0); mEngine.getTextureManager() .loadTexture(bitmapTextureAtlas); }
  • 19. Texture Atlas ● Quite a pain for AndEngine ● Built by hand ● Size must be a power of 2 ● One big or many small ones?
  • 20. Creating the Scene (1/3) public Scene onLoadScene() { Scene scene = new Scene(); PhysicsWorld physicsWorld = new PhysicsWorld(new Vector2(0, SensorManager.GRAVITY_EARTH), false); Shape ground = new Rectangle(0, camHeight - 2, camWidth, 2); FixtureDef wallFixtureDef = PhysicsFactory.createFixtureDef(0, 0.5f, 0.5f); PhysicsFactory.createBoxBody(physicsWorld, ground, BodyType.StaticBody, wallFixtureDef); scene.attachChild(ground);
  • 21. Creating the Scene (2/3) Sprite box = new Sprite(0, 0, mBoxTextureRegion); FixtureDef boxFixture = PhysicsFactory.createFixtureDef(1, 0.5f, 0.5f); Body boxBody = PhysicsFactory.createBoxBody(physicsWorld, box, BodyType.DynamicBody, boxFixture); physicsWorld.registerPhysicsConnector(new PhysicsConnector(box, boxBody, true, true)); scene.attachChild(box);
  • 22. Creating the Scene (3/3) scene.registerUpdateHandler(physicsWorld); scene.registerUpdateHandler(mUpdateHandler); return scene; }
  • 23. Types of bodies ● Dynamic ● It is affected by physics like gravity ● Kinematic ● It moves in a specified way ● Static ● It does not move
  • 24. More Interesting things ● TiledTextures / Animated Sprites ● Animations ● Sound Engine ● Particle Systems ● Collision Detect ● Polygonal Bodies ● Menus
  • 25. Intermission ← AndEngine Example apk
  • 27. jPCT-AE ● http://www.jpct.net/jpct-ae/ ● 3D Engine ● 3DObjects ● Lights ● etc ● No physics ● It has collision detection
  • 28. Games built with jPCT-AE ● SpaceCat ● SkyFrontier ● Forgotten Elements ● Mobialia Chess ● Freddy Budgett ● Alien Runner ● ...
  • 29. Games built with jPCT-AE
  • 30. Project setup Add jpct-ae.jar to libs / Build path
  • 31. Concepts / Classes ● Renderer / FrameBuffer ● World ● Texture / TextureManager ● Object3D ● Light ● Camera
  • 32. Game Architecture / jPCT-AE Game Engine Draw Thread Game Objects Update Thread Renderer World 3DObject
  • 33. Preparing the GLSurfaceView mGlView = (GLSurfaceView) findViewById(R.id.glview); mGlView.setKeepScreenOn(true); mViewRenderer = new MyRenderer(mGlView, mWorld); mGlView.setRenderer(mViewRenderer);
  • 34. Renderer setup public void onDrawFrame(GL10 gl) { buffer.clear(back); synchronized (mWorld) { mWorld.renderScene(buffer); mWorld.draw(buffer); } buffer.display(); }
  • 35. Setup the World mWorld = new World(); mWorld.setAmbientLight(150, 150, 150);
  • 36. Loading Textures Resources res = getResources(); Texture texture = new Texture(res.getDrawable(R.raw.texture)); TextureManager.getInstance() .addTexture("texture", texture);
  • 37. Loading Objects mModel = Loader.load3DS(getResources() .openRawResource(R.raw.model), 1)[0]; mModel.setTexture("texture"); mWorld.addObject(mModel); mWorld.buildAllObjects();
  • 38. Creating Lights Light sun = new Light(mWorld); sun.setIntensity(250, 250, 250); SimpleVector sv = new SimpleVector(0, -100, -100); sun.setPosition(sv);
  • 39. Handling the camera Camera cam = mWorld.getCamera(); cam.setPosition(new SimpleVector(0, 0,-100)); cam.lookAt(mModel.getTransformedCenter());
  • 40. More about the camera ● It has a position ● Camera.setPosition ● It has a target ● Camera.lookAt ● It has a rotation ● Camera.setRotation
  • 42. Operations with objects ● Hierarchy ● addChild ● Move ● setPosition / translate ● Rotation ● rotateX, rotateY, rotateZ
  • 43. More Interesting Things ● Keyframe Animations ● Collision detect (Ellipsoids) ● Billboards ● Transparency ● Culling ● Primitive Objects
  • 44. And a workaround ● Overlay native layouts ● Menus ● Dialogs
  • 45. Another Intermission ← jPCT-AE Example apk
  • 46. Bonus: Other Engines ● PlayN ● https://developers.google.com/playn/ ● NME ● http://www.haxenme.org/ ● Unity ● http://unity3d.com/ ● Game Maker ● http://www.yoyogames.com/make
  • 48. Why use a Library? ● Not reinventing the wheel ● It is proven that works ● Familiarity for users ● Other games use them ● You do not own the servers ● You don’t, and that is good
  • 49. Available libraries ● ScoreLoop ● OpenFeint
  • 50. What do you get? ● Achievements ● Not very impressive ● Leaderboards ● That is interesting ● News Feed ● Friends management ● Improved engagement
  • 51. Easy to integrate ● Android Library Project ● Initialize with the Application ● Open a specific screen ● 2 lines of code ● Submit a score or achievement ● 2 lines of code
  • 52. Monetization Too much to say for a single slide
  • 53. And now... ● Lunch ● Pitch your game idea ● Gather a team ● Hackaton ● Demos, Pizza & Beer
  • 54. Tools for Android Games Raul Portales @sla_shalafi @thepilltree [email protected] http://thepilltree.com