Scripting Engine Discussion (split from Updates Announcement. AP)

General discussions about X Rebirth.

Moderator: Moderators for English X Forum

bambikaka
Posts: 153
Joined: Sat, 26. Dec 15, 13:24

Scripting Engine Discussion (split from Updates Announcement. AP)

Post by bambikaka »

Shimrod wrote:Great to hear about X4. Crossing my fingers for a scripting engine!
i wish, it was one of the best parts of x3 :(
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

Shimrod wrote:Great to hear about X4. Crossing my fingers for a scripting engine!
i dont think there is any need for that because every EGO Game since X² has one.
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
bambikaka
Posts: 153
Joined: Sat, 26. Dec 15, 13:24

Post by bambikaka »

UniTrader wrote:
Shimrod wrote:Great to hear about X4. Crossing my fingers for a scripting engine!
i dont think there is any need for that because every EGO Game since X² has one.
well, xr does not have it... at least its nothing like we had it in x3.
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

bambikaka wrote:
UniTrader wrote:
Shimrod wrote:Great to hear about X4. Crossing my fingers for a scripting engine!
i dont think there is any need for that because every EGO Game since X² has one.
well, xr does not have it... at least its nothing like we had it in x3.
so you want to deny that AI and MD Scripts exist? sure, they work diffrent than the ones X3 had, but they do exist. They may not be internally editable anymore, in preference for External Tools (the latter being a long-standing wish by the Scripting Community btw :roll: )
denying their Existence isnt helping your cause, quite the opposite - it makes you look like you have no idea what you are talking about..
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
bambikaka
Posts: 153
Joined: Sat, 26. Dec 15, 13:24

Post by bambikaka »

UniTrader wrote:
bambikaka wrote:
UniTrader wrote:
Shimrod wrote:Great to hear about X4. Crossing my fingers for a scripting engine!
i dont think there is any need for that because every EGO Game since X² has one.
well, xr does not have it... at least its nothing like we had it in x3.
so you want to deny that AI and MD Scripts exist? sure, they work diffrent than the ones X3 had, but they do exist. They may not be internally editable anymore, in preference for External Tools (the latter being a long-standing wish by the Scripting Community btw :roll: )
denying their Existence isnt helping your cause, quite the opposite - it makes you look like you have no idea what you are talking about..
lol, poor try, nobody was denying anything, you know just as i know i was talking about the internal editor and thats called scripting engine... notepad isnt one.
User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 12188
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar »

Shouldn't a SW dev know what a scripting engine is? Or how do you think those xml files are parsed, magic? :roll:

MFG

Ketraar
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

Ketraar wrote:Or how do you think those xml files are parsed, magic? :roll:
Nope, the Magic was in X3, especially the Price Calculation :D i doubt anybody knows how it actually works, and afaik it has been unchanged since X-BtF
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
bambikaka
Posts: 153
Joined: Sat, 26. Dec 15, 13:24

Post by bambikaka »

Ketraar wrote:Shouldn't a SW dev know what a scripting engine is? Or how do you think those xml files are parsed, magic? :roll:

MFG

Ketraar
did you mean a mod? hmm, not necessarily... xml files are parsed by xml parsing not scripting, you know scripting is the process of writing the scripts and a scripting engine is what allows the user to write scripts... parsing/compiling them is an other category. but i quit this pointless offing...
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

bambikaka wrote:you know scripting is the process of writing the scripts and a scripting engine is what allows the user to write scripts...
Nope, a Scripting Engine is the Part of a Program which interprets and executes small Programs (aka Scripts) to run in the Environment given by the Scripting Engine. Where these Programs/Scripts are written is not part of the Definition - it may be internally in the main Program, like in X2/X3 (which has this as primary method of Creating them, and that is VERY unusual for Scripting Languages. As secondary means to write and test short sequences of Code, or point to external files to be executed, it is far more common) or, more commonly, by Text Editors, which even have helpful highlighting and Block Folding for them. (Example for a proper Editor would be Notepad++, and examples for Scripting Languages primarily edited this way are Lua, Bash and Windows Shell (aka bat(ch) files))
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 12188
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar »

UniTrader wrote:Nope, the Magic was in X3, especially the Price Calculation :D i doubt anybody knows how it actually works, and afaik it has been unchanged since X-BtF
You refer to RelVal I presume and yes it has "magic" noted in the comments of the var. :-D

MFG

Ketraar
User avatar
jack775544
Posts: 1277
Joined: Tue, 13. Dec 11, 08:27
x4

Post by jack775544 »

Despite the scripting being perfectly fine in XR, I would definitely have no complaints if it was something a bit less unwieldy as XML in X4.
My dream would be a Python package written by egosoft that could interact with the game, but that is more my love for Python then anything else :)
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.
User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 12188
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar »

But mind that many of us modders are not programmers and thus a more simple approach like xml will allow more people to create content.

MFG

Ketraar
Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 13129
Joined: Sat, 9. Nov 02, 11:45
x4

Post by Xenon_Slayer »

