An unofficial rules engine for the world's greatest card game.

Overview

Forge

Official repo.

Dev instructions here: Getting Started (Somewhat outdated)

Discord channel here

Requirements / Tools

  • you favourite Java IDE (IntelliJ, Eclipse, VSCodium, Emacs, Vi...)
  • Java JDK 8 or later (some IDEs such as Eclipse require JDK11+, whereas the Android build currently only works with JDK8)
  • Git
  • Git client (optional)
  • Maven
  • GitHub account
  • Libgdx (optional: familiarity with this library is helpful for mobile platform development)
  • Android SDK (optional: for Android releases)
  • RoboVM (optional: for iOS releases) (TBD: Current status of support by libgdx)

Project Quick Setup

  • Login into GitHub with your user account and fork the project.

  • Clone your forked project to your local machine

  • Go to the project location on your machine. Run Maven to download all dependencies and build a snapshot. Example for Windows & Linux: mvn -U -B clean -P windows-linux install

Eclipse

Eclipse includes Maven integration so a separate install is not necessary. For other IDEs, your mileage may vary.

Project Setup

  • Follow the instructions for cloning from GitHub. You'll need to setup an account and your SSH key.

    If you are on a Windows machine you can use Putty with TortoiseGit for SSH keys. Run puttygen.exe to generate the key -- save the private key and export the OpenSSH public key. If you just leave the dialog open, you can copy and paste the key from it to your GitHub profile under "SSH keys". Run pageant.exe and add the private key generated earlier. TortoiseGit will use this for accessing GitHub.

  • Fork the Forge git repo to your GitHub account.

  • Clone your forked repo to your local machine.

  • Make sure the Java SDK is installed -- not just the JRE. Java 8 or newer required. If you execute java -version at the shell or command prompt, it should report version 1.8 or later.

  • Install Eclipse 2018-12 or later for Java. Launch it.

  • Create a workspace. Go to the workbench. Right-click inside of Package Explorer > Import... > Maven > Existing Maven Projects > Navigate to root path of the local forge repo and ensure everything is checked > Finish.

  • Let Eclipse run through building the project. You may be prompted for resolving any missing Maven plugins -- accept the ones offered. You may see errors appear in the "Problems" tab. These should be automatically resolved as plug-ins are installed and Eclipse continues the build process. If this is the first time for some plug-in installs, Eclipse may prompt you to restart. Do so. Be patient for this first time through.

  • Once everything builds, all errors should disappear. You can now advance to Project launch.

Project Launch

Desktop

This is the standard configuration used for releasing to Windows / Linux / MacOS.

  • Right-click on forge-gui-desktop > Run As... > Java Application > "Main - forge.view" > Ok

  • The familiar Forge splash screen, etc. should appear. Enjoy!

Mobile (Desktop dev)

This is the configuration used for doing mobile development using the Windows / Linux / MacOS front-end. Knowledge of libgdx is helpful here.

  • Right-click on forge-gui-mobile-dev > Run As... > Java Application > "Main - forge.app" > Ok.

  • A view similar to a mobile phone should appear. Enjoy!

Eclipse / Android SDK Integration

Google no longer supports Android SDK releases for Eclipse. That said, it is still possible to build and debug Android platforms.

Android SDK

Reference SO for obtaining a specific release: https://stackoverflow.com/questions/27043522/where-can-i-download-an-older-version-of-the-android-sdk

Windows

Download the following archived version of the Android SDK: http://dl-ssl.google.com/android/repository/tools_r25.2.3-windows.zip. Install it somewhere on your machine. This is referenced in the following instructions as your 'Android SDK Install' path.

Linux / Mac OSX

TBD

Android Plugin for Eclipse

Google's last plugin release does not work completely with target's running Android 7.0 or later. Download the ADT-24.2.0-20160729.zip plugin from: https://github.com/khaledev/ADT/releases

In Eclipse go to: Help > Install New Software... > Add > Name: ADT Update, Click on the "Archive:" button and navigate to the downloaded ADT-24.2.0-20160729.zip file > Add. Install all "Developer Tools". Eclipse should restart and prompt you to run the SDK Manager. Launch it and continue to the next steps below.

Android Platform

In Eclipse, if the SDK Manager is not already running, go to Window > Android SDK Manager. Install the following options / versions:

  • Android SDK Build-tools 26.0.1
  • Android 8.0.0 (API 26) SDK Platform
  • Google USB Driver (in case your phone is not detected by ADB)

Note that this will populate additional tools in the Android SDK install path extracted above.

Proguard update

