Can I allocate ViewId manually (not with PhotonNetwork.AllocateId)?

Options

I'm building a game using PUN2 and PhotonServerPlugin and designing my code in a variation of the MVC pattern. The game logic is divided into 3 layers:

  • State - serves as a "Model" from MVC.
  • Simulation (happens in real-time on Clients only, includes reading user input, shooting bullets, etc.) - corresponds to "Controller" in MVC.
  • Visualization (happens in real-time on Clients only, includes animating characters, playing VFX, etc.) - corresponds to "View" in MVC.
public class GameplayState  
{
    ...
    public List<EntityState> entities = new List<EntityState>();
    ...
}

public abstract class EntityState
{
    public int id;
}

public class UnitState : EntityState
{
    public int teamId;
}

public class RangeWeaponState : EntityState
{
    public short ammoMagazine;

    public short ammoStock;

    public double lastUseTime;
}

"State" is basically a "snapshot" of a gameplay situation; it's a collection of instances various data types, holding info like current unit health, ammo, etc. Both Client and Server have copies of GameplayState.

Core idea is that any user can connect at any time, receive a "snapshot" and recreate scene content using State.

To sync frequently updated data (like unit's positions and rotations) each Unit-GameObject also has a PhotonView with a controller-script, which read/writes to stream using OnPhotonSerializeView() method. So in order to bind PhotonView with a corresponding state I need ViewId to be the same as UnitState.id.

My questions are:

  1. Can I allocate and keep track of ViewId manually?
  2. Is it okay to have non-sequential ViewIds like 3,37,125,200 or do they have to be a sequence starting with 1?
  3. Is ViewId persistent or does it change when I transfer control over PhotonView from one user to another? Docs left me with mixed feelings.