So I've been working on a Gosu implementation of RGSS. Here it is:
http://www.rpg-palace.com/mewsterus/gosu-rgss-0.8.zipSome background: RGSS is the Ruby-based scripting language of RPG Maker XP and VX. The RGSS library is Windows-only GDI-based, and is generally considered slow for what it does.
What I've done above is to create an implementation of RGSS2 - that is, with the extensions added in RMVX - but with RGSS1 classes where there are conflicts. For example, windowskins are handled differently between the two; the RMXP version is implemented. Tilemaps are wildly different; I have only implemented the RMXP version.
To try it out, you need an RMXP project (uncompressed). Simply extract the files to the project's root directory (it will include main.rb and a directory). Run main.rb, either directly (it has a shebang) or with the ruby command. You can create a new project using the trial version of RMXP, available here:
http://download.cnet.com/RPG-Maker-XP/3000-7537_4-10437117.htmlWhy am I posting it here? Well, besides the fact that people from the RPG Maker community are here (I know who you are!), I'm having some issues that are probably due to my relative inexperience with Gosu:
1. Image loading:
a: Limited format support. I need at least JPG's. The current version cannot display the title screen because it has no means of loading JPG's.
b: No transparency? For some reason, Gosu will not load the alpha value from some (but not all) RTP graphics (png's).
2. Really slow text drawing; RGSS implements text drawing as an operation on images. I'm implementing it as a Texplay splice with Gosu::Image.from_text. This is slow. I've tried using render_to_image and Gosu::Font.draw, but that method does not preserve alpha channels.
3. I need MIDI support! Granted, I've only tested on Mac, but MIDI's are currently disabled so I could test other things.
4.
FIXED General performance issues: Scene_Map is running at about 9 fps, and I haven't been able to figure out why. Do I just need to do this in C instead?
5.
FIXEDSegfaults with modifying $window. I am trying to set the window's caption to something else when "F2" is pressed (to display frame rate) during $window.update and that segfaults.
6. I'm also trying to bring the game in and out of fullscreen during $window.update by closing the existing $window object and restarting it; I'm getting a huge mound of untraceable Cocoa errors. I haven't even tried testing the resize_screen or frame_rate= methods, which do the same thing.
Any hints or suggestions? Any vouchers of support or condemnations?
For those worried about the legality, this is not "reverse engineering" which is forbidden in the RMXP license. I am just implementing an interface. I know full well that Enterbrain implemented it using GDI, and I am implementing it completely differently. It is still necessary to purchase a license to use the interface, especially because games made with RMXP basically never escape their roots in Enterbrain's coding style and practices. Further, this does not negatively affect the marketability or profitability of Enterbrain's products; in fact, it increases the marketability by allowing people to distribute their games on more platforms.
Updates:
2011-02-07: I fixed #4 by figuring out that some sprites were creating a new Gosu::Image every frame. I've stopped them from doing that, and also rewritten that procedure to use Texplay clearing and splicing instead of creating a new Gosu::Image for source rectangles. New file:
http://www.rpg-palace.com/mewsterus/gosu-rgss-0.81.zip2011-02-21: Part of #5 seems to have evaporated, either due to a Gosu update or a change I made to the dual-threading between Gosu::Window and Graphics. I separated #6 from that as it's a separate issue that may need a more involved solution, such as providing :fullscreen=, :update_interval=, and a :resize(width, height) method. Ne file:
http://www.rpg-palace.com/mewsterus/gosu-rgss-0.82.zip2011-02-28: So #5 was still an issue, but I've fixed it now. Not posting the file again because I don't think anyone cares; I'll post the next time I fix something.