|
I had a painful experience trying to make the video of gnomines-clutter for my last post... it seems to be very hard to capture OpenGL apps under X with any reasonable framerate. Anyway... after finally getting one of the dozens of programs that I tried to work (I can't remember which one now...), I decided I'd try to fix the problem from a different angle.
I'm really only interested in exporting the output of Clutter views, mostly. So, I figured I'd hack up Clutter to output PNGs for each frame. I added a check for the CLUTTER_EXPORT_FRAMES environment variable (or the --clutter-export-frames argument); if it's set, I discard the system time and instead draw every frame (incrementing the master clock by 1/CLUTTER_DEFAULT_FPS, so that the "frame rate" of the output is adjustable). When clutter_stage_paint is called, I read the pixels of the stage and export them to incrementally-numbered PNGs in the current directory.
This should work in theory. In practice, for some reason, some animations randomly speed up or slow down. You can see it in the video (most specifically with the sliding bounces when you finish a level).
Video of Lights Off with this here.
Patch is here. It's not particularly attractive... but maybe once it works I'll make it make more sense...
I'll have to harass someone working on Clutter and see if we can make it work/what I'm doing that's so crazy, because I'd really love for it to work!
There's at least one other thing that needs to be taken into account: idle time. Since frames are only exported when the stage is painted, when you're just sitting there doing nothing, nothing is exported, so the video runs like you're very, very quick with the mouse :-) But I'll work on that later...
Anyway, this might all be crazy or pointless. If so, I apologize! In any case, it can't possibly be as crazy as Carol's first blog post in many months... which is quite entertaining and awesome all at the same time, and details from a layman's point of view what she worked on all summer (while making fun of most of our crew at the same time). It's nice to see her getting along with GCC, finally! :-)
Today marked the final day of this year's Google Summer of Code! It's been a good summer, though I certainly didn't get as much done as I'd hoped, a lot of cool stuff got finished this summer.
Future in GSoC
I've decided that this is my last year participating in GSoC as a student; I had a great deal of fun both years, but I guess it's time to give others a chance, and I really don't like working on open-source with a definite deadline... it's more of a hobby to me than a "job", and I'd like to keep it that way for now — at least as long as I'm sitting at home/school; I think things would work a lot better if I had to go into work instead of working from somewhere where I'm comfortable/easily distracted. I guess a lot of people run into that problem...
Anyway; though I'm not going to participate as a student next year, I'd absolutely love to help out or mentor/co-mentor someone working on a GNOME-related (especially games, or Clutter, or Seed) next year. I think that would be great fun! But that's a good ways away now...
Also: be sure not to take any of the above to suggest that I'm leaving; far from it! I'm definitely going to be at Boston Summit this fall, and I plan to continue working on Seed and GNOME Games for the foreseeable future (as long as nobody wants to get rid of me (I realize there are some who want to get rid of all of us who peddle Clutter/GL/JavaScript/etc., but whatever...)).
Summer Results
It seems the general consensus is that my three games (lightsoff, same-gnome-clutter, and gnomines-clutter) will be moved to the "normal" section of GNOME Games (versus the "staging" section in which they currently reside) in master as soon as 2.28 is branched, and will ship with 2.30.
- seed — I was more or less the active Seed maintainer during the majority of the summer, so this involved a lot of releases, patches, and bugs. I wrote a lot of documentation over the course of GSoC.
- lightsoff — I completely rewrote Lights Off during the GSoC period, and created the entirety of the surrounding UI. It's 99% of the way there; it needs documentation and one preference to be removed (or made functional). The new version has theming, and is much more attractive and less buggy than v.1 or v.2.
- same-gnome-clutter — Lots of updates and reorganization, as well as a bunch of preferences. And theming! (though there are no other themes, at the moment)
- gnomines-clutter — Started an initial implementation, using things I've learned over the course of writing and rewriting the other two games. It has a very preliminary Clutter UI, but the game is theoretically playable.
Overall, I'm very happy with the games as they stand... I'm a little iffy about the performance of same-gnome-clutter, but I think I might know how to fix that. There's still a lot of work to do (saving high-scores still doesn't work, but I put that aside to work on gnomines-clutter so I would have something to show by the end of the project).
gnomines-clutter
Since nobody's seen any of gnomines except my family and Thomas, I guess I might as well show it to you here! Keep in mind that this is a total of a day of Clutter work (after working on and off for a few weeks in between other things on the underlying structure of the game and getting a playable CLI version working), so it'll get a lot better shortly. Also, I stole the flags and bombs from the current version of gnomines... that could be a good thing, or a bad thing... we'll see!
Click on the image for a short video!
I'll be creating a gnomines-clutter branch on GNOME Games git tomorrow (if nobody has any complaints) in which to continue working on this (right now I'm just using a local Git repo, so the code isn't published anywhere yet).
Just this afternoon, I pushed Seed 0.8.5 and gnome-js-common 0.1.1 to GNOME FTP. Both of these are primarily maintenance releases; however, Seed sees two new bits of code: native modules to bind MPFR and gettext. The bindings for the former are still incomplete and experimental, but the latter has already found use in my gsoc-seed-games branch of GNOME Games. Many thanks to Matt Arsenault for the MPFR bindings.
The largest change in 0.8.5 is a massive reorganization of the documentation. I've recently been somewhat irritated at some other projects' poor documentation, and have always appreciated the care that Clutter and GLib/Gtk+ always seem to have taken with their reference manuals (all three of which I rely on daily). This reorg is the first step I'm trying to take towards having a good reference guide for Seed, too. I realize that there's still a lot of writing to do, but the framework is finally there in a way that I feel comfortable working within.
Between 0.8 (I realize it says 0.7, someone forgot to update the source) and 0.8.5, we went from this:
to this:
As you can see, that's a pretty significant jump in structure. I've also decided to jump on the one-manual bandwagon, unless anyone objects, so I'm going to be updating and moving the tutorial into the manual, as well as constructing a Seed+Clutter tutorial (probably a walk-through of constructing a draft of one of my games, unless someone has a better idea). In addition, the runtime documentation (which covers using the JavaScript side of Seed) will be merged in (and is in dire need of updating).
I realize that some of the right-hand side long descriptions are somewhat contrived, but it looks so empty if you leave one out!
After the jump, the 0.8.5 ChangeLog:
- Significant reorganization and expansion of the reference documentation
- New native modules:
- gettext
- MPFR (partially complete)
- Same Seed has moved to the gsoc-seed-games branch of Gnome Games (and will eventually move to master)
- Add seed-module.h, which includes a handful of macros to make writing modules slightly more attractive. Look at gettext or the reference docs for examples.
- Prefix native modules with seed_ (libseed_readline.so, etc.); this fixes the need to incessantly 'make clean' seed and cuts down on ambiguity in naming.
- Add 'seed_value_is_string', 'seed_value_is_number', and 'seed_value_is_object_of_class' to libseed
- Update examples to latest (now frozen) Clutter API changes.
- Fixes a bug with the importer search path which resulted in the search path being overwritten each time something was imported
- The importer now also searches the directory in which the script being executed is located by default.
It's been way too long since I've written here; and, it's going to stay that way for now, unfortunately. I'm just going to quickly copy my weekly status reports for the first five weeks of GSoC in here, to share...
Week 1
Hi, all!
I was in Barcelona at UDS last week, so I didn't get that much work done, but I also started early so as to get something done.
So far:
* I started (and got a good ways on) a much-cleaner and more-modern-seed rewrite of Lights Off. There's all kinds of awesome brokenness (mostly a result of airport coding practices) so I wouldn't suggest installing it at the moment.
(http://jayne.hortont.com/git/cgit.cgi/lightsoff3.git/)
(http://files.hortont.com/lo3.png)
* I created a PPA for those of us working on GNOME Games to publish our work; I'm going to get introspection and Clutter and seed and whatever you guys need in there shortly, and once all that is working, I'm going to merge all of the GSoC GNOME Games branches, build a copy, and push it to the PPA (and wash, rinse, repeat, at least once a week). (if anyone has working debian packaging for the as-yet-unreleased gobject-introspection-0.6.3, let me know, I've been fighting with it all morning)
(https://launchpad.net/~gnome-games-experimental/+archive/ppa)
* I worked with racarr to get seed-0.8 out the door while at UDS, which includes an important GC-related fix that affected ClutterAnimations, so we reduced leakage (or hacky code to avoid leakage) in all of the seed games.
(http://ftp.gnome.org/pub/GNOME/sources/seed/0.8/)
* I blogged about the Lights Off tiles (just for fun!), and got about 1000 votes, choosing the new ones 4:1 (not even remotely surprising).
(http://www.hortont.com/blog/2009/05/lights-off-tiles/)
Week 2
I spent a good part of the last five days (my last status report was late, so the duration between these two is less than it ought to be; do let me know if Sunday night is the wrong time for these!) working on various things:
* I created a branch of GNOME Games for myself (gsoc-seed-games) and imported the rewrite of Lights Off from last week into it.
* I finished populating the PPA that I mentioned that I created in the previous cycle. It has fresh-from-Git versions of webkit, seed, opengl-glib, gobject-introspection, gir-repository, gnome-js-common, clutter, and clutter-gtk as well as a copy of gnome-games which includes my branch, Guillaume's branch, and Zhang's branch (so, as far as I know, all of the GNOME Games GSoC Goodness).
* I talked to both Guillaume and Zhang to fix tiny packaging problems in their branches in order to achieve the above.
* I spent the better part of an entire day deep inside the Clutter source, trying to determine the source of a bug; I eventually found the _source_ of the bug (#1631), but do not have a proper patch; the PPA includes a patch (which is also in the seed repo, in the patches subdir) that removes the broken optimization, but I'm not sure how to appropriately /fix/ it... in any case, this means that the most significant animation bugs are fixed.
* I cannot wait until Clutter-1.0's API stability. There was lots of updating Lights Off to the changes caused by the merge of the integration-1.0 branch into head, this week, too...
All in all, a week of bugs and packaging, and not a whole lot of awesome new code... but these are important things! I also made a very overview-y next-steps-to-do list at Thomas' request:
1) Get libgames-support installed + building gir/typelib.
2) Consume libgames-support inside LO so I get game-related stock items and stuff, finish LO UI.
3) Move LO + Same into gnome-games git. (this is half done, now)
4) UI for Same (consuming libgames-support stuff); high-scores, preferences (?)
5) Mines!
Week 3
Hi, again!
This is going to be a terse status report, as I'm currently running around rather busy...
This week, I:
* got libgames-support installing into prefix/share/gnome-games-common (commondatadir)
* got libgames-support build generating introspection data
* consumed the aforementioned introspection data in Lights Off, and started (about halfway) to consume it (for high scores) in Same
Next, I want to:
* move Same into my branch of gnome-games, and get it building as an option (alongside the C version)
* figure out what to do about ggz introspection data
* finish high scores code in Same, menu, etc.
Week 4
Another week! Another short, last-minute status update.
* Fixed a longstanding bug (#579008) in gobject-introspection, which was requiring us to carry around a patch to Clutter that would /never/ get applied (it removed annotations to work around the bug). Hasn't been committed yet, but since it ended up only being a single line (once I realized what was going wrong), I'm sure it will be soon. Also, filed a bug (#1653) against Clutter to *add* some necessary annotations once this gets fixed...
* Worked a bit on getting the SVN version of GGZ to generate its own introspection data. This is proving to be slightly annoying, because GGZ is split into numerous parts, and I'm having awesome crashes and stuff...
* Moved Same (the JS version) into gnome-games repo, get it building properly (right now, it installs beside the real version, should become a switch at some point).
* Same (when it was still in the Seed repo) has a C version that I'm using to figure out some oddities with Seed+Clutter, and both that and the JS version work with Clutter head now.
Stuff in the gnome-games repo hasn't been pushed yet (just got home from NY, fighting with Git, I hate losing the ability to rewrite history, etc.; it'll all be up by tomorrow).
Week 5
* Made a to-do list to keep up to date (http://www.hortont.com/gsoc-seed-games-todo.html) Right now, it only has stuff that I could think of off the top of my head this morning, but it's already a relief to no longer need to keep such things in my head. Anyway, I'll continue updating it and checking things off from here on out.
* Cleaned up animation and events and stuff in Same, which fixes some strange flickering when you move the mouse over the window, and makes most of the animation smooth again (update to match the fact that Seed handles animation memory now, too). This is incomplete, still, there's a little left to be done.
* Wrote a tiny 'gettext' C module for Seed, so that we can _("asdf") from JS. I still have no way to scan JS files (xgettext in C mode pulls out all of the strings for some reason), but my to-do list links to a promising project (I don't know what licensing problems would be involved in utilizing a MIT-licensed project to do this, though...) that scans JS for gettext calls.
* Added an About dialog to Lights Off, after getting gettext working as above.
* Finished the LO menu (except for "Help"), fixed keyboard accelerators.
* Fixed the blue corruption around the LED display, and make drawing much more logical and efficient (not sure what I was thinking making dozens of ClutterCairoTextures)...
* Theme names are pretty printed now, not just the name of their directory.
* Keyboard-based play (use the arrow keys and enter) — move around a small glowing dot, and play without the mouse. It's not fun, but I saw it somewhere else — Same, maybe? So it seemed like a good thing to have. Accessibility in games? I'm not sure.
* GConf schema for LO prefs! Whoops; this one should have happened a long time ago.
* Got most of the PPA updated. However, for some reason, gnome-games refuses to build on non-x86 architectures. If anyone wants to help me, please do :-D
Anyway, LO is almost done (needs "Help" and various bits of cleanup, but it's mostly happy)... Same isn't far behind.
During one of my first conversations with my GSoC mentor, Thomas H.P. Andersen, he suggested that we set up a Launchpad PPA. A PPA would be a great way for people (people using Ubuntu, at least) to get ahold of the very latest work being done with Gnome Games, provide a lot more eyes, and encourage much more feedback from the community during the summer development process.
So, this week, I went ahead and created the gnome-games-experimental PPA. It currently contains all of the dependencies for my branch of Gnome Games (including WebKit, seed, gobject-introspection, and Clutter), as well as a build of Gnome Games itself. This build includes three branches:
gsoc-seed-games — my ports of Same Gnome and Mines to Clutter+Seed, and a new game, Lights Off
gnibbles-clutter — Guillaume Beland's port of Gnibbles to the Clutter canvas
sudoku-tube — Zhang Sen's implementation of joint Sudoku games over Telepathy tubes
Keep in mind that we've only been coding for a week and a half, so if you go ahead and try out the PPA today, expect to see very little working, and within what works, lots of horribleness (I personally know of numerous gigantic animation bugs in Lights Off that you'll get to experience!). However, if you do decide to jump onto the cutting edge, you can feel awesome about yourself for helping us out, and you'll also get to play with the finished products long before anyone else.
I plan to update the packages in this PPA once a week at the minimum; you're welcome to use it (please, use it!) and let me know how it goes... I'm new to packaging things (relatively; I packaged bits for Seed before, but that never went well), and I'm probably doing it slightly (or totally) incorrectly. Let me know, and I promise I'll fix it!
It seems to install properly against a fresh Jaunty install (just add the repository, upgrade gnome-games, and watch as the dependency list explodes in your face; most of those won't end up actually being dependencies of Gnome Games, it's gir-repository's fault...); Karmic builds will be ready soon. I make no promises about stability or about these packages not screwing up your machine (especially things that use WebKit)... but if you have trouble, again, please let me know!
Today more or less officially starts coding for GSoC; however, I'm leaving for Barcelona (for UDS) at 10AM. To offset the fact that I'm going to be missing for the first week, I started hacking on the clutter-0.9/modern-seed version of Lights Off. You can check it out [Ed.: merged into gnome-games Git] if you want, you'll need a recent version of Seed and a patched Clutter (the patch is in the Seed repo, under /patches). I'd suggest you wait, though, because all of the shiny (animations and such) is currently broken (looooong airplane flight tomorrow, we'll see what happens!).
Anyway; the Lights Off tiles from the video are from six months ago, and were made in a matter of minutes in Inkscape, designed to look as much like the physical copy of the game as I could achieve (I am not an artist). Robb has since been trying to convince me to try again, suggesting that they might not be the most Gnome-y tiles in the world. I decided to grab the nicer, Tango-colored tiles I made for my Seed port of Same Gnome, create a black tile, and see how that looked (redesigning most of the rest of the somewhat-minimal UI in the process)...
In any case, I'm not sure what to use! I'm pretty sure I'm going to have a few swappable themes, but I don't know what to use as the default... or even if either of these were the best we can do. In the meantime, I figured I'd let you guys vote between the two, and if you have any ideas for improvement (or, even better, SVGs!), send me a note!
Newer style is on the left, the originals (from January) are on the right. Click away (your last vote is the one that counts, and voting is immediate when you click the link)!
[Ed.: voting is closed]
Yesterday, I got a wonderful email from Google telling me that my proposal for Summer of Code was accepted! So, this summer, I'm going to be working with Thomas Andersen on GNOME Games. I'm going to finish polishing Lights Off and the Seed-Same Gnome rewrite, make it easier to write games in Seed (by making libgames-support available), and (primarily) port Mines to Seed+Clutter. I have a feeling the work encompassed in my proposal might not take the whole summer, so I'm keeping my mind open for anything else that might be interesting to do towards the end. We'll see!
Anyway; thanks, again, to Google, GNOME, Thomas, and everyone, and I hope we all have a great summer!
P.S. A little birdie told me that Mike and Matt both also got GSoC projects this summer! Congrats!
2009.04.03 in code
The FOSSCamp at UDS : Hardy Heron was, more or less, my reintroduction to the Linux world... I'd been solely using Mac OS X up until that weekend. Robb dragged Gino and I (and Sarah) down to Boston to hang out with everyone there, and see what was going on. Since, I've become somewhat more involved in said world, mostly through contributions to Seed...
Fast forward to this year: Mom and Dad are helping (for Christmas) to send me to UDS : Karmic, so I'm going to Barcelona!!
I've been looking around at hotels and flights and stuff; most places in the area only offer doubles, so if anyone's going sans sponsorship and is looking for a roommate (and doesn't mind Hotel Rey Juan Carlos' 200€-a-night prices), I promise not to be too bad (really, I just might talk about JavaScript a lot... that's all!)! Email me if you're interested (or, even better, if you know of somewhere in the area that's cheaper!)...
2009.03.30 in code
Chromium is surprisingly usable on OS X at the moment. There's some quirky bits in rendering (which are funny because of the whole it's-really-WebKit thing), and you can't reorder tabs at the moment (they drag out and don't reattach to the window). I haven't crashed it yet...
In any case... I'm rather impressed with how far it's come so far, what with nearly nobody ever actually talking about it. Nate is convinced it'll be a worthy competitor to Safari, but I don't understand what a browser could offer that Safari doesn't already :-)
Oh, also... Google's SVN server is a million times faster than Apple's. I checked out all of Chromium (including a whole checkout of WebKit) within an hour. Which is significantly faster than the half-a-day it takes to get from Apple's SVN or Git. And build was really fast, too. But I've never built WebKit+Safari, so I have nothing to compare with (still, I'd say the overhead of Chromium+V8 over what WebKit normally takes to build was minimal...).
Try. It. In a few months...
P.S. Wrote this from Chromium!
2009.03.21 in code
I spent a bit of time trying to get the Intervalometer working, after Dad and I carved up the case while I was home. The board is really a mess; unsoldering the posts I put on from before turned into a real mess, so that's not going too well. We'll see — in any case, I put that off for a day when I'm not soldering at 1AM.
Instead, I got angry at the amount of crap required to get a standalone ATmega working (and programmable) on a breadboard. Even though it's only a handful of components (3) and wires (a bunch), the most annoying part is getting the ICSP cable attached. Right now, I've been just poking wires into the cable, which is annoying because there's no way to unplug it without looking up what goes where, again and again... very annoying.
So I sat down and started putting together a little gadget, based on one of the tiny little bits of protoboard I got from SparkFun. It's got a ICSP header, 16 MHz resonator, reset switch, and power LED, as well as the reset pullup resistor. There are 9 pins on the bottom (one more than optimal, really), in two rows (3 and 6) spaced at normal IC-spacing (0.2"?), so it drops right into a breadboard. Now, it's just 9 (optimally eight) wires to the ATmega, and you've got everything working great (except analog input, but that's just one or two more wires), and can easily remove the programmer without issue, and everything remaining is contained on the breadboard.

It's not as elegant as the little board that slips over the ATmega that I saw on that Arduino blog a few months ago, because the protoboard I had wasn't wide enough to span all of the necessary pins. Perhaps revision 2!
I'm not posting a schematic because it's obvious (and because it's 3AM), but if I revise it to be more interesting, I might...
|
|