This game is called Bakery. Check out the details on http://github.com/janmejay/bakery/ It works well on Mac, but has horrible fonts and is pretty slow in linux. May be i can use some learnings if anyone has linux/gosu performance war stories to tell. If you like the concept(or the game itself), please help me make it better by sending feedback to singh[dot]janmejay[at]gmail[dot]com
Byjlnr (dev)
Date 2009-08-09 10:29
Edited 2009-08-09 10:38
As I said, I like it :)
And if anyone has either good or bad performance on Linux, please post the distro and other information, because right now I have no idea where to start debugging Gosu :(
Well it does work on linux, but has a noticeable delay between show and hide of windows(for instance when user goes from game welcome screen to new game) and places like warehouse(after storyline strips, user is pushed to warehouse to purchase new inventory). Clicking on "Buy" button causes some delay before item shows-up as purchased(gray).
Comparing it with Mac makes it more evident. On Mac it is very snappy.
Fonts is the second problem and a very major one. On linux, gosu fails to load non system fonts(which spoil the appearance in addition to making it unreadable).
What parameters do i need to post to give more detailed understanding of my gosu/linux installation?
Mine is a Lenny(Debain) laptop running 2.6.26-2-686 (almost all the packages are installed from stable lenny repos). Ruby version is 1.8.7 p 72. aptitude show libopengl-ruby yields version=0.32f-2 and this is the list of installed dependencies -> freeglut3, libc6 (>= 2.3.5-1), libruby1.8 (>= 1.8.2-9), libx11-6 | xlibs (> 4.1.0), libxext6 | xlibs (> 4.1.0), libxi6 | xlibs (> 4.1.0), xlibmesa-gl | libgl1, xlibmesa-glu | libglu1
RUBY_PLATFORM = "i486-linux"
gosu version -> 0.7.2
Byjlnr (dev)
Date 2009-08-10 08:13
Edited 2009-08-10 08:23
I didn't look into your windowing system in detail, but if you are actually opening and closing several windows, then you're asking for trouble, because Gosu is not really designed for this :) The usual approach is to have several delegate "game state" classes and using one of these per screen, but keeping the same window open all the time.
Of course, that still doesn't explain where the delay comes from. But I wouldn't be surprised if any of the X11 windowing code could cause delays.
well, i am not opening multiple windows, im actually doing multiple game state objects and making one of them hook up with window. Additionally, the only thing i am doing is hide and show everytime i switch the game state object. My window manager is metacity(and env is gnome(i know that has nothing to do with this, just trying to give out as much info as i can)). I somehow think Metacity is the most lightweight window manager, i may be totally wrong. Do you think trying it on other window managers like xcomp-manager will help?f
@lobo_tuerto: not sure why should that happen... may be a relook @ loadpath will help. I guess you have a local gosu install(the shared object) which is being loaded in " require 'gosu' " call. I will push a commit to prepend to load_path and not append, so that frozen gosu is prefered over local one. Will post another message once im done making that change.
PS: there was another problem i observed on OS X where the RUBY_PLATFORM variable was 'darwin-...' and not 'universal-darvin-...', i am going to push the fix for that too.
Did away with the close/show code, and pushed. The user experience is a little better now(as the window doesn't disappear and reappear), but warehouse(the thing that allows purchase of new inventory) is still dead slow(it takes way too much time to load up)(because of which screen remains frozen for a long time). I will profile it and post the results soon. In the mean time... any other observations?
lobo_tuerto: what version of ruby are you on? i was on 1.8.6 and it never used to crash, ever since i moved to 1.8.7, it crashes once in a while. If you got a 1.8.6 installation by any chance, may be its worth trying to run it with that.
If you experience crashes on 1.8.7, is that with the latest version of Gosu? I had to push a hotfix out one or two versions ago because the behavior of Ruby's GC had changed. It's a bit unfortunate because it means that Gosu games packaged earlier may not work reliably anymore :(
Yep, this is exactly the change in the Ruby GC behavior that caused the problem and which I hotfixed from Gosu's side. It will also happen on recent patchlevels of 1.8.6, like those delivered via the OS X Software Update. So now you can guess why the new Ruby wrapper .app contains a complete, unpatchable-from-outside Ruby installation ;)
You can always ask people to install the fonts on their system… ;) The problem is that the underlying library (pango) is too confused in its own abstraction to do a simple file loading. cairo has been suggested as a replacement once or twice. Without contributed code, the To Do item will stay on its current schedule :)
See the ToDo wiki page for the stuff that I want to finish before I want to dedicate a full release of Gosu to typographical issues.