Skip to content
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

Open
tacertain opened this issue May 25, 2020 · 3 comments
Open

Events for first player in each round seem incorrectly logged #39

tacertain opened this issue May 25, 2020 · 3 comments

Comments

@tacertain
Copy link

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.

@tacertain 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
@jsnell
Copy link
Owner

jsnell commented May 25, 2020 via email

@tacertain
Copy link
Author

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?

@jsnell
Copy link
Owner

jsnell commented May 28, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants