The Origin of Games

Who invented them, when and why?