Multiplayer FPS game using PhotonEngine

Hi All,


First i would like to say PhotonEngine is awesome forum for every one who want to learn Unity and Thanks every one here and PhotonEngine Team.

I am making an Multiplayer Game, Using PhotonEngine. It is an FPS Game.

When a player spawns in Game, I call

Quote
PhotonNetwork.Instantiate (playerToSpawn, new Vector3( 25f, 1f, -15f ), Quaternion.identity, 0,new object[] { (byte)team }

Now when a player dies should i remove all RPC to this player and call the above method again or use the same old Spawned Object and Reset it.

My Second Question is

When user fires weapon from Weapon in Multiplayer Game i should use Ray Cast or Bullets to Kill Enemy ?

It is my first game so can you guys please help here

Regards
SUresh

Comments

  • Question 1: It's entirely up to you as the developer the way respawns happen in your FPS game as it doesn't affect the game play. Personally I prefer using PhotonNetwork.Destory and then PhotonNetwork.Instanstiate when he is spawning again it is totally possible to do it the reseting way. I've used both. I'm pretty sure the FPS tutorial by quill18_creates on YouTube (see below link for the series) using the reseting way. However, the Unity Official merry fragmas series does it the destroy and instantiate method.

    Question 2: Use raycast to shoot across a network, unless you have something like a rocket launcher. Have you ever seen bullets in an FPS game* fly around? No. You see effects** which follow the Raycast - just PunRPC the raycast across the network; using a bullet requires you PhotonNetwork.Instantiate another gameobject each time you shoot a bullet imagine the amount of gameobjects that would be instantiated and synced over the network where the players are all using fully automatic assault rifles.

    Side note: As this is your first game (assuming first multi-player game and not first game as you understand several different concepts), I suggest following both the merry fragmas FPS Unity Official tutorial and the FPS tutorial by quill18_creates - which both use PUN free as these teach a combination of creating your first online shooter with photon, the concepts behind every FPS game and best practices (mainly Unity Official does best practices).

    I hope this helps!

    https://www.youtube.com/watch?v=NCtgbNP3AOA - Merry Fragmas by the official Unity Channel
    https://www.youtube.com/watch?v=AIgwZK151-A&list=PLbghT7MmckI7BDIGqNl_TgizCpJiXy0n9 - FPS by Quill18_creates

    *Unless seeing the bullet is a specific part of the gameplay, such as a hunting game where you can watch the bullet penetrate something

    **Such as a white tracer line