A method of operating a piston engine, the method comprising the steps of - monitoring pressure in a plurality of cylinders of the engine, - based on the monitoring of cylinder pressure, determining the value of a first variable (CA 1, HR 1), which represents the development of cumulative heat release in a single cylinder of the engine during one or more engine cycles up to a first reference point (R 1), - comparing the value of the first variable (CA 1, HR 1) to a predetermined first target value or target range, which represents desired development of the cumulative heat release in the single cylinder up to the first reference point (R 1), - on the basis of the comparison, adjusting a first engine parameter, wherein the first engine parameter is a cylinder specific parameter affecting start of combustion in the single cylinder (104, 104a, 104b), - simultaneously with the determining of the value of the first variable (CA 1, HR 1), based on the monitoring of cylinder pressure, determining the value of a second variable (CA 2, HR 2), which represents the average development of cumulative heat release in a plurality of cylinders of the engine during one or more engine cycles up to a second reference point (R 2), the second reference point (R 2) being located at a later phase of combustion than the first reference point (R 1), - comparing the value of the second variable (CA 2, HR 2) to a predetermined second target value or target range, which represents desired average development of the cumulative heat release in the plurality of cylinders up to the second reference point (R 2), and - on the basis of the comparison, adjusting a second engine parameter, which affects combustion in the plurality of cylinders, wherein the second engine parameter is the pressure of intake air. - monitoring pressure in a plurality of cylinders of the engine, - based on the monitoring of cylinder pressure, determining the value of a first variable (CA 1, HR 1), which represents the development of cumulative heat release in a single cylinder of the engine during one or more engine cycles up to a first reference point (R 1), - comparing the value of the first variable (CA 1, HR 1) to a predetermined first target value or target range, which represents desired development of the cumulative heat release in the single cylinder up to the first reference point (R 1), - on the basis of the comparison, adjusting a first engine parameter, wherein the first engine parameter is a cylinder specific parameter affecting start of combustion in the single cylinder (104, 104a, 104b), - simultaneously with the determining of the value of the first variable (CA 1, HR 1), based on the monitoring of cylinder pressure, determining the value of a second variable (CA 2, HR 2), which represents the average development of cumulative heat release in a plurality of cylinders of the engine during one or more engine cycles up to a second reference point (R 2), the second reference point (R 2) being located at a later phase of combustion than the first reference point (R 1), - comparing the value of the second variable (CA 2, HR 2) to a predetermined second target value or target range, which represents desired average development of the cumulative heat release in the plurality of cylinders up to the second reference point (R 2), and - on the basis of the comparison, adjusting a second engine parameter, which affects combustion in the plurality of cylinders,