1/26/2018 in devlog
This week has all been about solving technical issues. Martin tried to persuade our age-old email server to continue sending emails after it stopped suddenly and without prior notice. Michi is still working on the space flight feature and moved code to the server to prevent issues in the future.
What shall I say...I tried! I really wanted to have at least two days of quality PU time this week, but it simply wasn't doable. In a way I have to be glad that we have a huge pile of relatively well-paid customer work that definitely helps to pay the bills around here. But on the other hand it's been months since I actually laid hand on the game. And that's starting to feel seriously frustrating.
Anyhow, enough of the whining! There was in fact one interesting thing this week that is somewhat related to Prosperous Universe: As I hinted at last week, I started very basic preparations (mostly just planning stuff) for the notification system, the first larger feature I'll be working on once the backlog of external work is empty enough. One aspect of said feature is the transmission of fairly large quantities of email. This is something we've already had to tackle for our other game AirlineSim, so we do have respective systems in place that abstract away the intricacies of sending emails, handling bounces, allowing users to unsubscribe from particular types of messages and so on.
And just this week, this system stops working. Out of the blue, without any visible error message. It just quit and refused to send the emails that were queued. Since it's been in operation for several years and - so far - has done its job with a minimal amount of issues, I had trouble to figure out what the actual problem was. Past-me obviously didn't write a sufficient amount of documentation and patching it in its current state felt dangerous...I didn't even know (for sure) how I deployed this thing. Yeah, yeah, not me brightest hour, I know ;-)
I ended up converting the system to the current way in which we deploy software, mostly to have a fast and reliable delivery pipeline in place to do troubleshooting. But as it turns out, that was already enough for the mystery-bug to disappear. So that might actually safe me a few hours of rework once I need this system for Prosperous Universe. Think positive...
I am still working on the space flight feature and solved a dormant issue just waiting to wake up and cause trouble: route calculation!
When a player plans a route to another planet within the system or in a different star system the calculation is done in the client. The client takes into account all sorts of information to make this calculation: ship stats like weight, thrust, fuel and system stats like mass of sun, mass of planets, etc. It then comes up with a solution, displays it in the maps and allows to fine tune the engine usage to let the player choose faster or slower transits.
Every time the user uses the slider to adjust the fuel usage a new route has to be calculated since it changes the flight's parameters like the burn times of the engines. The waypoints to display the route are recalculated and displayed immediately to reflect tha change in the route. Here it comes handy that the calculations are done on the client since no round-trip to the server is necessary.
Once the player starts the flight all its parameters are send to the server which validates them and updates the ship's data. The data is send back to the client and the flight begins. So far so good, but here is the point: If we have to recalculate the route because we closed the browser or because we never calculated a specific route (for example one from a ship of another player) we have to use the ship's current parameters to do so, because we have no older data from before the flight. This can be a problem, because in the newer data some parameters have already changed: fuel has been consumed for example. So to do a proper recalculation on the client we have to guess what the parameters have been. Of course this is problematic and I tried to change that.
Routes are now only calculated on the client before a flight starts. If we need waypoint data to display a route in the maps the server will send very specific details of this flight, for example the position of the start and end point of the route, star mass and ship mass. That way the client doesn't have to guess parameters. There is also another great benefit: If we display traffic of other players' ships to a player we don't have to send all the information there are about these ships to the player's client.
As always: we'd love to hear what you think: join us on the forums!