290 points · by rrradical · 12y ago · 110 comments
We had one guy knicknamed Major Cablecutter as he "clipped" the guidelines of a radio tower one time. He also had come back more than once with branches stuck to his F4. Being that they were only "Recon" they tended to be aggressive during war games and this game guy over stressed his airframe turning into some F18s trying to tag him.
So many military planes have such high thrust to weight ratios I do not doubt that wings merely become the means to stable flight
Just the first that comes to mind.
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.
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/
I'd love to be able to do this with ECL (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!!
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.
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.
((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.
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.
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-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.
There's a basic explanation of the method in another comment I've written here though.
Almost makes me want to play around with it again. :)
I had trouble getting the server based repl working, so here's the in-game repl I ended up implementing as a Quake-type dev console: http://imgur.com/J6ozzT6
(Obviously disabled in the App Store version.)
I may be getting ahead of myself, but I think it's a GREAT language for writing games, and is going to take off at some point.
The cool thing about having a real Gambit REPL was that you could use the Gambit debugger in real-time. So if an error ever occurred, the debugger REPL would pop up and you could step around. You also get all the builtin stuff for inspecting cooperative threads and such.
Anyway, it would be a great minimalistic environment if it was fleshed out more. Part of my mission in the JavaScript world is to bring these concepts to more people, and hopefully lead them to Clojure/Scheme/etc.
Did you use a module system? Last I remember Black Hole was getting really advanced. Did that ever take off within Gambit?
I couldn't get Black Hole to install and gave up. I remember the docs being pretty bad, even for Gambit. I use the builtin namespacing system, which works pretty well. Hopefully R7RS will make the whole scheme world a bit more user friendly.
You sound like you know how to code. Can you talk a little more about how the algorithm you were confronting made the effort of getting a Scheme platform working worthwhile? Understood if the answer is "not that big an effort". :)
Part of my question is that a solid lisp (of any ilk) programmer can program non-lispy languages in a lispy way.
It is great work, and I think there's value in making other languages that don't require huge runtimes viable for ios development.
Just today I found a Clojure/ObjC bridge: https://github.com/galdolber/clojure-objc
https://itunes.apple.com/us/app/gambit-repl/id434534076?mt=8
and on the Android platform (updating it with the latest version of Gambit is on my todo list):
http://apps.keithflower.org/?page_id=152
http://apps.keithflower.org/?p=223
https://play.google.com/store/apps/details?id=org.keithflowe...
Note that this is just the interpreter itself - not a very good way of writing games for Android.
(car(cdr(car(cdr(cdr a)))))http://www.amazon.com/The-Little-Schemer-4th-Edition/dp/0262...
I tried reading the book a few years ago, I remember being irritated by the QA style it uses and dumping it because of it. On my second attempt I realized that it's only irritating if you know the answers very well and skipped to the chapter I didn't have so much confidence in understanding. And it was very pleasant experience, especially when I stopped to think a little before reading the answers. It felt like I was having fun.
So I'd advise to give a book a go, even if you are confident in your Scheme and FP skills. Just skip the parts which seem too obvious to you and get to the interesting stuff, you won't be disappointed.
Now it's time for The Seasoned Schemer, I guess :)
JavaScript in webviews is excepted because you couldn't show a website without that.
If you don't get new code from the Internet (for example, someone types it in) that's ok. It's even ok to copy and paste it from the Internet.
This developer has another puzzler in the App Store as well: Button Brigade, also quite original, but more of an adventure style puzzle game.
https://itunes.apple.com/us/app/button-brigade/id542991688?m...
Tried your game, was not disappointed. :-) It's almost spooky that your post came at this time, for I have read a lot about Scheme->C systems this week. This PDF made a great impression on me of the gambit scheme system. http://www.iro.umontreal.ca/~gambit/Gambit-inside-out.pdf
I have a few questions for you:
1. I installed Gambit-Scheme via Brew and compiling any scheme file results in a clang segfault. How did you get around this? For now I use gcc instead. :-/
2. Why Gambit-Scheme and not Chicken-Scheme? I can't really decide which is the better choice for writing a game.
3. Do you use continuations to make coroutines in your game?
Basically, the problem is with the version of llvm/clang that Apple uses in Xcode 5.
Some of the newer Xcode betas might fix it. I personally use the Xcode 4 compiler. You could probably also build your own clang from their SVN.
For more info you could probably ask the mailing list.
2. I definitely looked at chicken, and I can't remember my exact reason for going with gambit, but it was a practical one. I don't think I could get chicken up and running on the iphone for some reason. Chicken did seem to be better documented with better libraries. Gambit may be faster though.
(I started working on this about a year ago. The situation may be completely different now.)
My game isn't too complex, compared to, say, a first person shooter. I'm not sure if the GC implementation would start to matter in that circumstance. I recommend trying one and then if you're happy with it, great. If not, most of the code will be portable.
3. No. I don't have much experience with them (besides learning the basics in school). I did use a lot of closures, anonymous lambdas, and lambda builder functions.
Glad you're enjoying the game!
I wonder if I'd have taken more to Scheme if I were learning it now. At the time, I was double majoring CS and Telecom, but the world of open source hadn't been as friendly to Mac as it is now, and Macs were a prereq for TCom. Getting Scheme running on my old iBook was a pain in the ass, let alone the assignments (which still didn't match the untouchable stability of our automated grading system). I conceptually understood why I needed to learn it, and even grasped many of the concepts of what I was learning, but it wasn't the language for me.
scheme REPL over TCP using chibi scheme: https://github.com/clarkeaa/Scheme_iOS_REPL
calling in and out of Gambit-C: https://github.com/clarkeaa/HelloGambit
You can grab a precompiled Gambit-C library from the later project if you want.
Your in game REPL is neat. For developing games, where there's a need to explore variations quickly, it is a powerful tool. I'm currently working on a remote REPL for Gambit-JS, so that you can remotely debug Scheme code (possibly games) running in the browser.
Am I interpreting correctly from some of the other components that doing the programming in a language-once-removed (ie Scheme instead of Obj-C) opens an easier path to compiling for both iOS and Android?
http://en.wikipedia.org/wiki/Ultimate_(sport)
my college football team played it as a spring sport during "optional" workouts and it was brutal. Like rugby, only with a forward pass.