News for hackers. Stuff that matters.
Re:Godotcaml for Godot 4.2 by alabhyajindal on Tuesday July 16, 2024 @02:00PM (#40978764)
Why didn't Ruby take off in the game industry? As I understand OOP is a critical language feature which led to the success of Java and C#. Is it maybe because of dynamic typing?

OOP experience in Ruby is very pleasant and I wish the language was used more.

Re:Godotcaml for Godot 4.2 by runeblaze on Tuesday July 16, 2024 @04:09PM (#40979857)
I used to code in Ruby for indie games (well, RPG Maker). For me the reason is several things:

1. Its performance meant that it would never survive against Java/C# for AA/AAA games, not to speak of C++

2. Lack of libraries. Last time I tried no physics engine worked with Ruby 2.3, and ouch that made my game or many games impossible

3. No significant advantage over Python, especially given that for indie games Python had the popularity advantage, the numpy/numba/Pillow/easier to write high performance code advantage. Bitmap manipulation in Python using even numpy is much easier than whatever I can do in Ruby.

4. OOP is not actually that important especially for the market Ruby can break into. DragonRuby is in the right step, but look at pico8, love2d, or even Unity3D -- there is not a lot of inheritance going on. Simplicity is good.

Of course the above factors play into each other.

Re:Godotcaml for Godot 4.2 by cardanome on Tuesday July 16, 2024 @04:10PM (#40979861)
Mostly other languages like Lua and Python also being good choices.

Lua is simpler, is much, much easier to embed into your project and is much faster, especially with LuaJIT. It is the perfect fit for this task

Too much OO can hurt performance quite badly and while some form of OO is common in the game industry there is also more emphasis on keeping things simple. Ruby is a very nice language and not a bad choice for non-performance critical code but Lua is the default choice for game scripting for a reason.

And for the cases there Lua is too simple, well there is Python. Sure Ruby does a few things better but it doesn't really have a clear advantage over Python while also being less popular.

Re:Godotcaml for Godot 4.2 by amirrajan on Wednesday July 24, 2024 @04:13AM (#41054712)
Late reply, but maybe it’ll be useful to other people coming across this post.

1. mRuby is trivial to embed.

2. S7 Scheme is also trivial to embed.

3. LuaJIT will not work on consoles (proprietary CPU architectures), and JIT isn’t supported on iOS or Android. You have to use vanilla Lua.

4. Lua has historically been the default because it was first to provide a nice embed story.

5. Lua as a language leaves a lot to be desired (Ron Gilbert really disliked using it within his games)

6. This gist post goes into details wrt the deficiencies of Lua [1]

7. Here are two GH repos with Roguelike Tutorial. One in Lua [2], the other in mRuby [3]. It’s worth comparing and contrasting.

8. If I want extremely performant code, then I drop down to C. For scripting level/game code. mRuby is plenty fast [4].

[1] https://gist.github.com/amirrajan/2c42315ffef311600ecb2d8dcf...

[2] https://github.com/Lycea/Rogue/tree/master/components

[3] https://github.com/kfischer-okarin/roguelike-tutorial-2021/t...

[4] https://m.youtube.com/watch?v=MFR-dvsllA4

Re:Godotcaml for Godot 4.2 by raytopia on Tuesday July 16, 2024 @02:16PM (#40978890)
It is used for some of the RPG Maker engines [0]. There's also DragonRuby [1] which I believe is made by someone heavily involved in SDL.

I'm sure a lot of people will say it's too slow, etc. but the truth is that great games come from a very wide range of tools and if Ruby fits your needs then you should use it.

[0] https://www.rpgmakerweb.com/

[1] https://dragonruby.org/toolkit/game

Re:Godotcaml for Godot 4.2 by georgeecollins on Tuesday July 16, 2024 @02:15PM (#40978886)
Maybe it is because the games industry evolves more slowly now and depends a lot on legacy technology. You don't see a bunch of new game engines being built and the two most popular ones use C++ and C#. The emphasis is much more on content now and much less on technology.
Re:Godotcaml for Godot 4.2 by bobajeff on Tuesday July 16, 2024 @02:51PM (#40979185)
I would assume Object Oriented Programming isn't very important in games. In fact I think there might be a aversion to it now.

As an aside I've been thinking lately that OOP isn't very well defined unlike FP. I think that's why there is a disagreement on what is OOP. Many think it's about inheritance because of Java while Alan Kay says it's about message passing as in Smalltalk. Whereas functional programming is just programming using pure functions. That simple, no confusion.

Re:Godotcaml for Godot 4.2 by honkycat on Tuesday July 16, 2024 @02:13PM (#40978872)
it is incredibly slow and is interpreted not compiled.
Re:Godotcaml for Godot 4.2 by alabhyajindal on Tuesday July 16, 2024 @10:41PM (#40982106)
Yes. I completely forgot that games need to be fast.
Re:Godotcaml for Godot 4.2 by kevingadd on Tuesday July 16, 2024 @06:08PM (#40980800)
Ruby still gets used in indie and professional games for scripting but it's just got fewer advantages vs something like Lua or even JavaScript.
Re:Godotcaml for Godot 4.2 by dartos on Wednesday July 17, 2024 @02:49AM (#40983199)
Anything with a stop-the-world GC is a non-starter in games land.
Re:Godotcaml for Godot 4.2 by pebal on Wednesday July 17, 2024 @04:22AM (#40983621)
GC doesn't have to stop the world. There are fully concurrent GC engines.
Re:Godotcaml for Godot 4.2 by dartos on Wednesday July 17, 2024 @10:13AM (#40986184)
Correct, but ruby historically (and might still) use a stop-the-world gc.

That’s why I specifically said “with a stop-the-world GC”

Re:Godotcaml for Godot 4.2 by amirrajan on Wednesday July 24, 2024 @03:54AM (#41054590)
Creator of DragonRuby here. Send me an email and I’ll hook you up with a license to the game engine :-)

at[at]amirrajan[dot]net