True Asteroids On A Torus
Written by Mike James   
Friday, 20 March 2015

There may be life in old games done right. Asteroids is a classic, but have we been implementing it wrong all these years? 

If you have played any of the classic games where moving off the edge of the screen brings you back on the other side and moving off the top brings you back on the bottom then you might have wondered what shape the playing surface actually was? 

You might at first think that it was a sphere, but the answer is easy to see if you take a piece of paper and first glue two sides together. This produces a tube. Now glue the two ends of the tube together and you get a torus - OK. an inner-tube-like thing. 

torus

 

That's right, the game of Asteroids has been played on the surface of a torus for all these years without anyone really noticing - expect for Peter Musgrave, the programmer of interesing physics simulations like ThreeBody and author of the N-Body Physics blog. He wondered what Asteroids would be like if the game took account of the shape of the space it was being played in - Geodesic Asteroids. 

There is the question of what is the appropriate geometry for a torus? You could argue that the original game picked a valid representation of a flat torus, but a more interesting idea is to take the curvature of the 2D torus that you get from its usual 3D embedding.

In fact you also have the choice of showing the motion on the 2D surface in 3D or map the torus to a 2D screen represenation.

 

torus3d

 

The key idea is that the asteroids would move, not on straight lines, but on geodesics - the shortest path between two points taking the curvature into account. 

 

torusicon

 

If you would like to try the game out it is available for Android, iOS and Blackberry - just search for Geodesic Asteroids.

Are there any other games that could gain a second life by being played on curved 2D surfaces, or even curved 3D surfaces? If you are interested you will need to learn some differential geometry, which the app also explains a little bit. 

 

torus

 

More Information

http://nbodyphysics.com/blog/

Related Articles

Find N-Body Solutions In Your Browser       

PhysicsJS - Physics In Pure JavaScript       

The Magic Of N-Body Solutions       

 

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, FacebookGoogle+ or Linkedin,  or sign up for our weekly newsletter.

 

Banner


Apache Fury Adds Optimized Serializers For Scala
31/10/2024

Apache Fury has been updated to add GraalVM native images and with optimized serializers for Scala collection. The update also reduces Scala collection serialization cost via the use of  encoding [ ... ]



.NET 9 Released
18/11/2024

.NET 9 has been released with a number of performance improvements and new features designed to help developers use AI.


More News

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

 

 

 

Last Updated ( Friday, 20 March 2015 )