Interdimensional Prophets – Deckbuilder (Game Dev) #2


If someone had told me a few years ago, when I was obsessed with board and card games, that in a few days I would have developed a Python program that generates game cards effortlessly, I would have jumped for joy. Working with Python, coming from Rust in particular, is like going from aerospace engineering to building toy rockets; thankfully, a card generating program doesn’t require the speed and multiprocessing that Rust provides.

Anyway, check out the current cards I’m working with as I keep developing the program:

This is an Encounter card, which represent the weird shit that the team of explorers come across as they explore alternate Earths. The name of the card and the image are self-evident. The tree icon indicates that this encounter can only happen in a biome with an icon that matches that type. The row of icons below are the Struggle icons. In the game, the players should match those icons with their player cards to consider the encounter beaten. Those struggle icons depicted are Emotional, Cognitive and Environmental respectively.

Images courtesy of Midjourney, of course.

Here are some Biomes:

I know that the icon designs don’t match each other, but whatever.

I must thank again the most powerful large language model we have access to: GPT-4. It’s like having an extremely knowledgeable veteran programmer ready to help you at all times. For example, an hour ago I thought that the icons could use some subtle drop shadows. I had no clue how to even begin programming that, so I just asked GPT-4. After a short back and forth (in the first attempt it dropped shadows for the invisible part of the alpha channel), the icons now drop perfect shadows. How about that?

I have already started working on the Rust version of the game, using the Bevy crate, which seems to be the most advanced game development engine in that language. I have displayed a few encounter cards that move smoothly to the center of the screen for no particular reason other than that I wanted to figure out how to move stuff smoothly on screen.

Next up, I’ll focus on developing the necessary cards and Rust systems to make the following happen:

  • Design and generate an Exploration Zone card, which are the cards that determine which types of Biomes and Encounters can show up during an exploration (only those with matching icons can).
  • Display the Exploration Zone card in Rust.
  • Write the code to build the Biomes deck with only matching Biomes.
  • Display the Biomes deck on screen in Rust.
  • Write the code to build the Encounters deck with only matching Encounters.
  • Display the Encounters deck on screen in Rust.

Interdimensional Prophets – Deckbuilder (Game Dev) #1


A couple of weeks ago I kept myself busy programming an exploration game based on an old free verse poem of mine. I had developed the core of the game, the encounter system, when it became obvious that for the game to feel remotely compelling (even for myself), I’d have to manually develop dozens or hundreds of encounters. The game as it was conceived couldn’t continue past that point, so I thought about what I liked the most about that concept:

  • A team of players cooperating to solve some issue.
  • Each player having special abilities.
  • Gaining resources, abilities, etc, for one of the players at a time.
  • Exploring strange places.
  • Encountering weird shit.
  • Events that could alter how some encounters play out.
  • Gaining injuries, diseases, etc.
  • Gaining mental afflictions.
  • Being able to regroup at the hub and determine the resources that would be used for the next exploration.

Damn it if that isn’t a deckbuilding game. Not surprising, given that one of my favorite games ever is Arkham Horror LCG, a card game in which a team of at the most four players, each with his or her deck, uses the resources and abilities contained in that deck to solve perilous situations and beat weird monsters. It also features a location system that forces the team to move around, although that’s probably my least favorite part of the game.

So I thought, why can’t I program a deckbuilding game?

First of all, I need a fast system to produce cards. I had looked up programs to create cards in the past, and I was extremely disappointed due to how obscure their usages were. So I would need to develop one such program myself, tailored to the needs of my game.

So that’s what I’ve begun to do thanks to the insane Python skillz of ChatGPT. Behold the repository with the current version of my card generator:

Link to the GitHub repository for the card generator program

The first notion I had of such a program is that it should be able to take a background image, a card image, a frame image, and the necessary text, and generate a standard-sized card immediately. And so it does:

Yes, the cards even have rounded corners. Isn’t that fucking cool?

I have become emboldened by the fact that I could get this far in a few hours. So to come up with ideas I have relied on the current king of mini-AGIs (artificial general intelligences), that for me is godmode.space (requires a plus subscription to OpenAI and an API key; I had to wait for mine). Such AGIs are able to make plans, determine what tasks to perform, and criticize their own performance, in the pursuit of fulfilling some goals you’ve told it to focus on. As I’m writing this, GPT-4 is running in the background, coming up with game ideas and mechanics for the notions I fed it. For example, these are some of the texts that GPT-4 has written:

  • An Afflictions deck will be created, which will add an element of chance and difficulty to the game. The deck will consist of afflictions such as injuries, diseases, and mental statuses that will be detrimental to the player when drawn. The severity of each affliction will be determined, and a variety of afflictions will be included to ensure that the deck does not become predictable.
  • Illusion: A card type that represents deceptive, disorienting elements a player might encounter on specific biomes. These cards could have effects that remove enemy cards from the encounter deck or switch the order of Biome cards in the Biome deck.
  • A card drafting system will be developed to allow players to choose which cards to add to their deck when trading resources. The system will allow players to have more agency and control over their deck, and add another layer of strategic thinking to the gameplay. The rules for the drafting system will be determined, such as how many cards are presented to the player, and how many of those cards can be added to their deck. The card drafting system will be tested to ensure that it provides an engaging level of strategy without compromising the overall gameplay.
  • Encounter cards will be matched with one or more features of the Exploration Zone card in play. This will reflect the biome, geography, or climate the team is exploring, making the game more interesting and exciting for players. Additionally, we will develop a mechanism for how Encounter cards are ‘beaten’ through spent Player cards that feature certain icons. This will give players more agency in the game and create more engaging gameplay.

