You will typically need to register an account with the game's developer and link it to your PS4 or Switch account in order to play cross-platform titles. You can play with gamers on other platforms and keep all of your devices' purchases and progress in sync if you do this.