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

Two "Two Girls" cards #29

Open
tresi opened this issue Jun 11, 2013 · 5 comments
Open

Two "Two Girls" cards #29

tresi opened this issue Jun 11, 2013 · 5 comments

Comments

@tresi
Copy link
Contributor

tresi commented Jun 11, 2013

This came up during a game. There are two "Two Girls..." cards when you include both the NEIndy and Image1 expansions.

2 matches for "girls.*cup" in buffer: cards.js
1007: {"id":1007,"cardType":"A","text":"Two girls, one cup.","numAnswers":0,"expansion":"NEIndy"},
1284: {"id":1284,"cardType":"A","text":"2 Girls 1 Cup","numAnswers":0,"expansion":"Image1"},

@samurailink3
Copy link
Owner

I'm not sure we want to modify the card packs, and this will undoubtedly happen when multiple custom packs are added to a game. We could scan the text of each card, but it sounds pretty extreme, given that we'd have to search for each variation of the string. Any suggestions that come to mind? I'm not sure we can fix this for all use cases easily.

@tresi
Copy link
Contributor Author

tresi commented Jun 11, 2013

Is the expansion field used for anything other than pulling in cards? Would it break if we gave the cards the same text and id? If we didn't want to have duplicate ids, we could uniquify across text.

It's clearly bad if both cards pop up as answers.

@samurailink3
Copy link
Owner

The way HAH parses cards is through a JSON array, so giving two cards the
same ID would break the array and cause the game not to load. I agree, it
isn't a good thing having both pop up, but the chances are rather remote,
and I'm sure this can/will happen with other expansion packs in the future.
I could see a card validation system being used, but to be initially
effective, it would have to be manual and run before the game starts. I
don't think anyone would want to use the manual card blacklist before a
game.

@tresi
Copy link
Contributor Author

tresi commented Jun 11, 2013

I don't want to complicate things unnecessarily, but this problem seems completely avoidable. When it does come up, there's no good choice for the czar should this answer be the best one.

Idea 1: Make these two cards' text the same. Make each expansion its own file. Detect and suppress duplicate card text when we merge them into the game deck at the start of the game.

Idea 2: Keep a list of ids of identical cards, and make sure to uniquify at the start of game. This seems a lot more fragile, but would probably require less code to change.

Either of these can be incrementally updated as duplicates are discovered.

@samurailink3
Copy link
Owner

I agree. In the v2 rewrite we are breaking the expansions into separate
files,so we should be able to do the analysis then.

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