The Proguard included with the Android SDK Build-tools is outdated and does not work with Java 1.8. Download Proguard 6.0.3 or later (last tested with 7.0.1) from https://github.com/Guardsquare/proguard

  • Go to the Android SDK install path. Rename the tools/proguard/ path to tools/proguard-4.7/.

  • Extract your Proguard version to the Android SDK install path under tools/. You will need to either rename the dir proguard- to proguard/ or, if your filesystem supports it, use a symbolic link (the later is highly recommended), such as ln -s proguard proguard-<your-version>.

Android Build

The Eclipse plug-ins do NOT support building things for Android. They do however allow you to use the debugger so you can still set breakpoints and trace things out. The steps below show how to generate a debug Android build.

  1. Create a Maven build for the forge top-level project. Right-click on the forge project. Run as.. > Maven build...

    • On the Main tab, set Goals: clean install
  2. Run forge Maven build. If everything built, you should see "BUILD SUCCESS" in the Console View.

  3. Right-click on the forge-gui-android project. Run as.. > Maven build...

    • On the Main tab, set Goals: install, Profiles: android-debug
    • On the Environment tab, you may need to define the variable ANDROID_HOME with the value containing the path to your Android SDK installation. For example, Variable: ANDROID_HOME, Value: Your Android SDK install path here.
  4. Run the forge-gui-android Maven build. This may take a few minutes. If everything worked, you should see "BUILD SUCCESS" in the Console View.

Assuming you got this far, you should have an Android forge-android-[version].apk in the forge-gui-android/target path.

Android Deploy

You'll need to have the Android SDK install path platform-tools/ path in your command search path to easily deploy builds.

  • Open a command prompt. Navigate to the forge-gui-android/target/ path.

  • Connect your Android device to your dev machine.

  • Ensure the device is visible using adb devices

  • Remove the old Forge install if present: adb uninstall forge.app

  • Install the new apk: adb install forge-android-[version].apk

Android Debugging

Assuming the apk is installed, launch it from the device.

In Eclipse, launch the DDMS. Window > Perspective > Open Perspective > Other... > DDMS. You should see the forge app in the list. Highlight the app, click on the green debug button and a green debug button should appear next to the app's name. You can now set breakpoints and step through the source code.

Windows / Linux SNAPSHOT build

SNAPSHOT builds can be built via the Maven integration in Eclipse.

  1. Create a Maven build for the forge top-level project. Right-click on the forge project. Run as.. > Maven build...

    • On the Main tab, set Goals: clean install, set Profiles: windows-linux
  2. Run forge Maven build. If everything built, you should see "BUILD SUCCESS" in the Console View.

The resulting snapshot will be found at: forge-gui-desktop/target/forge-gui-desktop-[version]-SNAPSHOT

IntelliJ

Quick start guide for setting up the Forge project within IntelliJ.

Card Scripting

Visit this page for information on scripting.

Card scripting resources are found in the forge-gui/res/ path.

General Notes

Project Hierarchy

Forge is divided into 4 primary projects with additional projects that target specific platform releases. The primary projects are:

  • forge-ai
  • forge-core
  • forge-game
  • forge-gui

The platform-specific projects are:

  • forge-gui-android
  • forge-gui-desktop
  • forge-gui-ios
  • forge-gui-mobile
  • forge-gui-mobile-dev

forge-ai

forge-core

forge-game

forge-gui

The forge-gui project includes the scripting resource definitions in the res/ path.

forge-gui-android

Libgdx-based backend targeting Android. Requires Android SDK and relies on forge-gui-mobile for GUI logic.

forge-gui-desktop

Java Swing based GUI targeting desktop machines.

Screen layout and game logic revolving around the GUI is found here. For example, the overlay arrows (when enabled) that indicate attackers and blockers, or the targets of the stack are defined and drawn by this.

forge-gui-ios

Libgdx-based backend targeting iOS. Relies on forge-gui-mobile for GUI logic.

forge-gui-mobile

Mobile GUI game logic utilizing libgdx library. Screen layout and game logic revolving around the GUI for the mobile platforms is found here.

forge-gui-mobile-dev

Libgdx backend for desktop development for mobile backends. Utilizes LWJGL. Relies on forge-gui-mobile for GUI logic.

