Often, I encounter enemy vessels and simply retreat from them. Most of the time, I gain 20+ XP for this encounter. However, occasionally, no XP is gained (or at least, no XP is displayed as being gained.) I think this most commonly (only?) happens against certain Indies. Is this a bug, or intentional?