How to Make a Prototype of a Cards Game From a Csv File Using Free Softwares

by Leon_Reboul in Living > Toys & Games

174 Views, 0 Favorites, 0 Comments

How to Make a Prototype of a Cards Game From a Csv File Using Free Softwares

mainCardsADEME.jpg
mainPicProtoV1.jpg
jeuExtremeDefi.png

In this Instructables I will share the steps I used to create a prototype of a cards game from scratch!

Steps of the Instructable:

  1. Context.
  2. Gather relevant data and organize it in a csv file.
  3. Gather relevant pictures and edit them using Inkscape.
  4. Automatically generate a pdf from the csv files and the pictures using Overleaf.
  5. Print the pdf.
  6. Cut and put in sleeves.

Supplies

Materials:

  1. A4 paper
  2. A standard cheap deck of card
  3. A bunch of sleeves

Machines:

  1. A 2D printer

Software:

  1. Overleaf: an online editor (principally use to create scientific documents: articles, thesis, reports,...) where you type code to generate a pdf file.
  2. Inkscape: free 2D CAD software
  3. Libre Office calc (but you can use Google Sheets or Microsoft excel as long as you export the file in a csv format)

Context

jeuExtremeDefi.png

I am making a card game in collaboration with RFFLabs (french Fab Lab Network) and LUZ'IN (Fab Lab in La Tour du Pin) for the Extrem Mobility Challenge an extreme innovation course in competition whose objective is to create new travel solutions to replace the car in everyday travel in peri-urban and rural areas. We should call it "XD" in the remaining of this post.

I was looking for a way to automatically generate a deck of cards from a csv (comma-separated values) file. I found several projects doing so:

  1. Dextrous (great but you need to pay)
  2. Nandeck (free but for windows)
  3. cardlatex (free but for windows)

I am using Linux and I wanted a free tool that I can modify to fit my need. I have already used Overleaf and I know a bit of TikZ (more on that later in step 4). So I decided to start from the code shared by user "Arvid" in this tread and remake it to fit my needs.

Gathering the Relevant Data and Organize It in a Csv File

WikiADEME_Explorer.png
FicheVhelio.png
TechnicalDataVhelio.png
spreadsheetXD.png

I used the wiki of the XD to gather data on the vehicles and the team that designed and make them. I them put all the data in a csv file using Libre Office calc.

I use the first raw of the csv file to put the titles of the column, this will be important for the Overleaf step.

Gather Relevant Pictures and Edit Them Using Inkscape

imageFromAdemeWiki.png
inkscapeSetClip.png
InkscapeResizeDocument.png
InkscapeCenterRectangle.png
InkscapeResizeAndCenterImage.png
InkscapeExportPng.png
evig.png
hvr.png
u1.png
karbikesPro.png
kairos.png
tiny.png
carreto2x2.png
soraya.png
laPlateau.png
laBagnole.png
inga.png
movR3.png
bct.png
facteur10.png
leFlorhyan.png
carreto4x4.png
cyclospace.png
roza.png
citroenAmi.png
greenAndBike.png
charette.png
carver.png
aeroStar.png
noCar.png
fourCycles.png
veMoo.png
ceb.png
plateformeCarbikes.png
bob.png
cycleKart.png
segmobyl.png
cyclesMidi.png
slappy.png
euclH2.png
libellule.png
cobraneX.png
ikarhus.png
acticycle.png
alounga.png
midipile.png
gfg101.png
jdmSLE.png
soletta.png
urbaner.png
sliikone.png
veemoSE.png
edi.png
tinkercad.png
pumba.png
ouiCycle.png
eva.png
gfg201.png
toot.png
eGoCAR.png
cargoLab.png
SurbX.png
laBarquette.png
eRoeFlash.png
db1.png
woodyBus.png
eliZero.png
capitole.png
tZer.png
noPicture.png
extremeDefiLogo.png
silex.png
kiwiMobility.png
caminade.png
cylure.png
sulCity.png
weez.png
ptiteZalye.png
pelicanTrain.png
moduleo.png
tripalette2.png
autocycletteRemorque.png
grossomodow.png
quadryfox.png
triviak.png
snakeBike.png
scouter.png
cyclauto.png
triporteurFlorianBikes.png
bugE.png
sMouv.png
biro.png
bimboum.png
helixx.png
camel.png
cargoxhytan.png
cGo.png
colibri.png
golo.png
scaramobile.png
quike.png
oxpecker.png
cargomobile.png
intelectra.png
qbxSorean.png
circle.png
camiGO.png
veloce.png
grozalye.png
azurite.png
mob4.png
upt.png
karbikes.png
IoTwoOne.png
sulCountry.png
cargo3E.png
TricyclePallette.png
supercycletteVhelio.png
autocyclettePickUp.png
BuggE.png
unikle.png
bikloowRecycle.png
tcr.png
eSpider.png
twoSeater.png
jetbike.png
troisRoy.png
solarBoost.png
scorpio.png
kBine.png
ketchCleenElectrique.png
half.png
vhéliOriginal.png
biporteurMidi.png
veloBus.png
lokka.png
MoskitOS.png
kRyole.png
proxity.png
eGokART.png
avatar.png
bakerPrax.png
autocycletteTaxi.png
velbou.png
jva2.png
solarCommuter.png
ownDrive.jpeg.png
scoobicMouse.png
vheliotech.png

