We wanted to use Magnet's real-time messaging framework to make something cool that's not exactly messaging. We thought of recreating the popular Agar.io game, but with a twist.
What it does
We use geolocation to plot the user's position as a circle on a map, and as they walk around and collect smaller, randomly generated dots, they get larger in size.
When they see another player that is smaller than them, they can try to consume the other user by walking near them.
How I built it
We took advantage of Magnet's real-time publish-subscribe messaging framework to create smooth and interactive gameplay.
Challenges I ran into
We had first decided to build this with the new react-native for android, which was only a week old. We quickly found out that wouldn't work, as many features were not implemented yet. We pivoted to react, and ran into another problem.
Commercial geolocation is not very reliable, and it destroyed the smooth aspect we were trying to achieve. Player's would jump around sporadically due to GPS inaccuracies, and movement would lag due to latency.
In addition, since we were not developing for native android we had to use Magnet's RESTful API which was not fully implemented for our needs. We should have researched that more before we decided on this project.
Accomplishments that I'm proud of
Though we were pretty discouraged after seeing all our hard work squashed by something in space we couldn't fix, we still managed to hack together a cool prototype. We implemented some guards to reduce GPS errors, and increased our render frequency to make it seem smoother.
What I learned
We learned that the technologies you choose to develop around is very important, and can either benefit or hinder you. For us, react-native for android and GPS delayed our progress greatly, and in hindsight we should have forseen that they were causing.
What's next for Agar
We will take our skills and passion elsewhere for now, but Agar.me will always be remembered.