SlideShare ist ein Scribd-Unternehmen logo
1 von 45
back4app.com
How to build a Pokemon Go App
How to Build a Pokemon Go App
• Back4app provides Parse server service to take care of your backend and APIs
development.
• Parse also provides basic application activity APIs like Login-in, push
notification, payment…etc.
• For this demonstration, we can use Parse Geo Point Service and back4app as
our backend to build a simple Pokémon-Go.
• You can read the original publication on:
http://docs.back4app.com/docs/new-parse-app/how-to-build-a-pokemon-go-
app/
Part 1: Setting up Back4app Parse
on your Unity3d
• Go to https://parse.com/docs/downloads
• Download Unity Blank Project (v1.7.0)
• Download https://drive.google.com/file/d/0B7k7pGQXUypGTWRqS1BqVDB
WQUU/view?usp=sharing for updated Parse SDK for Unity3d
Part 1: Setting up Back4app Parse
on your Unity3d
• Open Unity3d Parse Blank Project -> Click Upgrade if required.
• Replace Asset/Parse/Parse.Unity.dll to the latest one.
• Go to Asset/Scene
Part 1: Setting up Back4app Parse
on your Unity3d
• The Parse Initializer GameObject will miss some scripts.
• Add ParseInitializeBehaviour to it.
Part 1: Setting up Back4app Parse
on your Unity3d
• Type your Application ID, dotNet Key, serverUrl to a parameter from your
Back4app dashboard.
Part 1: Setting up Back4app Parse
on your Unity3d
• Create a GameObject and add script component to the Scene for testing.
Part 1: Setting up Back4app Parse
on your Unity3d
• Add following code to TestParse.cs
Part 1: Setting up Back4app Parse
on your Unity3d
• using UnityEngine;
• using System.Collections;
• using Parse;
• using System.Threading.Tasks;
• public class TestParse : MonoBehavio
ur {
• // Use this for initialization
• void Start () {
• ParseObject testObj = new ParseObje
ct("TestObject");
• testObj["a"] = "HI";
• testObj["b"] = "Back4app";
• Task saveTask = testObj.SaveAsync();
• }
• // Update is called once per frame
• void Update () {
• }
• }
Part 1: Setting up Back4app Parse
on your Unity3d
• Press Play Button on your Unity3d Editor
• Go to Back4app database dashboard to check the success or not.
Part 1: Setting up Back4app Parse
on your Unity3d
• It is connected with your back4app account successfully if you find your
uploaded data in the database.
Part 2: Integrate Google Map
to your Unity3d Project
• To generate the terrain like Pokémon-Go, we need to integrate Google map
your Unity3d Project.
• First, create Plane and Name it as “Map”, create directional light.
Part 2: Integrate Google Map
to your Unity3d Project
• Second, Create a script “GoogleMap” and add to Map Game object.
Part 2: Integrate Google Map
to your Unity3d Project
• Second, Create a script “GoogleMap” and add to Map Game object.
• You can see the original script on:
http://docs.back4app.com/docs/new-
parse-app/how-to-build-a-pokemon-
go-app/
Part 2: Integrate Google Map
to your Unity3d Project
• Untick the AutoLocateCenter.
Part 2: Integrate Google Map
to your Unity3d Project
• Type some dummy parameter to try the Google Map.
Part 2: Integrate Google Map
to your Unity3d Project
• If the plane shows the correct location as your parameter, the Google map is
successfully integrated.
• You can use Refresh method to refresh the Google map to change location.
Part 3: Integrate Character and Interacting
with GPS Data
• Create LocationManager Gameobject and add the following code.
• This code is getting the GPS Data and updating the Google Map when GPS
data is changed.
• You can see the full code on:
http://docs.back4app.com/docs/new-
parse-app/how-to-build-a-pokemon-
go-app/
Part 3: Integrate Character and Interacting
with GPS Data
• Let test the Google map again.
• It is successful if the Google map change when you change the GPS Data
in Runtime.
Part 3: Integrate Character and Interacting
with GPS Data
Part 3: Integrate Character and Interacting
with GPS Data
• After that, create a Capsule as a character and a Cube as Direction of the
character on top of the Google Map.
• (For me, I place the character at X:0 Y:0.07 Z:0)
• Add a compass to your character when you test with your mobile device.
Part 3: Integrate Character and Interacting
with GPS Data
• Make sure your character is located correctly by checking Latitude and
Longitude on Google Map.
Part 4: Generating Monsters on Map (Part A)
• For Generating Monsters, we need to do some calculation on placing the
monster with their longitude and latitude location.
• Because the ratio between Google map, reality and Unity3d XYZ-world is
different.
• To figure out how to calculate the relationship between them, we need
dummy data.
• For more detail : how to calculate.
http://www.movable-type.co.uk/scripts/latlong.html
Part 4: Generating Monsters on Map (Part A)
• First of all, we need to set initial latitude and longitude on Google Map first
(You can choose where you want) and set the Markers on the Google Map.
Part 4: Generating Monsters on Map (Part A)
• Press Run, You will find the label on your Google map.
• PS: The reason why we cannot use the marker to be a monster because it is
combined with the texture.
• The marker itself is a part of the texture but not a Gmeobject so we cannot
do any implementation on that.
Part 4: Generating Monsters on Map (Part A)
• Beside that, we will make some dummy GPS data of monster on Parse server,
later on, so we need to know the corresponding ratio on the monster game
object position.
Part 4: Generating Monsters on Map (Part A)
• After that, we create a cube and place on top of the label.
• Record this position.
Part 4: Generating Monsters on Map (Part A)
• Now, we need to find the exact distance between the player GPS location and
the marker GPS location.
• The distance between start (37.38373, -122.0133) and marker (37.384782,-
122.012893) can be calculated by this script.
Part 4: Generating Monsters on Map (Part A)
• And then calculate the XYZ world distance between the CUBE maker and the
Player Capsule. (-0.563,0.07,-1.915) and (0,0.07,0).
• This is a simple calculation, so I don’t list how to do it.
• After that, the ratio will be found by this equation
• Ratio = XYZ world distance / Exact Distance.
Part 4: Generating Monsters on Map (Part A)
• Once we have this ratio, we able to calculate how far the monster should be
placed according to the Player location.
• However, the possible location still undefined because we don’t have the
bearing between the player and monster.
• To calculate the bearing.
• We can use this code. (You can see the full code on:
http://docs.back4app.com/docs/new-parse-app/how-to-build-a-pokemon-
go-app/)
Part 4: Generating Monsters on Map (Part A)
• After we get the ratio and bearing, it is possible to convert Longitude Latitude
location to be XYZ-world coordination, which means we can place any
monsters with latitude longitude location to correct game world location.
• With the above code, we know the correct XYZ coordination to spawn
monster.
Part 5: Generating Monsters on Map (Part B)
• While we are able to convert Longitude and Latitude data to the game world,
it is time now to create some dummy monster data on Back4app parse
server.
• Go to your Parse back4app dashboard and create a class call Monster.
Part 5: Generating Monsters on Map (Part B)
• Add a column: Location with data type Geopoint.
Part 5: Generating Monsters on Map (Part B)
• Insert some monster dummy row that around you.
Part 5: Generating Monsters on Map (Part B)
• The dummy monsters are set, they are waiting for you to call.
• Then I create a MonsterSpawn GameObject with script Spawn.
• Drop the LocationManager GameObject to it (For getting updated GPS Data)
• M prefab monster for spawning a monster.
Part 5: Generating Monsters on Map (Part B)
Part 5: Generating Monsters on Map (Part B)
• It is time to fetch the dummy monster data from back4app to your program.
Part 5: Generating Monsters on Map (Part B)
• The above code gets the result one by one and converting the GeoPoint data
to be XYZ-world coordination, and then push the result to the List.
• After adding the result is fetched, spawn becomes true to allow program
spawns the monster.
• You can see the full code on:
http://docs.back4app.com/docs/new-
parse-app/how-to-build-a-pokemon-go-
app/
Part 5: Generating Monsters on Map (Part B)
• After the Monsters are spawned, the monsters will keep updating when the
player GPS data has updated.
• Testing. The monster is spawn at correct XYZ coordination with their Latitude
Longitude data.
Part 6: How to move the Player (solve google
map texture slow problem!)
• Until Part 5, the movement of the player is relied on the Google Map texture
updating. However, it is not effective to play it.
• The user experience is not good.
• To solve this problem, we “unlock” the player.
• Make player move on the map.
Part 6: How to move the Player (solve google
map texture slow problem!)
• The algorithm behind is similar to updating the monster.
• We apply on the capsule. compare the last GPS data and new GPS data to
calculate how should the player move in the Game world.
• As we are updating the position of the player, therefore we don’t need
monster update and google map refresh function anymore.
• What you need to do : Modify LocationMaganger.cs
Part 6: How to move the Player (solve google
map texture slow problem!)
Part 6: How to move the Player (solve google
map texture slow problem!)
• You can see the full code on:
http://docs.back4app.com/docs/new-
parse-app/how-to-build-a-pokemon-
go-app/
Part 6: How to move the Player (solve google
map texture slow problem!)
• Second, attach following code to you camera make your cam follow you
character ( Don’t forget to drag your capsule to inspector.
Part 6: How to move the Player (solve google
map texture slow problem!)
• To view source code and whole project -> Raw Unity
Project
• Issues, comments or suggestions? Let’s discuss in
our Developers Group Topic.

Weitere ähnliche Inhalte

Andere mochten auch

อุปกรณ์เชื่อมต่อคอมพิวเตอร์
อุปกรณ์เชื่อมต่อคอมพิวเตอร์อุปกรณ์เชื่อมต่อคอมพิวเตอร์
อุปกรณ์เชื่อมต่อคอมพิวเตอร์Nannapatktwrps
 
Image Slide ( Animal Companion in Maze )
Image Slide ( Animal Companion in Maze )Image Slide ( Animal Companion in Maze )
Image Slide ( Animal Companion in Maze )tadamasa yamaguchi
 
Push notifications with dashboard and swift
Push notifications with dashboard and swiftPush notifications with dashboard and swift
Push notifications with dashboard and swiftCharles Ramos
 
Estructura naomi hara
Estructura naomi haraEstructura naomi hara
Estructura naomi haranaomikorin22
 
อุปกรณ์เชื่อมต่อคอมพิวเตอร์
อุปกรณ์เชื่อมต่อคอมพิวเตอร์อุปกรณ์เชื่อมต่อคอมพิวเตอร์
อุปกรณ์เชื่อมต่อคอมพิวเตอร์Nannapatktwrps
 
อุปกรณ์เชื่อมต่อคอมพิวเตอร์
อุปกรณ์เชื่อมต่อคอมพิวเตอร์อุปกรณ์เชื่อมต่อคอมพิวเตอร์
อุปกรณ์เชื่อมต่อคอมพิวเตอร์Nannapatktwrps
 
Gecko Labs - Our Student Engagement Solutions
Gecko Labs - Our Student Engagement SolutionsGecko Labs - Our Student Engagement Solutions
Gecko Labs - Our Student Engagement SolutionsGecko Labs
 
Denim Garments Quality Control and Inspection Services
Denim Garments Quality Control and Inspection ServicesDenim Garments Quality Control and Inspection Services
Denim Garments Quality Control and Inspection ServicesAsia Quality Control
 

Andere mochten auch (11)

Final Dissertation
Final DissertationFinal Dissertation
Final Dissertation
 
อุปกรณ์เชื่อมต่อคอมพิวเตอร์
อุปกรณ์เชื่อมต่อคอมพิวเตอร์อุปกรณ์เชื่อมต่อคอมพิวเตอร์
อุปกรณ์เชื่อมต่อคอมพิวเตอร์
 
Image Slide ( Animal Companion in Maze )
Image Slide ( Animal Companion in Maze )Image Slide ( Animal Companion in Maze )
Image Slide ( Animal Companion in Maze )
 
Push notifications with dashboard and swift
Push notifications with dashboard and swiftPush notifications with dashboard and swift
Push notifications with dashboard and swift
 
Estructura naomi hara
Estructura naomi haraEstructura naomi hara
Estructura naomi hara
 
อุปกรณ์เชื่อมต่อคอมพิวเตอร์
อุปกรณ์เชื่อมต่อคอมพิวเตอร์อุปกรณ์เชื่อมต่อคอมพิวเตอร์
อุปกรณ์เชื่อมต่อคอมพิวเตอร์
 
อุปกรณ์เชื่อมต่อคอมพิวเตอร์
อุปกรณ์เชื่อมต่อคอมพิวเตอร์อุปกรณ์เชื่อมต่อคอมพิวเตอร์
อุปกรณ์เชื่อมต่อคอมพิวเตอร์
 
CV-C.Mouli
CV-C.MouliCV-C.Mouli
CV-C.Mouli
 
イメージ
イメージイメージ
イメージ
 
Gecko Labs - Our Student Engagement Solutions
Gecko Labs - Our Student Engagement SolutionsGecko Labs - Our Student Engagement Solutions
Gecko Labs - Our Student Engagement Solutions
 
Denim Garments Quality Control and Inspection Services
Denim Garments Quality Control and Inspection ServicesDenim Garments Quality Control and Inspection Services
Denim Garments Quality Control and Inspection Services
 

Ähnlich wie How to build a Pokemon Go App

Unity3d scripting tutorial
Unity3d scripting tutorialUnity3d scripting tutorial
Unity3d scripting tutorialhungnttg
 
Monogame and xna
Monogame and xnaMonogame and xna
Monogame and xnaLee Stott
 
GIS - google earth -placemark - image overlay - screen overlay
GIS - google earth -placemark - image overlay - screen overlay GIS - google earth -placemark - image overlay - screen overlay
GIS - google earth -placemark - image overlay - screen overlay anjali s
 
Processing 2.0 + Open Data
Processing 2.0 + Open DataProcessing 2.0 + Open Data
Processing 2.0 + Open DataSteven Battle
 
Scene Graphs & Component Based Game Engines
Scene Graphs & Component Based Game EnginesScene Graphs & Component Based Game Engines
Scene Graphs & Component Based Game EnginesBryan Duggan
 
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)noorcon
 
