Even in high fantasy worlds such as Middle Earth, or future regions such as District 13, food attainment is often a satisfying backstory if it’s grown, hunted or foraged vs. developed solely in a laboratory or created entirely with magic fairy dust. If your characters consume food and medicinal plants, or if you need ancient royal, monastery or cottage farming methods, here's how it's been done in long ago times, and how, now with the backing of science, it may be done again with modern tweaks in future worlds.
In ancient America's Aztec Empire agriculture, they produced surplus food for their population even without what we consider flat, farmable land. For one, they adapted and used chinampas, which were small human-created islands floating in shallow lakes and swamps that produced abundant food crops without dry land. There were also personal gardens even in the ruling class, experimental gardens, grain storage systems, and an impressive terracing method using stone walls allowing them to grow many crops on hillsides. Good starter free in depth research here: http://www.aztec-history.com/aztec-agriculture.html
Ancient cultures in Europe, northern Africa and Asia developed intensive growing systems amidst their royal grounds, their monasteries and their peasants that produced more crops in smaller space that were more drought and frost resistant than any industrialized system has ever been able to mimic.
They sometimes operated as though the soil was a living organism that had a spirit that would grow the crops for them if they understood this spirit and provided what it needed. This form of farming and cottage gardening showed up in France, China and in various forms was used by the Romans, Greeks and Persians, and is often simply called intensive gardening or French intensive gardening/farming. Science now also understands the soil as a living organism.
For example, high producing soil has air pockets loaded with beneficial micro-organisms that create symbiotic relationships with plant roots, making them as healthy and productive as any garden in Eden. Industrialized combines compacted and destroyed that life. (If you like the idea of machinery in your fantasy novel, consider it being a hover machine instead of using industrialized tires on the ground). This method took intelligence, it couldn’t just be handed over to an untrained slave or simple-minded laborer. Here’s one PDF from the UCSC Center for Agroecology in Santa Cruz to get your research started: http://casfs.ucsc.edu/documents/for-the-gardener/French_Intensive.pdf
Back to the Americas, terra preta is the description of what appears to be human-made “Amazonian dark earth” discovered in the Amazon Basin. In areas known to have little natural fertility, terra preta is immensely fertile and the fertility lasts for hundreds if not more years with very little replenishment.
It’s under intense study now (with predictable arguments regarding how its almost magical growth abilities work. Some feel it works well only in tropical vs. temperate climates).
Believed to have originated at least 2500 years ago, a process using “biochar” is being explored to try to replicate it. Today, most of the emphasis is on its use to feed the world population while reducing global warming. Regardless of anyone's position on that, this method could be a fascinating system for your ancient or future fantasy fiction civilization. Search “biocar” and/or terra preta. And here’s a link to a commercial site that explains terra preta's origins, offers biochar research papers and sources, as well as information on their own technology and modern kilns they hope can replicate the method. (We are not affiliated, and do keep in mind that research shown here will support sales of their product, so do continue your research from here.) http://www.biochar.info/biochar.terra-preta.cfml
Ancient livestock breeds were far different from industrial and post-industrial developed world livestock. In the case of the latter, some cows have been bred to where they can only be milked by machine -- can't even be milked by hand if you wanted to. There are modern breeds that have lost some of their instincts regarding how to protect themselves and their herds from wild predators and no longer have coats that protect them in cold outdoor weather. Some poultry breeds have been bred to grow so fast their legs can break from under them.
But with the organic and grassfed/pastured farm animal movement, older breeds of livestock are being sought out and returned to some farms, with associations set up to preserve them, making it possible for you to learn about what type of chicken or cow may have lived in the meadow next to your character's ancient cottage. The cow in this photo is a Scottish Highland, which has grazed Scotland's rugged terrain since the sixth century. Both males and females have horns for predator protection. Their long hair sheds rain while their undercoat keeps them warm. To learn of many more breeds, from the Caspian horse dating back to 3000 BC Persia, to the multi-colored Navajo-Churro sheep, start your research at The Livestock Conservancy: livestockconservancy.org
Humans once made hay completely by hand and stored it outdoors even during spells of harsh weather by stacking it in a way that it maintained well without mold or rotting, even in rainy cold weather. Unlike
in modern times, where mechanical hay making means rushing and working
nonstop during sunny dry spells because when cut hay is rained on, the
crop can be destroyed, this old way of rain proofing the hay with
haycocks while it cured and while farmers moved over the fields little by little allowed far more time for making quality hay even in imperfect weather. Sometimes the stacks continued to be kept outdoors over winter, but they were also eventually stored inside once all the hay had properly cured and could be moved to the barn or covered with hay barracks.
After scything the tall grass and legumes and letting it dry, they would make "haycocks" by stacking hay around a center pole or tripod so there was air inside the stack. The stack would initially be put up on a floor of branches or some other natural method to keep it from touching the soil, because hay stacks will absorb moisture from the soil, causing rot, mildew and mold. The haycocks or stacks were made in various sizes and shapes. Search "making haycocks by hand" on Youtube, or, if you'd like to see ancient hay making using horse power, search "making haycocks with horses" on Youtube.