SlideShare ist ein Scribd-Unternehmen logo
1 von 31
The BGA framework at a glance
Intro

The BGA framework helps you to build a online
board game adaptation:
● That will be played in realtime.
● That will be played by several human players.

● That will be played from an internet browser.

● That will have rules enforcement (ie : no possibility to cheat).




This presentation shows at a glance how BGA
framework is working
After reading this presentation, you'll be able to understand how a game is running on the
BGA platform.
We won't go into details, in order you can have a good overview of the platform, and
afterwards immediately understand « which component is doing what ».
Clients & server


                                                    BGA server
                                                     BGA server

Here's an overview of the BGA
architecture.

3 players : Alice, Bob and Charlie
are playing a game on the BGA
server using their web browser.
                                         Alice's
                                          Alice's     Bob's
                                                       Bob's      Charlie's
                                                                   Charlie's
                                        browser
                                         browser     browser
                                                      browser     browser
                                                                   browser
Clients & server


                                                    BGA server
                                                     BGA server


While developing your game logic,
you'll have to work on both server
side and client side.

Let's see what's on each side.

                                         Alice's
                                          Alice's     Bob's
                                                       Bob's      Charlie's
                                                                   Charlie's
                                        browser
                                         browser     browser
                                                      browser     browser
                                                                   browser
The server side

On the server side, you'll find 3
components :                                             BGA server
                                                          BGA server
●   The game database :

This is the current state of the
game (ex : scores, tokens place on
board, which card is where...)

●   The game logic :                           Game         Game           Game
                                              database   logic (rules)   resources
This is the rules of the game. The game
logic ensures that it's not possible to
cheat (« rules enforcement »).

●   The game resources :

This is what's going to be downloaded to
be used by the client browsers (ex :
images, stylesheets, ...).
The client side

                                                Alice's browser
                                                 Alice's browser


On the client side, you'll find the
user interface (UI).

The user interface manage all what
is displayed to the user (ex : « this
token has moved from A to B »),                      Game
and make possible all user actions                    UI
on the game (ex : « a click on this
card plays this card »).
The client side

To do this, you will use 4 different
types of resources :                               Alice's browser
                                                    Alice's browser

●A HTML view which defines the
basic layout of your game UI.

● Some images to display the
game art.                                                 Game
                                                           UI
● A CSS stylesheet which defines
the style and position of elements
of your game UI.

● A javascript script which
defines the mechanisms of your
UI (ex : click on this button trigger    HTML    Images    Stylesheet   Javascript
this action).                             view
Summary : technologies
                       used
 The game database is using MySQL.




 The game logic is using the PHP language.




 The game ressources, used for the user interface, are using :



HTML language                CSS                      Javascript script
  (HTML4)                 stylesheet                (with Dojo framework)
Information flow


                                                    BGA server
                                                     BGA server
Now, let's have a look on how all
these components interact with a
simple example.

Our three players A, B and C are
starting a game together. The name
of this fake game is «mygame ».
                                         Alice's
                                          Alice's     Bob's
                                                       Bob's      Charlie's
                                                                   Charlie's
                                        browser
                                         browser     browser
                                                      browser     browser
                                                                   browser
Creating a new game

                                                   BGA server
                                                    BGA server
As soon as everyone accept to
start the game, your PHP method
« setupNewGame » is called (from
game logic).

This method must setup the initial       ««setupNewGame »»
game situation, as described in             setupNewGame
game rules, ie you have to create
the right SQL statements to
initialize the database according to
the game rules.

This is it, you can now welcome
your players !
                                        Alice's
                                         Alice's      Bob's
                                                       Bob's     Charlie's
                                                                  Charlie's
                                       browser
                                        browser      browser
                                                      browser    browser
                                                                  browser
Loading the game


                                                              BGA server
                                                               BGA server
Alice's browser requests to load the
game with the path :

« /mygame?table=9999 »                 http://boardgamearena.com/mygame?table=9999

Where « 9999 » is the identifier of
the table.
                                             Alice's
                                              Alice's            Bob's
                                                                  Bob's              Charlie's
                                                                                      Charlie's
                                            browser
                                             browser            browser
                                                                 browser             browser
                                                                                      browser
Loading the game

                                                    BGA server
                                                     BGA server




At first, we have to gather all
informations about the current
game situation in order Alice's           ««getAllDatas »»
browser can setup game situation             getAllDatas
on client side.

For this, your « getAllDatas » PHP
method is called.



                                      Alice's
                                       Alice's         Bob's
                                                        Bob's     Charlie's
                                                                   Charlie's
                                     browser
                                      browser         browser
                                                       browser    browser
                                                                   browser
Loading the game

                                                     BGA server
                                                      BGA server




Your getAllDatas method gather all
information Alice can see from the       ««getAllDatas »»==
                                            getAllDatas
