GithubHelp home page GithubHelp logo

uewbot / dipvis Goto Github PK

View Code? Open in Web Editor NEW
7.0 5.0 4.0 3.93 MB

Django-based visualiser for tournaments for the boardgame Diplomacy

License: GNU General Public License v3.0

Python 94.64% HTML 5.36%
django python diplomacy-game tournament-manager tabletop-gaming boardgame tabletop python3

dipvis's People

Contributors

a-r-i avatar byteofkathy avatar code-review-doctor avatar dependabot[bot] avatar jasonmastbaum avatar uewbot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dipvis's Issues

CentreCount.clean() not getting called

When a new set of CentreCounts is created for a game, it is possible for powers to come back from the dead or to more than double their SC count. This should be prevented by CentreCount.clean(), but that method doesn't seem to get called.

Better support for "The Paris Method" for board seeding

For a top board in particular, the whole power-assignment process is interesting.

Ideally, we'd be able to create a GamePlayer without a Great Power and then assign the GreatPower later.
We'd want to be able to display the power selection order and also which powers were chosen by who.
These should be added to Game.news() [e.g. "John Smith chose 3rd and picked Austria", "John Smith chose to pick a country after Joe Bloggs"].

More flexible draw vote reporting

DrawProposal currently only has a boolean "passed". Tournaments might want to store and/or report more detailed info, such as the number of votes cast each way, or even which powers voted which way. Need to be careful to keep it simple for the tournaments that just want pass/fail, though...

Crash updating game

Using the admin to update game R2G3 in the Cascadia Open tournament, there was a crash in models.py at line 1362 "KeyError: player Spiros...".

Only provide useful links

The links to game images aren't useful if no images have been uploaded for that game, so they shouldn't be displayed.

Similarly, if we add a page displaying SC ownership, it should only be linked to if that data has been added for the game.

Check game ticker template

The game ticker template uses the Game's CentreCount count to decided whether to display the background or the info for the game, with the intent being that it displays the background until something happens, and then the news. Given that we always create CentreCounts for 1900 for every game, though, I suspect that it always displays news.

Add TournamentPlayer flag to indicate ineligible for awards

Possibly only for if the TD plays, but there could potentially be other people.
Scores would be calculated as usual, but when using the scores to calculate rankings, players with this flag would be skipped and listed at the end as "Not Ranked". Score would be treated as just below zero.

Add a visual index of images for each game

As it stands, the only way to see which images exist for a game is to watch the timelapse. We have the timelapse and the "latest position", but no way to really review the game. Would be nice to have a page with thumbnails of all the images for a game, particularly so you can easily pull a couple up for a side-by-side comparison and analysis.

Add support for assigning countries to maximise variety

We have two ways to assign countries: Manual, and by Preference list (with the lowest-scoring power getting their first preference). Add support for assigning countries based on which countries each player has already played during the tournament, ideally avoiding any player playing the same power more than once. May want to add support for "power groups" so that players also get variety in e.g. eastern or western powers or central and edge powers.

Division by zero adding SC counts for the final year of a game

With a game with a set end year, entering the SC counts for that year causes a division by zero exception. The backtrace is something like this:
game_scoring.py:239 GScoringSumOfSquares.save()
models.py:802 Game.scores()
models.py:1166 Game.save()
models.py:1552 CentreCount.save()
views.py:1232 sc_counts()

It seems that local variable sum_of_squares is zero.

Add a "best countries" page

Countries across the top, with a list below giving player name, score as that country, and centres as that country. Can probably just throw everybody who's played that country into the list. Obviously sort each list by score, then by dot count.

Crash adding DrawProposal

When adding a DrawProposal for the Cascadia Open tournament, there was a crash in views.py line 1006 "DrawForm has no field power_1".

Bring up-to-date

I last looked at this code in 2014. It was working then, with Django 1.6.5 (the latest release is 1.9.7) and python 2.7.10.

Add automated scoring

Ideally, we want to be able to show the audience at any time "if the game/tournament ended now, this would be the results". To achieve that, we need to be able to do on-the-fly calculations of game score and tournament score.
Adding a new scoring system would probably involve adding code, but that's likely ok as completely new systems don't come along very often and inheritance can be used for systems that differ slightly from one another. Adding them to the code (rather then as data in the database) also makes them more easily available to all users.

Add board seeding

This is an obvious feature to have.

In essence, it's just "assign these players to games". For later rounds, it's definitely good to avoid having the same people play each other again (as much as possible). It's also probably good to avoid people playing the same power again. Could also support power preferences (or power selection, as was used at DipCon 2017 at Carnage).

Add GameImages to Admin

It would be really useful to be able to see a list of GameImages and to be able to delete them, particularly in case they were added wrongly.

Split models.py up

