Welcome Guest.   Make a donation to an author on the site December 22, 2014, 05:30:34 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2010! Download 24 custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1] 2 Next   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: PythonProtoCards - Prototype Card Game Images - v1.5.01 - 9/9/12  (Read 13298 times)
mouser
First Author
Administrator
*****
Posts: 33,795



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« on: March 12, 2011, 11:23:24 PM »

I've now uploaded a rough version of my Open Source Python library/helper code for very rapidly prototyping card game images for playtesting, PythonProtoCards.
It includes my sample "CodyCards" game and sample use of the code to generate the cards for it.

Download from: http://www.donationcoder..../Mouser/pythonprotocards/

Release history:
  • v1.5.1 - 9/9/12 -- improved layout of large blocks of text; fixed bug when displaying text with linebreaks
  • v1.4.1 - 4/5/11 -- added corner circle text helper function, and used it from sample CodyCards
  • v1.2.1 - 3/25/11 -- improved transparency effects, improved full page bleed layouts
  • v1.0.1 - 3/13/11 -- first release

The PythonProtoCards library provides classes and functions that are useful for rapidly prototyping *printed* card games.

The library makes it possible to programmatically create lots of cards quickly. It helps you divide up work into different steps, so that you can manually create and edit game piece data or automatically generate it programmatically, and then generate printable images for this card and piece data. The data file format is designed to be very easy for humans to edit, but also parsable by code, which can load the data, modify it, and write out newly modified files, almost like a minimalistic database. This makes it easy to programmatically modify or add to existing data files that will also be hand edited.

The focus here is on very rapid prototyping (rather than pixel-perfect laytout control) so you'll find things like functions for automatically scaling text and images to fit within specific regions, text-wrapping, etc.

By interfacing with the Python Imaging Library (PIL), the PythonProtoCards classes can quickly generate large numbers of nice looking card images, and even lay them out for printing on card template sheets.

See the samples/codycards directory for a sample card game and scripts to create cards programmatically, and sample images

Please note this is an early release intended for programmers. I would very much like to extend this work to a full-featured tool for game designers, and even extend it to support online playtesting. If you are interested in seriously funding such work, please get in touch with me.



Let me know if you find it useful!



Non-core-python requirements: PIL image library

« Last Edit: September 10, 2012, 03:59:06 PM by mouser » Logged
cranioscopical
Friend of the Site
Supporting Member
**
Posts: 4,200



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: March 13, 2011, 09:21:37 AM »

Interesting!

I'm going to see if I can generate a couple more aces to keep up my sleeve.

Do you (does anyone) plan to create a DonationCoder card game?
Logged

Chris
mouser
First Author
Administrator
*****
Posts: 33,795



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: March 13, 2011, 10:37:17 AM »

Quote
Do you (does anyone) plan to create a DonationCoder card game?

Open up your eyes.
Logged
cranioscopical
Friend of the Site
Supporting Member
**
Posts: 4,200



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: March 13, 2011, 11:31:10 AM »

Quote
Do you (does anyone) plan to create a DonationCoder card game?

Open up your eyes.

 embarassed

Actually, my eyes are open but I have to keep looking away in order to boost the thermometer.
Logged

Chris
Ampa
Charter Member
***
Posts: 589


I am cute ;)

View Profile WWW Give some DonationCredits to this forum member
« Reply #4 on: March 13, 2011, 02:17:39 PM »

Oooh - looks interesting.

I have never used Python but may have a look as this develops.

When prototyping games I have always laid out cards on a portrait page 3x3 as I then get 9 per page rather than 8. Just a thought!

I would dearly love to see a good card prototyping environment developed, and would even lend a hand if I could. I most recently looked at NanDeck, but was quickly turned off as it seemed rather clunky.
Logged
mouser
First Author
Administrator
*****
Posts: 33,795



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: March 13, 2011, 02:23:15 PM »

