We propose an automated protocol for designing the energy landscape of a protein energy function by optimizing its parameters. The parameters are optimized so that not only the global minimum energy conformation becomes native-like, but also the conformations distinct from the native structure have higher energies than those close to the native one. We classify low-energy conformations into three groups, super-native, native-like, and non-native conformations. The super-native conformations have all backbone dihedral angles fixed to their native values, and only their side-chains are minimized with respect to energy. On the other hand, the native-like and non-native conformations all correspond to the local minima of the energy function. These conformations are ranked according to their root-mean-square deviation (RMSD) of backbone coordinates from the native structure, and a fixed number of conformations with the smallest RMSD values are selected as native-like conformations, whereas the rest are considered as non-native ones. We define two energy gaps Eg1 and Eg2. The energy gap Eg1 ( Eg2 ) is the energy difference between the lowest energy of the non-native conformations and the highest energy of the native-like (super-native) ones. The parameters are modified to decrease both Eg1 and Eg2. In addition, the non-native conformations with larger values of RMSD are made to have higher energies relative to those with smaller RMSD values. We successfully apply our protocol to the parameter optimization of the UNRES potential energy, using the training set of betanova, 1fsd, the 36-residue subdomain of chicken villin headpiece (PDB ID 1vii), and the 10-55 residue fragment of staphylococcal protein A (PDB ID 1bdd). The new protocol of the parameter optimization shows better performance than earlier methods where only the difference between the lowest energies of native-like and non-native conformations was adjusted without considering various degrees of native-likeness of the conformations. We also perform jackknife tests on other proteins not included in the training set and obtain promising results. The results suggest that the parameters we obtained using the training set of the four proteins are transferable to other proteins to some extent.