|
||||||||||||||||||
Add Forum to Favorites | Send Topic To a Friend | View Forum FAQ | Track this topic |
Last Thread Next Thread ![]() |
| JavaScript as game script |
|
![]() random_acts Member since: 2/3/2002 From: Chicago, IL, United States |
||||
|
|
||||
| Being a professional web developer and hobby C++ game programmer, I'm trying to incorporate SpiderMonkey (netscape/mozilla implementation of javascript) into my game engine (simple engine that makes it easy to do clones of arcade type games - tetris, asteroid, etc...). Now I know that JS for my purposes - simple games - will work fine because speed is not a huge issue, but when I do something I tend to want to do it the "right way." What are your thoughts on JS's performance. It was built to handle small document-centric tasks but could it be used for a larger scale, 3D game. I've heard pretty much nothing but good things about LUA, and the word is performance is great, but I'm not a big fan of the syntax. To complicate matters, I've heard people say that for scripting, syntax is the main feature to choose a language -- that they'll run at about the same speed. So is JS valid? Or should I go with LUA (or a more game specific script language)? Long post, but what are your thoughts/experiences with javascript in applications other than Web oriented tasks? |
||||
|
||||
![]() Kylotan Moderator - Scripting Languages and Game Mods Member since: 3/8/2000 From: Nottingham, United Kingdom |
||||
|
|
||||
| I expect it would be fine. Performance is hard to gauge because Spidermonkey is being tweaked for performance all the time, and really there isn't much in the way of data for it being used in games. I think the only definitive answer is to try it and see. I doubt it is likely to be a problem unless you do all your logic in it. |
||||
|
||||
![]() Jinx3d1 Member since: 12/18/2004 From: USA |
||||
|
|
||||
| OP, Evolutional has done some great work with spider monkey and his game engine... Last time I talked to him, he said he wrote a pretty nice wrapper to make it easier to use spider monkey in your games. ttyl. ~Jay |
||||
|
||||
![]() evolutional Moderator - Alternative Game Libraries Member since: 1/25/2002 From: Leeds, United Kingdom |
||||
|
|
||||
| It's been knocked down the priority queue due to an important in-progress projec, but I'm still working on an article which discusses using SpiderMonkey in your games. |
||||
|
||||
![]() Jinx3d1 Member since: 12/18/2004 From: USA |
||||
|
|
||||
| I tried my hand at it, but found that it was a bit tricky to understand. I would deffentially love to see your article evo! |
||||
|
||||
![]() markr Member since: 3/23/2004 From: Oxford, United Kingdom |
||||
|
|
||||
| There is somewhere, a project to enable easy wrapping of classes in C++ into JS in SpiderMonkey - like luabind and tolua But it might be somewhat wonky. Getting Spidermonkey itself going is pretty straightforward though and I agree that javascript is a much nicer syntax than lua. But I like coroutines :) Mark |
||||
|
||||
![]() evolutional Moderator - Alternative Game Libraries Member since: 1/25/2002 From: Leeds, United Kingdom |
||||
|
|
||||
Quote: Any idea what it was called? The closest thing I found was a binding wrapper for wxWindows called wxJs. The author used the template mechanism which I actually adopted for version 1 of my GameMonkey wrapper, gmBind. I was unable to find anything else though :/ Quote: That's one 'criticsm' I have with SpiderMonkey; it definitely works better as an event-driven scripting language which gets called from the application. It's not really a problem to me as I prefer to work this way, but for others it will definitely be an issue. |
||||
|
||||
![]() Rhalin Member since: 3/16/2004 From: USA |
||||
|
|
||||
| I'm working on spidermonkey integration at the moment and did some hunting for easy wrapping, all I came across was references to swigJS, but all the links I found were dead (including the one on the swig.org site). Fortunately, I don't have a lot of functions to wrap, and almost no classes, so I'm not in for too much of a headache. In my case, I'm using javascript as scripting for event-driven dynamic forms, but was planning on doing some game work with it later on, I'd be curious how it performs there. |
||||
|
||||
![]() daerid Member since: 8/13/2001 From: Sunland, CA, United States |
||||
|
|
||||
| Have you tried Squirrel? It's supposed to be basically a C/C++ looking Lua (at least from my understanding). Squirrel Homepage daerid@gmail.com |
||||
|
||||
![]() fagiano Member since: 10/5/2003 From: Italy |
||||
|
|
||||
| Well, maybe Squirrel 1.0 was not so far from Lua but since version 2.0 is really not comparable anymore. Has classes etc... It kinda took is own path. However if you like JScript, Squirrel looks very close to it(at least syntax wise). ciao Alberto ----------------------------- The programming language Squirrel http://www.squirrel-lang.org |
||||
|
||||
All times are ET (US)![]() |
Last Thread Next Thread ![]() |
|