Comments
  • Go-Shintai and AI

    Go-Shintai and AI

    Go-Shintai of Hidden Cruelty AI paid the cost even if AI was the only player with destroyable creatures

    The Part that makes AI pay this cost need more thinking.

    AI 
    opened by Hanmac 17
  • [SQUASH MERGE] HBG 5 cards

    [SQUASH MERGE] HBG 5 cards

    Comment Kardum, Patron of Flames : The card is working but i'm wondering if there's a cleaner way to make sure Forge forgets the cards he exiles when he changes zones without dying.

    Upcoming Set 
    opened by Simisays 9
  • Evolving wilds world

    Evolving wilds world

    Depends on #1794 being merged first.

    Adds a new ISetRotation interface that can be used by GameFormatQuest to change the behavior of its own set legality checks. Adds the new quest world Evolving Wilds that uses such a combo of GameFormatQuest and ISetRotation. Basically, all core- and expansion sets are potentially legal in Evolving Wilds, but only a few at a time. After a certain number of wins, the oldest set(s) are rotated out and replaced with new ones. Both the starting sets and the rotation order is random and uses the quest name as seed.

    Why?

    In quest mode, I like the early game where I have to scramble a deck together and quickly upgrade it into something strong. At that point it gets a bit boring though, because it's more efficient to keep upgrading my already good deck than experimenting with new ones. Evolving Wilds "solves" this problem by forcing me to create new decks when my old ones get rotated out. At least in theory; this is quite experimental.

    Feel free to give feedback on the idea or execution.

    opened by Robbatog 8
  • Bugs with some adventure cards

    Bugs with some adventure cards

    Describe the bug Sapphire Dragon and Giant Killer are going to graveyard instead of exile after their adventure is cast successfully and Dread Linnorm should have creature type "Snake Dragon" but has type "Giant" instead.

    To Reproduce Steps to reproduce the behavior:

    1. Start a Game.
    2. Play the adventures of sapphire dragon and giant killer.
    3. Look into your graveyard.
    4. Go to the deck editor and search for dread linnorm.
    5. compare the creature type on his image with the type in the box above.

    Expected behavior Sapphire Dragon and Giant Killer should go to exile after their adventure is cast and should be playable as creature from exile. Dread Linnorm should have type "Snake Dragon".

    Desktop (please complete the following information):

    • OS: Windows 10
    • Version: 1.6.54.1015 - SNAPSHOT

    Additional context I found the wrong creature type on Dread Linnorm because i had in on the battlefield and it did not get destroyed by the adventure of Realm-Cloaked Giant.

    opened by Terandox-The-Pineapple 8
  • Recent ETB Changes causes problems with LKI

    Recent ETB Changes causes problems with LKI

    This Section there by #663 causes problems:

    https://github.com/Card-Forge/forge/blob/master/forge-game/src/main/java/forge/game/ability/AbilityUtils.java#L223-L225

    Without the setting for LKI the test fails, but in game it works as it should With the setting for LKI the tests pass, but in game it becomes broken

    Can one of you guys check what should be done there? @Agetian @tool4ever @Northmoc somehow fix the tests?

    Game Mechanics 
    opened by Hanmac 8
  • Adventure Mode - Game Save/World Wide set or edition filter... not just a config file.

    Adventure Mode - Game Save/World Wide set or edition filter... not just a config file.

    Is your feature request related to a problem? Please describe. I'm always frustrated when I find cards or sets that really don't belong in normal gameplay in adventure mode.

    Describe the solution you'd like The ability to filter sets upon game world creation, instead of in a config file game wide.

    Describe alternatives you've considered Staring at the monitor until the pixels updated in a fashion I willed them to using only my mind... (it doesn't work.)

    Additional context I give you a heart in the discord if you do this.

    For clarity; I'd like to see either a white list for sets at game/world creation, or the ability to create and manage planes in game (with whitelisting sets/editions), or the ability to edit and manage planes via configs (with ability to whitelist sets/editions). NOT a universal filter for the entire game, and not a file that will be overwritten with an update which is how the current config file method is.

    opened by austeregrim 7
  • Global DamageHistory

    Global DamageHistory

    Small diagram to show the new structure:

    image

    • closes #365
    • closes #685
    • closes #684

    a single call in GameAction.dealDamage creates all the data because we keep a DamageHistory Collection in Game they're already grouped by source so no need to manually merge with timestamps

    Game Mechanics 
    opened by tool4ever 7
  • SNC: Dusk Mangler and support

    SNC: Dusk Mangler and support

    What do you think of using _ to separate the alternative costs? I thought it might be nice to avoid : as it could be used for other things. ; is out as it is used so much in cost strings.

    This seems to work well for the new card as well as the old ones. Smoothed out a few things in keyword to text like unneeded "pay" always tacked on to second cost.

    Upcoming Set Game Mechanics 
    opened by Northmoc 7
  • (A)Ochre Jelly doesn't create copies if it's not in the battlefield anymore

    (A)Ochre Jelly doesn't create copies if it's not in the battlefield anymore

    My (A)Ochre Jelly died during an end step. Before its death trigger resolved, I reanimated it with Nim Deathmantle. When the delayed trigger resolved, it did nothing.

    Game Mechanics 
    opened by Samthere 6
  • [Squash Merge] YSNC 12 cards

    [Squash Merge] YSNC 12 cards

    • closes #784
    • closes #783
    • closes #788
    • closes #782
    • closes #800
    • closes #801
    • closes #781
    • closes #799
    • closes #787
    • closes #794
    • closes #786
    • closes #796 Finally managed to set up Forge on Eclipse. added all my other pulls to this one for easier testing and changing
    Upcoming Set 
    opened by Simisays 6
  • Detect Screen DPI and scale images accordingly

    Detect Screen DPI and scale images accordingly

    The change in Fskin.java is using BaseMultiResolutionImage, which needs Java version >= 9.

    Currently this handles all card images rendering and some of icons like those used in the deck editor. But some icons or icons are still not scaled:

    • Icons in the main tab.
    • Player/Opponent avatar images in the duel screen
    • Card ability icons above card images in the duel screen
    • Card details panel <- This is using HTMLText to render texts and symbols, which I am not sure how to fix.

    But I think this fix is big enough for now and can be merged first, and I will try to fix the above cases later.

    Also I only tested in my environment, so I think other should test this fix and see if it works correctly in other environments too.

    enhancement 
    opened by mousep 6
  • "Can't enter" effects (Moved Prevent$) mess up ChangedState

    Examples with Grafdigger's Cage in play:

    • Cast Ever After on Abbey Griffin. You now have a Zombie Griffin in your graveyard
    • Try to return artifact creature that got Unearth from Ghost Ark. It now lost Unearth
    • Startled Awake will transform and then stay in the graveyard, but it should be allowed to ETB

    Also combined with Containment Priest Forge allows you to order both so you could make it exile which seems wrong too.

    They should probably be done as statics?

    Game Mechanics 
    opened by tool4ever 1
  • Discarded trigger can fail when depending on static

    Discarded trigger can fail when depending on static

    When you discard a non-Spirit creature with Maskwood Nexus in play Shipwreck Sifters does not trigger.

    Easy fix would be using the new card from GameAction.changeZone to run the trigger instead of the old hand version.

    Only question is if it should also trigger if you use Ashes of the Fallen instead because it only affects Graveyard.

    But I think it should probably too?

    603.10. Normally, objects that exist immediately after an event are checked to see if the event matched any trigger conditions, and continuous effects that exist at that time are used to determine what the trigger conditions are and what the objects involved in the event look like.

    No LKI exception does apply here

    As bonus we could then finally use Defined$ TriggeredCardLKICopy on cards like Bag of Holding.

    @Hanmac your opinion?

    Game Mechanics 
    opened by tool4ever 1
  • World rule: compare by time of type presence

    World rule: compare by time of type presence

    704.5k. If two or more permanents have the supertype world, all except the one that has had the world supertype for the shortest amount of time are put into their owners' graveyards. In the event of a tie for the shortest amount of time, all are put into their owners' graveyards.

    Currently if you have 2+ ETB together you get to keep one. That case can probably be fixed with game timestamps.

    But the problem gets bigger if you animate one to cast Mirrorweave on it. Now all creatures should LTB.

    Game Mechanics Rules compliance 
    opened by tool4ever 3
  • Simulated AI: Fix multi-target spell simulation.

    Simulated AI: Fix multi-target spell simulation.

    Removes an incorrect check that was comparing two semantically different things (number of possible to choose from vs. number of targets chosen). Adds a test using Incremental Growth, where number of possible targets is 5, but the spell requires only 3 to be chosen. Includes a few minor clean ups in code being changed.

    opened by asvitkine 0
  • AI Cast Warlord's Elite with 3 basic lands and an artifact

    AI Cast Warlord's Elite with 3 basic lands and an artifact

    The AI had 2 forests, a plains and a Goblin Firebomb (artifact) out, but managed to cast Warlord's Elite. It failed when I tried to do it myself, but the AI could!

    opened by Samthere 1
Owner
Forge
Forge
a program to periodically synchronize the tanzu developer portal profile page with my latest-and-greatest

Tanzu Developer Center Feed Processor 2.0 This is meant to be a logical successor to the original feeds processor. The program pulls in data from the

Developer Advocacy 5 Jul 9, 2022
The simple, stupid rules engine for Java

Easy Rules The simple, stupid rules engine for Java™ Project status As of December 2020, Easy Rules is in maintenance mode. This means only bug fixes

Jeasy 4.2k Jan 5, 2023
Drools is a rule engine, DMN engine and complex event processing (CEP) engine for Java.

An open source rule engine, DMN engine and complex event processing (CEP) engine for Java™ and the JVM Platform. Drools is a business rule management

KIE (Drools, OptaPlanner and jBPM) 4.9k Dec 31, 2022
Get device location by telephony (SIM card) or settings without using GPS tracker.

react-native-device-country Get device location by telephony (SIM card) or settings without using GPS tracker Installation yarn add react-native-devic

dev.family 46 Nov 29, 2022
ZerotierFix - An unofficial Zerotier Android client patched from official client

Zerotier Fix An unofficial Zerotier Android client patched from official client. Features Self-hosted Moon Support Add custom planet config via file a

KAAAsS 830 Jan 8, 2023
Cardsystem - Digital card sign-in/sign-out system for the Indiana Academy

