orionsbelt-battlegrounds / obb-rules

Licence: EPL-1.0 license
Orion's Belt BattleGrounds battle engine

Programming Languages

clojure
4091 projects

Projects that are alternatives of or similar to obb-rules

deck.zone
A board game creation tool.
Stars: ✭ 19 (+46.15%)
Mutual labels:  board-game, board
immutable-gametree
An immutable game tree data type.
Stars: ✭ 18 (+38.46%)
Mutual labels:  board-game, immutable
NemeStats
NemeStats is a completely free website for tracking board games played among a relatively stable group of players.
Stars: ✭ 43 (+230.77%)
Mutual labels:  board-game, games
rg3d-sound
Sound library for games
Stars: ✭ 58 (+346.15%)
Mutual labels:  games
Mappable
flexible JSON to Model converter, specially optimized for immutable properties
Stars: ✭ 27 (+107.69%)
Mutual labels:  immutable
AzurLaneAPI
[Project dropped] was a free (Unofficial) Azur Lane API
Stars: ✭ 12 (-7.69%)
Mutual labels:  games
Cold-Family-Feud
Host your own Family Feud game. Mobile friendly with built in buzzers.
Stars: ✭ 30 (+130.77%)
Mutual labels:  games
mach.d
Library for the D programming language.
Stars: ✭ 27 (+107.69%)
Mutual labels:  games
dobux
🍃 Lightweight responsive state management solution.
Stars: ✭ 75 (+476.92%)
Mutual labels:  immutable
boardgame-socketserver
A generic board game socket server
Stars: ✭ 39 (+200%)
Mutual labels:  board-game
l2bot
Simple and easy configurable Lineage 2 bot on AutoIt scripting language
Stars: ✭ 34 (+161.54%)
Mutual labels:  games
owlos
DIY Open Source OS for building IoT ecosystems
Stars: ✭ 43 (+230.77%)
Mutual labels:  board
hackathon-board
node.js based webapp to manage Hackathon events
Stars: ✭ 18 (+38.46%)
Mutual labels:  board
gdk-for-unity-blank-project
SpatialOS GDK for Unity Blank Project
Stars: ✭ 33 (+153.85%)
Mutual labels:  games
EnviroDIY Mayfly Logger
hardware design files, example code sketches, and documentation for Arduino-framework EnviroDIY Mayfly data logger
Stars: ✭ 25 (+92.31%)
Mutual labels:  board
inlinegamesbot
A Telegram bot providing games that can be played in any chat via inline keyboards.
Stars: ✭ 89 (+584.62%)
Mutual labels:  games
dotacard
You are at FODA artwork repository. Play now for free
Stars: ✭ 22 (+69.23%)
Mutual labels:  games
EpicGraphQL
Research about the Epic's non-documented Graphql API and main API, using Fiddler and Developer Tools to find requests and add them.
Stars: ✭ 22 (+69.23%)
Mutual labels:  games
shogi-board
ブラウザで動く将棋盤・棋譜並べ・検討用
Stars: ✭ 25 (+92.31%)
Mutual labels:  board
Tetra3d
Tetra3D is a 3D hybrid software/hardware renderer made for games written in Go with Ebitengine.
Stars: ✭ 271 (+1984.62%)
Mutual labels:  games

OBB Rules

![Gitter](https://badges.gitter.im/Join Chat.svg) Coverage Status Build Status Dependency Status

Implementation of the Orion's Belt BattleGrounds battle engine in Clojure(Script).

Board Example

Game Overview

This is a chess-like board game, played on an 8x8 board. The player has up to 8 units to play and he starts by deploying them on the first 2 rows. This is unlike chess where you have all the pieces deployed in a standard way. After both players deploy their units, one is randomly choosen to draw first blood.

Also unlike chess, each player has 6 action points to spend on his turn. Each unit has a movement cost and an attack cost. There are many units and each one has it's own gameplay tactics.

Available Actions

When deploying or during the turn, there are the following actions available:

[:deploy 10 :rain [8 8]]

Places 10 :rain units on coord [8 8]. Only possible on the deploy phase.

[:auto-deploy :firingsquad]

Gathers all available units and deploys them using a template. On this example the :firingsquad template is being used. Mainly used by the AI.

[:move [1 2] [2 3] 3]

Moves 3 units on coord [1 2] to coord [2 3]. Coords must be adjacent. The movement takes action points, depending on the selected unit's movement cost. You can do a partial move, but it will cost double action points.

[:go-to [1 2] [4 4]]

Moves all units on [1 2] to [4 4]. It tries to find a path using the unit's movement cost and movement type.

[:rotate [2 3] :north]

Rotates unit on coord [2 3] to north. It's possible to rotate to any direction and it takes 1 action point. Units can only attack to where they are faced.

[:attack [2 3] [2 6]]

Orders unit on coord [2 3] to attack unit on coord [2 6]. Takes 1 action point. They specified unit must have a range to reach the target unit.

Unit traits

All unit properties are defined on the metadata files. Units have several properties:

  • Range
  • Damage
  • Health
  • Bonus (damage and health bonus against specific categories)
  • Movement type (:normal, :front, :diagonal and :all)
  • Category (:light, :medium and :heavy)

Units may also have special powers:

  • Catapult: may attack even if other units are on the way
  • Rebound: when the target unit is destroyed, the remaining damage is given to the next unit in line
  • StrikeBack: when a unit is damage, it will also damage it's attacker
  • TripleAttack: when a unit attacks, it also damages units perpendicular to the target

These special powers can be mixed and matched and several units have one or more of them.

Installation

Add the following dependency to your project.clj file:

Clojars Project

Usage

You can create a game with a given stash for each player. A stash is an associative collection with the units and corresponding quantities to deploy.

(def stash (obb-rules.stash/create :rain 1 
                                   :crusader 2))
(def game (obb-rules.game-progress/new-game {:p1 stash :p2 stash} {:mode :annihilation})
;=> {:state :deploy, :stash {:p2 {:crusader 2, :rain 1}, :p1 {:crusader 2, :rain 1}}, :width 8, :height 8, :elements {}}

Or you can just create a game with a random stash. In this case, the same random stash is given to all players.

(obb-rules.game-progress/new-random-game {:mode :annihilation})
;=> {:state :deploy, :stash {:p2 {"toxic" 100, "anubis" 100, "heavy-seeker" 25, "nova" 25, "kamikaze" 50, "scarab" 50, "worm" 50, "crusader" 25}, :p1 {"toxic" 100, "anubis" 100, "heavy-seeker" 25, "nova" 25, "kamikaze" 50, "scarab" 50, "worm" 50, "crusader" 25}}, :width 8, :height 8, :elements {}}

Then, you can apply actions in a turn.

(obb-rules.turn/process game :p1 [:move [1 2] [2 3] quantity]
                                 [:rotate [2 3] :north]
                                 [:attack [2 3] [2 6]])

You'll get a result stating if the turn was successful and with the new board. There are several more working examples on the unit tests.

AI

This lib includes a very simple AI implementation. There is one implementation named :firingsquad that tries to mimic tipical firing squad tactics. The bot API is very simple: You pass it a board and the player to process, and it returns actions to process. The acts-as-a-bot-test has several usage examples.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].