際際滷

際際滷Share a Scribd company logo
A Multiplatform
Architecture for
Games
FISL 14
Thiago Figueredo Cardoso, Thiago de Barros Lacerda
Multiplatform development
At one extreme...
... one code per platform/device
Expensive
Hard to mantain
At the other extreme...
... same code for all platforms/devices
Needs a framework
Not every aspect of the code can be easily adapted
The intermediate path
We need to split platform-dependent from platform-independent
code and rewrite only the former
Game development
Architeture
Sprite.prototype.update = function (delta) {
// update position, animation, ...
};
Sprite.prototype.draw = function (context) {
< // draw on the screen
};
function mainLoop () {
for (var i in sprites) {
sprites[i].update();
sprites[i].draw();
}
}
Sprite's update deals with UI (platform-dependent) and
behavior (platform-independent)
What kinds of problems do we
face with this kind of
architecture?
1. Physics parameters change
when resolution changes
RectSprite.prototype.update = function (delta) {
this.x += this.velocity * delta;
};
RectSprite.prototype.draw = function (context) {
context.fillStyle = "black";
context.fillRect(this.x, this.y, this.width, this.height);
};
Velocity (pixel/sec): 10 Play
The velocity needs to be
scaled
1. Before setting the sprite parameter:
2. Inside the sprite's update:
var rect = new RectSprite();
rect.velocity = config.velocity / UI.SCALE;
RectSprite.prototype.update = function (delta) {
this.x += (this.velocity / UI.SCALE) * delta;
};
2. Scaling can introduce
rounding errors
3. Testing can become harder
FISL14 - A Multiplatform Architecture for Games
Circus v1
It wasn't modeled for multiple platforms
Problems with Circus v1
class Sprite : public QGraphicsObject
{
Q_OBJECT
...
};
Elements are implemented as objects of the graphic system
Problems with Circus v1
Behavior and UI mixed
Problems with Circus v1
void GameWorld::step(qreal dt)
{
...
const QPointF &ds = dt * sprite->velocity() * worldScaleFactor;
...
}
Multiple resolutions handled with scales in the physics
Circus v1 on Windows Phone
No Qt, no C++, no reuse :(
On top on the Sparta engine
Circus v2
New elements
Bug fixes
Problems with Circus v2
Implementation of classes/functionalities of the Qt framework in C#:
QtPropertyAnimation
Rotation
Object tree
Collision
Problems with Circus v2
No testing framework
Step-by-step debugging in many cases
Circus v3?
Oh, please, let's start from scratch!
A multiplatform architecture
for Circus
Three layer architecture, separation of concerns
FISL14 - A Multiplatform Architecture for Games
Platform deals with platform-dependent issues (UI, audio and
filesystem)
Tests uses the Core directly
Core deals with the behavior of the elements and game logic (score,
world)
Physics deals with collisions and its resolution
How a game element is
represented?
Physics
Elements are bodies, interactions are collisions
Core
Elements are entities that have a group of bodies
Interactions are input events and collisions between entities
UI
Elements are sprites that display an entity
No interactions, only forwarding of events (the UI doesn't alter the
game)
How do we use it in multiple
platforms?
Rewrite only the Platform layer
Summary
Behavior consistency guaranteed by having only one code for
behavior
No framework dependency, making it easy to translate to other
languages (C++?)
Tests are easier to write (no frameworks) and need to be written
once (one code)
Porting effort is clear
Let's try it!
INdT @ FISL
Workshop de Jogos HTML5 - Sala 714 - 14h
A Multiplatform
Architecture for
Games
FISL 14
Thiago Figueredo Cardoso, Thiago de Barros Lacerda
Ad

Recommended

PDF
So you want to quit Facebook Marketing? (Babelcamp 2014)
Die Socialisten
PDF
Curso superior de gesti坦n de contact center en barcelona
Rafael Martinez
PDF
Discurso del lehendakari - Inauguraci坦n gasoducto Bilbao-Treto
Irekia - EJGV
PPTX
IT Security Forum London ballintrae 240913 final
Jason Boud
PPT
Crowdsourcing Jos辿 Antonio Gallego
Innosfera
PDF
Wikivial 2011
Sierra Francisco Justo
PPTX
Adiccion a los videojuegos
Lezzliie EsCck
PDF
Amazon EMR Grundlagen
inovex GmbH
PPTX
Presentaci坦n 1
hfabiomarin
PDF
Memoria Red Salud 2012
el_m
PPTX
Driving Value Through Video - Michael Weissman General Manager, Creator Pla...
Conductor
PDF
Thought up in Barcelona 1
Barcelona Business
PDF
Charla Tryve en Expobike 2015
Alejandro Rios Pe単a
PDF
Dr. Jusuf Kardavi - Obligimet e t谷 rinj谷ve t谷 sotsh谷m musliman谷
Shkumbim Jakupi
PPSX
Huella L鱈quida, el Liderazgo Inspirador en el Ecosistema Interno
Edita Olaizola (+1.800)
PPTX
Pay stream and basware einvoicing trends and truths 12.11.14 final
Justin Combs
PDF
TIM SA - podsumowanie I kwartau 2016 r.
TIM SA
PDF
Csr
Ardi Yanson
PDF
Felicidad y desarrollo de la cultura organizacional
Vicente Ibarra
PPTX
Searle Vitamin Water (Realization of New Category)
Khurram Shakeel
PDF
Tratamiento de aguas residuales
LUIS STAPLETON PRIETO
PPTX
Kevin Hillstrom - How The Future of Retail is Like Professional Sports
Marketing Festival
PDF
Conociendo el interior de filtros para aceite
GONHER Autopartes
PDF
Catalogue francais 2014
EUROPAGES
PDF
Desarrollo territorial
Gustavo Sosa
PDF
Refor巽 i ampliacio matem 2
Merc竪 Balbastre
PDF
UX & RIAs: UI Design Challenges (ERGOSIGN)
Ergosign GmbH
PPT
Clima Oce叩nico y Clima Chino
FJOSEVidal
PDF
Introduction to android (and mobile) game development
Ruslan Novikov
PDF
Dot Net Project Mini Game
varun arora

More Related Content

Viewers also liked (20)

PPTX
Presentaci坦n 1
hfabiomarin
PDF
Memoria Red Salud 2012
el_m
PPTX
Driving Value Through Video - Michael Weissman General Manager, Creator Pla...
Conductor
PDF
Thought up in Barcelona 1
Barcelona Business
PDF
Charla Tryve en Expobike 2015
Alejandro Rios Pe単a
PDF
Dr. Jusuf Kardavi - Obligimet e t谷 rinj谷ve t谷 sotsh谷m musliman谷
Shkumbim Jakupi
PPSX
Huella L鱈quida, el Liderazgo Inspirador en el Ecosistema Interno
Edita Olaizola (+1.800)
PPTX
Pay stream and basware einvoicing trends and truths 12.11.14 final
Justin Combs
PDF
TIM SA - podsumowanie I kwartau 2016 r.
TIM SA
PDF
Csr
Ardi Yanson
PDF
Felicidad y desarrollo de la cultura organizacional
Vicente Ibarra
PPTX
Searle Vitamin Water (Realization of New Category)
Khurram Shakeel
PDF
Tratamiento de aguas residuales
LUIS STAPLETON PRIETO
PPTX
Kevin Hillstrom - How The Future of Retail is Like Professional Sports
Marketing Festival
PDF
Conociendo el interior de filtros para aceite
GONHER Autopartes
PDF
Catalogue francais 2014
EUROPAGES
PDF
Desarrollo territorial
Gustavo Sosa
PDF
Refor巽 i ampliacio matem 2
Merc竪 Balbastre
PDF
UX & RIAs: UI Design Challenges (ERGOSIGN)
Ergosign GmbH
PPT
Clima Oce叩nico y Clima Chino
FJOSEVidal
Presentaci坦n 1
hfabiomarin
Memoria Red Salud 2012
el_m
Driving Value Through Video - Michael Weissman General Manager, Creator Pla...
Conductor
Thought up in Barcelona 1
Barcelona Business
Charla Tryve en Expobike 2015
Alejandro Rios Pe単a
Dr. Jusuf Kardavi - Obligimet e t谷 rinj谷ve t谷 sotsh谷m musliman谷
Shkumbim Jakupi
Huella L鱈quida, el Liderazgo Inspirador en el Ecosistema Interno
Edita Olaizola (+1.800)
Pay stream and basware einvoicing trends and truths 12.11.14 final
Justin Combs
TIM SA - podsumowanie I kwartau 2016 r.
TIM SA
Felicidad y desarrollo de la cultura organizacional
Vicente Ibarra
Searle Vitamin Water (Realization of New Category)
Khurram Shakeel
Tratamiento de aguas residuales
LUIS STAPLETON PRIETO
Kevin Hillstrom - How The Future of Retail is Like Professional Sports
Marketing Festival
Conociendo el interior de filtros para aceite
GONHER Autopartes
Catalogue francais 2014
EUROPAGES
Desarrollo territorial
Gustavo Sosa
Refor巽 i ampliacio matem 2
Merc竪 Balbastre
UX & RIAs: UI Design Challenges (ERGOSIGN)
Ergosign GmbH
Clima Oce叩nico y Clima Chino
FJOSEVidal

Similar to FISL14 - A Multiplatform Architecture for Games (20)

PDF
Introduction to android (and mobile) game development
Ruslan Novikov
PDF
Dot Net Project Mini Game
varun arora
PDF
SAE AR/VR - The challenges of creating a VR application with Unity
Sebastien Kuntz
PPT
Delta Engine Multiplatform Development Presentation 2011-05
Benjamin Nitschke
PPT
Handling Many Platforms with a Small Development Team
Dietmar Hauser
PPTX
Windows game development with Unity 5
Jiri Danihelka
ODP
HTML5 Game Development frameworks overview
Abhishek Singhal [L.I.O.N]
PPTX
Unity XR platform has a new architecture Unite Copenhagen 2019
Unity Technologies
PDF
Facets Of Fragmentation by Mark Murphy
Skills Matter
PPTX
Flappy - Paris 2015
Phillip Trelford
PDF
mloc.js 2014 - JavaScript and the browser as a platform for game development
David Galeano
PDF
How hard can it be - Ui development at keen games
Julien Koenen
PPTX
Where Design and Development Meet: Cross Platform Mobile Experiences
Seattle Interactive Conference
PPTX
Cross platform development with C#
Michele Scandura
PPTX
Building a game in a day
Phillip Trelford
PDF
Rapid Prototyping for XR: Lecture 5 - Cross Platform Development
Mark Billinghurst
ODP
(2) gui drawing
Nico Ludwig
PDF
2D Game Development with Starling
Juwal Bose
PPTX
Game Studio
MarinaOpera
PPTX
Building the Matrix: Your First VR App (SVCC 2016)
Liv Erickson
Introduction to android (and mobile) game development
Ruslan Novikov
Dot Net Project Mini Game
varun arora
SAE AR/VR - The challenges of creating a VR application with Unity
Sebastien Kuntz
Delta Engine Multiplatform Development Presentation 2011-05
Benjamin Nitschke
Handling Many Platforms with a Small Development Team
Dietmar Hauser
Windows game development with Unity 5
Jiri Danihelka
HTML5 Game Development frameworks overview
Abhishek Singhal [L.I.O.N]
Unity XR platform has a new architecture Unite Copenhagen 2019
Unity Technologies
Facets Of Fragmentation by Mark Murphy
Skills Matter
Flappy - Paris 2015
Phillip Trelford
mloc.js 2014 - JavaScript and the browser as a platform for game development
David Galeano
How hard can it be - Ui development at keen games
Julien Koenen
Where Design and Development Meet: Cross Platform Mobile Experiences
Seattle Interactive Conference
Cross platform development with C#
Michele Scandura
Building a game in a day
Phillip Trelford
Rapid Prototyping for XR: Lecture 5 - Cross Platform Development
Mark Billinghurst
(2) gui drawing
Nico Ludwig
2D Game Development with Starling
Juwal Bose
Game Studio
MarinaOpera
Building the Matrix: Your First VR App (SVCC 2016)
Liv Erickson
Ad

Recently uploaded (20)

PDF
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
PDF
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
PDF
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
PDF
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
PDF
Mastering AI Workflows with FME by Mark Doring
Safe Software
PPTX
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
PDF
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
PDF
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
PPTX
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
PDF
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
PPTX
Wenn alles versagt - IBM Tape sch端tzt, was z辰hlt! Und besonders mit dem neust...
Josef Weingand
PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
PDF
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
PDF
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
PDF
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
PDF
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
PPTX
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
PDF
The Growing Value and Application of FME & GenAI
Safe Software
PDF
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Priyanka Aash
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
Mastering AI Workflows with FME by Mark Doring
Safe Software
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Priyanka Aash
Curietech AI in action - Accelerate MuleSoft development
shyamraj55
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
Wenn alles versagt - IBM Tape sch端tzt, was z辰hlt! Und besonders mit dem neust...
Josef Weingand
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
The Growing Value and Application of FME & GenAI
Safe Software
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
Ad

FISL14 - A Multiplatform Architecture for Games