Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / A few questions on Gosu...
- - By Eamonn Date 2013-07-02 22:11
Ok, most my questions on Gosu can be summed up in one question, if you're familiar with the LÖVE engine.

Is Gosu as powerful(or maybe even more powerful) than LÖVE/löve/Löve/love2d/Love2d/löve2d/Löve2d/LÖVE2d?

If you are not familiar with LÖVE, here are my questions:

• Can Gosu handle SpriteSheets, either via a plugin/library or natively?
• Can Gosu render Tiled maps?
• Is Gosu capable of creating a commercial game? Purely curiosity!!
• Is Gosu still active?

Those are questions that could have been answered if you knew what LÖVE was. Now I have a few other questions on Ruby & Gosu, and here they are:

• I asked this a while ago, but maybe there's one now: Is there a tutorial on Gosu? If not, can I have a game to learn from?
• Where could I go to recap on Ruby?
• Are there any commercial games made using Gosu?

As I asked above, where can I go to recap on Ruby? Maybe a small 20 minute recap? The Ruby website was good for a recap, with their learn Ruby in 20 minutes. But I'd like to recap more!!

Thanks! Any help is appreciated!
Parent - - By EdwinOdesseiron Date 2013-07-02 22:40
Well, I never looked up on Löve, so I'm not sure whether it is as/more powerful as/than it, but I can try answering most of these questions.

