The dual-fuel combustion technology utilizing hydrogen and diesel fuel shows potential in enhancing the performance of compression ignition engines and reducing carbon emissions. However, this approach is accompanied by several significant challenges, such as hydrogen transportation and storage, as well as low combustion efficiency at low loads. To address these challenges, this study integrates low-temperature combustion technology with online hydrogen production through methanol steam reforming to achieve efficient and clean combustion. The results of methanol steam reforming, mainly consisting of hydrogen, carbon dioxide, and unreacted methanol, is premixed via port injection as a low-reactivity fuel. Simultaneously, diesel fuel is directly injected into the cylinder as a high-reactivity fuel to achieve reactivity-controlled compression ignition mode. The primary fuels employed in compression ignition engines comprise reformate gas (mainly hydrogen), unreacted methanol, and diesel. This combination is collectively termed as tri-fuel combustion. This study utilizes a combination of genetic algorithms and 3D engine simulation to determine the optimal strategy for the methanol/reformed gas/diesel tri-fuel engine under different loads. The results of the optimization reveal that the tri-fuel combustion mode has the highest indicated thermal efficiency, surpassing the methanol/diesel dual-fuel mode and the reformed gas/diesel dual-fuel mode. Meanwhile, the optimized engine demonstrates significantly lower NOx and soot emissions than those required by the Euro VI emission regulations. Additionally, the study summarizes engine operating parameters impact on performance. Moreover, the tri-fuel combustion mode has a distinct advantage in increasing the methanol energy substitution rate at all three different loads. The dual-fuel mode leads to increased unburned hydrogen and methanol concentration near cylinder liner due to lower combustion temperature. In contrast, tri-fuel mode substantially reduces unburned hydrogen and methanol due to high combustion temperature and methanol reactivity.