Giter VIP home page Giter VIP logo

stevetaylordev / multiplayer-scaling-system-shooter Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 13.55 MB

An arcade shooter made in Unity, building in functionality that scales gameplay elements like health and EXP with multiple factors. Object pooling was implemented to aid performance.

License: MIT License

C# 7.80% ASP.NET 92.20%
unity multiplayer-game player-count scaling-algorithms object-pooling portfolio

multiplayer-scaling-system-shooter's Introduction

Multiplayer Scaling System (Arcade Shooter)

One of my oldest projects, built around 2016. Based on learning materials provided by Unity, this project came from a desire to build much further than what the materials covered, including functionality such as:

// Health // Health system functionality was added to the base shooter gameplay (which was built with the help of Unity tutorials), along with a health indicator to the player model, which adjusts the material color to match the current health. Player attributes such as a player number and color were also added, which could be reassigned or adjusted during gameplay.

// Multiplayer // Drop-in/drop-out multiplayer was added, with a game manager singleton handling each player, which led to the start of the scaling systems.

//Enemy Scaling // Enemy health scaling was implemented, which checks for the current difficulty level and player amount, and scales enemy max health in realtime based on an initial health value.

// Weapon // A dedicated script for weapon behaviour attributes was built, which provided functionality for customizable weapon shot speed, amount, and damage during gameplay. This was built intended to be used alongside the next scaling system that was added, EXP.

// Exp // Each player is assigned two exp values, passive exp and active exp, with each being spawned a different rates when hitting an enemy. The damage done determines how much of each will spawn. Exp is spawned when hitting an enemy, and attracts directly to the player. When an enemy is defeated, it spawns an equal amount of exp for each player (scaled with the enemy max health), then sets that exp to attract to its respective player, ignoring the others. It will also spawn exp that will float through space until a player gets close enough. This allows for a balanced multiplayer experience, with no player missing out on exp, but still allowing the chance to gain more depending on shots landed.

// Exp Increments // To keep within a reasonable limit of active rigidbodies for performance reasons, I added exp types of higher values, to be spawned when an enemy with very high health was defeated. This meant exp could be spawned with values of 5, 10, 50 etc. while keeping the same amount of physics objects active (or less).

// Object Pooling // One of the last things added to this project was object pooling, specifically to help with performance issues due to the large amounts of exp and bullets that can be spawned into the scene. This was handled by a game manager singleton, which instantiates a specified amount of each exp object type at runtime, sets each one's active state to false, and adds a reference to the respective pooled object list. Whenever an exp object is spawned, it will now search through the desired list for an inactive object reference, set its position and contents to the desired values, and set its active state to true.

My next intention with this project was to allow for weapons to be upgraded during gameplay based on current active exp, however I moved on to other projects since I felt, rather than refactor issues with the current code, I could do a better job building something from the ground up, having gained a stronger understanding of C# and Unity.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.