That old 4 hour rule has been discredited. There is bacteria on anything left out in the air the minute it gets left out. What makes you sick is not bacteria, per se, but the amount of bacteria and type. There is no general rule that fits all foods.
This brings up another backpack food item - cheese. If my cheese gets moldy, I just cut off the mold and eat the rest. Same with bread. Never had any problem with that. My husband is horrified by this! But then he is allergic to mold and I am not.
So your individual tolerance for bad food may also be a factor.
I did get food poisoning once, in Peru. Nasty, nasty!!