Quote
I have always laid out cards on a portrait page 3x3 as I then get 9 per page rather than 8. Just a thought!

youll see that the library is very generic about laying out the cards.. its easy to adjust.

that's really the point of this library -- it is code to make it easy to custom code your own quick custom card generation routines, without spending time on the low-level details.
Logged
mouser
First Author
Administrator
*****
Posts: 33,795



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: March 25, 2011, 12:04:21 PM »

New version uploaded.
Logged
mouser
First Author
Administrator
*****
Posts: 33,795



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: March 25, 2011, 12:15:31 PM »

This version includes as a sample the scripts and images for generating your own deck of CodyCards, as well as a complete instructions for playing the game.

I will be having some game decks printed and given away soon for fans of Cody.  thumbs up

For those interested in printing your own cards, I have successfully used PlainCards stock:
http://plaincards.com/Playing.html
« Last Edit: March 25, 2011, 12:26:12 PM by mouser » Logged
Gothi[c]
DC Server Admin
Charter Honorary Member
***
Posts: 857



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #8 on: March 25, 2011, 12:23:33 PM »

As having played fun games made with this library, I can only recommend it! smiley
Logged
Deozaan
Charter Member
***
Posts: 6,539



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #9 on: March 28, 2011, 10:31:25 PM »

Just curious: Is there a reason why you don't put the source on one of the better-known online open source repositories? Github, Bitbucket.org, SourceForge, code.google.com, etc.?

Also, what license is the source for PythonProtoCards released under?
Logged

mouser
First Author
Administrator
*****
Posts: 33,795



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #10 on: March 28, 2011, 10:38:50 PM »

Quote
Is there a reason why you don't put the source on one of the better-known online open source repositories? Github, Bitbucket.org, SourceForge, code.google.com, etc.?

i'm a believer in the idea that there should be one official home for things.. and since my home is on dc, that's where this lives.

Quote
Also, what license is the source for PythonProtoCards released under?

You've caught me -- i don't know yet, i need to figure out what open source license fits best.
Logged
mouser
First Author
Administrator
*****
Posts: 33,795



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #11 on: March 29, 2011, 11:07:24 AM »

here's a cleaner image of the proofs for sending the cards to be professionally printed -- gives you a better idea of what the library can super easily generate without any effort on your part:



ps. I created a separate thread to discuss the CodyCards game itself.
Logged
cranioscopical
Friend of the Site
Supporting Member
**
Posts: 4,200



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #12 on: March 29, 2011, 01:35:15 PM »

I'm a little alarmed to see a blood-thirsty Cody ensconced with all that weaponry!
Now I know why you claimed that it is a killer game.
Logged

Chris
mouser
First Author
Administrator
*****
Posts: 33,795



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #13 on: March 29, 2011, 01:39:09 PM »

cody is a pacifist thief in this game -- all the attacks are directed at him.
Logged
Deozaan
Charter Member
***
Posts: 6,539



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #14 on: March 29, 2011, 02:12:08 PM »

cody is a pacifist thief in this game -- all the attacks are directed at him.

A pacifist thief who attacks anyone who innocently knocks on his door. huh
Logged

mouser
First Author
Administrator
*****
Posts: 33,795



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #15 on: May 05, 2011, 04:56:29 PM »

It was suggested that the CodyCards could use the numbers values repeated in the upper left, so i added a helper function for this into the JrPythonCards library:



New version has been uploaded.
« Last Edit: May 05, 2011, 05:05:50 PM by mouser » Logged
mouser
First Author
Administrator
*****
Posts: 33,795



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #16 on: July 31, 2011, 11:52:50 AM »

Anyone tried this yet? Any feature requests?
Logged
mouser
First Author
Administrator
*****
Posts: 33,795



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #17 on: September 09, 2012, 09:43:29 AM »

You can see my latest use of the library in my Culinary game here.

Note: As of September 9th, 2012, I have made some updates to the python code to better support large blocks of text like you see in the Assignment cards.  Download has been updated.

