4 ms·
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, especia
by cardanome 2y ago
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.
- amirrajan 2y agoLate 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/2c42315ffef311600ecb2d8dcfe3ce88#file-readme-org https://gist.github.com/amirrajan/2c42315ffef311600ecb2d8dcf... [2] https://github.com/Lycea/Rogue/tree/master/components https://github.com/Lycea/Rogue/tree/master/components [3] https://github.com/kfischer-okarin/roguelike-tutorial-2021/tree/main/game/app/components https://github.com/kfischer-okarin/roguelike-tutorial-2021/t... [4] https://m.youtube.com/watch?v=MFR-dvsllA4 https://m.youtube.com/watch?v=MFR-dvsllA4