just to store the PID of the PlayerSupervisor in the ZoneGenServer?
This would be not robust enough if the PlayerSupervisor crashes for some reason. One way would be to make ZoneGenServer trap exists of the respective PlayerSupervisor and also crash upon PlayerSupervisor crash, but that would mean you are implementing part of OTP already provided. I would go with the following (ZoneSupervisor is started with :rest_for_one strategy, all others with :one_for_one):
————————————————————
| ZoneSupervisor |
————————————————————
⇓ ⇓
———————————————————— ——————————————————
| PlayerSupervisor | | ZoneGenServer |
———————————————————— ——————————————————
⇓
————————————————————
| PlayerGenServer |
————————————————————
Now when we are safe against crashes, the only thing would be to make ZoneGenServer aware of PlayerSupervisor. It might be done by asking ZoneSupervisor about its children and/or by name registration with {:via, module, term}. Using PID as a process handler is vulnerable to process restarts (due to crashes etc.) PID changes, the registered name does not.