• Stars
    star
    954
  • Rank 47,914 (Top 1.0 %)
  • Language
    C#
  • License
    MIT License
  • Created almost 9 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🎮 A multiplayer first person shooter game based on Unity Game Engine

Multiplayer-FPS

PRs Welcome License: MIT Template from jarvis

A multiplayer first-person shooter game based on Unity3D. Different types of input devices are supported, including Kinect, Xbox controllers, Leap motion, and VR Glasses. (Each contained in a different branch, UPDATE: those are not maintained since 2020, use at your own risk)

Requirement

Unity 2020.3.4f1 (LTS)

Game logic and functionality

  • Login panel

    • Input your player name and the room name you want to join
    • Click 'join or create room' button to join a room or create a new room
    • The network connection state shows on the bottom left corner img
  • Game interface

    • Player's HP on the top left corner
    • The message panel on the bottom left corner, which shows status of other players (e.g. dead or respawn)
    • A gun (AK-47) is always shown on the bottom right corner in front of every thing you can see
    • A red shooting sight is always in the center of the screen
  • Player models

    • All the original models and their animations were found from Mixamo, which is a pretty good game model website run by Adobe

    • There are three types of player models:

      • Policeman: a policeman-like model with yellow skin
      • RobotX: a robot-like model with dark pink skin
      • RobotY: a robot-like model with dark blue skin
    • Animations:

      • Walk towards four different directions
      • Run towards four different directions
      • Jump without affecting upper part body (achieved by unity3d body mask)
      • Shoot without affecting lower part body (achieved by unity3d body mask)
      • Unity Blend Tree
        • This makes the player walk or run more naturally. It uses interpolation function to map different combinations of user input to different animations.
        • img
    • State Machine

      • There are multiple layers in the player state machine.
  • Player movement

    • Walking && Running && Aiming
    • Jumping
    • Dying
  • Gun model

    • The original gun model (AK-47) was from Unity Assets Store
    • Shooting animation are added by setting keyframes in unity3d animation panel img
  • Networking

    • This game uses Photon Unity Networking 2, which is a good network model from Unity Assets Store
  • Bullet effects

    • Bullets hitting different materials will cause different effects
      • Wood
      • Ground
      • Metal
      • Concrete
      • Water
  • Door animation

    • Doors will automatically open when there is someone nearby and close when no one is around
    • Before opening
    • After opening

Script files

  • CameraRotation.cs
    • Rotates the scene camera in every updated frame
  • DoorAnimtion.cs
    • Controls the door animation and detect if the player enters or exits the door triggering area
  • FpsGun.cs
    • Controls the gun in first person view, mainly for shooting
  • TpsGun.cs
    • Controls the gun in third person view (replicated on network), mainly transform and particle effects
  • IKControl.cs
    • Ensures the model is holding a gun regardless of movements or rotations
  • ImpactLifeCycle.cs
    • Destroys the bullet object after several seconds to save CPU time and memory
  • NameTag.cs
    • Displays other players' names above their heads
  • NetworkManager.cs
    • Controls the whole network connection
  • PlayerHealth.cs
    • Calculates and updates health points of each player
  • PlayerNetworkMover.cs
    • Synchronizes the position of the player among different clients

Input Devices

  • Mouse and keyboard
    • The traditional way
    • Cheap and easy to use
  • Kinect
    • See below for details
    • This part was implemented by my friend Ruochen Jiang, many thanks to him!
  • Xbox Controller
    • Like the combination of mouse and keyboard
    • Most Xbox games use this way to play
  • Leap Motion
    • User hand gesture to control game
    • A more advanced interaction that might become popular in the future
  • VR glasses
    • More vivid and closer to reality
    • Recently very popular but devices are most likely expensive
    • Players cannot move now due to the limitation of my device

Kinect Details

  • Tools and Platform:

    • Kinect for Xbox One
    • Kinect for Windows SDK
    • Unity
    • Visual Studio
  • Recognition Method:

    • Use Kinect for Windows SKD (BodySourceManager) to get the positions of the player's skeleton. Determine the actions of moving, jumping, shooting based on these positions and regard rotation as an input of the game.
  • Shooting

    • Users can trigger shooting by lifting their right arms. The game calculates the distance between the user's right hand and right shoulder based on skeleton nodes. Shooting will be triggered if the calculated distance reaches a threshold.
  • Moving:

    • Move in the game by stepping forward, backward, leftward, and rightward. The game recognizes moving actions by the offset of right foot’s skeleton node on x-z plane. A movement will be triggered if the offset reaches a threshold.
  • Jumping:

    • Users can jump in the game. The game calculates offset of right foot’s skeleton node on the z-axis to register a jumping action. Jumping will be triggered if the calculated offset reaches a threshold.
  • View Rotation:

    • Use your right hand as a virtual mouse to control the camera rotation. The game records the initial position of the left hand as the initial position of the mouse, then calculates the camera rotation by the left hand’s offset.