I think the Django way is to split it into separate apps, although https://code.djangoproject.com/wiki/CookBookSplitModelsToFiles describes a way to just have multiple files that together constitute "models".
Logical groupings are:

  1. GreatPower, GameSet and SetPower
  2. Player, PlayerRanking and the other player background classes
  3. Tournament and TournamentPlayer
  4. Round and RoundPlayer
  5. Game, GamePlayer, GameImage, CentreCount, and DrawProposal
    Not clear where the various scoring systems fit in.

Player appears twice in final standings

For the Cascadia Open tournament, in the final standings, player Colin appears twice. The scores seem to be correct, and nobody seems to be missing.
This could be because he replaced Matt playing Italy. This replacement was not flagged as such in the database.

Support "unpublished" tournaments

Would be nice to add an "is_published" attribute to Tournament and to exclude unpublished tournaments from the UI for most users (initially, anyone not logged in. Once we have per-tournament permissions, anyone who doesn't have that permission).
This would allow people to experiment with tournaments on a site that is also open to the public, or to prepare a tournament in advance and "release" it when it's ready to go.

Add a player page

Page should list info about the player, link to WDD, include links to tournaments in the database, and list the "background" for that player.
Should be linked to from the SC chart page and scores pages, at least.

Support adding news items manually

There are probably "interesting events" that can't be determined algorithmically. System should allow the manual creation of news items at a board, round, and tournament level.

This was also identified in issue #7 as an easy way to meet that need.

Images need to be scaled down to fit frames

Because we're auto-refreshing images (e.g. for timelapse views), we can't rely on the user scrolling the frame. We have to ensure that the whole image is visible regardless of the frame size.

Add player background from dipvis

For the cases where a tournament is in dipvis but not (yet) in the WDD, we should add appropriate background entries for the players who participated.

Check for limits in the admin

When trying to update a Game's SC count through the Admin, I hit an error about exceeding some limit. I think we may have too many models on that page.

Better permission support

Ideally, we want to be able to grant permission for individual tournaments.

Each tournament should have a (set of) owner(s), which are the only people allowed to modify those tournaments (including rounds, games, etc of the tournament).
That means a Many-to-Many association between Tournament and User, and probably a decorator to check for permission.

Replacement player support

Rudimentary support is there - the database schema does support multiple players of a power, each with a start and end season. That's as far as it goes, though - lots of TODOs in the code note things that are broken when replacement players exist.

Add "results" page

For the tournament, add a page with per-player results to date.
A table, with player names (alphabetical) down the left and rounds across the top. Each entry contains the result (win, n-way draw, concession, elimination, loss), centre-count and year.

Add the ability to export to a csv file

The WDD imports from two csv files, one for the "classification" (the overall tournament results) and one for the "boards" (the individual board results). It should be pretty easy to generate these two files from the database.

Some games never finish

The only places where Game.is_finished is set to True are DrawProposal.save() if the draw passed, and CentreCount.save() if the final game year has been played or somebody has won.

Games should also end on reaching the end of a timed round. This could be determined algorithmically, but it may be sensible to add a mechanism to the GUI to flag a game as ended (particularly as timed round end times are usually a range).

Need to add tests for views

I found multiple issues today in view code that just hasn't been run since I switched diplomacytv.com to running python 3.

Add support for tracking SC ownership

SC ownership may well provide a lot of the information that board images do, while being much easier to add to the database.
Could add a page with a grid. SC name versus year, with the power in the body.
This could also be a good source of "news" (e.g. Being able to distinguish gaining two and losing two from staying static, and being able to provide more detail about big gains and losses)

Add Carnage scoring

Two variants, which differ in how eliminations are scored:

  1. All eliminated players get an equal share of the position points
  2. Elimination order determines position

Other than that, it's 1 point per dot, plus position points - 7000 for first down to 1000 for 7th. Ties get an equal share. Soloer gets all 28034 points.

Add support for power preference lists

Ideally, for Carnage, we want each player to enter power preferences for each round. Once players have been assigned to games, powers are assigned from lowest ranking on up. So that would be a change to the RoundPlayer class (assuming anyone playing two games would be compelled to use the same preference list for both, which seems reasonable, and doesn't necessarily mean that they'll end up playing the same power in both games).

To enter the preferences, we'd ideally like each player to have their own URL that gets sent to them in an SMS message, and we'd like to send them their country assignment by SMS, too. That would mean adding a cell phone number to the Player (or TournamentPlayer) class, and adding a way to send SMS messages (which was done in Chicago for WDC).

Make DrawProposal.proposer optional

In practice, it's not always clear which power proposed a draw, and in tournaments where they are allowed to then vote it down anyway, it doesn't actually matter that much. Thus it probably makes sense to make it optional.

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.