You are browsing as a guest. Sign up (or log in) to start making projects!

AstroCode

  • 3 Devlogs
  • 5 Total hours

A spaceflight simulator with a programmable ship to help aid in teaching programming.

Open comments for this post

2h 9m 36s logged

Today was primarily spent working on the physics engine of the game. The first thing I did was give the spacecraft some more variables like thrust and mass, so we can use physics calculations to give realistic gravity and movement vectors. Later, I implemented the rendering functions for both the earth and moon as well as their respective gravity methods. There were some bugs in how the gravity works as well that I have fixed. Then I realized for some reason that the gravity and movement vectors were a lot more powerful then they were supposed to be. This was due to me applying one second’s gravity and movement vectors instead of one tick’s. One tick in my game is based off the display of the computer which in my case is 1/60th of a second, so it was 60x faster than intended. Another issue encounted includes that my game was significantly laggy when I approached the moon which was the moon’s distance in meters worth of pixels away from earth. I hypothesized that the cause of the lag was the major amount of pixels being loaded, so I scaled down the entire game by a factor of 10 in the distances and scaled the weighted down by a factor of 100 to make the force of gravity the same as SI. Then, I also implemented side thrusters and angular velocity as well as torque and inertia to make turning actual physics instead of just values I determined on the spot which will make more sense for people who are playing my game later. Finally, implemented collision code that stops the game if the spacecraft collides with either the moon or Earth. Thanks for reading! If you guys have any other physics based features that you want me to implement, please comment it down below! I need this project to take more hours :).

0
0
4
Open comments for this post

1h 40m 9s logged

I realized how much effort I previously put into one of my project’s Stellar Landing Simulator. This project requires a working spacecraft to simulate the physics engine and actual player’s piece, so I tried implementing what I did for that project from scratch, but I lowkey was making errors I fixed previously, so I just copied all the code from that project into this one. Then, I removed all the extra bloat from those project files that this one had. Those project files has stuff like terrain.js which procedurally generated the moon’s terrain. I have no need for that currently, so I removed that file as well as some extra nonsensical stuff. Additionally, I refactored the codebase to have all the code related to the spacecraft in one singular file called spacecraft.js as this project will entail many different objects and having all the code in one file will make me crazy. Lastly, I updated the spacecraft model from something that was made out of sticks to the current model in the screenshot provided below. I honestly like it pretty well so far. Tomorrow, I lowkey probably will try and implement the actual physics behind it. Thanks for reading! I am always open to suggestions!

0
0
6
Open comments for this post

1h 7m 20s logged

Hello everyone, so today I started to set out with the creation of my new project AstroCode. I plan for it to be a web-based site where users are able to create their own code to program a simulated spacecraft to do many cool things and missions as well as a sandbox mode. Today, I was just continuing with the set up with the actual spaceflight simulator section. I plan on starting with developing actual movement and the physics engine before I delve too deep into something I can not handle. Some issues I dealt with was just making some stupid syntax and simple semantic errors, stuff I should no longer be messing up. It’s fine though. I am getting the hang of simulating this again. Tomorrow, I will likely finish up a HUD or the actual planet generation. Thanks for reading! If you have any ideas, I will be happy to read it.

0
0
6

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…