Multiplayer Top-Down Shooter Template (From HEAVYART)

🚨
this should cover everything that I as a developer would need from an asset. Plus all of the top value aspects proposed by an asset.
image

Publisher: HEAVYART ([Link)](Raphael Ernaelsten) "TODO"

Unity Forum Name: TODO Twitter

Overview:

Core concepts of the Asset

  • A top down multiplayer template using Unity’s own Netcode for GameObjects

Links

Link to Documentation

Link to Changelog

Unity Version Support Matrix:

  • Minimal target support: 2017.2
  • Most recently submitted with 2017.4.33
  • Tested with:
    • 2019.1.7f1 (OSX Catalina Beta) <Metal> on Radeon Pro 555 (with Intel HD 630 )
    • 2019.1.14f1 (Windows 10) Nvidia 980

Sample Scenes and Examples

Test Number 1

  • Notes with version of asset and unity version + settings, my os, and my hardware

GIFS....

image

with the names to find scene and prefabs made obvious

image

Keeping in mind that these gifs can't possibly showcase how good this looks live.

A single frame jpg without all the gif artifacts:

image

Integrations:

  • Gaia
  • Amplify Shader Editor
  • Bolt - Visual Scripting

Support:

Caveats:

  • WARNINGS from the AUTHOR and things I ran into
‣

Notes from my testing:

And then I went into the Unity services dashboard and setup Lobby and Relay on this Unity Cloud project.

After all of that, I am finally ready to import the asset from the asset store, so I clicked ā€œopen in unityā€, downloaded it, and clicked ā€˜Import’.

Now I’m greeted with this warning (from Unity):

image

I’m going to check each of those in turn before I do this import:

  • AI Navigation 1.1.5
  • Input System 1.7.0
  • Netcode for GO 1.9.1
  • Lobby: 1.2.2
  • Relay: 1.1.1

So I am actually ahead of each of all of those except relay, which I’m spot on. I wonder what the warning is for, since I appear to already have satisfied the dependencies.

I’m going to let it install/upgrade and see what happens.

Now, Unity is warning me that I don’t have the native devices enabled and that it will have to restart unity for me to enable those. Hrmph.

image

I guess I’ll do that and then come BACK to installing my package once Unity gets restarted.

…

So, I’m finally back into unity and I’m importing the package I came here to import. This is a common thing, but a huge pet-peeve of mine. The import will override a bunch of my current project’s settings, including ones that shouldn’t have any impact on like the Audio Manager, Physics 2d, Graphics settings, Quality Settings, etc. In fact, the only ones that I can think that make sense overriding are the inputmanager, maybe. Why does this asset need to override all of these settings?

image

I’m going to capture a commit right before I import the project and allow it to override those assets and see if I can track down what this asset is actually doing to all of those assets.

Uh-Oh. This is going to be one of those days….

image

First error….

  • Failed to find entry-points:Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Assembly-CSharp-Editor.…

Second Error is actually a group of common errors:

  • Assets\HEAVYART\Top-Down Shooter Template (Netcode, Lobby, Relay)\Scripts\Lobby\LobbyManager.cs(19,21): error CS0433: The type 'Player' exists in both 'Unity.Services.Lobbies, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'Unity.Services.Multiplayer, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'

Confirmed that the Multiplayer Services package from Unity includes Lobbies and Relays already under its folder structure.

image

So … I’ll remove Lobby 1.2.2 and see if that clears up that group of errors.

Yep.

Now to do the same for Relay to fix this error:

  • Assets\HEAVYART\Top-Down Shooter Template (Netcode, Lobby, Relay)\Scripts\Lobby\LobbyGameHostingControl.cs(42,17): error CS0433: The type 'Allocation' exists in both 'Unity.Services.Multiplayer, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'Unity.Services.Relay, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'