game (and not the cards in the
hand of Bob!), and return this data.




                                        Alice's
                                         Alice's        Bob's
                                                         Bob's     Charlie's
                                                                    Charlie's
                                       browser
                                        browser        browser
                                                        browser    browser
                                                                    browser
Loading game

Then, we have to generate for Alice                      BGA server
                                                          BGA server
a classical webpage where she can
play « mygame ». Of course, this
webpage is in classic HTML.

This is the view of the game.

You can use some logic to create                   HTML
some dynamic HTML page, but                      (inc data
most of the time we'll let the client            for Alice)
do the biggest part of the game
setup and return a simple piece of
static HTML here.

Note that the HTML generated
embed automatically the data              Alice's              Bob's     Charlie's
previously generated (in « json »          Alice's              Bob's     Charlie's
                                         browser
                                          browser             browser
                                                               browser   browser
                                                                          browser
format).
Loading the game


                                                   BGA server
                                                    BGA server




The HTML webpage and all
information are returned to Alice...


                                        Alice's
                                         Alice's     Bob's
                                                      Bob's      Charlie's
                                                                  Charlie's
                                       browser
                                        browser     browser
                                                     browser     browser
                                                                  browser
Loading the game


                                                  BGA server
                                                   BGA server



Then, like any classic webpages,
resources are downloaded : your
images, your javascript and your
css stylesheet.

                                       Alice's
                                        Alice's     Bob's
                                                     Bob's      Charlie's
                                                                 Charlie's
                                      browser
                                       browser     browser
                                                    browser     browser
                                                                 browser
Loading the game


Finally, your « setup » javascript                  BGA server
                                                     BGA server
method is called.

In this method, you can use the
data returned by the server
(« Alice data ») to finalize the
game setup for Alice.                                  ««setup »»
                                                          setup
                                         Alice's
                                          Alice's
Ex : wow, Alice starts the game         browser
                                         browser
with 3 money tokens. Let's set her                    Bob's         Charlie's
                                                       Bob's         Charlie's
money counter to « 3 ».                              browser
                                                      browser       browser
                                                                     browser
Loading the game


                                                  BGA server
                                                   BGA server


This is it !

Alice has now a view of the current
game situation, and she's ready to
play.
                                       Alice's
                                        Alice's     Bob's
                                                     Bob's      Charlie's
                                                                 Charlie's
                                      browser
                                       browser     browser
                                                    browser     browser
                                                                 browser
Loading the game


                                                 BGA server
                                                  BGA server



Of course the same thing
happened to Bob and Charlie.

Now, everyone is ready to play!

                                      Alice's
                                       Alice's     Bob's
                                                    Bob's      Charlie's
                                                                Charlie's
                                     browser
                                      browser     browser
                                                   browser     browser
                                                                browser
Making a move


                                                       BGA server
                                                        BGA server
It's Alice turn. She is the « active
player ».

Let say Alice want to play a card,
and then clicks on a card.


                                           Alice's browser       Bob's
                                            Alice's browser       Bob's Charlie's
                                                                         Charlie's
                                                                browser browser
                                                                 browser browser



                                         « clic »
Making a move


                                                       BGA server
                                                        BGA server

During the initial « setup » of the
page, we setup a handler for this
« clic » event for this card.

Let say this handler is a javascript                          «onClicMyMethod»
                                                               «onClicMyMethod»
method call « OnClicMyMethod ».
                                           Alice's browser       Bob's
OnClicMyMethod is called.                   Alice's browser       Bob's Charlie's
                                                                         Charlie's
                                                                browser browser
                                                                 browser browser



                                         « clic »
Making a move


                                                      BGA server
                                                       BGA server


OnClicMyMethod gets the ID of the        /mygame/mygame/playAcard.html?card=99
Alice's card (ex : 99), and send a
request to BGA server at this url :
                                                              «onClicMyMethod»
                                                               «onClicMyMethod»
/mygame/mygame/playAcard.html?
card=99
                                          Alice's browser          Bob's
                                           Alice's browser          Bob's Charlie's
                                                                           Charlie's
                                                                  browser browser
                                                                   browser browser



                                        « clic »
Making a move

                                                          BGA server
                                                           BGA server




On server side, your corresponding                              «playAcard( 99 )»
                                                                 «playAcard( 99 )»
method « playAcard » is called,
with the id of the card played in
parameter.



                                     /mygame/mygame/playAcard.html?card=99


                                           Alice's
                                            Alice's          Bob's
                                                              Bob's          Charlie's
                                                                              Charlie's
                                          browser
                                           browser          browser
                                                             browser         browser
                                                                              browser
Making a move

                                                              BGA server
                                                               BGA server




Your first work, on this method, is to
check if this is a right move :
● Is Alice the active player really ?
                                                                    «playAcard( 99 )»
                                                                     «playAcard( 99 )»
● Can she play a card at this

moment of the game ?
● Does she really have this card in

hand ?
● ...



                                         /mygame/mygame/playAcard.html?card=99


                                               Alice's
                                                Alice's          Bob's
                                                                  Bob's          Charlie's
                                                                                  Charlie's
                                              browser
                                               browser          browser
                                                                 browser         browser
                                                                                  browser
Making a move

                                                          BGA server
                                                           BGA server

Done !

Now, you just have to apply the
rules of the game to the current
situation.                                                      «playAcard( 99 )»
                                                                 «playAcard( 99 )»
Let's say the card played by Alice
gives her 2 money tokens. We write
in the database that she has 2
more money tokens and that her
card is now discarded (and that
                                     /mygame/mygame/playAcard.html?card=99
Bob is the new active player).

                                           Alice's
                                            Alice's          Bob's
                                                              Bob's          Charlie's
                                                                              Charlie's
                                          browser
                                           browser          browser
                                                             browser         browser
                                                                              browser
Making a move

                                                               BGA server
                                                                BGA server
Now, we have to notify all the
players that the situation has
evolved.

Note that we can't notify only Alice
here. All players must be notified                                   «playAcard( 99 )»
                                                                      «playAcard( 99 )»
that she has played a card and got
2 money tokens.

The BGA framework proposes a
simple method to create and send
notifications to players :                /mygame/mygame/playAcard.html?card=99
« notifyAllPlayers ».

Now let's notify all players that Alice         Alice's
                                                 Alice's          Bob's
                                                                   Bob's          Charlie's
                                                                                   Charlie's
got 2 money tokens...                          browser
                                                browser          browser
                                                                  browser         browser
                                                                                   browser
Making a move

                                                             BGA server
                                                              BGA server
                                                                                «playAcard( 99 )»
                                                                                 «playAcard( 99 )»



Let's name our notification
« takeMoneyToken ».

We associate to the notification a                         « takeMoneyToken »
little packet of data saying that the
concerned player is Alice and that
the number of token is 2.

The notification is sent to all         /mygame/mygame/playAcard.html?card=99
players.
                                              Alice's
                                               Alice's          Bob's
                                                                 Bob's             Charlie's
                                                                                    Charlie's
                                             browser
                                              browser          browser
                                                                browser            browser
                                                                                    browser
Making a move


                                                                  BGA server
                                                                   BGA server

Let's have a look on what happend
on Bob's browser.                       …/playAcard.html?...
                                                               « takeMoneyToken »
He receives a « takeMoneyToken »
notification. Automatically, your                                         «notif_takeMoneyToken»
associated javascript method                                               «notif_takeMoneyToken
« notif_takeMoneyToken » is               Alice's                 Bob's browser         Charlie's
called, with arguments saying that it      Alice's                 Bob's browser         Charlie's
                                         browser
                                          browser                                       browser
                                                                                         browser
concerns Alice and that the number
of money tokens is 2.
Making a move


                                                                 BGA server
                                                                  BGA server

… and finally, your
notif_takeMoneyToken just have to      …/playAcard.html?...
increase money tokens number of                               « takeMoneyToken »
Alice by 2 on the web page.

Of course the same thing happens                                         «notif_takeMoneyToken»
                                                                          «notif_takeMoneyToken
on Alice's and Charlie's browser, so
everyone knows that Alice is             Alice's                 Bob's browser
                                                                  Bob's browser        Charlie's
                                          Alice's                                       Charlie's
wealthier.                              browser
                                         browser                                       browser
                                                                                        browser
Making a move


                                                            BGA server
                                                             BGA server

Afterwards, two additional
                                     …/playAcard.html?...
notifications are sent to notify
players that Alice's card has been
discarded and that it's now Bob's
turn.

And this is it : Bob can take some       Alice's              Bob's
                                                               Bob's      Charlie's
action, and so on...                      Alice's            browser       Charlie's
                                        browser
                                         browser              browser     browser
                                                                           browser
Summary


● You know what is managed on the server side, and what is manager on the client
(browser) side.

●   You know which technology is used for each part of the game adaptation.

●You know what happened during basic steps of the game lifecycle : game setup,
page load and making a move.

●You understand the concepts of game database, game view, game action and
notification.

Weitere ähnliche Inhalte

Was ist angesagt?

Game engines and Their Influence in Game Design
Game engines and Their Influence in Game DesignGame engines and Their Influence in Game Design
Game engines and Their Influence in Game DesignPrashant Warrier
 
Unreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game FrameworkUnreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game FrameworkNick Pruehs
 
カード収集ゲームにおけるPlayFabの使い方
カード収集ゲームにおけるPlayFabの使い方カード収集ゲームにおけるPlayFabの使い方
カード収集ゲームにおけるPlayFabの使い方Daisuke Masubuchi
 
Intro to unreal with framework and vr
Intro to unreal with framework and vrIntro to unreal with framework and vr
Intro to unreal with framework and vrLuis Cataldi
 
Unreal Engine (For Creating Games) Presentation
Unreal Engine (For Creating Games) PresentationUnreal Engine (For Creating Games) Presentation
Unreal Engine (For Creating Games) PresentationNitin Sharma
 
Game Balance 1: What is Game Balance
Game Balance 1: What is Game BalanceGame Balance 1: What is Game Balance
Game Balance 1: What is Game BalanceMarc Miquel
 
Blockchain in gaming industry
Blockchain in gaming industryBlockchain in gaming industry
Blockchain in gaming industryCeline George
 
LAFS Game Mechanics - Resource Management Mechanics
LAFS Game Mechanics - Resource Management MechanicsLAFS Game Mechanics - Resource Management Mechanics
LAFS Game Mechanics - Resource Management MechanicsDavid Mullich
 
PRESENTATION ON Game Engine
PRESENTATION ON Game EnginePRESENTATION ON Game Engine
PRESENTATION ON Game EngineDiksha Bhargava
 
Game monetization: Overview of monetization methods for free-to-play games
Game monetization: Overview of monetization methods for free-to-play gamesGame monetization: Overview of monetization methods for free-to-play games
Game monetization: Overview of monetization methods for free-to-play gamesAndrew Dotsenko
 
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...Gerke Max Preussner
 
個人からトリプル A タイトルのゲーム開発者まで。Azure PlayFab で LiveOps しよう
個人からトリプル A タイトルのゲーム開発者まで。Azure PlayFab で LiveOps しよう個人からトリプル A タイトルのゲーム開発者まで。Azure PlayFab で LiveOps しよう
個人からトリプル A タイトルのゲーム開発者まで。Azure PlayFab で LiveOps しようDaisuke Masubuchi
 
191221 unreal engine 4 editor 확장하기
191221 unreal engine 4 editor 확장하기191221 unreal engine 4 editor 확장하기
191221 unreal engine 4 editor 확장하기KWANGIL KIM
 
Mobile Game Development in Unity
Mobile Game Development in UnityMobile Game Development in Unity
Mobile Game Development in UnityHakan Saglam
 
Game Architecture and Programming
Game Architecture and ProgrammingGame Architecture and Programming
Game Architecture and ProgrammingSumit Jain
 
サーバー知識不要!のゲームサーバー "Azure PlayFab" で長期運営タイトルを作ろう
サーバー知識不要!のゲームサーバー "Azure PlayFab" で長期運営タイトルを作ろうサーバー知識不要!のゲームサーバー "Azure PlayFab" で長期運営タイトルを作ろう
サーバー知識不要!のゲームサーバー "Azure PlayFab" で長期運営タイトルを作ろうDaisuke Masubuchi
 
Building Games for the Long Term: Pragmatic F2P Guild Design (GDC Europe 2013)
Building Games for the Long Term: Pragmatic F2P Guild Design (GDC Europe 2013)Building Games for the Long Term: Pragmatic F2P Guild Design (GDC Europe 2013)
Building Games for the Long Term: Pragmatic F2P Guild Design (GDC Europe 2013)Kongregate
 
New tools and services to take your live ops to the next level
New tools and services to take your live ops to the next levelNew tools and services to take your live ops to the next level
New tools and services to take your live ops to the next levelCrystin Cox
 

Was ist angesagt? (20)

Game engines and Their Influence in Game Design
Game engines and Their Influence in Game DesignGame engines and Their Influence in Game Design
Game engines and Their Influence in Game Design
 
Unreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game FrameworkUnreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game Framework
 
カード収集ゲームにおけるPlayFabの使い方
カード収集ゲームにおけるPlayFabの使い方カード収集ゲームにおけるPlayFabの使い方
カード収集ゲームにおけるPlayFabの使い方
 
Intro to unreal with framework and vr
Intro to unreal with framework and vrIntro to unreal with framework and vr
Intro to unreal with framework and vr
 
Unreal Engine (For Creating Games) Presentation
Unreal Engine (For Creating Games) PresentationUnreal Engine (For Creating Games) Presentation
Unreal Engine (For Creating Games) Presentation
 
Game Balance 1: What is Game Balance
Game Balance 1: What is Game BalanceGame Balance 1: What is Game Balance
Game Balance 1: What is Game Balance
 
Blockchain in gaming industry
Blockchain in gaming industryBlockchain in gaming industry
Blockchain in gaming industry
 
LAFS Game Mechanics - Resource Management Mechanics
LAFS Game Mechanics - Resource Management MechanicsLAFS Game Mechanics - Resource Management Mechanics
LAFS Game Mechanics - Resource Management Mechanics
 
PRESENTATION ON Game Engine
PRESENTATION ON Game EnginePRESENTATION ON Game Engine
PRESENTATION ON Game Engine
 
glTF 2.0 Reference Guide
glTF 2.0 Reference GuideglTF 2.0 Reference Guide
glTF 2.0 Reference Guide
 
Game monetization: Overview of monetization methods for free-to-play games
Game monetization: Overview of monetization methods for free-to-play gamesGame monetization: Overview of monetization methods for free-to-play games
Game monetization: Overview of monetization methods for free-to-play games
 
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
 
個人からトリプル A タイトルのゲーム開発者まで。Azure PlayFab で LiveOps しよう
個人からトリプル A タイトルのゲーム開発者まで。Azure PlayFab で LiveOps しよう個人からトリプル A タイトルのゲーム開発者まで。Azure PlayFab で LiveOps しよう
個人からトリプル A タイトルのゲーム開発者まで。Azure PlayFab で LiveOps しよう
 
191221 unreal engine 4 editor 확장하기
191221 unreal engine 4 editor 확장하기191221 unreal engine 4 editor 확장하기
191221 unreal engine 4 editor 확장하기
 
Mobile Game Development in Unity
Mobile Game Development in UnityMobile Game Development in Unity
Mobile Game Development in Unity
 
Game Architecture and Programming
Game Architecture and ProgrammingGame Architecture and Programming
Game Architecture and Programming
 
サーバー知識不要!のゲームサーバー "Azure PlayFab" で長期運営タイトルを作ろう
サーバー知識不要!のゲームサーバー "Azure PlayFab" で長期運営タイトルを作ろうサーバー知識不要!のゲームサーバー "Azure PlayFab" で長期運営タイトルを作ろう
サーバー知識不要!のゲームサーバー "Azure PlayFab" で長期運営タイトルを作ろう
 
Building Games for the Long Term: Pragmatic F2P Guild Design (GDC Europe 2013)
Building Games for the Long Term: Pragmatic F2P Guild Design (GDC Europe 2013)Building Games for the Long Term: Pragmatic F2P Guild Design (GDC Europe 2013)
Building Games for the Long Term: Pragmatic F2P Guild Design (GDC Europe 2013)
 
Gaming and eSports
Gaming and eSportsGaming and eSports
Gaming and eSports
 
New tools and services to take your live ops to the next level
New tools and services to take your live ops to the next levelNew tools and services to take your live ops to the next level
New tools and services to take your live ops to the next level
 

Kürzlich hochgeladen

𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...rahim quresi
 
Low Rate Young Call Girls in Surajpur Greater Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Surajpur Greater Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Surajpur Greater Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Surajpur Greater Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034 Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034  Independent Chenna...Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034  Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034 Independent Chenna... Shivani Pandey
 
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...noor ahmed
 
Call Girls Nashik Gayatri 7001305949 Independent Escort Service Nashik
Call Girls Nashik Gayatri 7001305949 Independent Escort Service NashikCall Girls Nashik Gayatri 7001305949 Independent Escort Service Nashik
Call Girls Nashik Gayatri 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
VIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur Escorts
VIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur EscortsVIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur Escorts
VIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Independent Joka Escorts ✔ 8250192130 ✔ Full Night With Room Online Booking 2...
Independent Joka Escorts ✔ 8250192130 ✔ Full Night With Room Online Booking 2...Independent Joka Escorts ✔ 8250192130 ✔ Full Night With Room Online Booking 2...
Independent Joka Escorts ✔ 8250192130 ✔ Full Night With Room Online Booking 2...noor ahmed
 
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur EscortsCall Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...rahim quresi
 
↑Top Model (Kolkata) Call Girls Salt Lake ⟟ 8250192130 ⟟ High Class Call Girl...
↑Top Model (Kolkata) Call Girls Salt Lake ⟟ 8250192130 ⟟ High Class Call Girl...↑Top Model (Kolkata) Call Girls Salt Lake ⟟ 8250192130 ⟟ High Class Call Girl...
↑Top Model (Kolkata) Call Girls Salt Lake ⟟ 8250192130 ⟟ High Class Call Girl...noor ahmed
 
Almora call girls 📞 8617697112 At Low Cost Cash Payment Booking
Almora call girls 📞 8617697112 At Low Cost Cash Payment BookingAlmora call girls 📞 8617697112 At Low Cost Cash Payment Booking
Almora call girls 📞 8617697112 At Low Cost Cash Payment BookingNitya salvi
 
2k Shot Call girls Laxmi Nagar Delhi 9205541914
2k Shot Call girls Laxmi Nagar Delhi 92055419142k Shot Call girls Laxmi Nagar Delhi 9205541914
2k Shot Call girls Laxmi Nagar Delhi 9205541914Delhi Call girls
 
Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...
Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...
Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...Riya Pathan
 
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...noor ahmed
 
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...Riya Pathan
 

Kürzlich hochgeladen (20)

𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
 
Low Rate Young Call Girls in Surajpur Greater Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Surajpur Greater Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Surajpur Greater Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Surajpur Greater Noida ✔️☆9289244007✔️☆ Female E...
 
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034 Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034  Independent Chenna...Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034  Independent Chenna...
Verified Trusted Call Girls Tambaram Chennai ✔✔7427069034 Independent Chenna...
 
Goa Call "Girls Service 9316020077 Call "Girls in Goa
Goa Call "Girls  Service   9316020077 Call "Girls in GoaGoa Call "Girls  Service   9316020077 Call "Girls in Goa
Goa Call "Girls Service 9316020077 Call "Girls in Goa
 
Russian ℂall gIRLS In Goa 9316020077 ℂall gIRLS Service In Goa
Russian ℂall gIRLS In Goa 9316020077  ℂall gIRLS Service  In GoaRussian ℂall gIRLS In Goa 9316020077  ℂall gIRLS Service  In Goa
Russian ℂall gIRLS In Goa 9316020077 ℂall gIRLS Service In Goa
 
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Behala ⟟ 8250192130 ⟟ High Class Call Girl In...
 
Call Girls Nashik Gayatri 7001305949 Independent Escort Service Nashik
Call Girls Nashik Gayatri 7001305949 Independent Escort Service NashikCall Girls Nashik Gayatri 7001305949 Independent Escort Service Nashik
Call Girls Nashik Gayatri 7001305949 Independent Escort Service Nashik
 
VIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur Escorts
VIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur EscortsVIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur Escorts
VIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur Escorts
 
Independent Joka Escorts ✔ 8250192130 ✔ Full Night With Room Online Booking 2...
Independent Joka Escorts ✔ 8250192130 ✔ Full Night With Room Online Booking 2...Independent Joka Escorts ✔ 8250192130 ✔ Full Night With Room Online Booking 2...
Independent Joka Escorts ✔ 8250192130 ✔ Full Night With Room Online Booking 2...
 
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur EscortsCall Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
Call Girl Nagpur Roshni Call 7001035870 Meet With Nagpur Escorts
 
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
 
↑Top Model (Kolkata) Call Girls Salt Lake ⟟ 8250192130 ⟟ High Class Call Girl...
↑Top Model (Kolkata) Call Girls Salt Lake ⟟ 8250192130 ⟟ High Class Call Girl...↑Top Model (Kolkata) Call Girls Salt Lake ⟟ 8250192130 ⟟ High Class Call Girl...
↑Top Model (Kolkata) Call Girls Salt Lake ⟟ 8250192130 ⟟ High Class Call Girl...
 
Almora call girls 📞 8617697112 At Low Cost Cash Payment Booking
Almora call girls 📞 8617697112 At Low Cost Cash Payment BookingAlmora call girls 📞 8617697112 At Low Cost Cash Payment Booking
Almora call girls 📞 8617697112 At Low Cost Cash Payment Booking
 
2k Shot Call girls Laxmi Nagar Delhi 9205541914
2k Shot Call girls Laxmi Nagar Delhi 92055419142k Shot Call girls Laxmi Nagar Delhi 9205541914
2k Shot Call girls Laxmi Nagar Delhi 9205541914
 
Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...
Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...
Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...
 
Call Girls South Avenue Delhi WhatsApp Number 9711199171
Call Girls South Avenue Delhi WhatsApp Number 9711199171Call Girls South Avenue Delhi WhatsApp Number 9711199171
Call Girls South Avenue Delhi WhatsApp Number 9711199171
 
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
 
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
 
Call Girls New Ashok Nagar Delhi WhatsApp Number 9711199171
Call Girls New Ashok Nagar Delhi WhatsApp Number 9711199171Call Girls New Ashok Nagar Delhi WhatsApp Number 9711199171
Call Girls New Ashok Nagar Delhi WhatsApp Number 9711199171
 
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
 

BGA Studio: The BGA framework at a glance

  • 1. The BGA framework at a glance
  • 2. Intro The BGA framework helps you to build a online board game adaptation: ● That will be played in realtime. ● That will be played by several human players. ● That will be played from an internet browser. ● That will have rules enforcement (ie : no possibility to cheat). This presentation shows at a glance how BGA framework is working After reading this presentation, you'll be able to understand how a game is running on the BGA platform. We won't go into details, in order you can have a good overview of the platform, and afterwards immediately understand « which component is doing what ».
  • 3. Clients & server BGA server BGA server Here's an overview of the BGA architecture. 3 players : Alice, Bob and Charlie are playing a game on the BGA server using their web browser. Alice's Alice's Bob's Bob's Charlie's Charlie's browser browser browser browser browser browser
  • 4. Clients & server BGA server BGA server While developing your game logic, you'll have to work on both server side and client side. Let's see what's on each side. Alice's Alice's Bob's Bob's Charlie's Charlie's browser browser browser browser browser browser
  • 5. The server side On the server side, you'll find 3 components : BGA server BGA server ● The game database : This is the current state of the game (ex : scores, tokens place on board, which card is where...) ● The game logic : Game Game Game database logic (rules) resources This is the rules of the game. The game logic ensures that it's not possible to cheat (« rules enforcement »). ● The game resources : This is what's going to be downloaded to be used by the client browsers (ex : images, stylesheets, ...).
  • 6. The client side Alice's browser Alice's browser On the client side, you'll find the user interface (UI). The user interface manage all what is displayed to the user (ex : « this token has moved from A to B »), Game and make possible all user actions UI on the game (ex : « a click on this card plays this card »).
  • 7. The client side To do this, you will use 4 different types of resources : Alice's browser Alice's browser ●A HTML view which defines the basic layout of your game UI. ● Some images to display the game art. Game UI ● A CSS stylesheet which defines the style and position of elements of your game UI. ● A javascript script which defines the mechanisms of your UI (ex : click on this button trigger HTML Images Stylesheet Javascript this action). view
  • 8. Summary : technologies used The game database is using MySQL. The game logic is using the PHP language. The game ressources, used for the user interface, are using : HTML language CSS Javascript script (HTML4) stylesheet (with Dojo framework)
  • 9. Information flow BGA server BGA server Now, let's have a look on how all these components interact with a simple example. Our three players A, B and C are starting a game together. The name of this fake game is «mygame ». Alice's Alice's Bob's Bob's Charlie's Charlie's browser browser browser browser browser browser
  • 10. Creating a new game BGA server BGA server As soon as everyone accept to start the game, your PHP method « setupNewGame » is called (from game logic). This method must setup the initial ««setupNewGame »» game situation, as described in setupNewGame game rules, ie you have to create the right SQL statements to initialize the database according to the game rules. This is it, you can now welcome your players ! Alice's Alice's Bob's Bob's Charlie's Charlie's browser browser browser browser browser browser
  • 11. Loading the game BGA server BGA server Alice's browser requests to load the game with the path : « /mygame?table=9999 » http://boardgamearena.com/mygame?table=9999 Where « 9999 » is the identifier of the table. Alice's Alice's Bob's Bob's Charlie's Charlie's browser browser browser browser browser browser
  • 12. Loading the game BGA server BGA server At first, we have to gather all informations about the current game situation in order Alice's ««getAllDatas »» browser can setup game situation getAllDatas on client side. For this, your « getAllDatas » PHP method is called. Alice's Alice's Bob's Bob's Charlie's Charlie's browser browser browser browser browser browser
  • 13. Loading the game BGA server BGA server Your getAllDatas method gather all information Alice can see from the ««getAllDatas »»== getAllDatas game (and not the cards in the hand of Bob!), and return this data. Alice's Alice's Bob's Bob's Charlie's Charlie's browser browser browser browser browser browser
  • 14. Loading game Then, we have to generate for Alice BGA server BGA server a classical webpage where she can play « mygame ». Of course, this webpage is in classic HTML. This is the view of the game. You can use some logic to create HTML some dynamic HTML page, but (inc data most of the time we'll let the client for Alice) do the biggest part of the game setup and return a simple piece of static HTML here. Note that the HTML generated embed automatically the data Alice's Bob's Charlie's previously generated (in « json » Alice's Bob's Charlie's browser browser browser browser browser browser format).
  • 15. Loading the game BGA server BGA server The HTML webpage and all information are returned to Alice... Alice's Alice's Bob's Bob's Charlie's Charlie's browser browser browser browser browser browser
  • 16. Loading the game BGA server BGA server Then, like any classic webpages, resources are downloaded : your images, your javascript and your css stylesheet. Alice's Alice's Bob's Bob's Charlie's Charlie's browser browser browser browser browser browser
  • 17. Loading the game Finally, your « setup » javascript BGA server BGA server method is called. In this method, you can use the data returned by the server (« Alice data ») to finalize the game setup for Alice. ««setup »» setup Alice's Alice's Ex : wow, Alice starts the game browser browser with 3 money tokens. Let's set her Bob's Charlie's Bob's Charlie's money counter to « 3 ». browser browser browser browser
  • 18. Loading the game BGA server BGA server This is it ! Alice has now a view of the current game situation, and she's ready to play. Alice's Alice's Bob's Bob's Charlie's Charlie's browser browser browser browser browser browser
  • 19. Loading the game BGA server BGA server Of course the same thing happened to Bob and Charlie. Now, everyone is ready to play! Alice's Alice's Bob's Bob's Charlie's Charlie's browser browser browser browser browser browser
  • 20. Making a move BGA server BGA server It's Alice turn. She is the « active player ». Let say Alice want to play a card, and then clicks on a card. Alice's browser Bob's Alice's browser Bob's Charlie's Charlie's browser browser browser browser « clic »
  • 21. Making a move BGA server BGA server During the initial « setup » of the page, we setup a handler for this « clic » event for this card. Let say this handler is a javascript «onClicMyMethod» «onClicMyMethod» method call « OnClicMyMethod ». Alice's browser Bob's OnClicMyMethod is called. Alice's browser Bob's Charlie's Charlie's browser browser browser browser « clic »
  • 22. Making a move BGA server BGA server OnClicMyMethod gets the ID of the /mygame/mygame/playAcard.html?card=99 Alice's card (ex : 99), and send a request to BGA server at this url : «onClicMyMethod» «onClicMyMethod» /mygame/mygame/playAcard.html? card=99 Alice's browser Bob's Alice's browser Bob's Charlie's Charlie's browser browser browser browser « clic »
  • 23. Making a move BGA server BGA server On server side, your corresponding «playAcard( 99 )» «playAcard( 99 )» method « playAcard » is called, with the id of the card played in parameter. /mygame/mygame/playAcard.html?card=99 Alice's Alice's Bob's Bob's Charlie's Charlie's browser browser browser browser browser browser
  • 24. Making a move BGA server BGA server Your first work, on this method, is to check if this is a right move : ● Is Alice the active player really ? «playAcard( 99 )» «playAcard( 99 )» ● Can she play a card at this moment of the game ? ● Does she really have this card in hand ? ● ... /mygame/mygame/playAcard.html?card=99 Alice's Alice's Bob's Bob's Charlie's Charlie's browser browser browser browser browser browser
  • 25. Making a move BGA server BGA server Done ! Now, you just have to apply the rules of the game to the current situation. «playAcard( 99 )» «playAcard( 99 )» Let's say the card played by Alice gives her 2 money tokens. We write in the database that she has 2 more money tokens and that her card is now discarded (and that /mygame/mygame/playAcard.html?card=99 Bob is the new active player). Alice's Alice's Bob's Bob's Charlie's Charlie's browser browser browser browser browser browser
  • 26. Making a move BGA server BGA server Now, we have to notify all the players that the situation has evolved. Note that we can't notify only Alice here. All players must be notified «playAcard( 99 )» «playAcard( 99 )» that she has played a card and got 2 money tokens. The BGA framework proposes a simple method to create and send notifications to players : /mygame/mygame/playAcard.html?card=99 « notifyAllPlayers ». Now let's notify all players that Alice Alice's Alice's Bob's Bob's Charlie's Charlie's got 2 money tokens... browser browser browser browser browser browser
  • 27. Making a move BGA server BGA server «playAcard( 99 )» «playAcard( 99 )» Let's name our notification « takeMoneyToken ». We associate to the notification a « takeMoneyToken » little packet of data saying that the concerned player is Alice and that the number of token is 2. The notification is sent to all /mygame/mygame/playAcard.html?card=99 players. Alice's Alice's Bob's Bob's Charlie's Charlie's browser browser browser browser browser browser
  • 28. Making a move BGA server BGA server Let's have a look on what happend on Bob's browser. …/playAcard.html?... « takeMoneyToken » He receives a « takeMoneyToken » notification. Automatically, your «notif_takeMoneyToken» associated javascript method «notif_takeMoneyToken « notif_takeMoneyToken » is Alice's Bob's browser Charlie's called, with arguments saying that it Alice's Bob's browser Charlie's browser browser browser browser concerns Alice and that the number of money tokens is 2.
  • 29. Making a move BGA server BGA server … and finally, your notif_takeMoneyToken just have to …/playAcard.html?... increase money tokens number of « takeMoneyToken » Alice by 2 on the web page. Of course the same thing happens «notif_takeMoneyToken» «notif_takeMoneyToken on Alice's and Charlie's browser, so everyone knows that Alice is Alice's Bob's browser Bob's browser Charlie's Alice's Charlie's wealthier. browser browser browser browser
  • 30. Making a move BGA server BGA server Afterwards, two additional …/playAcard.html?... notifications are sent to notify players that Alice's card has been discarded and that it's now Bob's turn. And this is it : Bob can take some Alice's Bob's Bob's Charlie's action, and so on... Alice's browser Charlie's browser browser browser browser browser
  • 31. Summary ● You know what is managed on the server side, and what is manager on the client (browser) side. ● You know which technology is used for each part of the game adaptation. ●You know what happened during basic steps of the game lifecycle : game setup, page load and making a move. ●You understand the concepts of game database, game view, game action and notification.