I want to move into some game development, but the only language I know really well is Ruby. Most of what I have read seems to point towards lower level languages like C++ for game development, or languages for specific frameworks like C# for using XNA. Does anyone have any experience using a language like ruby for game development? If so, would you advise for or against it?
-
I've not touched Ruby myself (it's on the TODO list), but a friend of mine developed a rather nice version of Berzerk using Ruby and Chingu, so it's certainly capable.
From Muttley -
There's no reason why you can't. As long as there's multimedia support for a language, then it's gamedev material. Heck, a large proportion of one of the Rollercoaster Tycoon games was done by hand in ASM.
From The Communist Duck -
Ruby is a nice language, but it's not really for games to be honest. If you don't want to use C++ but want something like Ruby check out Python. For a good Python framework you should check out something like www.cocos2d.org/.
Ian Schreiber : ... or www.pygame.orgRicket : This is nonsense. Ruby is no less of a language "for games" than Python.Kornel Kisielewicz : ... nonsense. You might as well say that Lua is not for games.caspin : Is there a ruby equivalent to pygame? I wouldn't say one language is more suited than the other. But it might be reasonable to say that python has better game libraries and gamedev community.The Communist Duck : I have a feeling that there's an SFML port to ruby.Ricket : @The Communist Duck: There apparently is; it's in the languages list here: http://www.sfml-dev.org/features.phpFrom UnknownDevice -
I have no preference towards Ruby (or Python), I'm a Java person myself. But UnknownDevice's answer about how Ruby is somehow "not really for games" and Python is, frustrated me. I do hope he will clarify.
I know Pygame exists and has been around, and I recognize that Python has a larger userbase than Ruby. But to be honest, neither of them seems like a language "for games". Neither does Java, and that's my game programming language of choice. (and when I say "of choice", I do mean by choice, not because it's what's taught in school or because it's something I "know"). And really, what is a language "for games"? Well, speed is a factor, and obviously it must have libraries for graphics and other game systems (audio, input, etc).
As far as speed goes, it seems to be a tossup between Ruby and Python. Do some searches and you'll quickly find benchmarks and arguments for both sides of the spectrum, and various configurations which put one or the other ahead. Python with something called "Psycho" seems a popular speed demon compared to Ruby, yet regular Python seems to be a bit slower than Ruby. In the end, if you're choosing such a high-level language you're obviously not concerned with native speeds anyway; go with the language you know best. And obviously you know Ruby best, so I encourage it!
The other factor is whether the technology is there to create games; whether it can support drawing to the screen and collecting input and playing audio. Ruby can do all of these. In fact there are a good number of options in this respect. There's a ruby-opengl package at RubyForge which will give OpenGL support to Ruby (or it might be included by default?). Alternatively, Chingu provides "lightning fast OpenGL accelerated 2D graphics!" according to its homepage; it builds extra features on top of Gosu, which you could choose to use if Chingu is too much for you. Or for 3D graphics, if you don't want to use ruby-opengl, try G3DRuby, "a very clean set of wrapper classes for many of the more advanced OpenGL features". There's even Rubygame, which I can't find much information on but it claims to be "a cross-platform multimedia library" and given the name, must have emphasis on game development. If you are familiar with the popular SDL library for C++, there's Ruby/SDL or RUDL, both of which are Ruby wrappers of SDL. Or if you prefer the newer, more object-oriented SFML, it is also available for Ruby!
There is no reason that Ruby should be less of a game programming language than Python; if there is one, I'd really like to hear it so I can argue against it. If you feel most comfortable programming in Ruby, and you are aware of the pros and cons compared to other popular languages, then by all means you can certainly develop games in Ruby!
Klaim : +1 but you should add something about the limitations of usage on some languages on proprietary platforms like consoles... (hardware and constructor-policy limitations) If the home-made games are done for training for getting a job in the industry, then using Ruby for the game itself will not really help on this side. For desktop games however, "why not???"Ricket : @Klaim I would argue that it is becoming less relevant, and I will be interested to know the language used for consoles of the next generation or perhaps the one after that. It's possible that they will continue to be developed with C++, but I personally believe it highly likely that they will progress towards higher-level languages. Android development, for example, is in Java; not that Android is a game console at all. But perhaps a hybrid language like Go will rise to be the new popular language in a console generation or two.Klaim : I agree on the principle, and maybe Go or D an achieve somthing on this side. But I think only system language can be "standard" in this industry. However, I'm talking about the industry, not the indie side of the video-game domain. I think if you go your own way (not a salary of a big established company) then you have the chance to use whatever you want. But you still need to use the tools asked by constructors when you want to do something on anything other than console. Phones use Java but a lot of C++ is used on more performance-needed applications, on those same phones.Klaim : In fact I think that as the video-game industry is slow to adopt even the current standard C++, theres good chances that you'll have to wait a lot of years before having anywthing other than C++ on consoles. A shift in way constructors and developers work might happen but it's not really easy to imagine from today.From Ricket -
http://gafferongames.com/2009/01/11/ruby-is-not-at-all-suitable-for-game-development/
The URL is probably a bit of a spoiler.
tl;dr: the naive garbage collector is a real problem.
Ricket : Very informative! Can a Ruby expert comment on whether this is still applicable today? The article is dated January 2009 and I wouldn't be surprised if a lot has happened since then. *edit* Okay, I just found an article dated September 3 2010 which hints that indeed this is still the case today, saying "the Ruby garbage collector was not meant to be run" - interesting! http://jabberwocky.eu/2010/09/03/ruby-garbage-collectionJoe Wreschnig : Ruby's garbage collector is mark-and-sweep, but in the case of cycles, so are Python and Lua (in fact on a Python game I worked on we had to delay GC for exactly that reason). I have not done benchmarks, but perhaps Ruby's is just incidentally slow rather than fundamentally slow. I don't see that as a hugely compelling reason to avoid Ruby, especially if you are talking about building games entirely in Ruby as the questioner is. Just disable GC until some appropriate time.From Neverender -
I said Python because it has a bigger userbase and more choices when it comes to frameworks/libraries for games development. Its pretty obvious that this person has no experience in games development so it doesn't make sense to me to recommend that they use something like Ruby just because it's possible.
When I work on games I use C++ with Lua, I don't go off and write my game in Visual Basic just because it has media support. I'm sure everyone here has heard someone say certain tools for certain jobs. I'm sure you can hammer a nail with a shoe, but why would you do that when you can use a hammer.
Ricket : C++ is a nice language, but it's not really for games to be honest. If you don't want to use assembly but want something like C++ check out C. For a good C framework you should check out something like http://www.libsdl.org/. (okay it doesn't quite work because C++ is backwards compatible but you get the point)UnknownDevice : Lol no I don't get your point. Honestly I don't really care what you're saying so don't bother replying to me. I'm just trying to help someone out, not argue about the legitimacy of a programming language.Neverender : His point is that your original answer had absolutely no substance with regard to the question asked. You assert that Ruby is "not really for games," but that's ALL you say. There's little value in that. As for why OP would want to use Ruby, it's quite clear: it's "the only language he knows really well." That's not at all the same as "just because it's possible."From UnknownDevice -
It depends what type of game you are interested in writing. I've used ruby to write AI clients for several games, including Diplomacy, poker, and Lost Cities. I find it's a very friendly language for quickly experimenting with different concepts. On the other hand, I wouldn't want to use it to write my real-time shooter - it just won't have the performance I need.
From AShelly -
While I'm not familiar with a lot of the deep spec work surrounding Ruby, Enterbrain created the game making programs RPG Maker VX and RPG Maker XP that use game scripts based off Ruby: http://www.rpgmakerweb.com/
This was actually my first dive into the language. As most people said, you probably won't get the high performance of other languages, but if you're looking to start a 2D RPG (or other 2D game, really), it's probably one of the most sophisticated game editors out there to help.
From Bimini Road
0 comments:
Post a Comment