Frak…. so after I do that, now I get issues with Lobby and Relay not working with the asset due to it calling them specific ways that their dopplegangers over in Multiplayer Services doesn’t handle:

  • Assets\HEAVYART\Top-Down Shooter Template (Netcode, Lobby, Relay)\Scripts\Lobby\LobbyGameHostingControl.cs(48,55): error CS1729: 'RelayServerData' does not contain a constructor that takes 2 arguments
  • Assets\HEAVYART\Top-Down Shooter Template (Netcode, Lobby, Relay)\Scripts\Lobby\LobbyManager.cs(154,50): error CS0234: The type or namespace name 'Instance' does not exist in the namespace 'Lobbies' (are you missing an assembly reference?)

Going back into the instructions to make sure I was supposed to install Multiplayer Services… ? Ahh, I DO NOT see it in the requirements list.

So now …. I’m removing multiplayer services and then re-adding Relay and Lobby by hand.

…

So now, lets get back to what the changes are in the assets

ā‰ļø AudioManager

image

Changed the BufferSize of the Audio…. is this needed for multiplayer? My guess is gonna be no.

ā‰ļø DynamicsManager

image
  • looks like it is reverting my serialized version, and making a handful of tweaks to the cloth settings. I don’t remember any cloth in the demos…
  • the only thing that I can image MAY have an impact on the demo scenes is the m_DefaultMaxAngluarSpeed which is sets to 7 (and the default was 50)

āœ… EditorBuildSettings

  • this one actually does have some reasonable changes, as it adds all the scenes (boot, loading, etc) into the unity Build settings.
  • Interestingly, I don’t know why com.unity.input.settings is set in here, but it is set to type 2 as well. So this one looks like a valid change.

ā‰ļø EditorSettings

This one chafes me pretty bad.

image
  • it changes the line ending for new scripts, definitely not something that this should do.
  • It removes the mCollabEditorSettings altogether
  • and then it sets a bunch of other things in the environment that are definitely not needed for this asset (like changing the cache behaviors, allowing assets to use spaces in their names, etc).
āš ļø I am merging the collabEditorSettings back inot the EditorSettings.asset

ā‰ļø GraphicsSettings

Another one that may not need to be touched by this import.

image

Reading through the changes, I can’t see anything that needed to be changed for this asset.

ā‰ļø Physics2DSettings

I’m gonna guess that this one isn’t needed either.

image

ā‰ļø ProjectSettings

This one is a huge one, and it is a mixed bag as to if its needed or not.

I see a lot of settings changed related to build targets, the stripping during compile, and even some webGL stuff, which is odd since they specifically say they don’t work with webGL. There is one that I’m very nervous about in the change — it appears to ENABLE uNet cloudService in the included ProjectSettings.

image

I*t does appear to be doing things like setting the project to allow runInBackground, as well as a resizableWindow and changing fullScreenMode to 3 which all makes sense when testing a multiplayer game on the same machine. All the other settings really don’t look like they belong here.

ā‰ļø QuestionSettings

These seem like arbitrary changes to the question settings. Though I’m sure they will change the visuals at various quality settings on in the build, again, I don’t see how this is needed for this asset.

image

āœ… InputManager

This one makes sense.

—

Testing, Testing, 123

based on what I see in the buildOrder, I grabbed the BootScene and hit play:

image

Quick Game did what I expected, but without a second client, nothing to test.

Setting up a ParrelSync clone and opening that in another editor.

Now, when I try to play…. I’m getting the message that ā€œPlayer is already a member of the lobbyā€

image

Checking the MainMenuUI and I see that this is in the JoinGamePopup area under the object title: ErrorCodeText. Lets dive in and see who sets that to the player is already a member…..

The connection to that error text area is done in the inspector:

image

So now, I know that the code that is setting the error is 100% the JoinGamePopupUIController.

Looking into his code:

private void OnFail(string reason)
{
    errorTextComponent.gameObject.SetActive(true);
    processingTextComponent.gameObject.SetActive(false);
    joinButton.interactable = true;
    errorTextComponent.text = reason;
}

So reason is in getting sent to the OnFail as a callback from the LobbyManager:

LobbyManager.Instance.JoinLobbyWithAccessCode(accessCode, OnSuccess, OnFail);

