I am beginner wanting to make a game, and chose to learn Ruby ,since it seems easier to read than most languages.

Reading up on Ruby, I find that Ruby could be used to make small-scale games, but it's garbage collector was a serious problem. The post I read had been closed, so the most recent post was from 2013. In contrast, Ruby 2.0 came out in 2013, and apparently the garbage collector got better. I was wondering if the garbage collector is still a major problem.

To be a little more specific, the game I want to make is going to be 2D, using pixel art. It's a small PvP game using LAN. I want to make 7 character classes, but I can start with less. This game is quite small, but there are a lot of things I want to add as I get more experience, such as a story.

Does the garbage collector still make game development a problem, in Ruby?

  • \$\begingroup\$ I've never heard of ruby being used in game development. \$\endgroup\$ – Alexandre Vaillancourt Jan 18 '17 at 18:21
  • 1
    \$\begingroup\$ @AlexandreVaillancourt RpgMaker used Ruby up until the MV release, which now uses Javascript. \$\endgroup\$ – Krythic Jan 18 '17 at 18:27
  • \$\begingroup\$ @Krythic That's good to know! \$\endgroup\$ – Alexandre Vaillancourt Jan 18 '17 at 18:28
  • \$\begingroup\$ @Krythic yes i knew that rpg maker used ruby before but i'm looking to not money at all if possbile for now but it still a good option. \$\endgroup\$ – Zero Jan 18 '17 at 18:36
  • \$\begingroup\$ Isn't ruby a server side language? If so, then making a game with it is like making a game with php. \$\endgroup\$ – Bálint Jan 19 '17 at 8:54

Let's first discuss your concerns of a garbage collector. Truthfully, it really shouldn't matter much, that is, assuming you're being smart about how you write your code. If you're working in a managed environment, you will need to obey several constraints while you code; the rendering loop is a good example. In constant loops you should be generating as little garbage as possible, by that I actually mean zero allocations. You need to be initializing as much data as you can beforehand, caching it, and reusing it. In other routines of your game/engine this can be different, because those routines will be executed infrequently. Also, consider using structs in place of certain plain-data classes, like Points, Vector2, Vector3, and Matrices. Structs are value types, thus are not allocated to the heap, that means no garbage collection.

  • \$\begingroup\$ The GC portion of your answer is perfect. -1 for the opinion presented without technical justification. Structs are not the be-all-end-all of anything, as proven by many successful games written without them. Will retract if you re-work your structs opinion into an objective technical explanation as to their utility, so OP can make their own determination as to their necessity. Or just remove the structs portion altogether, as the GC portion answers the OP perfectly. \$\endgroup\$ – darkside Jan 19 '17 at 0:50
  • \$\begingroup\$ @ananas There, I fixed it. \$\endgroup\$ – Krythic Jan 19 '17 at 1:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.