Making games in Ruby so far

Well I’ve been playing around in rbSFML now for a while and it’s been very satisfying to see how fast and easily your game evolves in Ruby. I recommend this language and I will try to give some tutorials for it.

Of course there are still some problems, like that every math operation is a heavy method call. Ruby truly embed the proverb for optimization:

The fastest code is the one never run.

I wrote in Ruby the process to generate and calculate the vertexes for floor and walls, that was like strangling the VM. But don’t let this scare you. Just as with every other aspect of the language it was fun trying to find a solution to the problem. I ended up with time slicing and only modifying the order of the vertexes when needed(actual position calculation is done on gpu)  and I think I can do it even smarter.

2D with perspective screenshot

Here is a picture of it running. Everything is done with 2D and rbSFML.

Resource and configuration management is also extremely easily to do with ruby thanks to utilities like YAML which is just perfect and don’t have the insanity of XML. YAML just works straight out of the box with ruby.

I do have a problem with threading. Don’t get me wrong, I understand why the GIL was put in place and how it’s thought that one should use threads in this environment. The problem I have is that I see it as a challenge to be solved and if I go down that road I will never get any progress done(or sleep) and get stuck there. So don’t expect any tutorial on how to make rendering run in parallel or anything similar, there’s only madness down that road.

I will see if I can start with some tutorials and hope I spike some interest.

No Comments »

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress. Theme: TheBuckmaker