Born too late to explore the Earth, born too early to explore space, born just in time for the AI revolution.

Information about words thanks to ChatGPT

Yesterday, the shady company behind ChatGPT sent me an API key so I could do extra stuff with their GPT-4 AI model. I was mainly interested in using it for Auto-GPT.

Don’t you know what’s Auto-GPT? Some clever people figured out that if you give ChatGPT access to the internet and various other tools (such as your operating system’s commands), and trap it in a loop of reasoning, planning and criticizing itself, you can drop into that loop some task, such as growing your business or gathering particular information from the web, and ChatGPT will work itself to the bone for you. They called this implementation Auto-GPT, and it’s the closest thing we got, that I’m aware of, to AGI (artificial general intelligence), which is the holy grail of AI, and possibly the thing that will kill us all.

Anyway, here’s a video that shows you what this Auto-GPT can do (the video includes plenty of cool new stuff about AI):

I was aware that Auto-GPT can write, test and run Python code for you (apparently just Python; although I dislike the language, it seems to be the favorite of scripters who want stuff done quick, so you must be familiar with it). I started thinking about what I could tell Auto-GPT to do that would help me for real, and I came down to the fact that I look up words very, very often while writing, mostly to check particular definitions or to get synonyms. I search the definitions of words so often, in fact, that Google has at times demanded that I proved that I was human. So what if ChatGPT could write me a Python program that would provide all the information I need from a word, with a single command from Powershell?

The instructions were clear enough. Auto-GPT did write code that gave me synonyms, antonyms and some other shit for any word I would input, but when I ordered it to change the code so that the word got passed as an argument, Auto-GPT got mired in trying to figure out how to pass command-line arguments from within the Docker container with some dedicated functions.

When I gave it a break so it could write tests for the function in another file, it had trouble correcting the original code so that the tests would pass, but I think that was mostly my fault, as ChatGPT would need to have previous knowledge of, for example, what synonyms a word would have, and in that case, what’s the point of writing a test?

Anyway, I got bored with Auto-GPT itself, but not with the notion that ChatGPT could write that Python program, so that’s what I forced it to do in a couple of hours. Behold the results of passing the word “horse” as an argument:

Information about horse

Meaning of horse

  • solid-hoofed herbivorous quadruped domesticated since prehistoric times
  • a padded gymnastic apparatus on legs
  • troops trained to fight on horseback
  • a framework for holding wood that is being sawed
  • a chessman shaped to resemble the head of a horse; can move two squares horizontally and one vertically (or vice
    versa)
  • provide with a horse or horses

Part of speech for horse

  • verb (transitive)
  • noun

Etymology of horse

  • “solidungulate perissodactyl mammal of the family Equidæ and genus Equus” [Century Dictionary], Old
    Englishhors”horse,” from Proto-Germanicharss-(source also of Old Norsehross, Old Frisian, Old Saxonhors, Middle Dutchors, Dutchros, Old High Germanhros, GermanRoß”horse”), of unknown origin. By some, connected to PIE rootkers-“to run,” source of Latincurrere”to run.” Boutkan prefers the theory that it is a loan-word from an Iranian language
    (Sarmatian) also borrowed into Uralic (compare Finnishvarsa”foal”),The usual Indo-European word is represented by Old
    Englisheoh, Greekhippos, Latinequus, from PIE rootekwo-. Another Germanic “horse” word is Old Englishvicg, from Proto- Germanicwegja-(source also of Old Frisianwegk-, Old Saxonwigg, Old Norsevigg), which is of uncertain origin. In many
    other languages, as in English, this root has been lost in favor of synonyms, probably via superstitious taboo on
    uttering the name of an animal so important in Indo-European religion. For the Romanic words (Frenchcheval,
    Spanishcaballo) seecavalier(n.); for Dutchpaard, GermanPferd, seepalfrey; for Swedishhäst, Danishhestseehenchman. As
    plural Old English had collective singularhorseas well ashorses, in Middle English also sometimeshorsen, buthorseshas
    been the usual plural since 17c.Used at least since late 14c. of various devices or appliances which suggest a horse (as
    insawhorse), typically in reference to being “that upon which something is mounted.” For sense of “large, coarse,”
    seehorseradish. Slang use for “heroin” is attested by 1950. Toride a horse that was foaled of an acorn(1670s) was
    through early 19c. a way to say “be hanged from the gallows.”Horse latitudesfirst attested 1777, the name of unknown
    origin, despite much speculation.Horse-pistol, “large one-handed pistol used by horseback riders,” is by 1704. Adead
    horseas a figure for something that has ceased to be useful is from 1630s; toflog a dead horse”attempt to revive
    interest in a worn-out topic” is from 1864.HORSEGODMOTHER, a large masculine wench; one whom it is difficult to rank
    among the purest and gentlest portion of the community. [John Trotter Brockett, “A Glossary of North Country Words,”
    1829]The term itself is attested from 1560s.The horse’s mouthas a source of reliable information is from 1921, perhaps
    originally of racetrack tips, from the fact that a horse’s age can be determined accurately by looking at its teeth.
    Toswap horses while crossing the river(a bad idea) is from the American Civil War and appears to have been originally
    one of Abe Lincoln’s stories.Horse-and-buggymeaning “old-fashioned” is recorded from 1926 slang, originally in reference
    to a “young lady out of date, with long hair.” Tohold (one’s) horses”restrain one’s enthusiasm, be patient” is from
    1842, American English; the notion is of keeping a tight grip on the reins.

