• Register

Planar is a realistic space travel simulator. The goal of the game is to play trough a story line split over 7 missions where you explore space from the perspective of different races in the galaxy. The game was made from scratch in java. It is more impressive in terms of programming, physics and math than the actual gameplay, so the source code will be included in the download. The game was mostly ment as a challange in programming, and technical aspects of making a video game. I did most of the work a few years ago and have since then learned and improved a lot, so don't be too harsh on me!

Post article RSS Articles

Physics of Planar

Feature 2 comments

In Planar you can fly your spaceship troughout the galaxy in a realistic way. The Galaxy is made up of a hierarchy of moons orbiting planets orbiting stars and so on.

Example showing how to use the mapview to look at the moon.


The universe of Planar is a fictional version of the real Galaxy, with realistic sizes. This means that most journeys involve a wide range of length scales, kilo-, mega-, giga-, tera-, peta-, exa- and finnaly zetameters.

View from moon to galaxy.


To explore this vast Galaxy you need to start by getting your ship into orbit. Since this can sometimes take a long time the game offers timewarp, which makes game time pass faster than frame time. This is also usefull when making large maneouvres and approaching an object you want to land on.

Timewarping your way into space.


Once in space you can change your orbit by turning on your space ships engines. In this case the ship is accelerating, causing the elliptical trajectory to expand until it wraps around the planet, and continuous expanding after that.

Orbit around planet


The orbit of a space ship around any massive object is usually an ellipse. As the ship accelerates, the shape changes from an ellipse to a parabole and finnaly a hyperbole. The trajectory gets cut off at the sphere of influence of the planet. At this point, the path continuous as an independent orbit around the mother star of this planet.

Escaping from a planet.


Once we have the orbit we want, all you need to do is wait to get the place you want to reach... for days, months or even years. Fortunately, you can skip this wait with the time jump function. Select any point on your orbit and then time jump towards it. The game will forward time by the amount needed, causing all planets in the view to orbit around as well.

Space ship jumping in time to different parts of its orbit.


Eventually you might want to visit a planet orbiting the same star you are orbiting. In this case, we managed to find an intersection orbit with the sphere of influence of Jupiter. This is more simple than it looks, all you need to do is put your ship on any point of jupiters orbit, then accelerate until jupiter happens to arrive at this point at the same time you will return to it. As the ship passes by Jupiter it gets slingshotted around and away. This generates a new orbit around the sun, shown in green.

Looking for jupiters sphere of influence


This is what the same trajectory looks like, while zoomed in on Jupiter. The orbit passes by and exits the sphere of influence again, unless it happens to collide with Jupiter itself.

Entry orbit around Jupiter.


Finnaly there is still the problem of interstellar travel. To reach another star there is no choice but to go to a sci-fi solution like a warp drive, unless the destination star happens to be very close. In that case, we can extend a normal orbit towards the destination.

Intersteller travel between close stars.


Congratulations! You know have a conceptual understanding of space travel and all the knowledge you need to play and beat Planar.

A little note for the experts among you: the trajectories in Planar are calculated using the famous patched conic approximation. This is by no means the approximation used for real life space travel, since it is too innacurate. So why didn't I use the real system for Planar? Well that's because most people don't want to play games on their home super computers. Calculating an orbital trajectory for real life applications takes minutes, hours or days, meanwhile Planar needs to do the same thing within one frame (1/60th of a second). This means that a more simple, faster approximation is needed.

And for the programmers among you: the code for calculating the trajectory can be found in the SpaceEntity and Path classes of the Planar_Source jar file. This involves nearly 2000 lines of code and some hardcore math and physics, so beware.

Even if Planar is not the kind of game for you, I hope I at least convinced you that physics can be awesome. Don't forget to support space travel!

Add file RSS Files
Planar MusicFix

Planar MusicFix

Patch

A fixed version of the game that keeps running even if the music player fails. Turned out some people had issues with this. You still need a jre to run...

Planar

Planar

Full Version

The full original game along with the source code of Planar. To play the game you only need to run the jar file Planar.jar To run a jar file you need...

Post comment Comments
ssd21345
ssd21345 - - 172 comments

Downloading as it seems attractive, so you will not update it anymore?
It seems music playing have problems so the game cannot be ran.

Reply Good karma Bad karma+1 vote
ssd21345
ssd21345 - - 172 comments

error: I.imgur.com

Reply Good karma Bad karma+2 votes
WARdd Creator
WARdd - - 6 comments

That didn't seem to be a problem on windows, you happen to run the game on mac or linux? If so I'll upload a fixed version for those platforms

Reply Good karma+2 votes
ssd21345
ssd21345 - - 172 comments

Sorry for late reply, I got build 1.8.0_91-b15 windows 7 64bit

Reply Good karma Bad karma+1 vote
WARdd Creator
WARdd - - 6 comments

Woops, then I have no idea wats causing the problem.
I just made a version that should keep going even if the music fails. Let me know if it works, and I'll add it to the downloads.
Dropbox.com

Reply Good karma+2 votes
ssd21345
ssd21345 - - 172 comments

It works. Thanks. Main menu doesn't have music, but ingame(after you start tutorial or other mission) have music. Idk if it can help to solve the music problems.

Reply Good karma Bad karma+1 vote
ssd21345
ssd21345 - - 172 comments

playtime for finishing the story: around 2-4 hours
secret code *cough* *cough*

Reply Good karma Bad karma+2 votes
WARdd Creator
WARdd - - 6 comments

great, thanks for the feedback
The secret code is talking about you and not me though :p

Reply Good karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account:

X