In LobbyManager, I see that the player (and his data) is setup as part of options:

options.Player = dataControl.GeneratePlayerObject(PlayerDataKeeper.name);

Where PlayerDataKeeper is a class that has things like name, etc.

  • And it has an authProfileName which is defined as the Unique Authentication Name.

So who sets authProfileName ?

Frak, there was already a section in LobbyDataControl.cs that said to uncomment if I’m using ParrelSync.

Finally!!! Works like a champ.

Left window is the first player / host, right window is the guest that joined via the code.

image

I was able to click into each window and control the avatars, though the NPC bots killed both of my players pretty quick when I was in the other window.

—

Minimum Viable Game

This template has a lot of the core game mechanics of a twitchy top down shooter as is. But with that said, the flow into a match and out of a match is rough, and the game juice isn’t there. Plus it couldn’t be shipped without Steam support.

Ideas for a complete game design :

  1. Music and SFX
    1. Using Persistent Object Spawner to spawn music track at launch of game.
    2. Then filter the audio during the match countdown… with SFX on the 3, 2, 1
    3. Switch to a new ā€œdrivingā€ combat track for the level combat
    4. Apply a filter on all UI popups
  2. Game feel:
    1. Needs sounds and aggressive music. Maybe time bullets to tempo of songs?
    2. Network sync music beats. Make ā€œfeelā€ pulses in time with beats.
    3. Couch coop building and
    4. Bullets need to have an impact
    5. Weapons should kick back.
    6. Death should feel bad, not just instant respawn.
    7. You should know scores of bots, other players, and who killed you during death scene.
    8. Respawn location shouldn't be random and near the combat every time either.
    9. Respawn location shouldn't be random and near the combat every time either.
  3. Needs to be much tighter feeling movement and aiming/colliding of bullets.
  4. There needs to be a level design with some kind of fog of war for ā€œaround the cornerā€ surprises.
  5. There needs to be a level design with some kind of fog of war for ā€œaround the cornerā€ surprises.
  6. Weapons need to be a wide variety, paper-rock-scissors balanced.
  7. Weapons need to be spawned in the level (quake style).
  8. An meta-game mechanic (rogue like) needs to be built where each match that you play gives you some kind of resource that you use to upgrade the base stats of your bot.
  9. Resources around the map can be found and collected by players for meta.
  10. Matchmaking will need to be done in a fair way.
    1. Perhaps if only queued players are too far apart, put them on a team vs bots?
    2. Which implies teams, team colors, team scoring, team points after match, etc.
  11. Bot building, customizing, styling, animation sets for walk/melee/jump/roll/death can all be purchased with level earned points.
  12. Rotating daily challenges.
    1. Play 2 pve matches on map x
    2. Get 10 melee kills
    3. Pick up 100 iron ores
  13. Meta game of refining ores over time (idle clicker style), where some of the upgrades require 100 steel plates made from 1500 iron ingots which came from 5000 iron ores collected during matches.
  14. Bot designs via socket sets using the low poly ones from synty
  15. Steam UGC for sharing bot designs
  16. Army / corp where player can register a corp and share their bot designs to corp members only. In exchange, corp gets a percentage of their members ores and points.

FSM for Local Game State

use FSM for switching between state inside of GameManager.cs and GameState.cs
have GameState fire Actions when any state is change
have MusicManager listen to GameState for different states and then turns on and cranks down the cutoff freq in the BGM WALL mixer

Level Building

‣
what about Ultimate Crafting System (UCS) ?
evaluate ā€œEasy Grid Builder Proā€
  • ASSET: UnityAssetStore Easy Grid Builder ProUnityAssetStore Easy Grid Builder Pro
  • DOCS: Introduction | Easy Grid Builder Pro DocumentationIntroduction | Easy Grid Builder Pro Documentation
  • Looks like it would be great for the interior floor building ā€œgrid basedā€ with snaps to grid instead of snapping to one another or to sockets
  • looks like it does a lot of what I’d want, including firing events when things get added (which I could hook into MP, perhaps) and allows blocking based on needed resources (make more steel plates).
  • it even has a top down switch to FPS swap to see the world from an FPS view after you’ve placed things.
  • OOOH, it looks like EGB Pro 2 will have Netcode integration and VR support
  • We’d use build conditions to block the building of the functional blocks until the player has enough resources from winning their matches
