README.md 3.31 KB
Newer Older
Rory 's avatar
Rory committed
1
2
# Geocaching Game Plugin for Unity

Rory 's avatar
Rory committed
3
A simple plugin that is designed to provide geolocation data to a Unity game, even when the screen is off.
Rory 's avatar
Rory committed
4
5
6

---

Rory 's avatar
Rory committed
7
8
9
**Important note**: This isn't really supposed to be a real production plugin, it's more of a learning tool or proof of concept.
If you want to use something like this it would be smart to research the topic and make something that works for your specific project.

Rory 's avatar
Rory committed
10
11
12
13
14
15
## Overview

This was created as a way for me to learn about making Android services and using them with Unity plugins.
It's also a way of me to resolve my issues with Pokémon GO, the most significant (apart from the lack of battle mechanics) is that I feel that the geolocation mechanics are poorly implemented.
However, I feel that I have no basis to make these claims until I have attempted to try and develop this feature myself.

Rory 's avatar
Rory committed
16
17
As this is focused on being a learning tool I tried to comment all my code in both the Unity project, demo and the Android native plugin (and I added comments to a little bit of the MapzenGo Code as well). If there's anything that doesn't make sense, is wrong or is just plain broken please let me know, I'll try and fix it as soon as I can. 

Rory 's avatar
Rory committed
18
19
## Systems

Rory 's avatar
Rory committed
20
The Unity part of the project was created with version 5.5.0 and the Android part was created with Android Studio version 2.3.
Rory 's avatar
Rory committed
21
22
The Git repo uses Git LFS and the editor I'm currently using is Visual Studio Community 2015.

Rory 's avatar
Rory committed
23
24
25
26
27
I also used [MapzenGo][MapzenGo], an open source Pokémon Go styled 3D map renderer using the Mapzen service. I altered it a bit though (because I felt like it).
The guy who made it is now working on the official [Mapzen Unity SDK](https://www.mapbox.com/unity/) so definitely take a look at that.
In future I'd like to try integrating this but it wasn't available when I started.
If you want more info on the MapzenGo project check out [the repo][MapzenGo] or  [Baran's blog][Baran].

Rory 's avatar
Rory committed
28
29
## Todo

Rory 's avatar
Rory committed
30
31
32
1. Provide better ways of reducing battery usage. *This is very important.*
2. Smooth distance calculations.
3. Smooth player movement and camera rotations. *Not important, just looks nice.*
Rory 's avatar
Rory committed
33

Rory 's avatar
Rory committed
34
35
## Tutorials and References

Rory 's avatar
Rory committed
36
37
38
39
40
41
42
43
44
1. [Plugins for Android - Unity Manual](https://docs.unity3d.com/Manual/PluginsForAndroid.html).
2. [Communication Between an Android App and Unity](http://jeanmeyblum.weebly.com/scripts--tutorials/communication-between-an-android-app-and-unity).
3. [Writing Plugins - Official Unity Tutorial with Mike Geig](https://unity3d.com/learn/tutorials/topics/scripting/writing-plugins) - video length 1:05.
4. [Creating a native Android plugin for Unity3d](http://www.what-could-possibly-go-wrong.com/creating-a-native-android-plugin-for-unity3d/).
5. [`TYPE_STEP_COUNTER` - Android API](https://developer.android.com/reference/android/hardware/Sensor.html#TYPE_STEP_COUNTER).
6. [Create An Android Plugin For Unity Using Android Studio](http://www.thegamecontriver.com/2015/04/android-plugin-unity-android-studio.html).
7. [Start android service from Unity3D code - Stack Overflow](http://stackoverflow.com/a/38369904).
8. [Set a Listener in a Service-based Class - Stack Overflow](http://stackoverflow.com/a/7775771).
9. [Bound Services](https://developer.android.com/guide/components/bound-services.html).
Rory 's avatar
Rory committed
45
46
47
48
10. [MapzenGo][MapzenGo], [Baran Kahyaoglu's blog](Baran).

[MapzenGo]: https://github.com/brnkhy/MapzenGo
[Baran]: http://barankahyaoglu.com/dev/