Archived

This topic is now archived and is closed to further replies.

Cherub

scripting languages...

Recommended Posts

Hi, Do you think I should use existing scripting languages like Python in my game? or should I create a new one? What''s your experience in these cases? Thanks

Share this post


Link to post
Share on other sites
Depending on your need. If you want to use script language to do some difficult task--call some libraries, etc. I recommand you to use Python or other powerful script language.

In my developing games, I use my own script language.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If you just want to learn, you may want to write your own scripting language, but either way, don''t do everything on your own. If you write you''re own scripting language and if you want it to be complex, look into getting Yacc and Lex online. These will generate parser and scanner code for you.

Share this post


Link to post
Share on other sites
That can''t be explained here. You need to read the docs and search online for a tutorial or two. Lex and Yacc are quite complicated tools, but they''re good at what they do. You would want to be sure that you really need to generate your own language before you go down the Lex/Yacc route, really.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]

Share this post


Link to post
Share on other sites
Lex & Yacc do make it easier, but it''s also fun to write your own LALR(1) parser. w00t!

Plus there are a few languages out there where Yacc is just overkill(Scheme, Lisp). And a lexical analyzer isn''t all that difficult to write.

And if you''re writing a compiler in Java, check out JLex & CUP(Compiler of Useful Parsers)

As far as existing scripting languages, check out LUA.

Share this post


Link to post
Share on other sites
From a practical perspective you should embed an existing engine. Only if you are both capable and willing of creating something that would work better for your specific needs should you develope your own. Otherwise you are spending more effort to do less. More effort to do more, less effort to do less and less effort to do more can all be sound decisions, but generally more effort to do less isn''t a sound decision. That said writing your own can be a valuable learning experience. You can use a fairly crude scripting system to make a utility of far greater utility with minimual effort once you know how to write a scripting system. It is time consuming to learn the basics, but once you know the basics it is generally fairly trivial to implement them. Then it can be the differance between writing ten or twenty programs in a week or one program in a day. So over the long haul it can be very beneficial to know the basics.

Personally I would say spend no more than a few months learning how to write a scripting system. Anything more than that ceases to be just an educational experience and starts to be a career decision. Writing something better than Python would be a significant career achievement and would require foresaking learning a good many other things.

Share this post


Link to post
Share on other sites