• Stars
    star
    906
  • Rank 50,411 (Top 1.0 %)
  • Language GDScript
  • License
    GNU Affero Genera...
  • Created about 4 years ago
  • Updated 5 months ago

Reviews

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

Repository Details

A framework which comes with prepared scenes and classes to kickstart your card game, as well as a powerful scripting engine to use to provide full rules enforcement.

Godot Card Game Framework 2.2

GUT

Godot Card Game Framework preview image

This framework is meant to provide well designed, statically typed, and fully commented classes and scenes which you can plug into any potential card game to handle typical behaviour expected from cards in a game in a polished manner.

Pull requests are more than welcome ;)

Provided features

  • Complete card text and rules enforcement capacity, via provided Scripting Engine! (see scripting engine features, below)
  • Tween & GDScript-based animations that look good for card movements.
  • Customizable card highlights
  • Supports Rich Text for card text, including embedded images.
  • Choice between Oval or Straight hand shape
  • Automatic focus-in on cards when moused over in-hand.
  • Automatic re-arranging of hand as cards are added or removed.
  • Drag & Drop of cards on table and between containers
  • Supports having multiple hands and piles.
  • Piles of cards represent their size visually.
  • Larger image of card when moving mouse cursor over it
  • Pop-up buttons for predefined functions on cards and card containers
  • Option to look inside the piles and choose cards to move out
  • Cards can rotate on the table
  • Cards can attach to other cards and move together as a group.
  • Cards can target other cards with a draggable arrow
  • Can flip cards face-down and view them while in that state
  • Can add tokens on cards. Tokens expand in the own drawer for more info.
  • Ability to define cards in standard dictionaries
  • Ability to split card definitions into sets
  • Automatically resizing text inside cards to fit the card size.
  • Supports resizing the window, in all stretch modes (including disabled stretch)
  • Can select layout of your CardContainers from a simple drop-down menu.
  • Automatic and manual Grid-based, or Free-form placement on the board, or a combination of both, on a per-card-type basis.
  • Functions from saving/loading settings from disk.
  • Caching mechanisms to reduce loading and instancing times.
  • Collecting game statistics
  • Easy customization via Themes. Dark Theme used in Demo, provided by Mounir Tohami
  • A functional and customizable Card Library.

Godot Card Game Framework card library preview image

  • A functional and customizable Deck Builder.

Godot Card Game Framework deck builder preview image

Scripting Engine Features

  • Can define card scripts in plain text, using dictionaries.
  • Can set cards to trigger off of any board manipulation.
  • Can filter the triggers based on card properties, or a special subset.
  • Can define optional abilities.
  • Can define multiple-choice abilities.
  • Can calculate effect intensity based on state of the board during runtime.
  • Can request simple inputs from the player during execution.
  • Tag-marking scripts which can be filtered by scripts triggering off of them.
  • Can store results from one script to use in another.
  • Can be plugged into by any object, not just cards.

All of the above while being very easily extensible to your own game's special requirements through simple dictionaries.

Easy Customization

The classes provide some easy customization options, such as the card size, how the card move, where they appear etc.

Check the Behaviour Constants of CFConst.gd for detailed information on what each does.

For more fine-tuned customization than that, you'll need to modify the code manually

Easy to Upgrade

This Framework has been designed with the idea that it can easily be upgraded to receive new features. Look at the Upgrade section within the Install guide for more info.

Usage

Most of the card manipulation functionalities work without any extra work, as long as the relevant scenes have been setup correctly (see Installation). For example, the code which handles moving cards around or focusing on them etc should work out of the box.

However some effects require some trigger, such as targeting of cards etc. The method calls to perform these are available to use and some demo functions have been provided to understand how it works, but it is expected that each game will provide their own logic in their own scripts to call the relevant methods.

You can find documentation about all the provided methods in the wiki

Demonstrations

Card Manipulation buttons

Hover over the card to reveal its manipulation buttons.

Targeting

Right-click and hold on a a card to begin dragging a targeting arrow. Release right-click on top of a card to target it.

Attachments

Click on the "Enable Attachment" toggle to make all cards act as attachments and therefore allow them to attach to others.

Card Rotation

Click on either the 'T' or '@' buttons. Click again the same button to revert to 0 degrees.

Tokens/Counters

Click on the 'O' Button, to start adding one of four random tokens to the card.

Click on the +/- buttons next to each Token to add/remove that token specifically

Card Flip Face-Up/Face-Down

Click on the 'F' button to exchange between these two states

Grid-placement

The demonstration board has been setup with two different grid placements you can use. Try drag & dropping a card to either "PlacementGridDemo" or "This Grid has a modified label".

Card Scripts

The first four cards you will draw from your deck each have different prepared automations. Their text explains these effects.

You can double click any of them in the hand or board to see their scripts in action.

Some of them have also effects that trigger off of other effects.

Mind that their script effect change, depending on whether they're in the hand or board, so make sure you move them to the board first if you want to see those scripts in action.

Installation

Please see the Install Guide

Scripting Engine

One of the most powerful features of this framework, is the possibility to easily script each individual card's abilities from start to finish, so that a player only needs to double-click on a card and your code will handle the proper execution. This allows games to very easily create complete rules enforcement of all card abilities, from the simplest to the most tricky ones.

