In the real world, ATC will assign you an altitude, taking into account your requested altitude, traffic conditions, and of course the FAR.
The aircraft designer for each aircraft will use a formula to calculate typical values, which will be included in the aircraft’s operating handbook.
At each combination there will be performance values such as:
- Average N1 (for a turbine)
- Max TAT for thrust rating
- IAS Knots
- Mach number
- ISA fuel flow LB/HR/ENG
- ISA TAS Knots
The flight distance will determine the approximate gross weight, which corresponds to an altitude and cruise speed that provide the best efficiency. Here is an example from a virtual 737 handbook, with the values listed. The optimum performance is in blue. Higher gross weights have been removed for clarity.
Airlines may have their own performance tables, choosing a custom balance of efficiency and speed. Dispatchers for the airline will take the flight information and decide on a cruising altitude for filing the flight plan, which the pilot will then receive. As you can see, as the aircraft burns fuel and gets lighter, it will be more efficient at higher altitudes. This is a step climb, where the aircraft will climb to higher altitudes as the flight progresses when they are cleared by ATC.
Modern planning systems can take into account weather factors such as winds aloft and turbulence to pick the most efficient route.
If you were going to try to replicate what cruising altitude to use on Infinite Flight, then you’d have to look at the above things on your own to before taking off. My answer is; whatever is the most efficient.
1. Aviation Stack Exchange