Jump to content

Scripting Languages


Recommended Posts

So I heard that they are going to support scripting in the game using LUA.

I would like to suggest possibly a javascript api aswell.

Why? I like javascript more than LUA.

 

I know some people aren't going to support this, but I figured it wouldn't hurt to at least request something I like.

 

FYI: I tried looking for javascript, but the forum won't let you search for that word. So if someone else has suggested this, sorry.

Link to post
Share on other sites

685dfa219f3e925e9a165c3f4ca979c5e1c35a0c

 

 

 

Your post reminded me of this.

 

LUA works due to the game engine's heavy use of C++ code. Look up Unigine 2.

 

 

They code an MMO, not a mobile game :V .

 

well....I mean iv played at least 1 mmo that still exists coded entirely in java

 

 

but im no professional. but I don't foresee them being able to support javascript and lua at the same time

Link to post
Share on other sites

well....I mean iv played at least 1 mmo that still exists coded entirely in java

 

 

but im no professional. but I don't foresee them being able to support javascript and lua at the same time

Which MMO is that? :o I always wanted to see something colossal held together by glue.

Link to post
Share on other sites

Which MMO is that? :o I always wanted to see something colossal held together by glue.

Runescape was a fully javascripted game up until recently. they recently switched to HTML5

 

but if you look at the oldschool runescape game they have from 07 that's a 3d game in java

Link to post
Share on other sites

Runescape was a fully javascripted game up until recently. they recently switched to HTML5

 

but if you look at the oldschool runescape game they have from 07 that's a 3d game in java

It's also isometric and of far less mechanics though. Just saying. C++ is the real powerhouse for MMOs of insane scale and potentials. Javascript or Java on its own, it's not as tough as C++ is.

 

And Unigine 2 was made in Russia. Rus-C-a. Can't blame them for it :V

 

 

 

*BadPunSpreeContinues*

Link to post
Share on other sites

It's also isometric and of far less mechanics though. Just saying. C++ is the real powerhouse for MMOs of insane scale and potentials. Javascript or Java on its own, it's not as tough as C++ is.

 

And Unigine 2 was made in Russia. Rus-C-a. Can't blame them for it :V

 

 

 

*BadPunSpreeContinues*

hey for a game that's been around since 01 its not in bad shape though lol.

Link to post
Share on other sites

It's also isometric and of far less mechanics though. Just saying. C++ is the real powerhouse for MMOs of insane scale and potentials. Javascript or Java on its own, it's not as tough as C++ is.

 

And Unigine 2 was made in Russia. Rus-C-a. Can't blame them for it :V

 

 

 

*BadPunSpreeContinues*

 

We aren't Putin up with your bad puns anymore. 

Link to post
Share on other sites

hey for a game that's been around since 01 its not in bad shape though lol.

Exactly. It was made for an era that internet connections were not that strong and Java suited them. The same reason why mobile games are mostly coded in Java as well. Limitations. A PC these days has no such limitations in place anymore.

Link to post
Share on other sites

well might as well get in on this. Java and C/C++ have very little actual performance difference with the main difference being the garbage collection areas of both languages with C/C++ leaving it up to the developer and Java basically doing it for the developer. (some people seem to be ratting on Java for some reason so thats my rant ignore it if you want)

 

Now I think there should only be one scripting language in the game though what it is I really don't mind as you would have to use their API for the most part anyway. I doubt there would be two as it doubles the work needed to maintain the scripting part of the game for no real gain other than make a few people happy so its not really worth it. LUA is actually a good one to use and many people can easily learn how to use it.

Link to post
Share on other sites

Here ye go. For the layman. Java is excellent for building in things like mobile phone games. C++ is for the real heavy duty. Directly interacting with the processor. Java is meant to stick, EVERYWHERE you put it into, like glue. C++ is duct tape. You can't use glue in space, but C++ is fair game.
Argueing furthermore is pointless. Java is a good language, don't get me wrong, but it's not meant for the same heavy duty stuff C++ is meant for, likewise C++ is too heavy for some things that are meant to run light and on the fly. Like mobile phones. Try putting a C++ coded game in a mobile phone, it will run terribly. 

TL;DR : C++ and Java, to each its own. One language is meant to be written with a cup of coffee on the side and ther other is written with whiskey by your side. 



Link to post
Share on other sites

I think this topic went way off track since Java and Javascript aren't really related other than by name. This StackExchange article lays it out pretty clearly:

 

http://stackoverflow.com/questions/245062/whats-the-difference-between-javascript-and-java

 

tl;dr - "Java and Javascript are similar like Car and Carpet are similar."

 

 

 

That aside, exporting bindings from C++ to LUA is much easier than exporting from C++ to Javascript, lookup any binding library on Github and the differences are pretty clear.

 

I would also argue it's probably much easier to integrate LUA into the game engine than trying to import a javascript engine (something like Google's v8 engine). 

 

Considering all of the posts that have been on the forum calling for an easier way to write code, expecting people to learn Javascript isn't going to be an easier sell by any stretch of the imagination over LUA either. 

 

 

 

Why? I like javascript more than LUA.

 

I think you're going to need much more reasoning than this to try to get a javascript API built into the game.

 

