6 ms·
Squib: A Ruby DSL for prototyping card and board games
- benlaud 11y agoYou force me to learn Ruby...
- cosarara97 11y agoBe happy you got an excuse to learn another programming language.
- codinganarchy 11y agoWait, we're supposed to have excuses for that? I've just been doing it for fun.
- GaiusCoffee 11y agoLooks cool. I don't know ruby though.. :(
- asQuirreL 11y agoYou don't know ruby yet.
- egeozcan 11y agoI really like it. It's like re-inventing email templates for playing cards. OTOH, can't static site generators be a bit more flexible for such tasks? I guess I'll need to give it a try, but first I need to learn a bit ruby I suppose.
- Marazan 11y agoEveryone should write their own static site generator.
- egeozcan 11y agoI wasn't talking about a new one, but using an existing one to generate card-style pages. One could then run a script to render them to svg/png images by using something like Phantom.js. Just an idea.
- Marazan 11y agoI gathered, however I passionately believe (through personal experience) that making an existing Static Site Generator do _exactly_ the thing you want is more pain and effort than just writing one from scratch. Writing one from scratch is also fun and instructive as a programming exercise. A classic Input->Process->Outout problem, so many ways to approach it, huge scope for elegant engineering and, once you are done, a really great tool for your specific needs.
- egeozcan 11y agoWho said I didn't? :) https://github.com/egeozcan/jstatico https://github.com/egeozcan/jstatico (very naive implementation to generate small sites) A larger percentage of the developers I know have their static site generators so I completely agree.
- zem 11y agohttp://prog21.dadgum.com/56.html http://prog21.dadgum.com/56.html agrees with you: I still like to implement my own ideas, especially in fun languages like Erlang and Perl. I'm glad I can program, because personal programming in the small is fertile ground and tremendously useful. For starters, this entire site is generated by 269 lines of commented Perl, including the archives and the atom feed (and those 269 lines also include some HTML templates). Why? Because it was pleasant and easy, and I don't have to fight with the formatting and configuration issues of other software. Writing concise to-the-purpose solutions is a primary reason for programming in the twenty-first century.
- calineczka 11y agoIt looks fantastic for rendering the cards :)
- zyxley 11y agoI wonder if it'd be possible to recreate Magic: the Gathering cards using this. It'd be nice to have an alternative to Magic Set Editor for high-quality cards.
- eru 11y agoOh, I was hoping for a DSL for prototyping the rules to play these kind of games on a computer (and perhaps train a neural network as an AI opponent). I've been working out how to do these things recently.
- gedrap 11y agoActually, sounds interesting. You could use it to discover flaws in the game play, given you can quantify 'bad / boring gameplay'.
- comrh 11y agoIt isn't a language but Tabletop Simulator [1] is basically the ultimate in simulating any board or card game. 1: http://store.steampowered.com/app/286160/ http://store.steampowered.com/app/286160/
- lfowles 11y agoCorrect me if I'm wrong, but isn't Tabletop Simulator only about physical simulation? VASSAL seems much closer to what parent is looking for (but there's still very little on the rules verification front there).
- comrh 11y agoI think you're right, Tabletop Simulator gives you an environment to do anything but doesn't help you define interactions and rules as far as I know.
- eru 11y agoAs far as what you care about most games go, a chat room with the ability to send private messages to each other and a (human) game master is all you need to play almost any game online, if you don't care about automated rule verification.
- mmanfrin 11y agoYonatan Bergman gave a talk last year at GoGaRuCo about building a really rudimentary AI to test a board game prototype in ruby: https://www.youtube.com/watch?v=EcnvbsXdbtI https://www.youtube.com/watch?v=EcnvbsXdbtI
- gedrap 11y agoI shared it with my colleague who's not into programming but loves board games, that got him quite excited. So I thought that this project can be used as a motivator to teach kids programming :) because it's like look kids, with this simple code, you can generate these awesome cards, isn't it great?
- kriro 11y agoThis is a pretty excellent idea. It seems like a good idea in general to have code create something physical as a motivation. Another cool project would be a treasure map DSL or something similar...heh your comment got me thinking :) Maybe a DSL for describing simple 3D printable stuff would be an option if a printer is available.
- gedrap 11y ago3D printing is great because it's something physical and useful. Other physical alternative is, quite obviously, Arduino. I have no experience teaching kids but I think that it would be a really solid option too given they implement something useful (to some extent), and that's a really important point. I mean a blinking LED is cool for the first time but then you just forget about it. But for playing cards, or 3D printed stuff, it's something you can actually use it and you can keep improving it, driving more learning. Given the adoption of Arduino, I'd be surprised if no one has developed a solid course for kids yet.
- troels 11y agoVery cool. I have a bunch of html templates and imagemagick scripts for this, but always thought I would turn it into a more coherent suite at some point. Glad someone did it for me!
- milkworsethan 11y agoI don't have any use for this but it looks really neat given how simple it is to create the set of rules to generate cards, nice work.
- markmywords 11y agoThanks for sharing, this looks really nice. Does anyone know similar projects that help with developing card- and/or boardgames?
- lorennorman 11y agoThere's our project, Paperize: http://paperize.io http://paperize.io (spoiler alert: we're still invite only/early access!) It's a web app, not a code library, but we're solving similar problems. We love Squib though, keep up the good work!
- andymeneely 11y agoI'm really excited about Paperize. I can't wait to see more of what you're up to.
- lorennorman 11y agoYay! Let's be friends and unlock the magic of game design for everyone! (Serious comment)
- kriro 11y agoVery interesting. I'm interested in the same space alas I focus on prototyping the physical game virtually not generating physical prototyping materials. My vision is building a GUI where you can define game objects which generates JSON (I had something like a game DOM in mind). However I've been pondering how to get the actual rules system done/integrate it. It would be a lot nicer if one could define the rules via a DSL and link game objects to rules graphically than to implement them ad hoc. I'm mostly interested in rules based systems and AI and my research was leaning towards creating a DSL for describing players' strategy. I started out doing it in Prolog as an internal DSL but switched to ANTLR and changed it to an external DSL. Ruby is a pretty great choice which I considered before moving to ANTLR. Edit: As this is geared more towards creating physical prototypes you should post this on boardgamegeek if you haven't already.
- andymeneely 11y agoOk, so this is something I also want to do someday. It's not what Squib is at all, but I feel like we need better tools board game simulation and machine learning. In particular, I'd like to simulate the game with very basic AI, then analyze the games to look for overpowered moves (e.g. if 75% of all winners used Black Lotus). I'm trying to do this in an ad hoc way on my own games, but progress is slow :(
- lfowles 11y agoI'd recommend talking with the VASSAL people if you haven't already. I was looking into something similar (defining pieces and rules in a DSL that would spit out an engine suitable for AI) a few months ago when I was all motivation and no outlet.
- pepsin 11y agoThis is insanely awesome!
- rodw 11y agoI've never used it, and believe I'd prefer a text-based declarative framework like Squib for this task, but just an FYI for everyone, there is a GUI program called nanDeck [1] that is often used for this purpose. For what it's worth, I've occasionally used a little LaTeX framework derived from [2] to create fairly high-quality prototype cards. Perhaps a LaTeX or PS output from Sqiub would be a useful extension. From a quick skim though, I think I'll be giving Squib a try the next time I want to do something like this. [1] http://www.nand.it/nandeck/ http://www.nand.it/nandeck/ [2] http://tex.stackexchange.com/questions/47924/creating-playing-cards-using-tikz http://tex.stackexchange.com/questions/47924/creating-playin... PS: If you are looking to promote Squib, as might already be obvious to you, I'd recommend /r/boardgamedesign [3] and somewhere (I'm not sure where) on BoardGameGeek [4]. The latter might be especially interested as many people seem to create custom "fan decks" for existing board games. For example, the game Love Letter is frequently re-skinned or re-themed as seen at [5]. [3] http://www.reddit.com/r/boardgamedesign http://www.reddit.com/r/boardgamedesign [4] https://boardgamegeek.com/ https://boardgamegeek.com/ [5] https://boardgamegeek.com/files/thing/129622 https://boardgamegeek.com/files/thing/129622
- Schwolop 11y agoI did the same thing as you with Python + LaTeX + Tikz. I think I used the same stackexchange question as a starting point too... Here's a view of my deck: http://1drv.ms/1LREWSM http://1drv.ms/1LREWSM There's also http://paperize.io/prototypes http://paperize.io/prototypes which has recently opened up for a beta testing phase.
- crobi 11y agoWhat I like: - Data driven - High-quality output - Raster and vector output What I don't like: - Complicated to set up (install Ruby, install multiple dependencies, compile code). This will scare away many potential users. - Complicated to use (edit text files and run command line scripts). While I like this workflow personally, I feel this will again scare away some people. - There's already many generic tools where you can write scripts to produce images from input data. Maybe you could explain why your tool is better suited for designing cards, given how complicated it is?
- andymeneely 11y agoI simply made a thing that I wanted to use. And then made it open source in case anyone else wanted to contribute. I've used a ton of tools for this task for nearly 10 years now - most notably nanDeck, but trying out just about everything else. I kept saying, "this is cool, but I want to do it in Ruby". I also wanted an open source alternative to nanDeck. I love nanDeck, and Andrea Nini has been amazingly responsive at fixing bugs quickly, and at pushing out new features frequently. But open source projects (if done right) build more of the user-developer community that I'm looking for. Regarding being complicated. Personally, I made Squib to match the way I think. Doing rapid prototyping on card games is both complicated tedious no matter which way you slice it. Squib helps with the tedious part. Ruby provides so much to take complex tasks and condense them to readable code - I wanted to leverage that for a very specific task. Yes, I know some people are scared away by the fact that it's programming. Or the fact that it's Ruby with some native dependencies. But (and this I know from my day job as a software engineering professor) Ruby is among the easiest programming languages to learn. Already, I've seen some folks over at BoardGameGeek enthusiastically pick up Ruby and learn it just for Squib (http://www.boardgamegeek.com/article/19640981 http://www.boardgamegeek.com/article/19640981). That's awesome and already more than I had hoped for.
- crobi 11y agoYour project is certainly interesting, the comments regarding ease of use were just meant as a hint for how you could attract even more users. Consider a hypothetical web application (no setup) where you write the same Ruby code and get a live preview (no need to explain windows users what a command line is) - this would take lots of work and money, but would probably be more popular. Look also from the perspective of a person who is looking for a card design tool, is not emotionally attached to your project, and does not prefer Ruby over other languages. For these people, you compete against solutions like Tikz or Processing or some Python script, which are also capable of defining the content and layout of the cards separately. That's why I thought it might be a good idea to mention some amazing advantage of your tool in its short description. If you want to create a community around your project, how about opening a gallery with examples, like the one the Tikz project has (http://www.texample.net/tikz/examples/all/ http://www.texample.net/tikz/examples/all/)?
- mrblues 11y agoAnyone interested in this project might find this interesting. http://paperize.io/beta http://paperize.io/beta
- yellowapple 11y agoI'd probably prefer something allowing everything to be defined from the Ruby side (other than the images themselves, of course, or at least other than the raster ones), similar to how Prawn works. Pretty neat regardless.
- andrey-p 11y agoRelevant thing that was posted on HN last year: http://www.vassalengine.org/ http://www.vassalengine.org/ I haven't had a chance to try it out but it looks great. Apparently it allows you to build board game mockups, and then play them locally or online. Useful for prototyping gameplay without having to print stuff, or alternatively you can also try games out before buying them.
- nicolewhite 11y agoI never had any plans to learn Ruby, but I'm going to now.