Contribution

See CONTRIBUTING.md

License

MIT License

More Repositories

1

vue-typescript-admin-template

🖖 A vue-cli 3.0 + typescript minimal admin template
Vue
5,498
star
2

Automatic-Image-Colorization

🎨 Automatic Image Colorization using TensorFlow based on Residual Encoder Network
Python
169
star
3

express-webpack-react-redux-typescript-boilerplate

🎉 A full-stack boilerplate that using express with webpack, react and typescirpt!
TypeScript
165
star
4

Magic-Tower-Qt

⚔️ This is the C++(with Qt) version Magic-Tower game
C++
62
star
5

pytorch-nn-practice

💩 My pytorch neural network practice repo
Python
52
star
6

vue-typescript-admin-mock-server

🖥 Mock server for vue-typecript-admin-template project
JavaScript
42
star
7

Nightmares-VR

👻 A survival shooter game based on C# in Unity 3D, I also integrated VR (with Google Cardboard) into this game :D
C#
27
star
8

Jarvis

🤖 "Perhaps, if you intend to visit other planets, we should improve the exosystems."
TypeScript
21
star
9

vue-typescript-admin-docs

📝 The documentation source for vue-typescript-admin-template project
HCL
20
star
10

Book-Store-Management-System

A simple but useful C++ program, assignment 1 in OOP course
C++
16
star
11

pixiv-spider

🕷 哇来扒一扒p站hhhh (Web scraper for pixiv)
Python
12
star
12

upass-sfu

🚌 Python script to auto renew monthly UPass for SFU student
Python
10
star
13

Openssl-AES

🔑 Using Openssl library to encrypt and decrypt things (with AES).
C
10
star
14

K-SkyBand-Query-in-PostgreSQL

📊 K-SkyBand Query in PostgreSQL
C
6
star
15

Cocomic

💫 CMPT470 Project: An open-source platform for comic/manga collaboration
JavaScript
5
star
16

sentence-classifier-based-on-word-similarity

👀 A very simple sentence classifier based on word similarity with NLTK and rake_nltk package
Python
5
star
17

vscode-typescript-react-redux-snippets

👨‍💻 Typescript, React and Redux snippets for VSCode (followed ES6 standard)
TypeScript
4
star
18

nlp-paper-reading

🧠 Repository to remind myself of daily paper reading for NLP.
3
star
19

ZB_notepad

This is the project for “Principles of Computer Composition”
JavaScript
3
star
20

Lou-CPU

This is Lou Sir's CPU =w=
Verilog
3
star
21

lol

浙江大学LOL全国高校挑战赛 子活动作品展示页面
HTML
2
star
22

commitlint-config-armour

👀 My shareable config for commitlint
JavaScript
2
star
23

gmail-bot

🤖 Gmail bot for CMPT412 TA
Python
2
star
24

CMPT300

This is the repository for course CMPT300 assignments in SFU
C
2
star
25

Tanks

A 2 player tanks game (one keyboard) based on C# in Unity 3D
C#
1
star
26

boxbuy

This is the iOS version code for BOXBUY in ZJU [DEPRACATED]
Objective-C
1
star
27

Algorithms

🧠 Implements of Algorithms and Data Structures in C/C++/Python, also contains some codes as note like STL
C++
1
star
28

Dot-Files

✍ This repo is DEPRECATED in favor of [Jarvis](https://github.com/Armour/Jarvis)
Python
1
star
29

Handsim

This is a pretty handsome simulator of assembling and dissembling, and it is all for Lou Sir :D
C++
1
star
30

PHP_notes

sth about php
PHP
1
star
31

Space-Shooter

A simple Unity 3D game based on C#
ShaderLab
1
star
32

game-of-life-in-verilog

Game of life
Verilog
1
star
33

CMPT365

This is the repository for course CMPT365 assignments in SFU
Objective-C++
1
star
34

Resume

🙈 My resume
TeX
1
star
35

Roll-a-Ball

A simple Unity 3D game based on C#
C#
1
star
36

CMPT361

This is the repository for course CMPT361 assignments in SFU
C++
1
star
37

go-validate-npm-package-name

🔮 Go clone of https://github.com/npm/validate-npm-package-name - Check if the given string is an acceptable npm package name
Go
1
star
38

LeetCode

👨‍💻 This repo is used for storing my solution for LeetCode OJ.
C++
1
star