I would think that the ride would dictate your food requirements. A ride on asphalt which is flat would not need as much food as mountain biking up a dirt road.
For the nice flat asphalt, I have eaten a large meal a couple of hours before the ride and only drank water during the ride with no problems. I don't do the mountain bike thing but I probably couldn't make a 100km ride going down hill on a mountain bike no matter what I ate.