Can Gosu handle SpriteSheets, either via a plugin/library or natively?
Yup, Gosu can natively handle spritesheets. Using
Gosu::Image.load_tiles(window, path, width, height, tileable?)
(where width and height is the size of single sprite (if you're not sure what is the size of single sprites, but know that spritesheet will be ex. 8x8 sprites, use negative values to divide)) will create an array (1d) of Images from given file. You can then access them in other methods, such as draw

Can Gosu render Tiled maps?
If you mean maps created with program called Tiled ( http://www.mapeditor.org/ ) then I'm not sure. If you mean normal tiled map, with tiles stored in 2d array, then yes, Gosu can render those easily, with simple for loops.

Is Gosu capable of creating a commercial game? Purely curiosity!!
Of course, Gosu is capable of creating a commercial game.

Is Gosu still active?
Yup. Gosu is still active, and it is actively being updated (as far as I'm aware). Surely any problem you have with it will be dealt pretty fast, depending on the problem.

I asked this a while ago, but maybe there's one now: Is there a tutorial on Gosu? If not, can I have a game to learn from?
There is definately one tutorial, you can find it here: https://github.com/jlnr/gosu/wiki/Ruby-Tutorial . I guess that's the tutorial most of us (if not all) started with. More you will probably have to learn by yourself, but there are few basic files, well commented too, that you can find in your Gosu gem location, in "examples" folder. Where is it depends on where you installed ruby, ex. on my desktop the path is:
C:\Ruby192\lib\ruby\gems\1.9.1\gems\gosu-0.7.47.1-x86-mingw32\examples

Are there any commercial games made using Gosu?
I don't know that, but I'm actually wondering that myself. I think I read about a Ruby/Gosu game being sold on Steam somewhere, but I'm not sure where, and if I really did, so... yeah.
Parent - - By Spooner Date 2013-07-03 22:43
I doubt if Ruby/Gosu has been commercialised. I know Unity of Command is a commercial Python/PyGame game on Steam though. Bit different though (only ships with bytecode, for example).

That said, there are several commercial open-source games, but for obvious reasons that makes "fair" multi-player pretty much impossible in a Ruby.
Parent - - By oli.obk Date 2013-07-04 06:54
there are simple systems for open source games to have fair multiplayer, just have a look at clonk

also, why would ruby be worse than any other language?
Parent - - By Spooner Date 2013-07-04 11:03
Sorry, I meant that editable source (like Ruby) games make fair multiplayer impossible. Open-source games that ship exe/bytecode certainly have the potential to be fair.
Parent - - By oli.obk Date 2013-07-04 12:37
i don't see how an open source game would be fairer if it's code can be compiled to bytecode?
Parent - - By Spooner Date 2013-07-04 12:39
It can't be edited directly, unlike Ruby files. Thus, it is significantly harder to hack (or, rather, it must be hacked, rather than just edited in notepad :D).
Parent - - By oli.obk Date 2013-07-04 12:43
it's open source, do tell me how i cannot use the source to compile my own hacked version
Parent - By Spooner Date 2013-07-04 13:47
Ha, good point. My wisdom is seriously lacking today!
Parent - By bestguigui Date 2013-07-03 10:04
I don't know what LÖVE is. But i now for sure what Gosu is ! I've been using it for years and can't go anywere else. This lib is great because it seems anything can be done with it. But you'll have to get your hands dirty.

SpriteSheets for example don't exist in Gosu, but like it was said, Gosu::Image.load_tiles can do the job. It'll be yours to find an efficient way to get the correct frame from the returned array of Gosu::Image.

For tiled map, if you're refering to the technique itself, the way to do it will be the same as SpriteSheets : a global tileset that is loaded into multiple Gosu::Image using Gosu::Image.load_tiles. You could improve the performances if you're recording your map after the drawing using Gosu::Window#record method.

For commercial opportunities, the problem would be that Ruby is not easy to hide, since it wasn't made for this purpose. I never found a good way to protect source code, mostly because I never had to. I don't know a lot about licences, but I think MIT licence is ok with that. Check this with JLNR.

Gosu is really active, compared to Rubygame for example. There is often new versions and a great support on both those forums and the IRC channel.

For Ruby in 20 minutes... there is no secret way to learn a langage. The 20 minutes tutorial gives the taste of programming in Ruby langage. But you'll have to practice a lot before being able to code in a proper way. I'm not as good as most of programmers here, I learned enought so I can create quite complicated things in a small amount of time, but I know my Ruby style is not the best one, I just like it. I guess it's all relative to the person here.
Parent - - By jlnr (dev) Date 2013-07-03 10:26
Re: Sprite sheets. I have just added a method to the upcoming Gosu version that makes it possible to cleanly write a loader for TexturePacker, or whatever the popular sprite sheet builder app is called. :) So if that's a requirement, it should only take a few lines of Ruby to implement sprite sheet support.

Gosu's license allows commercial use, but it's impossible to hide the source code of Ruby games on Windows. I don't think anyone has ever sold a Ruby/Gosu app, but I do have a wildly unsuccessful C++/Gosu game on the iOS App Store.

The biggest thing to be aware of is that while Gosu is "active", it is also a never-ending project because operating systems get overhauled much faster these days than I can keep up with. Most users here have existing experience with Ruby or C(++) and that allows them to patch bits and pieces that get in the way of their games. I am also usually happy to fix things relatively quickly if a game release depends on it.
Parent - - By Spooner Date 2013-07-03 22:41
Not being able to hide the source code is more an effect of CRuby (MRI) than Windows. Does Gosu actually work with any of the other versions of Ruby? I've never looked into it since CRuby is the only Ruby that works perfectly on Windows.

CRuby also has a dreadful garbage collector, which means you need to be very careful, especially on Windows, with action games, since otherwise your game will stutter horribly.
Parent - - By jlnr (dev) Date 2013-07-04 00:38
Yeah, it's dangerous that I rarely use Windows. I really have no idea how good or bad the GC is these days. :)

Is there any other Ruby impl. that supports C extensions on Windows? I guess I could wrap Gosu to Java using the JNI, and then use JRuby to use the resulting C/Java library. But that's already pretty ugly… :)
Parent - - By Spooner Date 2013-07-04 01:06
I'm pretty sure that extensions aren't supported on Windows/JRuby. At least they weren't last time I looked...
Parent - - By jlnr (dev) Date 2013-07-04 05:36
Right, but "Java extensions" are probably supported… :)
Parent - - By bestguigui Date 2013-07-04 09:09
I found this : http://rubyencoder.com/

It seems to encrypt all the source code. Do you know if that works ?
Parent - - By oli.obk Date 2013-07-04 10:07
even if it does, you need the decryption code somewhere before you can execute the program -> there's probably some program on the interwebs that simply decrypts that encrypted ruby code :)

the more important part of this rubyencoder is the conversion to bytecode. if that is done properly, there is no trivial un-compiler :)
Parent - - By bestguigui Date 2013-07-04 10:15
So it makes the task of reverse engineering more difficult, but still possible. I thought about using a socket way to get the app from a server, but even this can get intercepted... It seems that there is just no safe way to use Ruby in a commercial purpose.
Parent - By oli.obk Date 2013-07-04 12:42
depends on your definition of safety.
what is the goal you want to reach?
in a singleplayer game, you don't really care about cheating.
in a multiplayer game, you can design the server software as cheat-safe as you wish
in a closed source game, people still cheat and manipulate the raw bytes

so having a game with readable source only prevents you from creating useful DRM
do you really believe you need DRM? other than that, who cares if your game is closed source but ruby and therefor decompilable?
a simple wrapper to only unpack your ruby code on execution and delete the temporary files afterwards is hard enough to keep away script kiddies, and everyone else will crack any other protection anyway.
Parent - - By Spooner Date 2013-07-04 11:01 Edited 2013-07-04 12:44
True bytecode export is something that is "coming" in Ruby 2 (I read that it is implemented, but disabled, in 2.0, so maybe in 2.1?)
Parent - By oli.obk Date 2013-07-04 12:42
now that is cool.
bring on the bytecode optimizers!
Up Topic Gosu / Gosu Exchange / A few questions on Gosu...

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill