Planet simulator and Goserver
In an effort to revive this blog and start posting regularly I’ve decided to post some things I made ages ago which I haven’t posted online before.
The first is a solar system simulator that demonstrates Kepler’s laws of planetary motion:
This originated as part of a multiplayer space shooter game I worked on with Bencoder, which was never completed (mainly because we couldn’t decide how the game was supposed to work). We wanted planets which would move, but would be consistent across the network. Keplerian orbits allowed us to predict the state of the system at any given time, while still being realistic enough to satisfy my nerdiness. This is basically the map editor I wrote for the game. I think it was my first C++ application and my first GUI application (using Qt). As a result, the code is a horrible mess and it’s a bit buggy, but it’s quite fun to play around with.
Features:
- construct systems of suns, moons and planets
- customize the image shown for each one with user created content
- modify the size, mass and position of the objects
- modify the ellipticity and direction of the orbits
- view an animation of the system in real time
Note: since the planets only interact with one other object, the system will behave a bit weirdly when the orbital paths intersect or are close to each other.
The other thing I made (this was a bit more recent) is a turn based go server in ruby on rails. It’s unfinished at the moment, but I have it running here if you want to take a look. I was using this project to try and learn rails, but I think I may have picked something a bit too ambitious. There was a problem I couldn’t figure out with the images sometimes not loading and I eventually gave up on it. I learned a lot from it though, and I really like rails for web development, even though it’s a lot of hassle to set up on my website compared to PHP.