bambikaka wrote:
UniTrader wrote:
bambikaka wrote:
UniTrader wrote:
Shimrod wrote:Great to hear about X4. Crossing my fingers for a scripting engine!
i dont think there is any need for that because every EGO Game since X² has one.
well, xr does not have it... at least its nothing like we had it in x3.
so you want to deny that AI and MD Scripts exist? sure, they work diffrent than the ones X3 had, but they do exist. They may not be internally editable anymore, in preference for External Tools (the latter being a long-standing wish by the Scripting Community btw :roll: )
denying their Existence isnt helping your cause, quite the opposite - it makes you look like you have no idea what you are talking about..
lol, poor try, nobody was denying anything, you know just as i know i was talking about the internal editor and thats called scripting engine... notepad isnt one.
People who edit XML in notepad scare me :roll:

But yes, to clarify the terms we use: A Script Engine is the part of the game which parses the script files and executes them. IIRC it started with the X2 AI engine, then the X3TC Mission Director. XR has one for AI and one for MD but they share a lot of functionality and syntax.

The in-game Script Editor is what is not in XR, just as the X3 MD didn't have one. Visual Studio is usually the standard for that kind of XML editing, although I expect notepad++ has some plugins to help.

I'm not going to start on the pros and cons of each approach, just wanted to clear things up.
User avatar
ubuntufreakdragon
Posts: 5226
Joined: Thu, 23. Jun 11, 14:57
x4

Post by ubuntufreakdragon »

the .xml reduces pretty much the reading speed, and for newbies it could be pretty difficult to understand that they have to close tags etc.
And from logic Point the xml scripts work like a programing language so non programmers have to learn programming for both. :roll:
a non compiled lang like Python script might be a better approach.
the xml approach was good for tfiles but xml md and ai should die, so Ketraar has to learn something new :P
My X3 Mods

XRebirth, things left to patch:
In General; On Firing NPC's; In De Vries; Out Of Zone; And the Antiwishlist
User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 12188
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar »

ubuntufreakdragon wrote:the xml approach was good for tfiles but xml md and ai should die, so Ketraar has to learn something new :P
I already have a job, not having a sensible way to mod the games will only result in me playing more EU4 instead. :-P

MFG

Ketraar
User avatar
MegaJohnny
Posts: 2239
Joined: Wed, 4. Jun 08, 22:30
x4

Post by MegaJohnny »

Ketraar wrote:I already have a job, not having a sensible way to mod the games will only result in me playing more EU4 instead. :-P

MFG

Ketraar
Let me know if I'm getting out of scope for the thread. But I'm wondering what your favourite things are in the XML vs. standard scripting languages? I've not used the XML too much, but it seems to have similar principles as other languages, but much more verbose and with some syntactic quirks. Does it have some good features to appeal to non-programmers?
User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 12188
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar »

Well I can only speak for the MD way of using XML and after having tried for ages getting in SE in previous games, it was so convoluted that it always put me off. Where the MD just makes sense, check this, do that, wait here, do that x number of times, etc.

Now this is possibly more related to how the MD is structured and the schema is put then anything else, which I couldn't say as I'm no programmer by a long shot. It can also just be that it clicked for me and SE did not, much like with people, some you just dont like and you cant even tell really why... :roll:

MFG

Ketraar
CBJ
EGOSOFT
EGOSOFT
Posts: 54317
Joined: Tue, 29. Apr 03, 00:56
x4

Post by CBJ »

Some of the original reasons for choosing XML for the MD were:

- Domain-specific structure (it's laid out in the form of the conditions and actions required for mission progress) and syntax (many of the conditions and actions are directly mapped to mission activities rather than just being generic programming terms)
- Missions can be created with very limited programming knowledge (while it's possible to do programmer-y things like loops, it is also possible to create simple missions entirely without this, which helps with the learning curve)
- Editing comes with built-in self-documentation as well as syntax auto-completion (most self-respecting XML editors understand schemas, and the schemas can also be used to provide the documentation)
- Easy to parse and convert to internal format (it is loaded and parsed very simply using standard XML libraries, then converted into an internal form that is that is, like the raw syntax, closely tied to its purpose, rather than using a generic third party interpreter or JIT compiler)

Now, bearing in mind that we have been working with the MD, in one form or another, for nearly 10 years, the reason we continue to use it is very simple: we have it, it works, and it does what mission developers need it to. The AI scripting system shares some key elements, such as actions and conditions, with the MD, saving a lot of effort in maintenance and development, but is, again, tailored to the task in hand. It would be a very poor use of developer time to throw all that away in favour of something different, with all the issues and unknowns that would come with it, just because some people turn their noses up at it for being XML rather than a "proper" programming language.
User avatar
MegaJohnny
Posts: 2239
Joined: Wed, 4. Jun 08, 22:30
x4

Post by MegaJohnny »

Ketraar wrote:Well I can only speak for the MD way of using XML and after having tried for ages getting in SE in previous games, it was so convoluted that it always put me off. Where the MD just makes sense, check this, do that, wait here, do that x number of times, etc.

Now this is possibly more related to how the MD is structured and the schema is put then anything else, which I couldn't say as I'm no programmer by a long shot. It can also just be that it clicked for me and SE did not, much like with people, some you just dont like and you cant even tell really why... :roll:

MFG

Ketraar
Ah, right, I think I get it.

I don't mean to dispute the choice of XML or bash it, just that having been brought up on very procedural languages I was interested in another perspective.

Return to “X Rebirth Universe”