mDevcon tour 2014 beyondar
mDevcon tour 2014 beyondarmDevcon tour 2014 beyondar
mDevcon tour 2014 beyondarJoan Puig Sanz
 
Thesis presentation
Thesis presentationThesis presentation
Thesis presentationWataruSanuki
 
Application of Google Earth Engine in Open NAPs
Application of Google Earth Engine in Open NAPsApplication of Google Earth Engine in Open NAPs
Application of Google Earth Engine in Open NAPsNAP Events
 
Polybot Onboarding Process
Polybot Onboarding ProcessPolybot Onboarding Process
Polybot Onboarding ProcessNina Park
 
Geogebra for physics
Geogebra for physicsGeogebra for physics
Geogebra for physicsLenore Horner
 
Data Scenarios 2020: 6 Amazing Transformations
Data Scenarios 2020: 6 Amazing TransformationsData Scenarios 2020: 6 Amazing Transformations
Data Scenarios 2020: 6 Amazing TransformationsSafe Software
 
Geopaparazzi workshop on FOSS4G2015 Seoul
Geopaparazzi workshop on FOSS4G2015 SeoulGeopaparazzi workshop on FOSS4G2015 Seoul
Geopaparazzi workshop on FOSS4G2015 SeoulHirofumi Hayashi
 

