benjymous
Member
I'm planning on implementing some sort of scripting engine into my game, to simplify the scripting of events in levels, etc. Does anyone have any advice on any particular engines?
benjymous said:I'm planning on implementing some sort of scripting engine into my game, to simplify the scripting of events in levels, etc. Does anyone have any advice on any particular engines?
Depends on what language you want your scripts to be in, and how you want to expose your code to the scripting engine.
I'm currently writing a game in Scala that I don't want to make public yet, but it uses XML 'level files' with 'scripting code' in Java or Scala ('quotes' intentional), but that's just because that solution fits my game best and has very high performance on a JVM.
This. Lua is used in many professional games, and is really designed for this. The game that I'm working on is going to hopefully have a Lua scripting engine, if I ever get there. I have a lot of stuff left to write before I get to the scripting engine...'Count Tuxula' said:Lua?
'Archaemic' said:This. Lua is used in many professional games, and is really designed for this. The game that I'm working on is going to hopefully have a Lua scripting engine, if I ever get there. I have a lot of stuff left to write before I get to the scripting engine...'Count Tuxula' said:Lua?
+1 for Lua. Used it in the past, and it's a nice language to script in, and is used in many commercial & non-commercial games (see spring.clan-sy.com for a nice open-source, lua extensible rts engine).
lippy said:+1 for Lua. Used it in the past, and it's a nice language to script in, and is used in many commercial & non-commercial games (see spring.clan-sy.com for a nice open-source, lua extensible rts engine).'Archaemic' said:This. Lua is used in many professional games, and is really designed for this. The game that I'm working on is going to hopefully have a Lua scripting engine, if I ever get there. I have a lot of stuff left to write before I get to the scripting engine...'Count Tuxula' said:Lua?
Python would be good if you need a heap of features while still having an easy language. With Python, you can make things like web queries for your triggers (for multiplayer, or just very interactive items in the game) and other stuff (anything really) which are impossible in Lua.
But if you 'only' need a "logic" scripting language then go for Lua.
Would you prefer C/C++ support reflection? I wouldn't!'benjymous' said:The next question is does anyone have any experience/advice on actually doing the integration? All the stuff I've seen on Lua seems to require me to explicitly expose functions, which feels a little icky (although, I guess, more secure)
there is a module called RestrictedPython ( http://pypi.python.org/pypi/RestrictedPython ).'dflemstr' said:I'd recommend Python (see www.linuxjournal.com/article/8497) or if you want things more 'limited' and secure (to prevent loading of external libraries etc), Javascript (SpiderMonkey).