An engine comprising: a combustion chamber; an injector mounted to the engine and configured to inject fuel; a spark plug disposed so as to face an inside of the combustion chamber; a variable valve mechanism (23, 24) configured to change valve timing of at least one of an intake valve and an exhaust valve; and a controller connected to each of the injector, the spark plug, and the variable valve mechanism (23, 24), the controller configured to output control signals to the injector, the spark plug, and the variable valve mechanism (23, 24), wherein the controller is configured to output a control signal to the variable valve mechanism (23, 24) so as to perform valve control of opening the intake valve when the exhaust valve is open, and then output a control signal to the spark plug at predetermined ignition timing such that, SPCCI combustion, in which after air-fuel mixture is ignited and combustion is started, unburned air-fuel mixture is combusted by autoignition, is performed, characterized by a supercharging system provided to the engine, the supercharging system configured to supercharge the combustion chamber with gas to be introduced thereinto, wherein in a case where the controller performs the valve control and the SPCCI combustion while the supercharging system is performing supercharging, the controller is configured to make an overlap period, in which the intake valve and the exhaust valve are both open, constant regardless of change of load on the engine, and when performing the valve control and non-supercharge SPCCI combustion, the controller is configured to output a control signal to the variable valve mechanism (23, 24) such that the overlap period is longer when load on the engine is high, than that when load on the engine is low. a combustion chamber; an injector mounted to the engine and configured to inject fuel; a spark plug disposed so as to face an inside of the combustion chamber; a variable valve mechanism (23, 24) configured to change valve timing of at least one of an intake valve and an exhaust valve; and a controller connected to each of the injector, the spark plug, and the variable valve mechanism (23, 24), the controller configured to output control signals to the injector, the spark plug, and the variable valve mechanism (23, 24), wherein the controller is configured to output a control signal to the variable valve mechanism (23, 24) so as to perform valve control of opening the intake valve when the exhaust valve is open, and then output a control signal to the spark plug at predetermined ignition timing such that, SPCCI combustion, in which after air-fuel mixture is ignited and combustion is started, unburned air-fuel mixture is combusted by autoignition, is performed, characterized by a supercharging system provided to the engine, the supercharging system configured to supercharge the combustion chamber with gas to be introduced thereinto, wherein in a case where the controller performs the valve control and the SPCCI combustion while the supercharging system is performing supercharging, the controller is configured to make an overlap period, in which the intake valve and the exhaust valve are both open, constant regardless of change of load on the engine, and when performing the valve control and non-supercharge SPCCI combustion, the controller is configured to output a control signal to the variable valve mechanism (23, 24) such that the overlap period is longer when load on the engine is high, than that when load on the engine is low.