Please see the [ScriptingEngine](SCRIPTING_ENGINE] and ScriptDefinitions documentation for more details.

The game comes with some sample scripted cards which can be found under res://src/custom/cards/sets.

Getting help, talking dev, or general chat

You can join us on Matrix (https://matrix.to/#/!UdtRNwYEDJcLdQigxS:matrix.org) or Discord (https://discord.gg/AjZMFY7jD4)

Contributing

Please see the Contribution Guide

Support

If you wish to support the development of the Card Game Framework, consider becoming a patron via liberapay

Credits

Some initial ideas were taken from this excellent Godot Card Game Tutorial video series. This framework uses some of the concepts but also attempts to create better quality code in the process.

License

This software is licensed undel AGPL3. However an addendum has been added to allow distribution via Steam and integration with Steamworks SDK.

Games Made with CGF

More Repositories

1

AI-Horde

A crowdsourced distributed cluster for AI art and text generation
Python
450
star
2

hypnagonia

Therapy through Nightmares
GDScript
97
star
3

Android-Netrunner-OCTGN

The Game Definition for the Android:Netrunner LCG OCTGN plugin
Python
87
star
4

pythorhead

A python library for interacting with Lemmy
Python
77
star
5

Lucid-Creations

A simple client to create Stable Diffusion images without any dependencies or hardware requirements
GDScript
71
star
6

AI-Horde-Worker

This repo turns your PC into a AI Horde worker node
Python
65
star
7

fedi-safety

A script that goes through a lemmy images in storage and tries to prevent illegal or unethical content
Python
62
star
8

subredditScrubber

A script for removing all posts from a subreddit from any number of days ago.
Python
42
star
9

Stable-Horde-Client-Addon

A Godot addon for using Stable Horde
GDScript
39
star
10

KoboldAI-Horde-Bridge

Turns KoboldAI into a crowdsourced distributed cluster
Python
31
star
11

Fragment-Forge

A card game about the demoscene
GDScript
23
star
12

godot-hexgrid_tileset_demo

A godot demo of connecting tilemaps to a hex grid
GDScript
21
star
13

fediseer

Somethig something stop bad instances
Python
19
star
14

nataili

Python
13
star
15

Stable-Horde-Styles

Styles to use to enhance Stable Horde prompts in various tools
13
star
16

lemmy-tagginator

A script that attempts to tag all posts from specific communities
Python
13
star
17

threativore

A Thrediverse bot fight against spam
Python
12
star
18

Star-Wars-LCG-OCTGN

The Star Wars:The Card Game LCG game definition for OCTGN.
Python
10
star
19

AI-Horde-image-model-reference

9
star
20

pictrs-safety

Provides an API which can be used by pict-rs `external_validation` option
Python
8
star
21

mastodon-stable-horde-generate

A mastodon bot generating stable diffusion images as replies
Python
6
star
22

Doomtown-for-OCTGN

The Game Definition for Doomtown's OCTGN plugin
HTML
5
star
23

Hypnagonia-Softprompt

A script for scraping all posts from a subreddit
Python
4
star
24

CoC-LCG-for-OCTGN

The Game Definition for Call of Cthulhu LCG OCTGN plugin
Python
4
star
25

Dune-CCG-for-OCTGN

The Game Definition for the Dune CCG's OCTGN plugin
Python
4
star
26

reddit-stable-horde-generate

A Reddit bot generating stable diffusion images as replies
Python
3
star
27

pythonseer

A Python package to interact with Fediseer
Python
3
star
28

Netrunner-OCTGN

The Game Definition for the Netrunner CCG OCTGN plugin
Python
3
star
29

Simple-AI-Horde-Colab

Jupyter Notebook
3
star
30

Fluxa-Avataria

Script that randonly changes your social media avatars/banners at set intervals using the AI Horde.
Python
3
star
31

hordelib

A thin wrapper around ComfyUI to allow use by AI Horde.
Python
2
star
32

os-hardening

Ansible Collection for OS-agnostic hardening
YAML
2
star
33

7thSea-for-OCTGN

The Game Definition for the 7th Sea CCG OCTGN plugin
HTML
2
star
34

ansible-ops-playbooks

Some useful playboot (suite) that I've designed for my day to day in UNIX ops.
1
star
35

Doomtown-Reloaded-OCTGN

Doomtown:Reloaded on OCTGN
Python
1
star
36

exelisty

Evolving Spotify Playlists
1
star
37

Spycraft-CCG-for-OCTGN

The Game Definition for the Spycraft CCG's OCTGN plugin
HTML
1
star
38

reddit-mod-transparencies

A script which allows you to mirror mod pages to make public.
Python
1
star
39

CGF-Stats

A basic REST API service running on python to use for storing Card Game Framework game stats.
Python
1
star
40

ansible-inventories

Collection with custom ansible inventories
Python
1
star
41

hypnagonia-telemetry

A web service for collecting telemetry from Hypnagonia instances
Python
1
star
42

div0-theme

Theme for Divisions by Zer0
CSS
1
star
43

workstation_setup

A playbook to quickly re-set a new workstation
Shell
1
star
44

ansible_collection-hitachi_ops_center

Python
1
star