buggy123 Posted November 15, 2009 Report Share Posted November 15, 2009 (edited) Just some quick questions. How did you guys manage to embed the javascript in this game? What is it being used for? Is any other language used for scripting?and why not Lua? Isn't that much mroe popular than js? Edited November 16, 2009 by buggy123 Quote Link to comment Share on other sites More sharing options...
Ykkrosh Posted November 16, 2009 Report Share Posted November 16, 2009 How did you guys manage to embed the javascript in this game?By writing code to embed it . We use SpiderMonkey (the JS engine used in Firefox), which is designed to be easily embedded into non-web-browser applications.What is it being used for?For implementing gameplay code (currently not much, but it should be much more in the near future), and for GUI behaviour.Is any other language used for scripting?No.and why not Lua? Isn't that much mroe popular than js?There's a trillion pages on the web and two thirds of them use JavaScript; how much more popular do you want? It's true that JS seems to be rarely used in games, but we chose JS a long time ago (before I joined the project) and I think it was a good decision (since it's quite a nice language, and implementations have been improving a lot recently). Quote Link to comment Share on other sites More sharing options...
buggy123 Posted November 16, 2009 Author Report Share Posted November 16, 2009 (edited) Ah, I see.but what do u mean gameplay code ?(what aspects of it) how are u guys separating the game code from the engine? (is there a rule of thumb to decide where to put what?)sry if the questions seem a bit vague...I'm not sure how to phrase it Edited November 16, 2009 by buggy123 Quote Link to comment Share on other sites More sharing options...
janwas Posted November 16, 2009 Report Share Posted November 16, 2009 Gameplay would be things like deciding when to promote units, the effect of auras, harvesting - basically what defines 0ad. The rule of thumb for adding new gameplay-related code is: if it should be moddable (by non-C++-programmers) and it's not time-critical and there's no tight coupling with existing C++ code, write it in JS. Quote Link to comment Share on other sites More sharing options...
Jeru Posted November 16, 2009 Report Share Posted November 16, 2009 and why not Lua? Isn't that much mroe popular than js?There was a big, big argument about Lua vs. Python at the time. JavaScript was chosen as sort of a compromise, AFAIK. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.