We are developing a 3D shooter game for the Networks and Online Games subject of the Videogame Development & Design bachelor's degree. The intended goal is to have 4 different players in the game.
Link to Drive to see the deliveries and link to see the final delivery (UPC Login is required) Link to the GitHub Repository
Backfired! is an FPS free-for-all where the end goal is to get 5 points. Here's the twist, when you shoot you are also moved backwards, which can be used to jump and move in a fun and unique way. All the players can't move by any other means they would expect.
- Connectivity method: We use UDP since our game is a FPS we want a fast connectivity even if we lose some packets.
- Syncronization model: We use snapshot interpolation in combination with state interpolation.
- Network architecture: Our game has a client-server architecture and the server is not authorative since the server is listen-based.
- Object replication: We have the 4 steps that are recomended (mark, uniquely identify, indicate class, serialize) however we don't send multiple objects per packet since each client only sends their own player object.
- Object serialization: We use streams to send the data. The structure we use is:
- Header (information about the packet type and who is sending it).
- Data (depending on the packet type).
- Snapshot compression: We use fixed point to send less data losing very little precision. We also use geometry compression to use 3 numbers instead of 4 for the rotation.
- Latency hiding: We use client side prediction with client side interpolation to have both the smoothness of interpolating between packets and have less frames of delay.
- Scalability: We use instanciating both for the players and the healthpacks.
- Sergi Colomer: UI, Gameplay, Ping System, Sockets & Ports, Server to Client comunication, Chat, UIDs, Lock protection, Lerping, Closing Connections, Bug Fixing & Optimizations, QA
- Guillem Alava: UI, Gameplay, Ping System, Scenes Creation & Structure, Chat, UIDs, Lock protection, Lerping, Music & SFX, Closing Connections, Ingame Console, Bug Fixing & Optimizations, QA
- Carles López: Gameplay, Bug Fixing, QA
- Núria Lamonja: Bug Fixing, QA
As of now, Backfired! only works on LAN.
-
If working with 2 or more separate computers:
- Load HostJoin scene
- Press "Create" on one PC and "Join" on the others
-
If working on the same computer (as shown in the demo video):
- Build the project with the following scenes
- Scenes/HostJoin -> Scene 0
- Scenes/ServerHost -> Scene 1
- Scenes/ClientJoin -> Scene 2
- Open any instances of the .exe generated in the same computer
- Build the project with the following scenes
Creating/Joining a lobby:
- Fill in the input fields and press the corresponding button
- As the Host, you will be asked for your name and the server's name
- As a Player, you will be asked for your name and the server's IP
In-game Features:
- To toggle locking & unlocking the mouse, press [F1].
- To chat, click on the input field and simply write whatever you want and press Return to send the message.
- To shoot press [M1]. This is used both for shooting at your enemy and for movement.
- To look behind you press [M2] or [Left Alt].
- Use the mouse to control where the camera points.
- To mute all sound press [F11].
- To activate the in-game console press [F12].
- When a player joins, information about all players is sent, even if they aren't moving.
- The players now spawn in a random spawnpoint of a few. By doing this, we don't have to worry about the problem of spawning inside a building or too close to another player.
- We added lock protection to the lists that could be modified and read simultaniously.
- If the server is completely still when a new client joins mid-game, they won't see this player until they move themselves or even the mouse.
- Sometimes lerping and correcting the error makes the player jitter trying to correct their position. This is probably because of the difference in ms between sending and recieving messages. It is more clear when you do singular shots, as it is when the position is more dependant in predictions by the program rather than accurate positions sent by the original client.
- Environment used by ZENRIN CO., LTD., available in the Unity Asset Store