Browser Extension Vote-Counter (early demo)

This forum is for discussion related to the game.
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10766
Joined: April 28, 2011
Pronoun: he/they

Post Post #125 (ISO) » Wed Apr 03, 2024 8:56 am

Post by Psyche »

ooh ahh
User avatar
JacksonVirgo
JacksonVirgo
they/him
Survivor
User avatar
User avatar
JacksonVirgo
they/him
Survivor
Survivor
Posts: 13298
Joined: October 29, 2019
Pronoun: they/him
Location: ɐılɐɹʇsn∀

Post Post #126 (ISO) » Wed Apr 03, 2024 10:17 am

Post by JacksonVirgo »

In post 124, yessiree wrote: submitted another PR for some refactoring

one of them is using "view=print" mode when scraping posts, which should drastically speed up votecount generation since it potentially reduces the response payload size by over 90%! (from over 1 MB to ~40 kB per request)
Had no idea that was even an option lmao

Looked over the PR and merged it
"Am I a ghost like you, caught between the seams of two intertwining melodies?"


wiki // GTKAS
User avatar
JacksonVirgo
JacksonVirgo
they/him
Survivor
User avatar
User avatar
JacksonVirgo
they/him
Survivor
Survivor
Posts: 13298
Joined: October 29, 2019
Pronoun: they/him
Location: ɐılɐɹʇsn∀

Post Post #127 (ISO) » Tue Apr 09, 2024 11:22 am

Post by JacksonVirgo »

I am now able to work on this again with my computer fixed, I will be adding minor changes and then will be testing/compiling/releasing the new version.

Which Aureal's issues should be fixed in (thanks again yessiree <3 )
"Am I a ghost like you, caught between the seams of two intertwining melodies?"


wiki // GTKAS
User avatar
JacksonVirgo
JacksonVirgo
they/him
Survivor
User avatar
User avatar
JacksonVirgo
they/him
Survivor
Survivor
Posts: 13298
Joined: October 29, 2019
Pronoun: they/him
Location: ɐılɐɹʇsn∀

Post Post #128 (ISO) » Tue Apr 09, 2024 6:51 pm

Post by JacksonVirgo »

The new version with the fixes (and quote highlighting ig) has been compiled and can be downloaded here
"Am I a ghost like you, caught between the seams of two intertwining melodies?"


wiki // GTKAS
User avatar
yessiree
yessiree
he
Mafia Scum
User avatar
User avatar
yessiree
he
Mafia Scum
Mafia Scum
Posts: 4389
Joined: June 6, 2013
Pronoun: he

Post Post #129 (ISO) » Thu Apr 11, 2024 7:58 pm

Post by yessiree »

what are we cooking next? what's on your radar atm
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10766
Joined: April 28, 2011
Pronoun: he/they

Post Post #130 (ISO) » Thu Apr 11, 2024 8:16 pm

Post by Psyche »

i have a suggestion!
a vca tool
User avatar
yessiree
yessiree
he
Mafia Scum
User avatar
User avatar
yessiree
he
Mafia Scum
Mafia Scum
Posts: 4389
Joined: June 6, 2013
Pronoun: he

Post Post #131 (ISO) » Thu Apr 11, 2024 8:47 pm

Post by yessiree »

something more tangible and less grandeur
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10766
Joined: April 28, 2011
Pronoun: he/they

Post Post #132 (ISO) » Thu Apr 11, 2024 9:50 pm

Post by Psyche »

well i actually think it's a natural extension of the votecounter. mvp is presumably just generating more than one votecount and assigning font colors to names
User avatar
yessiree
yessiree
he
Mafia Scum
User avatar
User avatar
yessiree
he
Mafia Scum
Mafia Scum
Posts: 4389
Joined: June 6, 2013
Pronoun: he

Post Post #133 (ISO) » Thu Apr 11, 2024 9:58 pm

Post by yessiree »

would it really need to be a "votecount" though, as in a snapshot of all votes at a given time, since the underlying data would just be a collection of votes
User avatar
yessiree
yessiree
he
Mafia Scum
User avatar
User avatar
yessiree
he
Mafia Scum
Mafia Scum
Posts: 4389
Joined: June 6, 2013
Pronoun: he

