Live data from Hacker News

Show HN: Card game where players write their own cards that get parsed into code

app.wordbots.io

1–10 of 28 posts

Show HN: Card game where players write their own cards that get parsed into code

#1
Wordbots is a long-running side project I've been working on on-and-off for the past ~7 years that I finally feel comfortable enough with to share with the HN community.

It's an online tactical card game (inspired by games like Hearthstone and Magic: the Gathering), where players write their own cards in natural language, that gets parsed down to JavaScript. The English-to-JavaScript translation is handled by a semantic parser operating on a hand-crafted CCG grammar – kind of an “old-school” approach in this age of LLMs but one that performs quite well on the very constrained language of Wordbots cards.

The resulting game gets pretty wacky as players can create all sorts of cards, though there are some game formats that try to produce more balanced gameplay as well (e.g. one format in which both players shuffle their decks together, and various draft formats).

If you're curious about how it all works, I made a write-up about it here: https://app.wordbots.io/how-it-works

And if you want to chat about Wordbots beyond this thread, please don't hesitate to join our discord at https://discord.wordbots.io/ . I'd love to hear any and all feedback.

-Alex

Show HN: Card game where players write their own cards that get parsed into code
app.wordbots.io

Re: Show HN: Card game where players write their own cards that get parsed into code

#3
That looks neat, thanks for sharing. Speaking of sharing, it seems your repos are missing a license file (and the source files themselves don't have a licensing block that would also serve the same purpose).

I would also recommend linking to https://github.com/wordbots/wordbots-core/blob/v0.20.0-beta/... since the app.wordbots.io version seems to boot up some horrific amount of javascript or something, because the gears just sit there for about 15 seconds before the content finally shows up

Separately, do you know if the vocabulary for wordbots would tolerate the vocabulary for M:TG? IOW, is it possible to "port-over" some of the cards?

Re: Show HN: Card game where players write their own cards that get parsed into code

#4
I don't like competing so my first thought was to make a card which says, "You win the game." Is that possible, ostensibly with great cost, or is there some restriction on the effects? I believe MTG card effects often directly translate to a certain "mana" cost so it can be determined (in most cases) if a card is "overpowered" for its cost. Does this have some mechanism which ties effect to cost?

(I also appreciate the "old-school" approach in this case; I suspect it actually makes it easier to determine that the intended card is invalid.)

Edit: I tried, and I guess it is able to understand that. Nothing which seems to tie that to a cost, though. That makes sense as you'd effectively have to define a game system while this is crowdsourcing that to the community. I imagine the intention for play (if there really is one) is to have players agree on a set of cards to use.

Re: Show HN: Card game where players write their own cards that get parsed into code

#5
post #3

That looks neat, thanks for sharing. Speaking of sharing, it seems your repos are missing a license file (and the source files themselves don't have a licensing block that would also serve the same purpose). I would also recommend linking to https://github.com/wordbots/wordbots-core/blob/v0.20.0-beta/... since the app.wordbots.io version seems to boot up some horrific amount of javascript or something, because the ge…

Oops, lack of licenses was my bad - good catch! Just added LICENSEs to clarify that both the game (https://github.com/wordbots/wordbots-core) and the parser (https://github.com/wordbots/wordbots-parser) are MIT-licensed.

Re: Show HN: Card game where players write their own cards that get parsed into code

#6
post #3

That looks neat, thanks for sharing. Speaking of sharing, it seems your repos are missing a license file (and the source files themselves don't have a licensing block that would also serve the same purpose). I would also recommend linking to https://github.com/wordbots/wordbots-core/blob/v0.20.0-beta/... since the app.wordbots.io version seems to boot up some horrific amount of javascript or something, because the ge…

Regarding M:TG vocabulary, Wordbots's syntax is a little bit different but a lot of the same effects are possible. For example, M:TG's Flametongue Kavu's "When Flametongue Kavu enters the battlefield, it deals 4 damage to target creature." becomes "Startup: Deal 4 damage to a robot" in Wordbots.

Some of the cards that people have been making so far in Wordbots are rough reinterpretations of cards from other games (M:TG, Hearthstone, Faeria, etc). Of course, many cards from these games wouldn't be possible to reimplement in Wordbots, as it doesn't have anywhere near the breadth of mechanics that these more-sophisticated games do. But also, there are some mechanics that are only possible in a game like Wordbots – such as https://app.wordbots.io/card/cnrssvyxfsp: > Replace "1" with "2", "2" with "4", "3" with "6", and "4" with "8" on all cards in your hand.

Re: Show HN: Card game where players write their own cards that get parsed into code

#7

I don't like competing so my first thought was to make a card which says, "You win the game." Is that possible, ostensibly with great cost, or is there some restriction on the effects? I believe MTG card effects often directly translate to a certain "mana" cost so it can be determined (in most cases) if a card is "overpowered" for its cost. Does this have some mechanism which ties effect to cost? (I also appreciate t…

You can definitely make an Action card with the text "You win the game" :-)

Wordbots doesn't have a built-in mechanism to enforce cards being at a "fair" power level. We initially had a few ideas for how to do it: some kind of machine-learning approach to determine how much "energy" a card should cost to play based on its text and stats, or having a server constantly simulating games between AI players with various cards to see how effective cards are in practice, or even a market-based mechanic where cards could be traded for in-game currency and how valuable a given card was would determine it's a "fair" card or not.

All of these approaches were ultimately abandoned as too complicated. Instead, we opted to just prioritize game formats where both players are equally likely to have access to any given card in-game:

  - In the Mash-up format, both players build a deck made up of any cards they want, but the two decks are shuffled together into one big deck that both players draw from.
  - In the Set format, players build their own separate decks but have to choose cards from a given "set" of cards curated by a player (and ostensibly the cards within a set should be roughly balanced).
  - In the draft formats (Set Draft and Everything Draft), both players are drafting from the same pool of crads.
This way, overpowered (and underpowered) cards can still be created by players, but at least in these game formats, both players would be equally likely to draw said overpowered cards.

Re: Show HN: Card game where players write their own cards that get parsed into code

#9
post #7

I don't like competing so my first thought was to make a card which says, "You win the game." Is that possible, ostensibly with great cost, or is there some restriction on the effects? I believe MTG card effects often directly translate to a certain "mana" cost so it can be determined (in most cases) if a card is "overpowered" for its cost. Does this have some mechanism which ties effect to cost? (I also appreciate t…

You can definitely make an Action card with the text "You win the game" :-) Wordbots doesn't have a built-in mechanism to enforce cards being at a "fair" power level. We initially had a few ideas for how to do it: some kind of machine-learning approach to determine how much "energy" a card should cost to play based on its text and stats, or having a server constantly simulating games between AI players with various c…

That's clever and elegant, well done. I'm really interested, especially since it turns out to be more than just a ChatGPT front-end.

Re: Show HN: Card game where players write their own cards that get parsed into code

#10
I like the game itself - it feels well balanced when you are playing single-player mode with built-in cards only.

But creating your own cards is an INCREDIBLY frustrating experience. This is a robot I tried to create (sumbot):

"This robot's attack, speed, and health are the sum of the attacks, speeds, and healths respectively of all other robots in play."

It didn't understand the words: "are", "sum", "speeds", "healths", "respectively".

Very restrictive dictionary and grammar. It pissed me off at a deep level and I probably will step away from this game.

Maybe integrate with an LLM (such as GPT4) to accept card descriptions?

It seems I can set an arbitrary cost for my cards? How do you balance the game when it involves custom cards?

One strategy would be to give each player a deck consisting of their cards and the opponents cards. So if someone made a really imbalanced card, they would have a 50-50 chance of having it used on them.

Post reply on HN