Code Monkey home page Code Monkey logo

terra-mystica's Introduction

README

A play-by-email / play-by-web moderator for the boardgame Terra Mystica.

  • Full rules enforcement, automatic email notifications, command language + simple UI
  • Written in Perl and JavaScript
  • Uses PostgreSQL as the backing storage

terra-mystica's People

Contributors

5outh avatar amalloy avatar bcgraham avatar jsnell avatar saritonin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terra-mystica's Issues

logfile swallows faction after color pick in setup

After the last player X has picked a color during setup (expansion factions), the first initial building by the first player Y is wrongly attributed to X in the logfile. Game flow is not affected.

Example from game stans135:

alchemists 20 VP 15 C 3 W 0 P 5/7/0 PW 1/1/0/0 setup
dragonlords 20 VP 15 C 3 W 0 P 4/4/0 PW 2/0/0/0 setup
dragonlords 20 VP 15 C 3 W 0 P 4/4/0 PW 2/0/0/0 pick-color brown. build E3
fakirs 20 VP 15 C 3 W 0 P 7/5/0 PW 1/0/0/1 build D5

The "build E3" is actually an action by the first player (in this game: Auren).

Allow pass for unavailable tile during planning

'Show Result' in the Planning tab gets stuck if you try to pass bon1 if bon1 is not currently available. I want to be able to assume it will be available by the time I pass (so, unless it's the current move) and keep going with the simulation.

"Problem" in a two play game when the starting play is dropped.

I was in a two player game "1221" when the admin/creater of the game was dropped out due to his 12h time limit.
After that I had no change to end the game only the using "resign", that gave me a bad mark
(at least in my opinion) because I haven't quit the game or was dropped out. I simply had no other change.

Replace terra-mystica-spiel faction links with gamingstrategy.com links

terra-mystica-spiel.de has been down for quite a while (months?). Can we replace the faction info links with links to gaming-strategy.com?

Alchemists: http://www.gaming-strategy.com/board-games/terra-mystica/faction-strategy/faction-strategy-alchemists/
Auren: http://www.gaming-strategy.com/board-games/terra-mystica/faction-strategy/faction-strategy-auren/
Chaos Magicians: http://www.gaming-strategy.com/board-games/terra-mystica/faction-strategy/chaos-magicians/
Cultists: http://www.gaming-strategy.com/board-games/terra-mystica/faction-strategy/cultists/
Darklings: http://www.gaming-strategy.com/board-games/terra-mystica/faction-strategy/darklings/
Dwarves: http://www.gaming-strategy.com/board-games/terra-mystica/faction-strategy/dwarves/
Engineers: http://www.gaming-strategy.com/board-games/terra-mystica/faction-strategy/engineers/
Fakirs: http://www.gaming-strategy.com/board-games/terra-mystica/faction-strategy/fakirs/
Giants: http://www.gaming-strategy.com/board-games/terra-mystica/faction-strategy/giants/
Halflings: http://www.gaming-strategy.com/board-games/terra-mystica/faction-strategy/halflings/
Mermaids: http://www.gaming-strategy.com/board-games/terra-mystica/faction-strategy/mermaids/
Nomads: http://www.gaming-strategy.com/board-games/terra-mystica/faction-strategy/nomads/
Swarmlings: http://www.gaming-strategy.com/board-games/terra-mystica/faction-strategy/swarmlings/
Witches: http://www.gaming-strategy.com/board-games/terra-mystica/faction-strategy/witches/

Expansion links can continue to live where they do. I'd be happy to help you make this change with signoff and a bit of guidance!

Undocumented options

Hey,

The following default options are not documented in usage.org:

  • strict-leech
  • strict-darkling-sh
  • strict-chaosmagician-sh
  • errata-cultist-power

"Waiting for" blank when waiting for leech decisions prior to scoring

This may be intentional, but it jumped out at me. On the active games list, if a game is waiting for players to make leech decisions at the end of the round, then the "Waiting for" column has a blank field. Maybe just put something like "pre-scoring leech" in that field, or abbreviated names of both/all factions pending a decision?

Stalling with the 'done' command

Scenario:

  • I want to get the BON of the other player in a 1on1 situation but I have no other possible actions or do not want to use any other actions
  • I use the 'done' command to pass to the other player
  • It is now the other players turn who also uses 'done' to pass the turn back

The current scenario is currently unfolding in one of my games (see 0). Maybe I missed a part in the rules but it seems that the 'done' command can be abused to skip your own turn in order to get the BON of a player who'd pass after you (or for other shenanigans). Is this intended? Can I tell the player that this is a bug and he should just pass?

Change from IPv4 to IPv6 messing with SPF

I guess that the recent change at terra.snellman.net which enabled IPv6 incidentally downgraded GMails SPF rating from PASS to NEUTRAL. I don't know much about SPF but I think it is probably caused by a (missing filter)0 or the like. The problem might cause e-mails sent by terra.snellman.net to be marked as spam (as it happened to me but I can only tell for GMail).

While this does not really concern the terra-mystica code I hope it is alright that I'm still reporting it here.

Best regards,
David

When creating a private game, the players text box should contain your username

When creating a private game, you have to specify at least two users on two lines.

I wanted to start a game with a friend, and didn't understand why it didn't validate when I just entered their username.

I realized that I had to enter myself as well. It would be much more intuitive it it prefilled my name (still allowing me to remove it if I wish to create a game where only others would play.)

Bug: "Waiting for" empty when leech decision blocks

Hi jsnell! I think I found a small bug, or let's say, a scenario where I think the website was intended to behave differently. Below is a description; perhaps you agree! I hope it'll be fast to fix if you decide to. Thanks!

Description

Sometimes in the "your active games" tab, the column "waiting for" doesn't list the faction whose move the game is waiting for.

For example, in this game, all factions have passed round 4. One faction needs to make a decision on leeching before we can go to Phase III cult bonuses.

For all players in this game, in "your active games", the column "waiting for" is empty.
(The column "status" behaves as expected: for the active player, it shows "your turn", and for the waiting players, it's empty.)

Suggested solution

The column "waiting for" should always list the faction name who the game is currently waiting for, i.e. the faction that blocks the game, even if it's only by holding out on a leech decision.

Events for first player in each round seem incorrectly logged

I've been looking through the monthly JSON summaries, and I think there is a bug. For example, if you look at 4pLeague_S35_D1L1_G1 from 2020-03.json, you'll see that there are two events as turn one for one faction in each round. The darklings, for example, have both upgrade:TP and upgrade:TE marked with turn{1}{1} = 1.

It appears that the faction that moves first in each round has all of their events except the first one tallied with a turn number one less than it should be (i.e. all the events for the darklings in round 1 have a turn number one too small, except for their first turn; all the events for the engineers in round 2 have a turn number one too small, except for their first turn; etc.).

I poked around in the code for a while, but I couldn't figure out what the problem is. I am suspicious of the code around maybe_advance_to_next_player in acting.pm, where start_full_move($next) maybe_advance_turn($faction, $next) are called before finish_row() is called. Because the events are logged with the turn in effect when the command is executed, but then the row is stored to the ledger with the turn after maybe_advance_turn() is called. But it seems like that would make things wrong in the other direction - that the last player in each turn would get the event logged in the proper turn and then the ledger row would be in n+1. But presumably that would get caught very quickly. So maybe that was a problem and there is some fixup somewhere else that exposed this other problem, which nobody cares about!

I looked through the commit log for a while to see if I could find a commit that had something to do with this, and I looked through the closed issues, but I couldn't find anything related. It didn't look very simple to set up a local environment, so I didn't really get any further.

Happy to dig in more if there are instructions for setting up a developer environment that I missed.

chat message notification with playerN instead of faction/name, also ui glitch with planning for another faction

I just got an email that said A chat message was sent in Wy002 by player3:. I am player 3, and I sent the message, but that notification should have said Alchemists (sparr) not player3.

Also, in the chat tab for the game, that message shows up as being from player3 (sparr) (plain text), while the next message I sent shows up correctly as from Alchemists (sparr) (with the correct black background color).

Also, after sending the first message, I encountered a glitch in the web UI. I tried to switch to the Planning tab and got Trying to read another player's notes?.

This all happened either just before or just after (sorry for not remembering which) I made a leech decision when it was not my turn to take a main action.

Play with AI?

Since the TM AI is available, can we (my friend and me) play with the AI?

Player/faction order in the json?

Is there a way to determine this? The "faction" object isn't ordered, as you'd expect. I looked in the round 0 events data and there doesn't seem to be any useful information from the "order:x" events.

Instructions for running local server

I'm interested in investigating a possible bug, and wanted to reproduce it locally so that I can (a) confirm that it exists, and (b) try fixing it if so. But I don't see anything in the README about how to run it myself. It looks like deploy.pl might do it, but I'm not sure how to use that script, or what dependencies it has on how my system is already set up.

Game with Fire and Ice scoring missing the corresponding option in the JSON

As far as I can tell, this game has Fire and Ice scoring enabled, https://terra.snellman.net/game/OffSeason20Rematch01 , but only the following options set in 2016-05.json: 'option-email-notify', 'SCORE1', 'option-strict-chaosmagician-sh', 'option-errata-cultist-power', 'SCORE9', 'faction-count', 'option-variable-turn-order', 'option-strict-darkling-sh', 'option-shipping-bonus', 'SCORE6', 'option-mini-expansion-1', 'option-strict-leech', 'SCORE4', 'option-temple-scoring-tile', 'SCORE7', 'SCORE3' .

Feature request: Add relative turn order to "Waiting for [faction]"

On my list of active games it tells me "Waiting for" then the faction whose turn is pending. However, I can't memorize the current turn order in every game I'm in; it would be slightly useful to append a number to that column telling me how many more players there are between them and me.

"Waiting for darklings (1)" might indicate that I'm next, while "Waiting for darklings (4)" means I just had my turn, followed by darklings who haven't moved yet, followed by 3 other players.

Could also be (0) and (3) for those same situations.

Feature request: "+income" planning command

I want to plan across multiple turns without needing to deal with cult income or other game-mandatory decisions that are troublesome for me to predict. I find that I have to plan one turn, then look at my income, then +c +p +pw, then plan the next turn. But if I go back and change something about the first turn then I need to re-check its results and change the income lines. I would love to be able to just stick "+income" or something similar in there to have it bump my resources by whatever my current income level is.

Planning mode lets you dig as a cult reward with BON4

In a recent game, I did some planning:

Send P to Air.
Send P to Air.
Pass BON4.
Transform I9 to Red.

The round bonus was 4 Air -> Spade, and I needed the +1Ship from BON4 to reach I9. This worked in planning, but when it was executed in the real game, it informed me that I9 was out of reach. After reading the FAQ, I know this is the correct behavior, but it would be good if the planning pane respected the same rules as the "real" one.

Auction mode

Can you add the option to launch the game with an auction on four randomly selected factions or after banning colors?

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.