Ähnlich wie How to build a Pokemon Go App (20)

[React-Native Tutorial] Map
[React-Native Tutorial] Map[React-Native Tutorial] Map
[React-Native Tutorial] Map
 
Unity3d scripting tutorial
Unity3d scripting tutorialUnity3d scripting tutorial
Unity3d scripting tutorial
 
Robotics Portfolio
Robotics PortfolioRobotics Portfolio
Robotics Portfolio
 
Monogame and xna
Monogame and xnaMonogame and xna
Monogame and xna
 
GIS - google earth -placemark - image overlay - screen overlay
GIS - google earth -placemark - image overlay - screen overlay GIS - google earth -placemark - image overlay - screen overlay
GIS - google earth -placemark - image overlay - screen overlay
 
Map
MapMap
Map
 
Processing 2.0 + Open Data
Processing 2.0 + Open DataProcessing 2.0 + Open Data
Processing 2.0 + Open Data
 
Scene Graphs & Component Based Game Engines
Scene Graphs & Component Based Game EnginesScene Graphs & Component Based Game Engines
Scene Graphs & Component Based Game Engines
 
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
 
XNA in a Day
XNA in a DayXNA in a Day
XNA in a Day
 
Geolocation and Mapping
Geolocation and MappingGeolocation and Mapping
Geolocation and Mapping
 
