Page 1 of 1

Quest system.

Posted: Wed Oct 06, 2010 2:56 pm
by Minutis
Why quests are still written using python? Isn't it better to translate all quests to java?

Re: Quest system.

Posted: Wed Oct 06, 2010 3:16 pm
by lion
why touch what already work and don't have bug?

Re: Quest system.

Posted: Wed Oct 06, 2010 3:50 pm
by poltomb
Minutis wrote:Why quests are still written using python? Isn't it better to translate all quests to java?
It's mostly just preference. Unless someone can show some serious data supporting a performance gain in changing to java, then then there is no need for us to use the very limited L2J team manpower to convert the scripts. If you want to, feel free to do so and share the results. No guarantee it would get accepted though.

Personally, I think that groovy should be looked into. It has java-like syntax with the benefits of a scripting language like python. I don't know the performance differences between groovy, python, javascript, or plain java to say which is better though.

Re: Quest system.

Posted: Wed Oct 06, 2010 4:46 pm
by jurchiks
Duh... there have been made multiple topics about this, one guy "translated" scripts/custom folder to java, one other - few quests, but none of them ever got committed because as far as I can guess - some people just don't think it's MORE COMFORTABLE to have all scripts in the same language (Yes, I know some people know jython more than java but this is a JAVA project after all)!
Since I'm using Eclipse (just like so many other people out there), right-clicking on a method or a class in a jython script and going to the source is IMPOSSIBLE, unlike java scripts. That's the simplest, but also IMHO most annoying thing - you have to copy the method name, find in which file it is contained and then search in that file, not to mention that there are methods that have several versions of the same thing which makes it harder to find the right one.
If it's a java script, however, you get straight to the exact method.
Also, code completion and suggestions are not available in Eclipse. I tried jyDT and some other jython plugins for Eclipse, but I didn't really notice ANY difference, there was no option to go to core classes from jython scripts, no code completion, same old text editor, just with slight syntax highlighting...
Basically, I'm all hands for java. I've already mentioned this before, but I have translated multiple (~40) quest scripts to java myself and I might actually share them some day, but at the current rate and attitude (none of my contribs have been even appreciated, even though they were good) I don't see why I should.
[offtopic]If I had the time and passion, I'd make a fork myself, maybe some day I will. IMO current l2j attitude is way off. I'm not talking about the leecher thing, I'm talking about anyone that is not a team member and is not sucking a dick to become one.[/offtopic]

Re: Quest system.

Posted: Wed Oct 06, 2010 4:53 pm
by _DS_
Currently no one in team interested in such huge useless work. Remember what you should not only move to another language, but also test each quest and fix errors.

Re: Quest system.

Posted: Wed Oct 06, 2010 5:03 pm
by Minutis
First of all, if I'm not wrong - whole python code in L2J are quests.
--> So if we make them all java there will be no need of python injectors (that libraries for python integration into java, don't know how they're called).
--> Secondly Java is much more simple to learn and you don't need other programing languages to freely control L2J to suite your needs. It's easily readable.
--> Java is faster than Python.

So as I see things, we would get reasonable performance boost.

And I'll volanteruly start translating quests. Hope they will be accepted :) Or at least discussed about to see whats wrong.

Re: Quest system.

Posted: Wed Oct 06, 2010 5:06 pm
by Minutis
_DS_ wrote:Currently no one in team interested in such huge useless work. Remember what you should not only move to another language, but also test each quest and fix errors.
I know, i had translated few quests before and tested them. They worked good. But if it's really pointless then nevermind.

What I don't understand, why Quests have been written in Python. Why combine few languages, when i think it will be more efficient to use one.

Re: Quest system.

Posted: Wed Oct 06, 2010 6:23 pm
by Stake
Minutis wrote:
_DS_ wrote:Currently no one in team interested in such huge useless work. Remember what you should not only move to another language, but also test each quest and fix errors.
I know, i had translated few quests before and tested them. They worked good. But if it's really pointless then nevermind.

What I don't understand, why Quests have been written in Python. Why combine few languages, when i think it will be more efficient to use one.
When scripts are loaded, they are converted into Java bytecode, and JVM handles them the same way like a compiled pure Java code. Anyway, you're right about the performance issue, but it would affect only the loading time of the gameserver, runtime would be the same. I think, it's good as it is, since most of the quests work fine, and it would be unnecessary to rewrite them into pure Java just for about 10 second reduction in load (compilation) time.

Re: Quest system.

Posted: Wed Oct 06, 2010 6:35 pm
by Minutis
Oh if thats how it is, then this is really low priority :) Ok. How do you learn this stuff? By yourself?

Re: Quest system.

Posted: Wed Oct 06, 2010 6:39 pm
by poltomb
Minutis wrote:First of all, if I'm not wrong - whole python code in L2J are quests.
This is true.
Minutis wrote:--> So if we make them all java there will be no need of python injectors (that libraries for python integration into java, don't know how they're called).
They are not called either. It is a script engine.
Minutis wrote:--> Secondly Java is much more simple to learn and you don't need other programing languages to freely control L2J to suite your needs. It's easily readable.
First part: not for everyone.
I agree with the second two parts.
Minutis wrote:--> Java is faster than Python.
  • Do you have proof?
  • I believe it is your assumptions about Java, Python, and scripts written in Java that is causing you to believe this is always true. Scripts written in Java being faster would mean that the script engine compiles the Java into byte code that executes faster than the compiled classes from the Jython script engine. The last benchmark test I saw (granted it was several years ago) Jython typically performed as good or better than the Java Beanshell scripting engine (Beanshell is the engine we use that compiles our scripts in Java).
Minutis wrote:So as I see things, we would get reasonable performance boost.
See above.
Minutis wrote:And I'll volanteruly start translating quests. Hope they will be accepted :) Or at least discussed about to see whats wrong.
You are very welcome to do so! If you can do this, get it tested by enough server admins saying that it works the same (without any performance hit), then I will personally push to get this in. Mind you that this is still a datapack element, not a core element.

Re: Quest system.

Posted: Wed Oct 06, 2010 6:42 pm
by poltomb
Closed, continue here viewtopic.php?f=69&t=18894
:)