A system for proton therapy treatment, comprising: a gantry comprising a nozzle configured to emit a controllable proton beam; a proton therapy treatment system operable to automatically control the gantry according to a treatment plan; and a treatment planning system comprising: a memory; and a processor operable to perform a method of generating the treatment plan, the method comprising: receiving treatment planning parameters; determining a number of spots and energy levels of the spots according to the treatment planning parameters, each spot having a separate energy level; calculating intensities for the spots according to the energy levels; discretizing the spots into a plurality of blocks according to the energy levels, locations of the spots and intensities of the spots, wherein the treatment plan comprises the plurality of blocks, and wherein each block represents a distinct energy layer to be applied by the controllable proton beam; and outputting the treatment plan. a gantry comprising a nozzle configured to emit a controllable proton beam; a proton therapy treatment system operable to automatically control the gantry according to a treatment plan; and a treatment planning system comprising: a memory; and a processor operable to perform a method of generating the treatment plan, the method comprising: receiving treatment planning parameters; determining a number of spots and energy levels of the spots according to the treatment planning parameters, each spot having a separate energy level; calculating intensities for the spots according to the energy levels; discretizing the spots into a plurality of blocks according to the energy levels, locations of the spots and intensities of the spots, wherein the treatment plan comprises the plurality of blocks, and wherein each block represents a distinct energy layer to be applied by the controllable proton beam; and outputting the treatment plan. a memory; and a processor operable to perform a method of generating the treatment plan, the method comprising: receiving treatment planning parameters; determining a number of spots and energy levels of the spots according to the treatment planning parameters, each spot having a separate energy level; calculating intensities for the spots according to the energy levels; discretizing the spots into a plurality of blocks according to the energy levels, locations of the spots and intensities of the spots, wherein the treatment plan comprises the plurality of blocks, and wherein each block represents a distinct energy layer to be applied by the controllable proton beam; and outputting the treatment plan. receiving treatment planning parameters; determining a number of spots and energy levels of the spots according to the treatment planning parameters, each spot having a separate energy level; calculating intensities for the spots according to the energy levels; discretizing the spots into a plurality of blocks according to the energy levels, locations of the spots and intensities of the spots, wherein the treatment plan comprises the plurality of blocks, and wherein each block represents a distinct energy layer to be applied by the controllable proton beam; and outputting the treatment plan.