Post Post #134 (ISO) » Thu Apr 11, 2024 9:59 pm

Post by yessiree »

i guess that begs the question actually: what data format would be best suited to run vca or any kind of analysis on voting behaviors
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10766
Joined: April 28, 2011
Pronoun: he/they

Post Post #135 (ISO) » Thu Apr 11, 2024 10:14 pm

Post by Psyche »

yeah its a very interesting question
User avatar
JacksonVirgo
JacksonVirgo
they/him
Survivor
User avatar
User avatar
JacksonVirgo
they/him
Survivor
Survivor
Posts: 13298
Joined: October 29, 2019
Pronoun: they/him
Location: ɐılɐɹʇsn∀

Post Post #136 (ISO) » Fri Apr 12, 2024 10:03 pm

Post by JacksonVirgo »

I very rarely delve into VCA so the extent of what I'd do right now if I work on it is to have two options. One which sees votes in relation to the gamestate itself and then one slot in relation to itself.

In relation to the gamestate is to see generated votecounts with a particular frequency (either by time, amount of votes, or amount of total posts) and just colour the known alignments. Formatted in a super condensed way (as it's a pretty large chunk of data at a time).

In relation to themselves would be to see a list of their vote progression, which would show data like time between votes and coloured so you can see data in regards to a single player
"Am I a ghost like you, caught between the seams of two intertwining melodies?"


wiki // GTKAS
User avatar
JacksonVirgo
JacksonVirgo
they/him
Survivor
User avatar
User avatar
JacksonVirgo
they/him
Survivor
Survivor
Posts: 13298
Joined: October 29, 2019
Pronoun: they/him
Location: ɐılɐɹʇsn∀

Post Post #137 (ISO) » Fri Apr 12, 2024 10:03 pm

Post by JacksonVirgo »

I have no idea how legible that post is
"Am I a ghost like you, caught between the seams of two intertwining melodies?"


wiki // GTKAS
User avatar
Thestatusquo
Thestatusquo
He/Him
Shea

User avatar
User avatar
Thestatusquo
He/Him
Shea

Shea

Posts: 14371
Joined: July 27, 2006
Pronoun: He/Him
Location: Chicago!

Post Post #138 (ISO) » Sat Apr 13, 2024 7:31 am

Post by Thestatusquo »

I am pretty leery of a tool that steps over the line from just showing players information about the current game state into the realm of helping players play the game (i.e. doing data analysis.)
tout comprendre c'est tout pardonner
User avatar
JacksonVirgo
JacksonVirgo
they/him
Survivor
User avatar
User avatar
JacksonVirgo
they/him
Survivor
Survivor
Posts: 13298
Joined: October 29, 2019
Pronoun: they/him
Location: ɐılɐɹʇsn∀

Post Post #139 (ISO) » Sat Apr 13, 2024 10:44 am

Post by JacksonVirgo »

In post 138, Thestatusquo wrote: I am pretty leery of a tool that steps over the line from just showing players information about the current game state into the realm of helping players play the game (i.e. doing data analysis.)
It's not doing the analysis though, just making the analysis less tedious to set up
"Am I a ghost like you, caught between the seams of two intertwining melodies?"


wiki // GTKAS
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10766
Joined: April 28, 2011
Pronoun: he/they

Post Post #140 (ISO) » Sat Apr 13, 2024 10:47 am

Post by Psyche »

feel like a tool that collects votes across a thread and puts them in one place is still the "showing players information about the current game state" space but yeah the frontier approaches
User avatar
Thestatusquo
Thestatusquo
He/Him
Shea

User avatar
User avatar
Thestatusquo
He/Him
Shea

Shea

Posts: 14371
Joined: July 27, 2006
Pronoun: He/Him
Location: Chicago!

Post Post #141 (ISO) » Sat Apr 13, 2024 4:14 pm

Post by Thestatusquo »

In post 139, JacksonVirgo wrote:
In post 138, Thestatusquo wrote: I am pretty leery of a tool that steps over the line from just showing players information about the current game state into the realm of helping players play the game (i.e. doing data analysis.)
It's not doing the analysis though, just making the analysis less tedious to set up
It's a tricky line I think.
tout comprendre c'est tout pardonner
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10766
Joined: April 28, 2011
Pronoun: he/they

Post Post #142 (ISO) » Sat Apr 13, 2024 5:06 pm

Post by Psyche »

Another option is to try making the votecounter more powerful!

Have been gradually building a tight pool of test cases for votecounters based on examples from games I scraped years ago.

Wonder if your matcher can correctly match the vote in this post without manual aliasing:

Spoiler:

Subject: Mini 1098 - The Mafia Experiment! - Over!
In post 231, Substrike22 wrote: 1) Which single person do you think is the most likely to be scum?

