Replication Issues

 Author: Jacob McLain

Posted: 2/1/24

Problem: When running multiple clients that connect to each other, some will conduct actions that aren't replicated on the others. Specifically, the host client shoots bullets that get replicated on the others while the rest of the clients are unable to provide any changes to the host or other clients. After research, the problem boils down to the ownership of the weapon used to shoot. The weapon that possessed the ability to create the bullets was created primarily in the scene of the host client. Due to this, the weapon was owned by the server but we were trying to access it from a client.

Solution: I have two major paths that I'm pursuing in order to fix the issue. The first doesn't require too much upheaval of the systems. The gist is that instead of transferring the actual gun to the each client, we create a copy of it that is owned by the client. That way, it belongs to the client and is therefore allowed to create the bullets on the server side as opposed to just the client side. The only problem is the method, which I'm working towards putting together.

The second solution being to rewrite the entire shooting system. Right now, it's based on the gun the player's holding. The gun has the ammo, damage, bullet type, model, etc. This solution would take all of that and put that instead in the player. This would result in a mass migration of functionality moving to the player. I would most likely create a separate component that would accept the functionality so that I don't block others from editing the player. Either way, this would result in all the shooting belonging to the player, which belongs to the client that controls it.

Comments

Popular posts from this blog

Procedural Generation - Room NavMesh Spawning

Powerups and Wall clipping