Hi there, having the NPC ships flying around is a multi-layered task that will require some time to complete so here’s a little interim update.
The objective is to make all NPC vessels “persistent”, that is going on performing their mission even when outside of the player’s cognitive horizon. This way ASG’s galaxy should operate as a network, with all ships acting as propagation vectors for the game’s economy in a consistent way (carrying notably information, illegal goods and criminal agents).
As part of this work all inhabited stellar systems are now equipped with facilities, and new ships were added to reach a current total of more than 1200. That would obviously be too large a number to render with the usual continuous physics (one sample or more per frame). And thus the first component for the feature is a high-level event-driven simulator that manages agents at discrete times corresponding to the main changes in their state (for instance when a ship arrives at a new celestial body or docks to a station). That simulator produces the log displayed in the post’s featured image above.
An additional difficulty in ASG is the underlying physics which obviously has to apply to both the player and all NPC vessels. Again the associated flight planning computations would not be possible to manage in real time (even on parallel working threads), especially since the player may accelerate the simulation rate to more than x2000 on long ballistic legs. To deal with this, the simulation relies on pre-computed schedules for galactic routes linking the main civilization centers (more than 150 currently). NPC ships use these tables to plan their journeys at very low computation cost
Interestingly the constant orbital motion of the visited celestial bodies makes the trajectory change over time. In some circumstances the required ΔV budget may even exceed the capability of regular starliners, effectively closing the route to the commercial traffic. These “galactic tides” are depicted in the video below. The effect is worse on the rim where usable stellar systems are sparse and relative galactic velocities higher:
Complementing the pre-computed tables, intra-system trips are planned using the path-finding heuristic. On a single dedicated parallel thread this high-level simulator can currently animate all of the 1200 ships with a time acceleration in excess of x 30 000. That’s about a x 10 worst case margin over the main thread.
There are still a few quirks to iron out with this is first layer, and then the next step will consist in properly instantiating the nearby vessels for the regular continuous simulation flow.
Thanks for reading!