Example of support for larger blocks of text, with nice wrapping, autosizing, and formatting:
« Last Edit: September 09, 2012, 11:14:13 AM by mouser » Logged
40hz
Supporting Member
**
Posts: 11,084



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #18 on: September 09, 2012, 02:04:34 PM »

That's a much more elegant way to do things than the Quark Express template I once created to do something similar back in my graphic design days. Thmbsup

Ever consider doing a design analysis of how you created your codebase for this, and possibly turn it into a tutorial series or book? Learning something like Python by doing a working project with it would be a nice thing to see. That's always been a problem with most coding instruction IMO. You learn a lot of great stuff. But you're often left wondering what to do with it once you have learned it. Because it's one thing to learn all the the pieces and code small parts. But it's quite another thing to then be able to pull all those pieces together into an actual project or a full blown app. Most coding instruction teaches you how to do something. But it's not too often that it shows you why or where or when to do it.

Who knows? Maybe DC could even start it's own book series. Why should O'Reilly get to have all the fun? (Or make all the nickles?)
 smiley
Logged

Don't you see? It's turtles all the way down!
mouser
First Author
Administrator
*****
Posts: 33,795



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #19 on: September 09, 2012, 02:30:28 PM »

Appreciate the idea, but Python is not my strongest language and there's nothing very special about the codebase.
Logged
40hz
Supporting Member
**
Posts: 11,084



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #20 on: September 09, 2012, 03:14:17 PM »

Appreciate the idea, but Python is not my strongest language and there's nothing very special about the codebase.

Understood. But it doesn't need to be particularly special. Or about Python per se.  All it would need to illustrate is how a code project/app gets designed and put together.  smiley

But never mind. I was just thinking out loud anyway. Grin
Logged

Don't you see? It's turtles all the way down!
mouser
First Author
Administrator
*****
Posts: 33,795



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #21 on: September 10, 2012, 04:24:48 PM »

A different approach but related to programmatically generating lots of card designs is Nandeck, also free.
Logged
zaq.tech
Participant
*
Posts: 8

View Profile Give some DonationCredits to this forum member
« Reply #22 on: October 30, 2012, 03:54:57 PM »

Hi Mouser,

Congratulations from Brazil to this very nice LIB and for the work you are doing here.

I am using your Python Lib and as I am a noob python programmer I have this question for you:

How can I set the upper Text to not be in UPPERCASE? I've tried some changes, but I can't still handle it.

Thanks in advance and keep this great job up.

Zaq.
Logged
mouser
First Author
Administrator
*****
Posts: 33,795



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #23 on: October 30, 2012, 05:16:15 PM »

Finally the first user of the library!  smiley
Welcome Zaq.

Ok so I'm assuming you are using one of my sample scripts as a starting point.  In that code look for a call to .upper() and remove that.  That's the call that is uppercaseing the string.

So for example in samples\codycards\2MakeImages.py,

change:
[copy or print]
   title = pobj.get_propertyval("title","")
    title=title.upper()

to
[copy or print]
   title = pobj.get_propertyval("title","")
Logged
zaq.tech
Participant
*
Posts: 8

View Profile Give some DonationCredits to this forum member
« Reply #24 on: October 30, 2012, 05:28:38 PM »

Thank you mouser.

You have no idea what many things you can do with your LIB.

I got excited to learn Python just because your Library.

I have some good ideas to use  your library.

My first is to help children to learn alphabet. For example: one card I will put the letter "T" in other I will write the word "Tree" and say to children:  "T" as in "Tree", and so on...

Other nice thing to do: memory game. Print twice the card in a good paper and play with kids too.

I am studing a lot your website. Everyday I read things here I got more impressed with the great work you all are doing. I hope soon have time to share some things and projects with the members.

Thank you again mouser.

Zaq.
Logged
Pages: [1] 2 Next   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.045s | Server load: 0.07 ]