Id Software has been an inspiring example here, open-sourcing several historically significant game engines. https://github.com/id-Software/
However, they typically don't include the full game data; you have to use them with data from the free trial versions or contributed by the public mod community (something else Id really helped foster). Does anyone know if this is necessary for them to retain rights to the IP?