mDevcon tour 2014 beyondar
mDevcon tour 2014 beyondarmDevcon tour 2014 beyondar
mDevcon tour 2014 beyondar
 
Thesis presentation
Thesis presentationThesis presentation
Thesis presentation
 
Lab 1 1-1
Lab 1 1-1Lab 1 1-1
Lab 1 1-1
 
Application of Google Earth Engine in Open NAPs
Application of Google Earth Engine in Open NAPsApplication of Google Earth Engine in Open NAPs
Application of Google Earth Engine in Open NAPs
 
Geoprocessing.pptx
Geoprocessing.pptxGeoprocessing.pptx
Geoprocessing.pptx
 
Polybot Onboarding Process
Polybot Onboarding ProcessPolybot Onboarding Process
Polybot Onboarding Process
 
Geogebra for physics
Geogebra for physicsGeogebra for physics
Geogebra for physics
 
Data Scenarios 2020: 6 Amazing Transformations
Data Scenarios 2020: 6 Amazing TransformationsData Scenarios 2020: 6 Amazing Transformations
Data Scenarios 2020: 6 Amazing Transformations
 
Geopaparazzi workshop on FOSS4G2015 Seoul
Geopaparazzi workshop on FOSS4G2015 SeoulGeopaparazzi workshop on FOSS4G2015 Seoul
Geopaparazzi workshop on FOSS4G2015 Seoul
 

