Gamasutra.com - Mars Sucks - Can Games Fly on Google Earth?
It's free to join Gamasutra!|Have a question? Want to know who runs this site? Here you go.|Targeting the game development market with your product or service? Get info on advertising here.||For altering your contact information or changing email subscription preferences.
Registered members can log in here.Back to the home page.

Search articles, jobs, buyers guide, and more.

By Omar Rodrigues
[Author's Bio]
Mike MacPherson
[Author's Bio]
and Scott Crabtree
[Author's Bio]
Gamasutra
December 21, 2006

Mars Sucks - Can Games Fly on Google Earth?

arrowrightPage One
arrowrightPage Two
arrowrightPage Three
arrowrightPage Four




Latest Letters to the Editor:
Perpetual Layoffs by Alexander Brandon [09.21.2007]

Casual friendliness in MMO's by Colby Poulson [09.20.2007]

Scrum deals and 'What is Scrum?' by Tom Plunket [08.29.2007]


[Submit Letter]

[View All...]
  


Features

Mars Sucks - Can Games Fly on Google Earth?


Location Info

A limited set of information can be passed on from the Google Earth client to the game web server. This information consists of:

  • the latitude and longitude of a point on the ground where the camera is looking
  • the range from the camera to the point
  • the tilt of the camera with relation to the point
  • the heading of the camera with relation to north

This information was used to infer location of the camera on Earth and distance from the alien crafts.

Shooting

To make the game interactive and immersive we needed the ability to shoot the alien ships. The basic approach for shooting was to use the location information retrieved from the Google Earth client and compare it to the locations of the alien crafts.

The first strategy, which seemed to be the most intuitive, was to shoot by clicking on the alien crafts. This strategy fell through because there was no direct way to track clicks on objects.

The click event was not easily tracked but there was some functionality on the mouseover event, so the next obvious strategy was to shoot by moving the pointer over objects. This strategy did not work because the only functionality attached to a mouseover event was to change the style of the object.

The third strategy was to use the location information to create vectors from the point on the ground to the camera and from the point on the ground to the crafts. If the angle between vectors was in a predefined range, it would be considered a successful shot.

In the end, the simplest strategy to implement was the most useful. This strategy was to use the point on the ground as the center of a region with a defined radius. If an alien craft was found within this region, it would be considered a successful shot. Since the point on the ground is the point that is being looked at by the camera it also corresponds to the point on the screen that the cockpit cross hairs are centered on, thus everything works as expected, you can successfully shoot the alien when it is in the cross hairs.

We wanted to trigger the shooting with a key press or a mouse click but there was no way to map events to unused keys or mouse clicks. The shooting trigger had to be based on stopping the camera motion which is a pre-defined key that we could bind to an event.  It’s not the most intuitive method but it was the best workaround available.

Conclusion

Our prototype project was successful in that we learned a lot about what can — and can not — be done currently to build games on top of Google Earth. We ended up with a prototype that is fun to play, but is more scavenger hunt than action game. The player searches the Earth for aliens but can only blast them by stopping with an alien in the ship’s sights.

You can try the game by setting up a web server (see reference section at the bottom of this page for instructions) and client with the files available for download (see "Source Code," below). We learned that very simple games and casual games are possible now on Google Earth. We also learned that Google Earth is not yet ready to be the foundation of a serious action game.

While we think the prototype is fun to play, it is just an early prototype. Further enhancements—some by Google and some by game developers—would go a long way to improving the game and making bigger and better games available.

Recommendations to Google

As we write this, rumors are that Google is planning to release an application programming interface (API) for Google Earth, and we hope that will indeed happen soon. That step would really unleash the potential for building games and other applications over Google Earth. With the API release, we are hoping to find it’s much easier to display text on the screen and handle mouse events.

Recommendations to Developers

Honestly, most game developers don’t need our recommendations to make something vastly superior to the quick prototype we put together. But for those looking for a few suggestions on how to get started, here are a few of the tasks at the top of our list:

  • Add levels. This is game design 101: levels add a lot to a game. They would be easy to add to Mars Sucks.
  • Improve shooting. We’ve described the trouble we ran into and the solution we used above. Perhaps you can be more creative in solving the problems we ran into.
  • Add sound. A game without sound is, well, a prototype.

We know we’ve barely scratched the surface of what can be done with Google Earth and games. We encourage you to contact the authors with any questions or suggestions. We look forward to hearing from you and seeing what you can do with Google Earth games.

Source Code

Download the source code: mars-sucks-source-code-files.zip

References and Resources

 




join | contact us | advertise | write | my profile
news | features | companies | jobs | resumes | education | product guide | projects | store



Copyright © 2006 CMP Media LLC

privacy policy
| terms of service