2) What seems like a likely scumteam to you?

3) What has been your strategy this game? Do you feel it's worked?

4) Who (besides yourself) has been most helpful this game?

5) Who do you think has been least helpful but not necessarily scummy?

6) Who (besides yourself) do you find most likely to be town?

7) Do you think this strategy of questions to get reads is a good one?
============================================

1) You, TMHS. Thank you for the subtle Chainsaw/OMGUS attached to your wall of post yesterday. Also your first paragraph of 221 is scummy as you try to move your early busing attempt off of your scum buddy and set up a situation to move it semi-randomly into the crowd.

UNVOTE: Amor
VOTE: TMHS

2) TMHS, Amor, and ___________

3) Decline to comment, and this is borderline role fishing.

4) Decline to answer.

5) Internet Stranger, maybe SV although SV qualifies as slightly scummy.

6) This is fishing for a town shopping list and this is a blatant scum move. Honestly you should be lynched for this question, in my opinion, if nothing else you've done.

7) I think it's a great way for scum like yourself to see where they stand in the game.

Also, EMP, can you rephrase your question from the previous page, on post 211? I don't really understand what you're asking when you say "With the 5 currently voting, that’s 7. Although, um, what exactly is the draw of a bandwagon you are selling as being more palatable to Amor and RC?"


Here's code with the playerlist and HTML of the relevant fragment of the post:

Code: Select all

def test_match_vote_by_abbreviation():
    """
    Tests that a vote for a player by abbreviation is counted.

    Relevant phases:
    1098, D1: https://forum.mafiascum.net/viewtopic.php?p=2695031#p2695031
    """
    players = ['EmpTyger', 'Nul', 'Substrike22', 'Llamarble', 'Pinewolf', 'Amor', 'Scott Brosius', 'Internet Stranger', 'themanhimself', 'Guderian', 'RobCapone', 'Shattered Viewpoint', 'chkflip', 'WeirdRa', 'brokenscraps', 'Kingcheese']
    post_content = '<span class="bbvote" title="This is an official unvote.">UNVOTE: Amor</span><br><span class="bbvote" title="This is an official vote.">VOTE: TMHS</span>'
    votes = list(VoteParser(players).from_post(post_content))
    assert votes[-1] == 'themanhimself'


A simple distance metric seems to prefer to match TMHS to a different slot, such as Amor.
User avatar
JacksonVirgo
JacksonVirgo
they/him
Survivor
User avatar
User avatar
JacksonVirgo
they/him
Survivor
Survivor
Posts: 13298
Joined: October 29, 2019
Pronoun: they/him
Location: ɐılɐɹʇsn∀

Post Post #143 (ISO) » Sat Apr 13, 2024 5:26 pm

Post by JacksonVirgo »

There’s no way tmhs is getting corrected to “themanhimself” as it currently works
"Am I a ghost like you, caught between the seams of two intertwining melodies?"


wiki // GTKAS
User avatar
Random Nurse
Random Nurse
He/Him
Mafia Scum
User avatar
User avatar
Random Nurse
He/Him
Mafia Scum
Mafia Scum
Posts: 2712
Joined: April 29, 2023
Pronoun: He/Him

Post Post #144 (ISO) » Sat Apr 13, 2024 5:28 pm

Post by Random Nurse »

Where are we at currently with this votecounter?

Is a practical version available to be used in future game?
User avatar
Psyche
Psyche
he/they
Survivor
User avatar
User avatar
Psyche
he/they
Survivor
Survivor
Posts: 10766
Joined: April 28, 2011
Pronoun: he/they