Synonyms of horse

  • horse_cavalry
  • Equus_caballus
  • sawbuck
  • buck
  • sawhorse
  • cavalry
  • horse
  • knight
  • gymnastic_horse

Related phrases and expressions with horse

  • to the horse in English
  • your high horse and don
  • is a horse dick !
  • : The horse ?
  • , that horse is peeing
  • a Spanish horse .
  • on a horse ?
  • [ a horse and carriage
  • [ the horse and carriage
  • get a horse too .
  • take a horse !
  • taking the horse and I
  • smells like horse shit .
  • I mean horse .
  • got that horse and his
  • — Horse carriages ,
  • only a horse could love
  • is a horse !
  • and the horse didn ‘
  • take this horse and I
  • your new horse , honey
  • light that horse on fire
  • get a horse thief financing
  • the smelly horse carriages on
  • with this horse .

Semantic field(s) of horse

  • chessman
  • provide
  • gymnastic_apparatus
  • framework
  • equine
  • military_personnel

Hyponyms of horse

  • pommel_horse
  • eohippus
  • pony
  • stalking-horse
  • pinto
  • sorrel
  • steeplechaser
  • liver_chestnut
  • mesohippus
  • roan
  • remount
  • hack
  • wild_horse
  • workhorse
  • palomino
  • pony
  • gee-gee
  • pacer
  • stablemate
  • male_horse
  • bay
  • racehorse
  • harness_horse
  • protohippus
  • chestnut
  • trestle
  • vaulting_horse
  • hack
  • mare
  • saddle_horse
  • stepper
  • post_horse
  • polo_pony

Hypernyms of horse

  • military_personnel
  • gymnastic_apparatus
  • chessman
  • equine
  • framework
  • provide

Meronyms of horse

  • horseback
  • cavalryman
  • encolure
  • foal
  • gaskin
  • horse’s_foot
  • poll
  • horsemeat
  • withers

Domain-specific words related to horse

  • armed_forces
  • military_machine
  • chess
  • war_machine
  • chess_game
  • armed_services
  • military

Associated nouns with horse

  • horse

Associated verbs with horse

  • horse

Stylistic variations of horse

  • bathorse
  • horsepox
  • horseflesh
  • dishorse
  • horselike
  • horselaughter
  • ahorseback
  • horsewhipper
  • sawhorse
  • demihorse
  • horsekeeper
  • Horsetown
  • horsefettler
  • horseshoe
  • horsehead
  • ahorse
  • horseman
  • horsetree
  • underhorsed
  • woodhorse
  • horsehide
  • drawhorse
  • horsewomanship
  • overhorse
  • horsetongue
  • horsemint
  • horseleech
  • horsecloth
  • clotheshorse
  • horseboy
  • horseherd
  • horseload
  • horseplay
  • horsepower
  • horsedom
  • horsefish
  • horsetail
  • horsepond
  • horsefair
  • horsehood
  • rearhorse
  • horselaugh
  • horsemastership
  • horsefly
  • cockhorse
  • waterhorse
  • horsehair
  • horseway
  • horsebreaker
  • horsemonger
  • horsewoman
  • unhorse
  • horsegate
  • horsehoof
  • horseweed
  • horser
  • horseshoer
  • horsefight
  • horsewood
  • horselaugher
  • horsemanship
  • studhorse
  • horsecraft
  • horsefoot
  • horsejockey
  • horseback
  • horseplayful
  • horsewhip
  • underhorse
  • horsehaired
  • horsebacker
  • hobbyhorse
  • horsecar
  • horseless

A couple of weird points about this implementation, although they don’t bother me:

  • I gather the etymology from a website, but some words end up stuck together for whatever reason. Also, no paragraphs. Not sure if it can be fixed, because the html tags don’t come through the request.
  • The section “Related phrases and expressions” only looks for a few words around the passed word, from a dataset that ChatGPT recommended. The results are often strange.

Because I’m obsessive (and compulsive), I kept bothering ChatGPT by telling it to come up with more useful information that the program could provide about any given word. I didn’t know what a hyponym was.

Anyway, this little program ended up being a great tool for writing, which is what I should have done with my afternoon instead of getting involved with ChatGPT. Its auto version has huge potential; I probably need to come up with better use cases.