Coder Social home page Coder Social logo

coltwi's Introduction

Overview

This is a console application that implements the FLN Bot for the board game Colonial Twilight, designed by Brian Train and published by GMT Games. The FLN Bot was designed by VPJ Arponen.

This program supports the Short, Medium and Full scenarios. You must have a copy of the board game in order to use this program.

Downloading the package

You can use this link to download the latest release: Version 2.16

If you are upgrading to a newer version and the major version numbers of the two versions are the same, then any saved games in progress will be compatible.

Simply copy the games folder from the older coltwi-x.x directory to the new coltwi-x.x directory.

Running the program

This is a Scala program, so you will need to have the Java JVM installed and make sure that the java command is on your PATH

There are two scripts provided that will start the program.

  • coltwi -- As bash script used on Mac and Linux
  • coltwi.cmd -- A Windows command file for use on Windoze

Using the program

When you first run the program, it will prompt you to enter:

  1. The scenario that you wish to play
  2. A name for your game (so your progress can be saved)

Your game is saved after each turn or Propaganda round is completed.

The next time you run the program, it will ask if you want to resume a saved game.

Entering commands

The program does not maintain the deck of cards. You must setup and shuffle the deck and then tell the program which card has been drawn. To do this you simply enter card 3.
This indicates that the third card Leadership Snatch has been drawn. You can shorten all commands to their shortest prefix so entering c 3 would have the same effect.

Use the help command to see all of the the available commands. You can get further help for a specific command by typing its name after help. For example for help on the show command type help show.

The show command allows you to inspect the current state of the board, game status, etc.

The history command allow you to review the actions of the current card or to review the entire game log.

The rollback command will let you restart the game from the beginning of any turn.

You can also abort the current action that you are playing at most prompts by entering abort.

All commands can be shorted to the prefix of the command name that is unique. The h command is actually shorthand for history.

In fact this use of abbreviated prefixes works at every prompt in the game. So if you are choosing the country where you want to train troops and police, you can enter cons to indicate Constantine or med for Medea. To select the France Track enter fra which is short for france track. If the prefix you type is not unqiue, the program will display the valid choices.
To get a list of all choices enter a question mark ?.

License

Copyright (c) 2017 Curt Sellmer

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

coltwi's People

Contributors

sellmerfud avatar

Stargazers

Michael McCarty avatar  avatar Andrew Jones avatar  avatar Chuck Strusz avatar  avatar Paul Martin avatar Peter Thorngren avatar  avatar George O'Hara avatar  avatar Nicolas avatar Mark avatar Brett Snyder avatar Jérémy Zurcher avatar  avatar  avatar Justin Honold avatar

Watchers

Jérémy Zurcher avatar  avatar  avatar  avatar Mark avatar  avatar  avatar

coltwi's Issues

Bot should consider potential special activities before forbidding an assault (and other ops?)

I want to do a troop lift and then assault. According to the manual, special activities such as troop lift can happen before, during or after an operation.


Government chooses: Execute Op & Special Activity

Choose Operation:

  1. Train
  2. Garrison
  3. Sweep
  4. Assault
    Selection: 4

There are no spaces that can be targeted by an Assault operation!

If I were allowed to do my troop lift before I could do a troop lift and move French troops where there are lots of active guerrillas, then assault them. At the moment though, this is forbidden.

Thanks,

App crashed with error

App crashed, log looks like below. Version is coltwi-2.10. Save game attached
game1.zip

Turn 14 (#10 Moudjahidine) <<<


FLN is up (2nd eligible, 14 resources)
Command (fln or ?): fln


FLN chooses: Rally

FLN executes Rally operation: Tunisia
Decrease FLN resources by -1 to 13
Exception in thread "main" java.lang.AssertionError: assertion failed: Insufficent pieces in the available box
at scala.Predef$.assert(Predef.scala:279)
at coltwi.ColonialTwilight$.placePieces(ColonialTwilight.scala:1640)
at coltwi.Bot$.placeGuerrillas(Bot.scala:178)
at coltwi.Bot$ConsiderRally$.doRallies$1(Bot.scala:992)
at coltwi.Bot$ConsiderRally$.execute(Bot.scala:1005)
at coltwi.Bot$.evaluateNode$1(Bot.scala:1673)
at coltwi.Bot$.act(Bot.scala:1679)
at coltwi.ColonialTwilight$BotCmd$.$anonfun$action$4(ColonialTwilight.scala:2223)
at coltwi.ColonialTwilight$BotCmd$.$anonfun$action$4$adapted(ColonialTwilight.scala:2223)
at coltwi.ColonialTwilight$.resolveEventCard(ColonialTwilight.scala:2409)
at coltwi.ColonialTwilight$.mainLoop(ColonialTwilight.scala:2177)
at coltwi.ColonialTwilight$.main(ColonialTwilight.scala:1989)
at coltwi.ColonialTwilight.main(ColonialTwilight.scala)

Card #56 - typo

When I did Status - All I saw this:

Active Events

Pivotal : none
Capabilities: FLN:Napalm - Scorch the countryside, FLN:Overkill - Revenge
Momentum : Dual: Hardend Attitudes

Hardend should be Hardened

v2.1 Short scenario, 1st Propaganda card bug

Short Scenario
Bug: on my 1st Propaganda card(#67) your script entirely skipped:

  • Support Phase
  • Redeploy Phase
  • Reset Phase

and then showed: 'Final Propaganda card' and 'Game Over: FLN wins!' - please take a look at attached screenshot.

PS. v1.5 worked fine
PPS. GREAT work and BIG THANK for your work
Screenshot from 2019-06-01 11:21:01

Feature request: add sectors numbers to ordinary messages, and bigger separators

The bot only mentions the Sectors Wilaya and number only when applying the "show all" command, or at least that was the only case where I have seen those used.

Normally the sectors are only referred to with their name.
I think that it would be very helpful to be able to also see their Sector "code" alonsgide with their name, maybe even with a colored text.
This could be optional eventually.

That's my suggestion and feature request.
Secondarily, I would think that adding more newlines or extra --------------------------------- could help readability. Especially when the bot does loads of stuff, I find it easy to miss something along the way.

Thank you for the bot nevertheless,

FLN - Napalm (Scorch the countryside) - card #35

The FLN bot has that capability, but the Assault spaces still cost only 2 resources for me.

List of capabilities:

Choose one:
----------------------------------------------------
1) Remove FLN:Napalm - Scorch the countryside
2) Remove FLN:Overkill - Revenge
3) Add Dual: Torture
4) Add FLN:Commandos - Zonal Commandos
5) Add FLN:Covert Movement - Cross Wilaya Coordination
6) Add FLN:SAS - Caution
7) Add FLN:Taleb Bomber - Effective
8) Add Gov:Commandos - Commandos de Chasse
9) Add Gov:Covert Movement - Dead Zones
10) Add Gov:Napalm - Effective
11) Add Gov:Overkill - Let God sort 'em out
12) Add Gov:SAS - Hearts & Minds
13) Add Gov:Taleb Bomber - Amateur
14) Finished

Assaults I just did (well, just one of them, to show the issue):

Government Assault operation
====================================================
spaces assaulted: OrleansVille, Philippeville, Sidi Bel Abbes

Choose one:
----------------------------------------------------
1) Select an assault space
2) Finished selecting assault spaces
3) Abort the entire Government turn
Selection: 1

Choose space to Assault:  Oran

Government executes Assault operation: Oran
Decrease Government resources by -2 to 14

Move the following pieces from Oran to AVAILABLE:
  1 Active guerrilla

I will Adjust my resources to compensate.

Version 2.13 won't run

This happens on both Linux and Windows, except with slightly different error messages.

On Linux:

Error: Unable to initialize main class coltwi.ColonialTwilight
Caused by: java.lang.NoClassDefFoundError: scala/Option

On Windows:

Exception in thread "main" java.lang.NoClassDefFoundError: scala/Option
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetMethodRecursive(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: scala.Option
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 7 more

Napalm card might be ignored

I got the "napalm" capability, and afterwards I assaulted in Orleasnville where I had four French troops and there were two active guerrillas and a base.

"coltwi" only told me to remove the guerrillas while the base stayed there, thus compromising the game.

Is perhaps my understanding of the game and of the card incorrect?

Many thanks,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.