I'll tear down some of the major differences between the two languages (Javascript and LUA) here:

  1. Lua has native support for coroutines.
  2. Lua doesn't convert between types for any comparison operators. In JS, only === and !== don't type juggle.
  3. Lua has an exponentiation operator (^); JS doesn't. JS uses different operators, including the ternary conditional operator (?: vs and/or), and, as of 5.3, bitwise operators (&, |, etc. vs. metamethods ).
  4. JS has increment/decrement, type operators (typeof and instanceof), additional assignment operators and additional comparison operators.
  5. In JS, the equals and not equals operators are of lower precedence than less than et al. In Lua, all comparison operators are the same precedence.
  6. Lua supports tail calls.
  7. Lua supports assignment to a list of variables. While it isn't yet standard in Javascript, Mozilla's JS engine (and Opera's, to an extent) has supported a similar feature since JS 1.7 (available as part of Firefox 2) under the name "destructuring assignment". Destructuring in JS is more general, as it can be used in contexts other than assignment, such as function definitions & calls and loop initializers. Destructuring assignment has been a proposed addition to ECMAScript (the language standard behind Javascript) for awhile.
  8. In Lua, you can overload operators.
  9. In Lua, you can manipulate environments with getfenv & setfenv.
  10. In JS, all functions are variadic. In Lua, functions must be explicitly declared as variadic.
  11. Foreach in JS loops over object properties. Foreach in Lua (which use the keyword for) loops over iterators and is more general.
  12. JS has global and function scope. Lua has global and block scope. Control structures (e.g. if, for, while) introduce new blocks.
  13. Due to differences in scoping rules, a closure's referencing of an outer variable (called "upvalues" in Lua parlance) may be handled differently in Lua and in Javascript. This is most commonly experienced with closures in for loops, and catches some people by surprise. In Javascript, the body of a for loop doesn't introduce a new scope, so any functions declared in the loop body all reference the same outer variables. In Lua, each iteration of the for loop creates new local variables for each loop variable.
    • local i='foo'
    • for i=1,10 do
    •   -- "i" here is not the local "i" declared above
    •   ...
    • end
    • print(i) -- prints 'foo'
    •  
    • The above code is equivalent to:
    •  
    • local i='foo'
    • do
    •   local _i=1
    •   while _i<10 do
    •     local i=_i
    •     ...
    •     _i=_i+1
    •   end
    • end
    • print(i)
    •  
    • As a consequence, functions defined in separate iterations have different upvalues for each referenced loop variable. See also Nicolas Bola's answers to Implementation of closures in Lua? and "What are the correct semantics of a closure over a loop variable?", and "The Semantics of the Generic for".
  14. Integer literals in JS can be in octal.
  15. JS has explicit Unicode support.
  16. In Lua, ~ is used in place of !. (as in, if foo ~= 20 then ... end) (technically syntax, but it's easily overlooked and causes subtle bugs).
  17. In Lua, the not/or/and keywords are used in place of !/||/&& (also syntax but also easily forgotten).
  18. In Lua, any type of value (except nil and NaN) can be used to index a table; in JavaScript, object indexes are converted to strings.

 

Depending on the tool used, the LUA interpreter or the LUA JIT Compiler, the performance over javascript can easily be 3x-100x faster according to some test results I've seen as well. I've not run any of those tests myself so I can't independently confirm them, but in a game like DU I imagine that performance needs to be squeezed out of every corner possible. 

Link to post
Share on other sites

@Yamamushi

I think the whole derailing started from my meme post,where I parallelised switching LUA for Javascript to switching C++ for Java :P

(Almost) everyone in coding knows Java and Javascript are different :P

I take full responsibility for the derail :P

Link to post
Share on other sites

Seems to be a lot of discussion here about code, but I haven't seen any discussion about C#. I'm no code expert with any degrees but I would like to know if it would be possible to use C# as well as LUA to code scripts in the game(also due to its similarity with C++). also, considering it is quite similar to java it would be quite easy for people who know java to learn C#(that's how I learned it). Just posting my thoughts though.

Link to post
Share on other sites

@yamamushi, I guess the real reason I don't like LUA vs javascript is the syntax, I like javascripts syntax more. I know embedding it wouldnt be a issue. But if performance would be, well I guess that would suck for me. Really it is just my preference.

If they were to add Javascript instead of LUA, they could have simply extended the game engine's C# native API to the players. It's the same thing more or less. Apparently, the devs got a CSD major and a guy with PhD in CSD leading the project.

 

LUA is accessible to everyone. You are not an exception. I would have preferred the scripts to be in C++ if possible, but I got to lay my CSD major's ego down for a moment and think of the community as well.

 

Our Lord and Savior, Dennis Ritchie, shall guide you out of the darkness. 

Link to post
Share on other sites

Exactly. It was made for an era that internet connections were not that strong and Java suited them. The same reason why mobile games are mostly coded in Java as well. Limitations. A PC these days has no such limitations in place anymore.

Java is no good thing in any way :P

 

With more limitations you need less java :P

Link to post
Share on other sites

Try making an mobile game in C++. Phone will explode xD

 

Siri will come online on its own and it'll start chanting the call of C-thulu.

 

loolwut?

nooo?

thats not how programming works :P

 

there are even frameworks for wrapping your C++ program into a thin layer of java that your android can run that without headache :P

same for iOS

 

you also have exactly one try to guess in what language the operating systems themself are written :P

Link to post
Share on other sites

loolwut?

nooo?

thats not how programming works :P

 

there are even frameworks for wrapping your C++ program into a thin layer of java that your android can run that without headache :P

same for iOS

 

you also have exactly one try to guess in what language the operating systems themself are written :P

You missed the point :V I said on C++ alone. Requiring Java to boot it up is a given, as android is built on Java.

 

 

And writing an app for Android in C++ and using Java to boot it up, clearly shows a man or a woman of conviction to get C++ to excel in a field it shouldn't be even involved into. It's like taking a nuke into a gunfight, or asking for an expansion on a procedurally generated world. Sure, but... why? 

Link to post
Share on other sites
  • 5 months later...

Which MMO is that? :o I always wanted to see something colossal held together by glue.

Puzzle pirates anyone? A hardcore game with casual mechanics. It's pretty stable but have horrible graphics and bad walk controls. By the way DU should use that game as an example for it's economy.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...