Imported from https://github.com/vitchyr/multiworld