Kürzlich hochgeladen

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 

Kürzlich hochgeladen (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 

How to build a Pokemon Go App

  • 1. back4app.com How to build a Pokemon Go App
  • 2. How to Build a Pokemon Go App • Back4app provides Parse server service to take care of your backend and APIs development. • Parse also provides basic application activity APIs like Login-in, push notification, payment…etc. • For this demonstration, we can use Parse Geo Point Service and back4app as our backend to build a simple Pokémon-Go. • You can read the original publication on: http://docs.back4app.com/docs/new-parse-app/how-to-build-a-pokemon-go- app/
  • 3. Part 1: Setting up Back4app Parse on your Unity3d • Go to https://parse.com/docs/downloads • Download Unity Blank Project (v1.7.0) • Download https://drive.google.com/file/d/0B7k7pGQXUypGTWRqS1BqVDB WQUU/view?usp=sharing for updated Parse SDK for Unity3d
  • 4. Part 1: Setting up Back4app Parse on your Unity3d • Open Unity3d Parse Blank Project -> Click Upgrade if required. • Replace Asset/Parse/Parse.Unity.dll to the latest one. • Go to Asset/Scene
  • 5. Part 1: Setting up Back4app Parse on your Unity3d • The Parse Initializer GameObject will miss some scripts. • Add ParseInitializeBehaviour to it.
  • 6. Part 1: Setting up Back4app Parse on your Unity3d • Type your Application ID, dotNet Key, serverUrl to a parameter from your Back4app dashboard.
  • 7. Part 1: Setting up Back4app Parse on your Unity3d • Create a GameObject and add script component to the Scene for testing.
  • 8. Part 1: Setting up Back4app Parse on your Unity3d • Add following code to TestParse.cs
  • 9. Part 1: Setting up Back4app Parse on your Unity3d • using UnityEngine; • using System.Collections; • using Parse; • using System.Threading.Tasks; • public class TestParse : MonoBehavio ur { • // Use this for initialization • void Start () { • ParseObject testObj = new ParseObje ct("TestObject"); • testObj["a"] = "HI"; • testObj["b"] = "Back4app"; • Task saveTask = testObj.SaveAsync(); • } • // Update is called once per frame • void Update () { • } • }
  • 10. Part 1: Setting up Back4app Parse on your Unity3d • Press Play Button on your Unity3d Editor • Go to Back4app database dashboard to check the success or not.
  • 11. Part 1: Setting up Back4app Parse on your Unity3d • It is connected with your back4app account successfully if you find your uploaded data in the database.
  • 12. Part 2: Integrate Google Map to your Unity3d Project • To generate the terrain like Pokémon-Go, we need to integrate Google map your Unity3d Project. • First, create Plane and Name it as “Map”, create directional light.
  • 13. Part 2: Integrate Google Map to your Unity3d Project • Second, Create a script “GoogleMap” and add to Map Game object.
  • 14. Part 2: Integrate Google Map to your Unity3d Project • Second, Create a script “GoogleMap” and add to Map Game object. • You can see the original script on: http://docs.back4app.com/docs/new- parse-app/how-to-build-a-pokemon- go-app/
  • 15. Part 2: Integrate Google Map to your Unity3d Project • Untick the AutoLocateCenter.
  • 16. Part 2: Integrate Google Map to your Unity3d Project • Type some dummy parameter to try the Google Map.
  • 17. Part 2: Integrate Google Map to your Unity3d Project • If the plane shows the correct location as your parameter, the Google map is successfully integrated. • You can use Refresh method to refresh the Google map to change location.
  • 18. Part 3: Integrate Character and Interacting with GPS Data • Create LocationManager Gameobject and add the following code. • This code is getting the GPS Data and updating the Google Map when GPS data is changed. • You can see the full code on: http://docs.back4app.com/docs/new- parse-app/how-to-build-a-pokemon- go-app/
  • 19. Part 3: Integrate Character and Interacting with GPS Data • Let test the Google map again. • It is successful if the Google map change when you change the GPS Data in Runtime.
  • 20. Part 3: Integrate Character and Interacting with GPS Data
  • 21. Part 3: Integrate Character and Interacting with GPS Data • After that, create a Capsule as a character and a Cube as Direction of the character on top of the Google Map. • (For me, I place the character at X:0 Y:0.07 Z:0) • Add a compass to your character when you test with your mobile device.
  • 22. Part 3: Integrate Character and Interacting with GPS Data • Make sure your character is located correctly by checking Latitude and Longitude on Google Map.
  • 23. Part 4: Generating Monsters on Map (Part A) • For Generating Monsters, we need to do some calculation on placing the monster with their longitude and latitude location. • Because the ratio between Google map, reality and Unity3d XYZ-world is different. • To figure out how to calculate the relationship between them, we need dummy data. • For more detail : how to calculate. http://www.movable-type.co.uk/scripts/latlong.html
  • 24. Part 4: Generating Monsters on Map (Part A) • First of all, we need to set initial latitude and longitude on Google Map first (You can choose where you want) and set the Markers on the Google Map.
  • 25. Part 4: Generating Monsters on Map (Part A) • Press Run, You will find the label on your Google map. • PS: The reason why we cannot use the marker to be a monster because it is combined with the texture. • The marker itself is a part of the texture but not a Gmeobject so we cannot do any implementation on that.
  • 26. Part 4: Generating Monsters on Map (Part A) • Beside that, we will make some dummy GPS data of monster on Parse server, later on, so we need to know the corresponding ratio on the monster game object position.
  • 27. Part 4: Generating Monsters on Map (Part A) • After that, we create a cube and place on top of the label. • Record this position.
  • 28. Part 4: Generating Monsters on Map (Part A) • Now, we need to find the exact distance between the player GPS location and the marker GPS location. • The distance between start (37.38373, -122.0133) and marker (37.384782,- 122.012893) can be calculated by this script.
  • 29. Part 4: Generating Monsters on Map (Part A) • And then calculate the XYZ world distance between the CUBE maker and the Player Capsule. (-0.563,0.07,-1.915) and (0,0.07,0). • This is a simple calculation, so I don’t list how to do it. • After that, the ratio will be found by this equation • Ratio = XYZ world distance / Exact Distance.
  • 30. Part 4: Generating Monsters on Map (Part A) • Once we have this ratio, we able to calculate how far the monster should be placed according to the Player location. • However, the possible location still undefined because we don’t have the bearing between the player and monster. • To calculate the bearing. • We can use this code. (You can see the full code on: http://docs.back4app.com/docs/new-parse-app/how-to-build-a-pokemon- go-app/)
  • 31. Part 4: Generating Monsters on Map (Part A) • After we get the ratio and bearing, it is possible to convert Longitude Latitude location to be XYZ-world coordination, which means we can place any monsters with latitude longitude location to correct game world location. • With the above code, we know the correct XYZ coordination to spawn monster.
  • 32. Part 5: Generating Monsters on Map (Part B) • While we are able to convert Longitude and Latitude data to the game world, it is time now to create some dummy monster data on Back4app parse server. • Go to your Parse back4app dashboard and create a class call Monster.
  • 33. Part 5: Generating Monsters on Map (Part B) • Add a column: Location with data type Geopoint.
  • 34. Part 5: Generating Monsters on Map (Part B) • Insert some monster dummy row that around you.
  • 35. Part 5: Generating Monsters on Map (Part B) • The dummy monsters are set, they are waiting for you to call. • Then I create a MonsterSpawn GameObject with script Spawn. • Drop the LocationManager GameObject to it (For getting updated GPS Data) • M prefab monster for spawning a monster.
  • 36. Part 5: Generating Monsters on Map (Part B)
  • 37. Part 5: Generating Monsters on Map (Part B) • It is time to fetch the dummy monster data from back4app to your program.
  • 38. Part 5: Generating Monsters on Map (Part B) • The above code gets the result one by one and converting the GeoPoint data to be XYZ-world coordination, and then push the result to the List. • After adding the result is fetched, spawn becomes true to allow program spawns the monster. • You can see the full code on: http://docs.back4app.com/docs/new- parse-app/how-to-build-a-pokemon-go- app/
  • 39. Part 5: Generating Monsters on Map (Part B) • After the Monsters are spawned, the monsters will keep updating when the player GPS data has updated. • Testing. The monster is spawn at correct XYZ coordination with their Latitude Longitude data.
  • 40. Part 6: How to move the Player (solve google map texture slow problem!) • Until Part 5, the movement of the player is relied on the Google Map texture updating. However, it is not effective to play it. • The user experience is not good. • To solve this problem, we “unlock” the player. • Make player move on the map.
  • 41. Part 6: How to move the Player (solve google map texture slow problem!) • The algorithm behind is similar to updating the monster. • We apply on the capsule. compare the last GPS data and new GPS data to calculate how should the player move in the Game world. • As we are updating the position of the player, therefore we don’t need monster update and google map refresh function anymore. • What you need to do : Modify LocationMaganger.cs
  • 42. Part 6: How to move the Player (solve google map texture slow problem!)
  • 43. Part 6: How to move the Player (solve google map texture slow problem!) • You can see the full code on: http://docs.back4app.com/docs/new- parse-app/how-to-build-a-pokemon- go-app/
  • 44. Part 6: How to move the Player (solve google map texture slow problem!) • Second, attach following code to you camera make your cam follow you character ( Don’t forget to drag your capsule to inspector.
  • 45. Part 6: How to move the Player (solve google map texture slow problem!) • To view source code and whole project -> Raw Unity Project • Issues, comments or suggestions? Let’s discuss in our Developers Group Topic.

Hinweis der Redaktion

  1. Davi
  2. Alysson
  3. Alysson
  4. Alysson
  5. Alysson
  6. Alysson
  7. Alysson
  8. Alysson
  9. Alysson
  10. Alysson
  11. Alysson
  12. Alysson
  13. Alysson
  14. Alysson
  15. Alysson
  16. Alysson
  17. Alysson
  18. Alysson
  19. Alysson
  20. Alysson
  21. Alysson
  22. Alysson
  23. Alysson
  24. Alysson
  25. Alysson
  26. Alysson
  27. Alysson
  28. Alysson
  29. Alysson
  30. Alysson
  31. Alysson
  32. Alysson
  33. Alysson
  34. Alysson
  35. Alysson
  36. Alysson
  37. Alysson
  38. Alysson
  39. Alysson
  40. Alysson
  41. Alysson
  42. Alysson
  43. Alysson
  44. Alysson
  45. Alysson