The diesel-piloted high-pressure direct-injection (HPDI) natural gas engine is a significant application of natural gas in heavy-duty engines. However, there is limited research focusing on quantitative optimization of the excess air coefficient and natural gas substitution rate of HPDI engines. In order to support the design and development of HPDI engines, this article investigates the effects of excess air coefficient and substitution rate on a dual fuel HPDI engine combustion performance and emission characteristics. Results show that increasing the excess air coefficient results in higher cylinder pressure, but it has minimal effect on the heat release rate. A higher excess air coefficient can also lead to higher nitrogen oxides (NOx) emissions, lower soot emissions, methane (CH4) and total hydrocarbon (THC) emissions significantly decrease at 50% loads (Case2 and Case4), but these increase at 70% loads (Case1 and Case3). Furthermore, increasing the substitution rate markedly reduces greenhouse gas emissions, though it comes with the drawback of heightened combustion instability, and there is a trade-off between engine combustion cycle variations and greenhouse gas emissions as the substitution rate changes. The above research findings will provide optimization guidance for the engineering development of HPDI engines.