Proćemon is a procedurally-generated trading card game from the exceedingly popular Proćemon media franchise. I found the source code under a truck so I leaked it online. You can use it to create your own unique decks.
Installation
- Get Python3
pip3 install procemon
Usage
- Either clone this repo or download this file.
cd path/to/the/file(Replacepath/towith the actual path to the repo or the directory where the downloaded file is located.)- Windows:
py -3 create_dex.pyOS X and Linux:python3 create_dex.py
Result: You will create a unique deck of cards.
What it does
- Create a "Dex" of a given number of "types" of Proćemon. Choose those "types" randomly.
- Generate Proćemon and assign them moves.
- Save a JSON object describing the Dex to disk.
- Get a sprite image for each Proćemon.
- Generate a card image for each Proćemon and save it to disk.
- Generate a temporary image of the back of a card.
- Create a PDF zine of some of the images.
How it works
Read the API documentation here.
- A Dex is a compendium of MonsterTypes. Per MonsterType, the Dex generates a given number of Monsters.
- Each Dex has a
regionname, generated via markov chains of Japanese cities and prefectures scraped from Wikipedia and US county names scraped from pycopora
- Each Dex has a
- Each MonsterType is stored as a JSON object here. MonsterTypes are a few important keywords (such as the name of the type) as well as:
- A list of
nounswhich will be used to generate monster names. MonsterTypes and their nouns were collected in several ways:- Reorganized from a pycopora dictionary
- Scraped from Wikipedia using Beautiful Soup
- Extracted from ImageNet synset hierarchies
- A list of
verbsand a list ofadjectives. These are used to create names of moves. Seeprocemon/data/moves/srcs.txtfor a list of sources. Verbs and adjectives are assigned to each monster type by runningprocemon/wv.pyit loads a Word Vector file. It then loads a list of verbs and a list of adjectives. Words are assigned to monster types based on their distance to the type. For example, if the type isflowerand the adjective isfloral, the distance will be really short, so now the adjectives dictionary will look something like:{"flower": ["floral"]}
- A list of
- A given number of Monsters are generated per MonsterType.
- Each Monster has 2 MonsterTypes. Each Monster's
nameis generated by combining part of a noun from the first MonsterType with part of a noun from the second MonsterType. - Each Monster has a
descriptioni.e. the flavor text at the bottom of the card. To generate the flavor text, it scrapes Wikipedia pages (with Beautiful Soup) using its MonsterType keywords (seeMonsterType.wikipedia) and its constituent nouns. It then creates a Markov chain model (using Markovify) from this text and to generate a short sentence. - Each Monster has a
rarity. This determines how "good" its stats are. In the Dex, each MonsterType has a certain percentage of card rarities (e.g. 20% of each monster type is Rare, and so on). - Each monster has a
strong_againstwhich is just the type one to the right of its "primary type" in the Dex array of MonsterTypes. For example if the array is["duck", "furniture", "fern"]then all Monsters with the primary type"duck"are strong against"furniture". (The order of this array is randomly shuffled whenever a new Dex is created.) - Each Monster has 2 Moves. Moves are generated using the Monster's first type (the "primary type").
- When the Dex is first created,
- There is also a list of generic "attack verbs" that any type can use and prefer if the move deals damage. These verbs are a very short distance away from the words like
"attack","battle", etc. These are calculated and cached via a word vector model when you runprocemon/wv.py(see above). - To get the
nameof a Move, a verb is first picked at random either from the "generic" verb list of the type-specific verb list. Then, sometimes a type-specific adjective is prepended to thename. - A
Movehas a certaincost. It might dealdamageand it might have aspecialeffect. The odds for how this is generated depends on the Monster'srarity.
- Once all of the monsters have been generated, the Dex can be saved as a JSON dictionary.
- Generate cards of each Monster by calling
Dex.create_cards()- A color palette is loaded. This array was derived from this image of the NES palette. Each MonsterType is associated with a "color index" representing a column in the palette array.
- For every MonsterType, the Dex gets a list of nouns (the same list used for generating monster names). Using a randomized subset of that list, the Dex tries to get the corresponding Wikipedia page. It then uses Beautiful Soup to scrape the page for image URLs. If there aren't any image URLs, the Dex stores this noun in
data/images/no_images.txtso we don't try it again. - Once the images have been selected, a card per Monster is created and saved to disk using PIL.
- The background is colorized using the color index in the palette.
- Some Perlin noise is applied to the background.
- This is the font. This is where it's from.
- Optionally, a zine can be created of some of the cards in the Dex. This script will:
- Generate an image of the back of the card to use as the front and back cover of the zine.
- Start creating a PDF using fpdf.
- Randomly select some cards and add them as pages.
- Write the PDF to disk.
Changelog
Metadata
Release files for procemon 1.5.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| procemon-1.5.3.tar.gz | 445.2 kB | Without provenance | Details for procemon-1.5.3.tar.gz |
Release files / procemon-1.5.3.tar.gz
| Download URL | procemon-1.5.3.tar.gz |
|---|---|
| Size | 445.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee5b97f0a1495c676fa39807c1d03a4dab554f283ce04028510c9b8aa2253def
|
|
BLAKE2b-256 checksum How to use checksums |
486e54fddc5a93a5b5c8df98613c4514dba73af937707f5da082da6a6df0f894
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.5
|
Security for procemon 1.5.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.