So why did all these ancient peoples devise these stories? There is at least one theory that in fact, the floods were real. Specifically, human beings, modern human beings, have existed since the last ice age and before. These were people no different than us, same brain capacity. So their experience with the massive and geologically sudden end to the ice age with its massive melting and rapidly rising sea levels would be remembered and reflected in their oral traditions, passed on from generation to generation and eventually captured in writing when that developed. If true, they would be the most ancient of human traditions, going back many thousands of years before the pyramids were conceived.
I suppose another theory would be that the flood as described in the bible is literally true and that all mankind descends from those few survivors, and that the shared oral traditions are the result of the memory of that distant event. Some "whisper down the lane" corruption of the story over centuries would explain the differences, and the attribution of the source of the flood to different gods, etc I suppose.
Whichever of these you prefer, both are more believable to me than the idea that all over the world, people came up with the same interesting idea for a fictional story and then decided it was such a good tale that it was the one they all would save for eternity. Seems more likely it was something real, something important that inspired these legends.
ML/NJ