You will not dream to produce food when resources run out, when energy and material runs out, and when environment is ruined. ALL agriculture needs ENERGY & MATERIALS for tools etc. Even a sufficiently UNPOLLUTED environment itself is a form of resources required for ANY agriculture. Regardless weather you are peaceful or waring, you are dead when over-sized population exhausted resources. Only way to survive is to CUT POPULATION level to fit the LIMITED resources, and it is very drastic, and only most brutal uncivilized way will be able to see a chance. Only after cutting down to a small enough level of population, you can consider how to produce food for the remaining people, with the remaining resources. But it will be surely easier when there is a smaller population.
Are you silly trying to prevent war by the poor argument that war hinders production of food hence can not have war? What rubbish? Man had wars since very beginning of own existence and almost never stop. It is the most natural and health mechanism of ELIMINATION & BALANCING. It had became so dysfunctional ever since man began a grave CHILDISH mistake of promoting Peace which was 1~2 century ago only, especially after establishing UN after WW2 to enforce global peace. This mistake shot up the population level curve in near vertical graphic scale.
https://en.wikipedia.org/wiki/World_population
https://en.wikipedia.org/wiki/File:Population_curve.svg
Look at the drastic sharp rise in the population level above. I can tell you that the shape of the curve of REMAINING GLOBAL RESOURCES is the vertical flip of this similar shape, except it is upside down and even falling more sharply due to the cumulative nature of reduction / consumption.