1
\$\begingroup\$

I'd like to use Google Maps, in my game, much like "Ingress", "Pokémon GO" and "Parallel Kingdom".

When I take a deeper look into the Android API/Google Maps API, and dozens of forums, I noticed that it's very hard to display sprites or even animations using the Google Maps API. Someone said that you need to layer stuff. Someone else said it's better to use game engines for that. No one tells me how to begin. I opened Android Studios and made a new Google Maps project. I compiled and ran the app. There is the map, so I guess I have completed the first step.

How do I combine the Google Map with an extra view or LibGDX layer for displaying sprites? How manage this with a multiplayer server?

I am wanting to set my map up like "Parallel Kingdom", which you can see, below.

Player avatars display their positions on a Google Map display.

The player avatar displays a range for accessing nodes on a Google Map interface.

\$\endgroup\$
6
  • 1
    \$\begingroup\$ Hey! Just a small note: you can't ask 'how did they do it' here, as it's primarily opinion based: unless one of the devs come and answer the question, it's only pure speculation. \$\endgroup\$
    – Vaillancourt
    Feb 8, 2017 at 12:57
  • \$\begingroup\$ Thanks for your answer :) I dont want to know how to every step and every Line of Code. As you said only speculation, what they could have Done. \$\endgroup\$
    – genaray
    Feb 8, 2017 at 14:46
  • 1
    \$\begingroup\$ I understand, the point is, we don't like "speculations" here :) But you can ask how you could achieve it :) It's a way to try to address your issue. It's a lot more tangible than how they could have done it. You'll get more solutions that you could use, instead of "well they used that super-secret API because the boss of the company was good friends with that other boss at Google." \$\endgroup\$
    – Vaillancourt
    Feb 8, 2017 at 14:54
  • \$\begingroup\$ Soo i edited the title and added an Main question. Thanks for your tipp ! Maybe now someone will answer me ^^ \$\endgroup\$
    – genaray
    Feb 8, 2017 at 15:07
  • \$\begingroup\$ The question is broad but I think it could be answered by someone who knows about it. Good luck :) \$\endgroup\$
    – Vaillancourt
    Feb 8, 2017 at 15:09

1 Answer 1

0
\$\begingroup\$

If you use OpenGL or a game engine that uses OpenGL, then you can make a canvas that's transparent. Then you put the map under the surface view and you draw the sprites on the view.

Calculating the position of the sprites is a bit harder, but luckily Google maps provides the current gps location, so you can figure out how to place them.

You should store the gls location of the entites on ths server and send this to the client (preferably only the stuff around it). On client-side you subtract the current GPS location from the enemy's location and based on the zoom you make it lay between the clipping plane's of the camera.

\$\endgroup\$
2
  • \$\begingroup\$ Great, Thanks for your answer ! But what if a game of that size got thousands of entitys ? If you gonna loop over everyone to calculate the distance to the next Player its gonna lag like hell :/ \$\endgroup\$
    – genaray
    Feb 16, 2017 at 13:09
  • \$\begingroup\$ @ganaray look into spacial partitioning, like quadtrees \$\endgroup\$
    – Bálint
    Feb 16, 2017 at 13:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .