-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Events for first player in each round seem incorrectly logged #39
Comments
tacertain
changed the title
Events for first player in each round are incorrectly logged
Events for first player in each round seem incorrectly logged
May 25, 2020
Hi,
There's instructions for setting up a dev environment here:
https://github.com/jsnell/terra-mystica/wiki/Local-environment-setup
The docs are a bit of a mess and doesn't necessarily cover every single
step, but some people have successfully used these instructions in the past.
…On Mon, 25 May 2020 at 02:47, Andrew Certain ***@***.***> wrote:
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.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#39>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEUTPXRYPXHMPUIWWAEA3DRTG5XZANCNFSM4NJD3H4Q>
.
--
Juho Snellman
|
Thanks. Do you happen to know if it'll run on Postgres10? I already have one running for other reasons. Also, are there any ways to get the turn-by-turn commands issued other than going to the game page for each one? Like are there any daily/monthly dumps for the JSON that's returned by app/view-game? |
I wouldn't expect Postgres 10 to cause any trouble, the version numbers are
there just to make sure that anyone wanting to reproduce the prod
environment exactly can do so.
Unfortunately there's no full dump of game contents available.
…On Mon, 25 May 2020 at 19:20, Andrew Certain ***@***.***> wrote:
Thanks. Do you happen to know if it'll run on Postgres10? I already have
one running for other reasons.
Also, are there any ways to get the turn-by-turn commands issued other
than going to the game page for each one? Like are there any daily/monthly
dumps for the JSON that's returned by app/view-game?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#39 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEUTPUK64YXFQD3MQA3JMDRTKSHBANCNFSM4NJD3H4Q>
.
--
Juho Snellman
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The text was updated successfully, but these errors were encountered: