discord-against-humanity icon indicating copy to clipboard operation
discord-against-humanity copied to clipboard

Markovified Black Cards

Open SharaaEsper opened this issue 8 years ago • 3 comments

This is the feature I was working on for my own personal bot, I cleaned up the code a little bit but it's still a kinda messy. I know you were talking about making a daily deck on a scheduler, but you also talked about switching to Postgres which would eliminate the main downside of this method (Hammering the SQLite DB).

Either way, includes the code to add a markov expansion via dah.add markov. Does have the downside of it adding any current markov expansions in other running games if a new session is added via dah.add all (past games cards are cleared out of the DB on dah.end)

Also includes the fix for new installs when the games DB is empty, and a script to generate the corpus from existing expansions present in dah/dah-cards.

SharaaEsper avatar Feb 08 '17 16:02 SharaaEsper

Thanks again for this cool idea! I hope to have time to review this and make some kind of implementation of it soon.

I know you were talking about making a daily deck on a scheduler, but you also talked about switching to Postgres which would eliminate the main downside of this method (Hammering the SQLite DB).

While true, I think even then I would stick with a daily build task (at the very least in my instance)

Looking at my bots statistics since launch, most people only play one or two games at most in a given day. Generating a large enough deck to cover approximately 10 players, it is unlikely they would ever in fact see all the cards - not to mention, they must add other expansions to their game since this is only black cards. So the next time they play (on another day) it would be an all new markov deck, therefore ; I'd rather serve them a cached daily deck instantly rather than have any theoretically any delay at all. I think the bot will scale better using this thinking, combined with using a Postgres adapter.

Anyway - I'd probably accept this as-is and refactor it later. :)

Another thought - did you happen to look into generating white cards? After seeing the results of this function, I'm curious. :wink:

z64 avatar Feb 08 '17 16:02 z64

I did try it with white cards, but the results aren't very good. Likely because it's harder to try and parse a question that sometimes has no blanks, but sometimes does. Here's a 50 line sample of that output:

https://gist.github.com/Ryuujinx/fd927f4d19882efd67f270971e763b39

SharaaEsper avatar Feb 08 '17 16:02 SharaaEsper

Interesting! Thanks for sharing. I see what you mean. :+1:

z64 avatar Feb 08 '17 17:02 z64