Post Post #145 (ISO) » Sat Apr 13, 2024 5:51 pm

Post by Psyche »

Right!

A key problem with this example is that TMHS's name doesn't have punctuation one could use a shortcut to match the acronym. You need something that knows enough english to predict how people might carve a username like "themanhimself" into units for an acronym. I've found that there's just enough knowledge in a basic dictionary to pull this off most of the time.

I used a spell-checking library called enchant.
It initializes with a dictionary and returns a boolean based on whether your string appears in the dictionary.
A function I made called "english_divides" considered every possible substring of each player's username and checked whether the substring was an english word or not, and stored every possible segmentation of the player's username based on english-word boundaries.
This also allowed for nonsense strings to occur in a segmentation.
For example, a username like "pprtown" might have among its splits '["ppr", "town"]'.

I could use these segmentations to propose candidate abbreviations. For example, the above segmentation could suggest an abbreviation of "pt" or "ptown".

From there, looking for exact or near matches among abbreviations generated from the most conservative segmentations (fewest separate chunks) while also minding the possibility of ambiguous abbreviations could consistently assign a broad swath of votes like TMHS -- and even reasonable typos I wasn't even intending to cover.

All this seems just as doable in a typescript project -- if it's worth doing. Things do get messy pretty quickly when you try to account for edge cases.
User avatar
Thestatusquo
Thestatusquo
He/Him
Shea

User avatar
User avatar
Thestatusquo
He/Him
Shea

Shea

Posts: 14371
Joined: July 27, 2006
Pronoun: He/Him
Location: Chicago!

Post Post #146 (ISO) » Sat Apr 13, 2024 6:54 pm

Post by Thestatusquo »

In post 144, Random Nurse wrote: Where are we at currently with this votecounter?

Is a practical version available to be used in future game?
Its functional right now I believe.
tout comprendre c'est tout pardonner
User avatar
Random Nurse
Random Nurse
He/Him
Mafia Scum
User avatar
User avatar
Random Nurse
He/Him
Mafia Scum
Mafia Scum
Posts: 2712
Joined: April 29, 2023
Pronoun: He/Him

Post Post #147 (ISO) » Sat Apr 13, 2024 7:00 pm

Post by Random Nurse »

In post 146, Thestatusquo wrote:
In post 144, Random Nurse wrote: Where are we at currently with this votecounter?

Is a practical version available to be used in future game?
Its functional right now I believe.

Nice.

So say I set up a Normal game.

Where do I go to start implementing it, please?

I'm eager to get some games going with this.
User avatar
yessiree
yessiree
he
Mafia Scum
User avatar
User avatar
yessiree
he
Mafia Scum
Mafia Scum
Posts: 4389
Joined: June 6, 2013
Pronoun: he

Post Post #148 (ISO) » Sat Apr 13, 2024 9:05 pm

Post by yessiree »

For votes with ambiguous targets, I lean more towards flagging them to be checked manually rather than trying to parse the intended target using NLP. Reason one is that configuration (usernames, aliases and replacements) are needed for each game anyway, reason two is that if the string parsing algo is not 100% accurate, you dataset ends up with some incorrect data, and reason three - NLP is hard!

I imagine the process would be like
- configure basic settings (usernames, replacements, common aliases, etc) for games from which to collect data
- collect votes -> get a list of votes + a list of flagged votes
- go through the flagged votes one by one and add aliases as necessary
- repeat step 2 until you have no more flagged votes
User avatar
JacksonVirgo
JacksonVirgo
they/him
Survivor
User avatar
User avatar
JacksonVirgo
they/him
Survivor
Survivor
Posts: 13298
Joined: October 29, 2019
Pronoun: they/him
Location: ɐılɐɹʇsn∀

Post Post #149 (ISO) » Sat Apr 13, 2024 9:06 pm

Post by JacksonVirgo »

I don’t think I do anything with the flagged names at the moment, that would be the next best thing for me to work on personally
"Am I a ghost like you, caught between the seams of two intertwining melodies?"


wiki // GTKAS

Return to “Mafia Discussion”