I used the wiki to download the pictures of the vehicles. If you know what you are doing and the website is well coded you can use a web scrapper program to automatically download all images of a website.

I remove the background of the image using the removebg website.

For the few images where the background wasn't perfectly removed I used Inkscape and follow the steps:

  1. draw a line around the part I want to keep using the Pen Tool
  2. select both the image and the line (shift + left mouse button)
  3. go to object menu
  4. Clip
  5. Set clip

For all the images I formatted them so that they will fit nicely in the cards and look the same, here are the steps to do it in Inkscape:

  1. Resize the document size to 60mm by 60mm (ctrl + shift + D),
  2. draw a 40 by 25mm rectangle and center (ctrl + shift + A and relative to the page),
  3. resize and place the image centered in the rectangle (as big as possible inside the rectangle)
  4. delete the rectangle
  5. export the image in a png file (ctrl + shift + E, export the whole page)

Note: if you know what you are doing you can use the "mogrify" command to process several images at the same time. I do recommend that you first make a copy of the folder with all the image first, as a mistake in the command line could erase all the pictures in the file.

Automatically Generate a Pdf From the Csv Files and the Pictures Using Overleaf

overleafFrontAndBackCards.png
ademeVehiculesOccupationExampleCards.png
OverleafExampleCaffeineLib.png
OverleafLayoutExample.png

Disclaimer:

Cons of Overleaf:

  1. Overleaf is originally used to make scientific papers/write phd thesis. It is not beginner nor user friendly, you type code on the left part to generate a pdf on the right. If something goes wrong you have to debug by yourself.
  2. The learning curve is steep for people not use to programming and reading technical documentation (for example the documentation of the TikZ and PGF package is 1321 pages).

Pros of Overleaf:

  1. LaTeX is completely free to use.
  2. You can reuse a lot of templates (already made code), so if you know where to look, it is simply putting your text at the right place.
  3. It work really well (as one could guess) for science diagram: you can make cool chemical formulas if you want to as shown in the illustration of cafeine (from overleaf website).
  4. You can use a lot of libraries to make your work easier
  5. You have all the control regarding everything on the pdf page size, position of the card, style of the cards and so on...
  6. There is a lot of documentation available.

My process:

I used the "datatool" package to modify a code from the thread: Creating playing cards using Tikz from StackExchange.

The datatool documentation is available on this page, under the section documentation: User guide .

The tex files:

  1. cards.tex this is the main file that will call the others files,
  2. colors.tex this the file to define the colors,
  3. libs.tex this is the file to import all the libraries that we need in the project,
  4. tikzcards.tex this is the file to define the commands that make the cards.

The csv files:

  1. allDataFrench.csv this is the main file containing all the data in french on the vehicles
  2. testDataFrench.csv this is a smaller file containing a subset of the data of allData.csv use for testing (smaller so it run faster)

The code is commented to give you an understanding of the what does what in the file.

Note:

  1. You must have the cards.tex selected to compile the project otherwise you will get a compilation error and no pdf
  2. Before making modification I sugest that you make a copy of the source code that work
  3. In the overleaf menu button (top left with overleaf logo) be sure to have "LuaLaTex" selected in the Compiler setting (otherwise you won't be able to display emoji from the empoji package).
  4. Check overleaf tutorials to get to know the editors
  5. Coming soon: I will try to submit the files to the overleaf gallery so you can download all the files and pictures in one go!


Print the Pdf

Easy step, print your pdf on your 2D printer!

But I strongly recommend that you first print only the first page, cut it and check that it fits your sleeve (see step bellow) before printing the full pdf!

Cut and Put in Sleeves

mainPicProtoV1.jpg
cutting_folding_Cards.jpg

I follow this process:

  1. cut the card front and back,
  2. fold along the line,
  3. put a card from the cheap standard deck of card (it has to be the same dimension) between the front and the back,
  4. put them all in the sleeve!

Notes:

  1. this allows to easily remove the card from the sleeve to make adjustment,
  2. you can reuse the standard deck of card for another prototype,
  3. it look a bit nice already,
  4. you can playtest the game way easily them with just paper cards,
  5. if you want to create nicer cards check out this video by the Dining Table Print & Play.

Using Dextrous for Easier Implementation

dextrousCardsInterface.png
dextrousLayoutInterface.png

Dextrous allows for easier prototyping of the cards decks from a spreadsheet file.

Tutorials on the process can be found here