Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/NoelWidmer/unity-gameplay-framework
[deprecated] A gameplay framework to simplify Unity development.
https://github.com/NoelWidmer/unity-gameplay-framework
actor controller gameplay-framework pawn unity unity3d
Last synced: 5 days ago
JSON representation
[deprecated] A gameplay framework to simplify Unity development.
- Host: GitHub
- URL: https://github.com/NoelWidmer/unity-gameplay-framework
- Owner: NoelWidmer
- License: mit
- Created: 2017-04-04T11:23:00.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-22T20:39:07.000Z (over 6 years ago)
- Last Synced: 2024-08-03T05:18:34.173Z (3 months ago)
- Topics: actor, controller, gameplay-framework, pawn, unity, unity3d
- Language: C#
- Homepage:
- Size: 739 KB
- Stars: 42
- Watchers: 6
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unity3D Gameplay Framework
- [Introduction](#introduction)
- [Glossar](#glossar)
- [The Gameplay Framework Classes](#the-gameplay-framework-classes)
- [General](#general)
- [Controllers](#controllers)
- [Pawns](#pawns)
- [Player Managers](#player-managers)## Introduction
All objects spawned in a Unity scene are
Behaviour
s. For local games we work withMonoBehaviour
s and for networking games Unity provides usNetworkBehaviour
s. Aside from those there aren't many abstractions where Unity supports us. I came to the conclusion that great gameplay support should be a feature that ships with the engine, finding myself abandoning projects because it doesn't.I've worked with [Unreal's Gameplay Framework](https://docs.unrealengine.com/latest/INT/Gameplay/Framework/QuickReference/) which I really like and therefore want to improve Unity's gameplay layer by adding some of the things I have learned from UE4 ([Unreal Engine 4](https://www.unrealengine.com/what-is-unreal-engine-4)). However, the existing
Behaviour
code base cannot be removed as it lies at the heart of the Unity Engine.## Glossar
| Terminology | Description |
|:------------- |:--------------------- |
| Player | A player is a real human. Note that AIs (Bots) are not players. |
| Participant | Players and AIs can become participants when they request to join a game. Participants are taking part in the game and can interact with the world. They can have a huge imapact on the outcome of the game. A player spectator that is not able to interact with the world is not a participant for example. |
| Authority | The authority can either be a local client, a remote client (Host) or a server. A networking game has many actions that require to be authorized before they can happen. Win/Loose conditions are usually evaluated by the authority to prevent cheating for example. |## The Gameplay Framework Classes
The Gameplay Framework consist of a few classes that help to structure gameplay logic.
### General
#### Game Class
TheGame
class is a Singleton that provides general interaction with the game.Controller
s join theGame
to become participants for example.#### GameMode Class
TheGameMode
only exists on the authority. The authority'sGame
instance contains the onlyGameMode
across all participants. TheGameMode
constantly evaluates theGameState
for new events that require authorization. It checks win/loose conditions as a common example.#### GameState Class
AllGame
s across all participants contain a singleGameState
that is synchronized over the network. As the name suggests, this class contains the state of the game. However, not all information about the game must be stored in this class. Only data that must be autorized is required to be available in theGameState
.#### ParticipentState Class
TheGameState
contains a collection ofParticipantState
s. They contain the information of a participant that requires to be authorized. All participants have aParticipantState
.### Controllers
AController
represents the will of a player or an AI. It can possess a single pawn at the time and/or become a participant by requesting a join.#### PlayerController Class
APlayerController
is a controller that represents the will of a player.#### AIController Class
AnAIController
is a controller that represent artificial intelligence.### Pawns
AnIPawn
is an entity that can become possessed by a singleController
at a time. When possessed, a pawn follows the instructions of itsController
.#### MonoPawn Class
MonoPawn
s areIPawn
s that are used for local play. They inherit fromMonoBehaviour
.#### NetworkPawn Class
NetworkPawn
s areIPawn
s that are used for network play. They inherit fromNetworkBehaviour
and are currently not implemented due to a focus on local play for a first version of the Gameplay Framework.### Player Managers
PlayerManager
s are associated byPlayerController
s and handle the interaction between the game and the players.AIController
s do not requirePlayerManager
s because an AI doesn't require visual feedback.#### PlayerInputManager Class
APlayerInputManager
reads the input from the input devices of its player and prepares the information for itsPlayerController
. It does not interpret the input but is allowed to make device specific corrections such as applying a deadzone to an analogue stick.#### PlayerCameraManager Class
PlayerCameraManager
s are the cameramen in a game. Their main job is to position and rotate the camera correctly as well as performing any post-processing on the rendered image.#### PlayerHUDManager Class
APlayerHUDManager
is responsible to display a player's HUD (Heads Up Display).