uewbot / dipvis Goto Github PK
View Code? Open in Web Editor NEWDjango-based visualiser for tournaments for the boardgame Diplomacy
License: GNU General Public License v3.0
Django-based visualiser for tournaments for the boardgame Diplomacy
License: GNU General Public License v3.0
Two variants, which differ in how eliminations are scored:
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.
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.
When adding a DrawProposal for the Cascadia Open tournament, there was a crash in views.py line 1006 "DrawForm has no field power_1".
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.
Roughly 5 game years are visible.
Maybe just display the last N game years ?
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.
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).
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.
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...".
To help ensure that the right count is entered for the right game, it would helpful to display the player name as well as the country.
Mostly to make ties clear. If two people are tied, they show in alphabetical order.
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).
In particular, anything referring to the "current" situation should say "final" once the tournament is over.
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.
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.
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)
In practice, 5 minutes is too long between refreshes.
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.
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.
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.
We should have the ability to store and display a picture of a player.
With a central clock, it's likely that you'd gather all the SC counts and want to enter them all together.
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...
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:
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.
Like "websockets". The Django implementation is apparently called "channels", which was created in 2016 (Django 1.8).
Documentation is at https://channels.readthedocs.io/en/latest/concepts.html
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.
In add_player_bg(), if the power played is not one that exists in Standard, we skip that board. This will not skip results from all non-Standard games, which is probably a better thing to do.
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.
It shows the correct scores for completed games, but incomplete games are all listed with all players having a score of zero.
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.
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.
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).
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.
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.
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.
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 support for keeping the scoring system (and resulting scores) secret on a per-tournament basis.
If a GameImage is going to be replaced with a new picture, ensure that this is intentional.
I found multiple issues today in view code that just hasn't been run since I switched diplomacytv.com to running python 3.
Even before any RoundPlayers are created, there should be a list of all the TournamentPlayers.
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.
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.
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.
Should be fairly easy to just add an attribute to the Player class. Can populate it from or check it against the WDD and display a flag where appropriate.
tournament/templates/base.html has code that should only display the login link if the current user is not authenticated.
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"].
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.
Where players have no WDD id, we currently have the text "None" as a hyperlink to the page being displayed.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.