cardsystem Digital card sign-in/sign-out system for the Indiana Academy Requirements: Create system for inputing destination, companion, and estimated

null 1 Feb 23, 2022
Unofficial community-built app for the Japanese language learning tool jpdb.io.

jpdb-android Unofficial community-built app for the Japanese language learning tool jpdb.io. While the web app works in most scenarios, the goal with

null 3 Feb 15, 2022
A simple Flash Card application to assist in learning and remembering something.

a-flash-deck A simple Flash Card application to assist in learning and remembering something. This project is intended for demo app for a-navigator an

null 16 Dec 30, 2022
A multi-ride amusement park ticket application on NFC memory card

A multi-ride amusement park ticket application on NFC memory card. The security features cover mitigating: Man in the Middle attack, Rollback attack, tearing protection, Write Protection.

Jayshree Rathi 1 Nov 28, 2022
React Native plugin to manage Sim card(s) & eSim

react-native-sim-cards-manager A new library that merge multiple sim cards libraries into a single one: https://github.com/markneh/react-native-esim h

@odemolliens 11 Jan 3, 2023
OwlGram is an unofficial messaging app that uses Telegram's API.

?? OwlGram OwlGram is an unofficial messaging app that uses Telegram's API. ?? About Reproducible Builds To reproduce the build of OwlGram is only nee

OwlGram Dev 193 Dec 31, 2022
OpenL Tablets Business Rules Management System

Easy Business Rules OpenL Tablets targets the infamous gap between business requirements (rules and policies) and software implementation. Designed to

OpenL Tablets 114 Dec 17, 2022
A collection of JUnit rules for testing code which uses java.lang.System.

System Rules System Rules is a collection of JUnit rules for testing code which uses java.lang.System. System Lambda is an alternative to System Rules

Stefan Birkner 536 Dec 22, 2022
An All-In-One Macro for Hypixel Skyblock. Includes numerous features for Quality of Life that do NOT abide by the Hypixel Rules.

AIOMacro An All-In-One Macro for Hypixel Skyblock. Includes numerous features for Quality of Life that do NOT abide by the Hypixel Rules. Installation

Jackson 18 Dec 19, 2022
A Java-based template project for the FastJ Game Engine.

FastJ Java Template Program Requirements Java 16 JDK Basic understanding of Java Initial Setup Download the Template You have a few options for gettin

Andrew Dey 13 May 15, 2022
Spring boot backend for marble guessing game inspired by Squid Game TV series.

Back-end for marble guessing game inspired by Squid Game TV series. Built with Spring-boot and WebSocket.

Zaid 4 Sep 3, 2022
Realtime Data Processing and Search Engine Implementation.

Mutad The name Mutad is a reverse spelling of datum. Overview An implementation of a real-time data platform/search engine based on various technology

Shingo OKAWA 14 Aug 4, 2022
🕊️ The world's most advanced open source instant messaging engine for 100K~10M concurrent users https://turms-im.github.io/docs

简体中文 What is Turms Turms is the most advanced open-source instant messaging engine for 100K~10M concurrent users in the world. Please refer to Turms D

null 1.2k Dec 27, 2022
Sceneform React Native AR Component using ARCore and Google Filament as 3D engine. This the Sceneform Maintained Component for React Native

Discord Server Join us on Discord if you need a hand or just want to talk about Sceneform and AR. Features Remote and local assets Augmented Faces Clo

SceneView Open Community 42 Dec 17, 2022