Evaluate Easy Build System
  • UnityAssetStore Easy Build System - Modular Building SystemUnityAssetStore Easy Build System - Modular Building System
  • Oh yeah, this system is still the best one.
  • I’d be using the ā€œadvanced building add-onā€ for the per component construction
  • It even has the ā€œbuggy constructor add-onā€ which lets me have a complex object with multiple ghost parts (I could do this with weapons perhaps) and and then let the player swap out one set of parts for another.
  • Oh WOW — they added a scene view editor to make things even easier to build whitebox scenes.
Try Easy Build System out in this project
  • I don’t think I’ve seen it do this before … I’m importing EBS, but its touching materials and adding tifs for the armature.fbx? Maybe they both had the same robot avatar?
image
  • Ahhh, that THIS is a sensible import setting override list!!!
image
  • TODO NOTE: I’ll need to manually merge the tags from MP TDST into EBS when I’m done.
  • maybe not — there doesn’t seem to be any tags other than vanilla in the main project:
image
  • so …. a handful of the demo scenes aren’t behaving as nice as I’d like, but that may be due to the import into an existing project, or my input system, or who knows what else. Long story short, EBS just worked about 95% of the way there imported in.
  • omg, I didn’t realize they had a GKC integration with EBS.
  • Worth noting that they have PUN2, Mirror, and fish-net network stuff too, so I bet that a netcode for gameobjects is on its way.
  • But I don't see a roadmap for ebs anywhere. Might have to assume I'm going to add netxode for GO.
  • Questions for EBS:
    1. how do I handle fBlock based maps with player placed fBlocks?
      can it do a ā€œgridā€ build system
      • No, it doesn’t appear to have any concept of grid space, just snaps and collision based.
      can I place a cube on the multiplayer scene?
      /// Event triggered when a Building Part is being placed.
      /// </summary>
      BuildingManager.Instance.OnPlacingBuildingPartEvent.AddListener((BuildingPart part) => { });
    2. Building Manager | Easy Build SystemBuilding Manager | Easy Build System
    3. So all I gotta do is on the client, when this event is fired, pass the part and (hopefully) the location data to the server for it to repeat the placement and navmesh rebuild.
    4. can I tell all the agents that the navmesh has changed?
      what is the simplest way to re-implement the grind / weld logic?
So now it is down to EasyGridBuilderPro (EGBP) vs EBS.
  • EBS, I already know a good bit about (from using it with Gestalt)
  • EBS is also the more complete asset, and which can do both placement and build states like I want, top down, and iso.
  • EGBP does have that smooth swap between top down and FPS which I want to have in Gestalt.
  • the ā€œgrid systemā€ of EGBP is really nice for what I was imagining for the interior of ship building (you get a grid of X by Y squares, perhaps not a rectangle grid even, as it will need to fit within the exterior hull choice, but the player is installing on the
Consider what I can re-use from Gestalt?

Steam Tasks

  • Starts with Toolkit for Steamworks Legacy (which covers everything before 6000)
setup Steamworks auth Authentication | Heathen KBAuthentication | Heathen KBetup
Use steam ā€œStatsā€ to track how many kills I get in a match Stats | Heathen KBStats | Heathen KB
setup steam ā€œcloud saveā€ for save file Cloud Save | Heathen KBCloud Save | Heathen KB
Setup Steam workshop to upload ā€œmapsā€ Workshop | Heathen KBWorkshop | Heathen KB

Feel

MPPM work for easier testing

upgrade this project to unity 2023.3 LTS or 6000 to be able to test with MPPM

All of this in a game that plays the combat quick in, quick out via steam deck, pc, or mobile. Then the Meta game can be played in a browser in the game or directly in a browser out of game.