5 ms·
I'm the author. I wrote the game and engine using the wonderful, and fast, Gambit Scheme (http://gambitscheme.org/ http://gambitscheme.org/). I needed a lisp t
by rrradical 13y ago
I'm the author. I wrote the game and engine using the wonderful, and fast, Gambit Scheme (http://gambitscheme.org/ http://gambitscheme.org/).
I needed a lisp to manipulate the puzzles, because they aren't based in a strict grid. It ended up being way more natural to program the block structures as lists rather than traditional matrices.
Gambit compiles the Scheme code down to C, which I can then link to Objective-C for iOS, or port to Android or any other platform that Gambit supports.
- orthecreedence 13y agoWould really like an end-to-end guide on compiling C with objective C (and possibly some example code in gambit that shows the interfacing you did). I'd love to be able to do this with ECL (http://ecls.sourceforge.net/ http://ecls.sourceforge.net/) to build apps in common lisp for iOS (possibly android). I know about MOCL, but I'm a pretty cheap guy, so would rather stick to open technologies and do the work myself. I'm not a scheme guy, but until you get a writeup done, would you mind posting any info you have on interfacing gambit with iOS? Good work, and thanks for sharing!!
- funcall 13y agoI did an ECL port to iOS a while back, which you can read about in the ecl links here: http://kriyative.github.io/tags/ http://kriyative.github.io/tags/ I vaguely remember someone adapting it with an ECL to android cross compilation effort. Can't find that link now. The LGPL license of ECL is something to keep in mind as you consider your options. Good luck.
- rrradical 13y agoThe standard Gambit distribution actually comes with an example iOS project. It also has a script for building the Gambit runtime for ARM (the phone) and x86. It's definitely not a 10 minute process, but shouldn't be too hard. I think I also remember some projects popping up the Gambit mailing list to make all of this easier. It might be worth searching the archives.
- anuragramdasan 13y agoMy lisp experience has been largely restricted to writing elisp. I would really love to write something in Scheme though. How well maintained and diverse are the GambitScheme libraries? I see three different sets on their packages page, do you have any experience with those or would you have some better suggestions?
- rrradical 13y agoI didn't use many libraries. It's pretty straightforward to interface with C code, so instead of writing a whole OpenGL wrapper, I just call into some C code to handle the rendering. It was somewhat tricky to get it all setup, but I followed in the footsteps of James Long (http://jlongster.com/s/jlongster-old/pages/blog/write-apps-iphone-scheme.html http://jlongster.com/s/jlongster-old/pages/blog/write-apps-i...) and a few others. I hope to contribute back what I learned and make it easier for others to use it for games in the future. It's seriously a great language for game writing.
- anuragramdasan 13y agoI agree. I would love to someday be able to build on mobile using games. It would be amazing if you could share a writeup or maybe a hello world starter template on running Gambit on iOS or android. This seems like a lovely project. Congratulations and good luck.
- Turing_Machine 13y agoWould love to see it! I ran across Long's page some time ago, but unfortunately it's way out of date.
- Touche 13y ago> How well maintained and diverse are the GambitScheme libraries? The library situation in Gambit is.... very bad. Last time I tried it (~6 months ago) you had to compile from a different branch to get Blackhole to work. Chicken Scheme has a much better ecosystem. It also compiles to C and is fast. Gambit is known for its speed so I won't say Chicken is as fast but it is "fast enough" and the ecosystem is worth the difference IMO.
- npsimons 13y agoThanks for posting this, but the link is rather anemic for this audience; any possibility of a writeup (even a quick and short one) of how you did it? I've been looking at cross-platform solutions for apps, and the best I've come up with so far is Kivy (http://kivy.org http://kivy.org) and haXe (http://haxe.org http://haxe.org), which both still require a machine running OSX to package for iOS.
- rrradical 13y agoThanks, that's a good point. I am definitely planning on writing up everything I learned in the process. It just launched a few days ago so I'm still focused on handling that at the moment. If you like I can e-mail you in the future when the article is out. There's contact info on my website: http://asivitz.com/cloudbreaker/ http://asivitz.com/cloudbreaker/
- npsimons 13y agoEh, no pressure; I'll keep an eye on your website and HN, but I'd be curious if anyone here has found ways to do cross-platform (Android, iOS, Linux, OSX, Win, etc) apps from the environment of their choosing. I'm not looking to monetize, so arguments of "investing" into platforms I don't already have are moot; this is mostly a hobby/side "what could I do if . . . " sort of thing right now, and just having scheme as another option is awesome :)
- lisper 13y agohttps://wukix.com/mocl https://wukix.com/mocl
- terhechte 13y agoI've recently spend quite some time trying to figure out what's the best way to use a Lisp in order to write multi platform games. I'm still in the researching phase, but if you need to support more than iOS & Android, then ClojureScript on top of a Javascript Game Engine (possibly with native extensions) is the best bet.
- 13y ago
- TuringTest 13y agoOh? How do you traverse vertical and horizontal structures that are wider than one block? If you have vertical lists, following a horizontal row wild involve lots of find-nth-position calls, which I wouldn't call "natural"
- rrradical 13y agoThe basic data structure is this ((0 (73 84 92)) (1 (17 95 31))) Where the 2 digit numbers are id numbers for the blocks. The single digit number to left of each row is the horizontal offset. So, shifting a row, the most elementary operation in the game, just requires incrementing the offset. Vertical shifts are done with a 90 degree rotation operation, then a horizontal shift, then a -90 degree rotation. Sometimes traversing the lists is necessary, but the most common operations are fast, and then rest are fast enough. The limiting factor in performance is definitely rendering, not the game logic.
- mcescalante 13y agoSince you mentioned it, I'd love (to download & play) a port to Android at some point :)
- rrradical 13y agoThanks! I'm planning on releasing for Android soon. Hopefully in the next month or two.
- moron4hire 13y agoAny chance you'd write a technical article on your algorithms? I'm in love with puzzle manipulation code. Seeing the sort of things you're doing would be a lot of fun.
- rrradical 13y agoYea, I'd love to write about some of that stuff. There's unfortunately a big problem with indie games getting cloned out of existence by some big publishers, so I'm a little hesitant to put all of the logic out there. I do think it would be pretty hard to implement in a traditional OO language though. There's a basic explanation of the method in another comment I've written here though.
- jorgeleo 13y agoAwesome work in so many ways. Congratulations!
- chm 13y agoAs soon as I saw the game, I thought about Gambit-C. I'm currently following a compiler class with its author.
- j_m_b 13y ago> I'm currently following a compiler class with its author. Is this an online source? I would love to see a compiler course by someone like Marc Feeley!
- rrradical 13y agoMe too! That would be amazing!
- chm 13y agoNo, it's at the Université de Montréal.
- Flow 13y agoDoes the course have a public page for us to see?
- j_m_b 13y agoI did some digging before I ask chm originally, here is what I found: There are some lecture notes for the compiler class in French: http://www.iro.umontreal.ca/~feeley/cours/ift3065-ift6232/ http://www.iro.umontreal.ca/~feeley/cours/ift3065-ift6232/ Chrome automatically translated that resource for me. Here is Feely giving a talk about a Scheme to javascript compiler: http://www.iro.umontreal.ca/~boucherd/mslug/meetings/20041020/minutes-en.html http://www.iro.umontreal.ca/~boucherd/mslug/meetings/2004102... chm: Lucky... it would be awesome to do a compiler class in Scheme! Could you please tell Feely that some people on Hacker News would be thrilled if he made his lectures available online?
- chm 13y ago