Skip to content

perfect-hand/ue5-cardgame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ue5-cardgame

Card game plugin for Unreal Engine 5.

Note: This document is work-in-progress and subject to change.

Goals

  • Common Gameplay Features
  • Blueprint API
  • Networking
  • Automated Tests
  • Savegames
  • Auto AI
  • Diagnostics
  • Simplicity
  • Documentation

Plugin Setup

  1. Close your Unreal Editor.
  2. Download the latest release.
  3. Copy the CardGame folder to the Plugins folder next to your .uproject file (create if necessary).
  4. Start the Unreal Editor.

Usage

Data

  1. Add data assets of class CardGameCard.
  2. Add data assets of class CardGameCardPile.
  3. Add data assets of class CardGameAttribute.
  4. Add a data asset of class CardGameConfiguration.
  5. Add a (blueprint) class with parent class CardGameActor and implement Init.
  6. Add a (blueprint) class with parent class CardGameActorManager and set Card Actor Class.
  7. Add a (blueprint) class with parent class CardGamePlayerController and set Actor Manager Class.
  8. Add a (blueprint) class with parent class CardGameMode and set Configuration and Player Controller Class.

Game Setup

  1. Using the Card Pile Subsystem, add cards to player piles, shuffle them and/or move cards betweem them.
  2. Using the Attribute Subsystem, set global and player attribute values.
  3. In your card game mode, call Start Game.

Structure

  • Assets: Unreal assets (Blueprintable UObjects, UDataAssets). No logic. Used by plugin users for creating their content.
  • Model: Pure model classes. No logic. Need to be copied for Auto AI.
  • Providers: Value providers (e.g. ids, random numbers). Have logic and state.
  • Services: Core game logic classes. Stateless.
  • Subsystems: Unreal blueprint access to services. Trivial delegate pattern.

Layers similar to traditional model/view/controller or endpoint/service/DAO:

  • PlayerController (components) = (replication) endpoints
  • services = services
  • providers = DAO

Design Decisions

  • Provider subsystems are used for injecting dependencies for service subsystems. These dependencies need to be available before the game mode might have been initialized.
  • RPCs for efficiency, events and secrets
  • Relations expressed by indices, not pointers, to allow for copying.
  • Player actions are just abilities. This allows Auto AI to automatically apply them.

Commit Checklist

  • Add unit tests.
  • Add detailed documentation.

About

Card game plugin for Unreal Engine 5.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages