Suggestion: Community Mission Editor

This forum is the ideal place for all discussion relating to X4. You will also find additional information from developers here.

Moderator: Moderators for English X Forum

User avatar
LittleBird
Posts: 762
Joined: Mon, 19. Dec 11, 02:02

Post by LittleBird » Sat, 14. Apr 18, 23:07

UniTrader wrote: such a thing as a Torpedo Ship is certainly do-able. Also if the Player was lead away during the Fight the Torpedo Ship could (if spawned) be created further away to give the Player enough time. For simple/initial Variants of this Mission (a Foundation to build upon if you want) the Torpedo Ship could simply ignore everything other than its intended Target, and/or placed in such a way that its Path is free. for Improvements the Mission could react to diffrent circumstates/solutions, like hitting another Ship you might have intentionally placed in its Path...
Its an Engineering Problem, not a question of possibility or impossibility..
Really? You have that much control and can even decide where the freigther has a clear path?
Then I take back what I said about the limitations for this case.
CBJ wrote: But this is as sandbox game, and that's what many players like about it. Indeed the feedback we get is that they want it to be more of a sandbox game, not less. What you're describing is a mission system that would be great for another game, but goes against what a lot of people want this game to be about.
Is the feedback based on the forum or more represantive informations? I "believe" there are also players who have fun with missions besides the sandbox approach.

Speaking for myself I enjoy both in the X-series. But after completing all plots and missions (what requires playing the sandbox in the first place) I can not find any motivation for an endless play like other player types do.
And I do not think that a mission editor whould result into less sandbox. In fact it would be the same sandbox plus content for an other player type. Various content due player creation.

X is not Wing Commander and not Freespace. But sometimes I think why does the plot stop there? Why does the mission can not have some more... spice?
And then ideas like my suggestion arises in hope of a compromise without hurting the basic X-feeling.
But if you can say for sure developing for this type is waistet effort because a lot of your players have no interest in these things then I have to accept it.
Ich bin für die Einführung von Ironie- und Sarkasmustags.
Alle Klarheiten beseitigt!

Skeeter
Posts: 3665
Joined: Thu, 9. Jan 03, 19:47
x3

Post by Skeeter » Sun, 15. Apr 18, 02:01

@cbj

Been a fan since xbtf, sandbox is ok the first few games but being pure sandbox is a bit dull, egosoft doesn't have to be so focused on sandbox gameplay, there is room for both sandbox and structured enjoyment such as story campaign/missions/progression systems.

People like GTA games like me who can successfully manage to be both sandbox and have a great story and mission structure, it's why I wish egosoft tried to evolve instead of rinse and repeat a generic space game every few years. I.e they set up a universe add some stations and ships a plot which I feel isn't budgeted enough and that's about it and expect the users to fill in the fun factor themselves which is hard if I've played alot of the X games since the start.

Basically I'm trying to say yeah some sandbox i.emessing around without the game saying u don't need to do anything is ok and often fun but I'd expect that only to happen after the main games finished and u can choose to play the game once I've saved the universe or something.

So not all X players want more sandbox as you said in a above post.

If I could imagine I'd take the great story and gameplay of starlancer and merge it with the freedom of travel and variety of stations and ships, mainly ships, don't need too many stations. So mix of them 2 games would be a great new X game.

Just my opinion of course as long time fan and hoping X games change a bit more which is why I stick around. Hoping the next X game evolves a bit more in structured fun instead of a mostly nice looking but empty game if you take away the underdeveloped plot arcs, tho I admit I haven't played x3 story much and skipped x3 TC and ap and gave up in rebirth.

Man I know this sounds super selfish and harsh. I just want that feeling back when I first saw xbtf box on shelf in 1999 and thought hmm this looks super cool and then had loads of fun with the story and improving my ship, did some station building but just enough to pay for upgrades till plot was done and enjoyed doing it in x2 but x3 turned me off due to lack of dropped features that I thought were great parts of the older games.


Now another thing is dropped, the gate and single areas in favour of big areas, which is why it's Gona be hard to want to get x4. I'll see what it's like when it's out, it might be alot better than rebirths big areas and easier to use map.
[ external image ]
7600x cpu 5.4ghz 32gb DDR5 5600mhz 6700XT 32" 1440p mon

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24950
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Sun, 15. Apr 18, 10:38

Skeeter wrote:So not all X players want more sandbox as you said in a above post.
CBJ didn't say that all players want more sandbox though. ;)

Also scripted, limited level designed gameplay has been a part of all X games to date, including the X3 and XR games which feature an iteration of the MD. The missions are usually part of the storyline / plots. The problem here is the effort to write these storylines in contrast to how often they are played.

However, sandbox or not, I feel there's a general misconception of what a tool can do in contrast to the Mission Director itself. A tool will never be able to create more complex missions than the Mission Director. Why? Simply because the tool will be based on the Mission Director. If one of the requirements of the tool is being easy to use without knowledge of the MD, then this is only viable if the tool limits the possibilities of the mission creator by offering only a part of the overall options the MD has to offer, as the tool will have to make sure that all pieces work together in the given combinations. If you increase the amount of options, you also greatly increase the amount of combinations and to an even higher degree the complexity of what the tool would have to do in order to ensure mission stability.
Personally, I think the best of what could come out of such a tool is an increased variety of smaller missions with less complexity. Although one has to ask, whether it's really worth the effort to create such a tool in the first place.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

User avatar
LittleBird
Posts: 762
Joined: Mon, 19. Dec 11, 02:02

Post by LittleBird » Sun, 15. Apr 18, 13:17

X2-Illuminatus wrote: However, sandbox or not, I feel there's a general misconception of what a tool can do in contrast to the Mission Director itself. A tool will never be able to create more complex missions than the Mission Director.
That is a misunderstanding.

What hinders complexity of missions is the sandbox (for clarification: the complexity what the creator has to look for increases of course => and that hinders mission complexity).
It is not the tool that allows for more complex missions it is the area the creator has complete control of.
And complexity is not even the major point. An area that can not affect the normal game is a requirement that players can create content. Because you can not demand that everyone would keep game balance in mind or all the possibilities a sandbox has to offer.

So I could drop the idea of an easy to use mission editor if MD using really is not that hard what it looks first. So that a lot of players can create content if they like.
But the major point is this independent area.
Ich bin für die Einführung von Ironie- und Sarkasmustags.
Alle Klarheiten beseitigt!

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24950
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus » Sun, 15. Apr 18, 15:03

I think you are too focussed on using level design gameplay in a sandbox. While in some instances in story telling it's beneficial to have independent areas (and again this has been done in previous X games already), it's by no means necessary to create content. You also do not have to take care of everything possible in that sandbox. In any way, the biggest obstacle to proper mission design is the player, finding ways around what you carefully planned before. ;)

Edit: typo.
Last edited by X2-Illuminatus on Sun, 15. Apr 18, 20:56, edited 1 time in total.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

SirNukes
Posts: 546
Joined: Sat, 31. Mar 07, 23:44
x4

Post by SirNukes » Sun, 15. Apr 18, 20:14

Ketraar wrote:Once people get around to understand the "basic" logic of MD and how it "ticks" its pretty straightforward, create cues, add conditions, wait for conditions to be meat, trigger the action, repeat.
Doesn't that chase off the vegetarian modders?

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

Post by UniTrader » Sun, 15. Apr 18, 21:30

Addition to X2s Post:
you can <create_presentation_cluster/> to have your own seperate Space to play/Make Missions in - in there you have complete control whats happening. there is usually just a single Cluster, Sector and Zone in there (and a chooseable Background) and thats it.. no other Ships, Asteroids or anything else which might disturb you.. but no idea how something like this helps in any way for making Missions.. just clear it up after you are done..
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
Killjaeden
Posts: 5366
Joined: Sun, 3. Sep 06, 18:19
x3tc

Post by Killjaeden » Sun, 15. Apr 18, 22:18

X2-Illuminatus wrote:I think you are too focussed on using level design gameplay in a sandbox.
Both can (and should) coexist in a sandbox imo. One provides more sand to play with over and over, the other provides a (hopefully) nice break from all the sand (e.g. handcrafted, unique story missions). They are not equally weighted of course. Having more sand is arguably more better for a sandbox vs. breaks from it.
___

When it's broken down, i dont think there is any technical difficulty in providing non-coding people access to mission design via a real tool, even for dynamic missions. The biggest factor is propably that the
tool would ideally provide direction. You will know what you are missing in your stuff, or what you should do next more easily with a good tool - which in a scripteditor you don't (apart from syntax).

An interface system where they can select conditions for mission start and parameters, dynamic target selection based on requirements, etc etc. Conditions and stuff could be linked in a node like fashion.

The main problem with it is the considerable time it would take to create this tool and have it run reliably. And it would of course still require people to learn it anyway. It might be quicker to learn than script. But once a beginner understand mission structure and all that - he might discard the tool and use text instead (whatever is more time efficient ).

So this problem is, i think, more efficiently tackled with didactically better tutorials sound that go into all the basics of 1) mission structure in MD in general 2) structure in script s 3) concrete examples that break down a mission into it's components, explaining what is what and why.
[ external image ]
X-Tended TC Mod Team Veteran.
Modeller of X3AP Split Acinonyx, Split Drake, Argon Lotan, Teladi Tern. My current work:
Image

User avatar
JSDD
Posts: 1378
Joined: Fri, 21. Mar 14, 20:51
x3tc

Post by JSDD » Sun, 15. Apr 18, 23:06

LittleBird wrote:So I could drop the idea of an easy to use mission editor if MD using really is not that hard what it looks first. So that a lot of players can create content if they like.
if you really want to create missions, you have to start learning the language, it took me a long time (i dunno, at least 1year with almost no experience in programming except c++ basics, which doesnt help you much in terms of MD) to understand how to script stuff in x3. you`ve got to invest a bunch of time into that before you can create awesome stuff / missions / plugins / whatever ...

@ complexity of missions:
yes, in x3 missions were not that complex, kind of created by "magic" with no bigger purpose behind the mission. in general, you have to be able to break down the problem into smaller ones, otherwise you get lost while trying to maintain overview of the threads ... the code structure in MD (node-tree-like structure) is very bad for maintaining overview in complex mission types ... a procedural code structure would be easier to use (but unfortunately x3 MSCI is gone). besides that, you NEED to plan the mission very carefully

you dont need complete control to create complex mission threads or other awesome stuff, but you need to cope with all the circumstances that can occur during the mission (which can be very difficult), and do the necessary clean-up (in the correct order) after everything is completed ... otherwise you have e.g. some useless argon mammuth ships in senators badlands belonging to noone doing nothing, just carrying stuff that you cant use nowhere else in the game :roll:

X3-related:
on the one hand, egosoft gave us the tools to script stuff ourselves into the game, on the other hand, scripts written by egosoft often were buggy of not very user friendly, or didnt help much to accomlish your goal (see the original trade /fight scripts) ... i hope that this time better scripts are being written initially by egosoft

@ TOOL:
would be a great idea to "wrap" the node-tree MD stuff into procedural (and easier to read) code (back and forth without losses) if that is possible (?) ... but who`s gonna write it ? :roll: there are no x4 freaks with programming knowledge around (at release i guess) ...
To err is human. To really foul things up you need a computer.
Irren ist menschlich. Aber wenn man richtig Fehler machen will, braucht man einen Computer.


Mission Director Beispiele

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

Post by CBJ » Mon, 16. Apr 18, 00:46

Killjaeden wrote:The main problem with it is the considerable time it would take to create this tool and have it run reliably. And it would of course still require people to learn it anyway. It might be quicker to learn than script. But once a beginner understand mission structure and all that - he might discard the tool and use text instead (whatever is more time efficient ).

So this problem is, i think, more efficiently tackled with didactically better tutorials sound that go into all the basics of 1) mission structure in MD in general 2) structure in script s 3) concrete examples that break down a mission into it's components, explaining what is what and why.
You pretty much hit the nail on the head here. The only thing I'd add to what you've said is that in addition to the time it would take to create the tool, we would also have to maintain and update it as the available actions and conditions evolve and improve, which is an ongoing process.

SirNukes
Posts: 546
Joined: Sat, 31. Mar 07, 23:44
x4

Post by SirNukes » Mon, 16. Apr 18, 10:22

JSDD wrote: @ TOOL:
would be a great idea to "wrap" the node-tree MD stuff into procedural (and easier to read) code (back and forth without losses) if that is possible (?) ... but who`s gonna write it ? :roll: there are no x4 freaks with programming knowledge around (at release i guess) ...
It is certainly possible. As I see it, there are two problems with the MD as-is: xml makes a bit of a scary mess of things, and there should be a translation layer between the runtime engine and the design time script development. For fun, I spitballed some code to convert MD xml to something slightly more recognizable.

Example input, taken from whatever script I landed on when scrolling through the cat file list for rebirth (trade.performplayertraderun.xml in this case):

Original snippet (skipping some debug stuff that's mostly text prints):

Code: Select all

<?xml version="1.0" encoding="iso-8859-1" ?>
<aiscript name="trade.performplayertraderun" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="aiscripts.xsd" priority="60">
  <params>
    <param name="debugchance" default="0"/>
  </params>
  <attention min="unknown">
    <actions>
      <!-- debugging -->
      <set_value name="$failreason" exact="''" />

      <wait min="1s" max="2s" />

      <!-- get top item from shopping list -->
      <label name="check shoppinglist" />
      <get_trade_from_shoppinglist object="this.ship" result="$shoppinglist" multiple="true" />
      <do_all exact="$shoppinglist.count" counter="$c">
        <set_value name="$tradeorder" exact="$shoppinglist.{$c}" />
        <do_if value="$tradeorder.seller.exists">
          <add_ware_reservation object="$tradeorder.seller" result="$reserved" ware="$tradeorder.ware" entity="this" amount="0" />
          <do_if value="$reserved" min="$tradeorder.amount">
            <add_ware_reservation object="$tradeorder.seller" ware="$tradeorder.ware" entity="this" amount="$reserved" replace="true" duration="5h" />
          </do_if>
          <do_else>
            <add_ware_reservation object="$tradeorder.seller" ware="$tradeorder.ware" entity="this" amount="$tradeorder.amount" duration="5h" />
          </do_else>
        </do_if>
        <do_elseif value="not $tradeorder.unbundle">
          <add_ware_reservation object="$tradeorder.buyer" result="$reserved" ware="$tradeorder.ware" entity="this" amount="0" />
          <do_if value="$reserved" min="$tradeorder.amount">
            <add_ware_reservation object="$tradeorder.buyer" ware="$tradeorder.ware" entity="this" amount="$reserved" replace="true" duration="5h" />
          </do_if>
          <do_else>
            <add_ware_reservation object="$tradeorder.buyer" ware="$tradeorder.ware" entity="this" amount="$tradeorder.amount" duration="5h" />
          </do_else>
        </do_elseif>
      </do_all>
After a couple hours writing a reformatter:

Code: Select all

@aiscript (priority = 60)
def trade_performplayertraderun (debugchance = 0):
    # debugging 
    failreason = ''
    
    wait (max = "2s", min = "1s")
    
    # get top item from shopping list 
    label .check_shoppinglist
    shoppinglist = get_trade_from_shoppinglist (multiple = True, object = "this.ship")
    for c in range(shoppinglist.count):
        tradeorder = shoppinglist[c]
        if tradeorder.seller.exists:
            reserved = add_ware_reservation (amount = 0, entity = "this", object = "tradeorder.seller", ware = "tradeorder.ware")
            if reserved:
                add_ware_reservation (amount = "reserved", duration = "5h", entity = "this", object = "tradeorder.seller", replace = True, ware = "tradeorder.ware")
            else:
                add_ware_reservation (amount = "tradeorder.amount", duration = "5h", entity = "this", object = "tradeorder.seller", ware = "tradeorder.ware")
        elif not tradeorder.unbundle:
            reserved = add_ware_reservation (amount = 0, entity = "this", object = "tradeorder.buyer", ware = "tradeorder.ware")
            if reserved:
                add_ware_reservation (amount = "reserved", duration = "5h", entity = "this", object = "tradeorder.buyer", replace = True, ware = "tradeorder.ware")
            else:
                add_ware_reservation (amount = "tradeorder.amount", duration = "5h", entity = "this", object = "tradeorder.buyer", ware = "tradeorder.ware")
Or maybe this looks better:

Code: Select all

@aiscript (priority = 60)
def trade_performplayertraderun (debugchance = 0):
    # debugging 
    failreason = ''
    
    wait (
        max = "2s",
        min = "1s",
    )
    
    # get top item from shopping list 
    label .check_shoppinglist
    shoppinglist = get_trade_from_shoppinglist (
        multiple = True,
        object = "this.ship",
    )
    for c in range(shoppinglist.count):
        tradeorder = shoppinglist[c]
        if tradeorder.seller.exists:
            reserved = add_ware_reservation (
                amount = 0,
                entity = "this",
                object = "tradeorder.seller",
                ware = "tradeorder.ware",
            )
            if reserved:
                add_ware_reservation (
                    amount = "reserved",
                    duration = "5h",
                    entity = "this",
                    object = "tradeorder.seller",
                    replace = True,
                    ware = "tradeorder.ware",
                )
            else:
                add_ware_reservation (
                    amount = "tradeorder.amount",
                    duration = "5h",
                    entity = "this",
                    object = "tradeorder.seller",
                    ware = "tradeorder.ware",
                )
        elif not tradeorder.unbundle:
            reserved = add_ware_reservation (
                amount = 0,
                entity = "this",
                object = "tradeorder.buyer",
                ware = "tradeorder.ware",
            )
            if reserved:
                add_ware_reservation (
                    amount = "reserved",
                    duration = "5h",
                    entity = "this",
                    object = "tradeorder.buyer",
                    replace = True,
                    ware = "tradeorder.ware",
                )
            else:
                add_ware_reservation (
                    amount = "tradeorder.amount",
                    duration = "5h",
                    entity = "this",
                    object = "tradeorder.buyer",
                    ware = "tradeorder.ware",
                )
Of course it needs a fair amount of work on evaluating expressions to pick out nested variables and such, according to MD rules, and a lot of other little things would need sorting out as well; 2-3 hours only covers so much, especially without any experience Rebirth modding. :)

You might notice the second form is in python syntax. If you slap a framework behind it with various node definitions, code writing can then be done in any nice python IDE (pycharm, visual studio, etc.) with the usual autocompletions and documentation popups and such. Scripts would also be runnable as python code, though initially it would probably just be for some logic checks. Eventually, functional test support could be added.

Conversion from python back to MD xml would be slightly tougher, since it would take some ast parsing, but isn't that big of a deal (python makes it really easy to do ast traversal). All sorts of functionality can be injected into the reverse conversion, like compilation warnings/errors if node fields look wrong, function inlining, debug code injection or pruning, dead code removal, etc.

User avatar
LittleBird
Posts: 762
Joined: Mon, 19. Dec 11, 02:02

Post by LittleBird » Mon, 16. Apr 18, 18:25

X2-Illuminatus wrote:I think you are too focussed on using level design gameplay in a sandbox. While in some instances in story telling it's beneficial to have independent areas (and again this has been done in previous X games already), it's by no means necessary to create content. You also do not have to take care of everything possible in that sandbox. In any way, the biggest obstacle to proper mission design is the player, finding ways around what you carefully planned before.
"level design gameplay"... I think that describes it really good.
By looking for game balance and posibilities I mean stuff like "massive Xenon invasion in Argon Prime". If we would have an easy to use tool many players would create... everything and everything is not practical in a sandbox.
JSDD wrote: if you really want to create missions, you have to start learning the language, it took me a long time (i dunno, at least 1year with almost no experience in programming except c++ basics, which doesnt help you much in terms of MD) to understand how to script stuff in x3. you`ve got to invest a bunch of time into that before you can create awesome stuff / missions / plugins / whatever ...
This is just not practical.
The idea should make it possible that many players can create content.
Killjaeden wrote: The main problem with it is the considerable time it would take to create this tool and have it run reliably. And it would of course still require people to learn it anyway. It might be quicker to learn than script. But once a beginner understand mission structure and all that - he might discard the tool and use text instead (whatever is more time efficient ).
I disagree in the last point.
The tool would be allways faster and more time efficient. That is its purpose.
But the tool is limited and for more complicated stuff experienced user would switch to coding. So it would be great if the tool could show you the code. This would also helps in learning it.
Killjaeden wrote: So this problem is, i think, more efficiently tackled with didactically better tutorials sound that go into all the basics of 1) mission structure in MD in general 2) structure in script s 3) concrete examples that break down a mission into it's components, explaining what is what and why.
I am sure that would help existent modding and scripting community. But face the truth it very unlikely that new people would take on what JSDD above described.



Sooooo my conclusion for this thread.

- Tool creation and support is to time consuming for realization.
- MD learning is very time consuming and it is unrealistic it could attract many players... even with a better documentation.

- The idea of independent areas for more level design like missions collides with the sandbox aspect.
- I still believe it would extent the design possibilities compared to sandbox missions. And I still believe it would be a great way to fill empty space with the help of the community.
Ich bin für die Einführung von Ironie- und Sarkasmustags.
Alle Klarheiten beseitigt!

User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 11741
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar » Mon, 16. Apr 18, 19:01

LittleBird wrote:- MD learning is very time consuming and it is unrealistic it could attract many players... even with a better documentation.
Here I think you are skewing the notion a bit. I doubt a mission tool will attract new players, it arguably would inspire existing players to create missions sure, but I think those that have the drive to create content usually find a way to do it, with more or less effort.

I'd also argue that the MD coding itself is pretty easy to learn, with existing documentation and tools. Cant speak too much about XR MD, but I think its not much different, in that the struggle to "learn MD" is to know how the game ticks. Its far more important imho to know the inner workings of the game's logic (Jobs, map design, assets, voices, text, etc) then MD itself, since it will be important to know when to make use of what and the impact that will have in the "universe".

Now if we were to just able to magically wish a tool into existence, I'd wish for it to be able to cross ref assets, so that one could say "make a Paranid actor" and it would create all the needed lines for a working NPC, that just needs lines fed, that would be nice.

MFG

Ketraar

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

Post by UniTrader » Tue, 17. Apr 18, 00:00

LittleBird wrote:
Killjaeden wrote: The main problem with it is the considerable time it would take to create this tool and have it run reliably. And it would of course still require people to learn it anyway. It might be quicker to learn than script. But once a beginner understand mission structure and all that - he might discard the tool and use text instead (whatever is more time efficient ).
I disagree in the last point.
The tool would be allways faster and more time efficient. That is its purpose.
But the tool is limited and for more complicated stuff experienced user would switch to coding. So it would be great if the tool could show you the code. This would also helps in learning it.
he meant the effort for egosoft (or whomever) to create such a tool, not the effort for the user which you refer to :roll: also why create such a Tool in the first place if it can only cover the simpler stuff if you have to switch to the already existing tool if you want to do more?

@Ketrar
for me a one-eyed Paranid please :D


@SirNukes
what you converted was an AI Script, which is similiar in many aspects to MD but not the same (it controls Ships and such stuff, but is not usedl for Missions), and compared to MD is pretty "classic" flow-wise.
try the same for any File in the md directory (best something really Mission-related). i guess this will turn out to be pretty complicated to convert because of the possibly many event conditions and parallel stuff happening...
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
Killjaeden
Posts: 5366
Joined: Sun, 3. Sep 06, 18:19
x3tc

Post by Killjaeden » Tue, 17. Apr 18, 01:52

SirNukes wrote: For fun, I spitballed some code to convert MD xml to something slightly more recognizable.
Thank you very much for this efford. I personally think XML is eyecancer... and i would never get within 10m of "MD" if i had to deal with xml BS. I will never understand why they would chose xml over any other "language style" to embedd their script language in, especially for missions - and then also advertise it as beginner friendly...
I'm not a programmer by profession, but i can read and write c and python code (and "X3 script") just fine, because it's logical, clean and structured. "X3 script" was so easy to use with the script editor that it motivated me to write some smaller stuff on my own back in the days. XML has the opposite effect. XML is structured but ridiculously cluttered... obfuscating the real content with "fancy" tree structures and <word>tags</word>, wasting everyones space and time.

But we already had this topic i think a while ago... and that ship has already sunk, its not going to resurface differently anymore.

Edit: 5000th post. Celebrations. Insanity.
[ external image ]
X-Tended TC Mod Team Veteran.
Modeller of X3AP Split Acinonyx, Split Drake, Argon Lotan, Teladi Tern. My current work:
Image

User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 11741
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar » Tue, 17. Apr 18, 02:15

Killjaeden wrote:"X3 script" was so easy to use with the script editor that it motivated me to write some smaller stuff on my own back in the days. XML has the opposite effect. XML is structured but ridiculously cluttered... obfuscating the real content with "fancy" tree structures and <word>tags</word>, wasting everyones space and time.
Guess we are opposite then. As a non programmer I found and still find that SE is just a nonsensical mess made by aliens and I just could never get through it, whereas MD cklicked pretty fast and still make more sense to me than any SE script. Mostly because one can actually read the MD script and see what it does, especially for (linear) Missions its like reading a storyboard.

That one can do ridiculous stuff with MD that is convoluted and frankly not really intended to be done using it, is just a nice bonus.
Edit: 5000th post. Celebrations. Insanity.
Welcome to the spammer club. :-P

MFG

Ketraar

SirNukes
Posts: 546
Joined: Sat, 31. Mar 07, 23:44
x4

Post by SirNukes » Tue, 17. Apr 18, 07:14

I gave a mission script a shot. It took a bit longer than I would like, mostly fiddling with different ways it could be displayed (actually getting it to parse was fine, it was just not satisfying my goals).

While not perfect, here an example snippet taken from the start of 'GM_Escort_Ships.xml' (with a little comment pruning for space), since I figure a ship escort should be reasonably complicated. The best cleanup comes later once cues get more complicated, but that is mostly just repeating what is shown in the AI script.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<mdscript name="GM_Escort_Ships" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
  <cues>

    <cue name="Force_Generic" instantiate="true">
      <conditions>
        <event_cue_signalled/>
      </conditions>
      <actions>
        <signal_cue cue="md.GenericMissions.RemoveAllOffers"/>
      </actions>
      <force name="GM_Escort_Ships"/>
      <cues>
        <cue name="Force_Generic_Signals">
          <delay exact="1s"/>
          <actions>
            <do_all exact="25">
              <signal_cue_instantly cue="md.GM_Escort_Ships.StartGeneric" param="100"/>
            </do_all>
          </actions>
        </cue>
      </cues>
    </cue>

    <cue name="StartGeneric" instantiate="true" namespace="this">
      <conditions>
        <check_any>
          <check_all>
            <!--Generic Mission Case (If this cue is to be signalled by other sources, add a parameter to differentiate)-->
            <!--signal_cue_instantly - event.param = $DebugChance 0 to 100-->
            <event_cue_signalled />
            <check_value value="player.sector"/>

            <!--No need to look for a destination station just yet. That will be handled in the variation checks-->
            <count_stations space="player.sector" min="1" canhaveofferlocation="tag.mission" result="$missionstations">
              <match_relation faction="faction.player" comparison="not" relation="enemy" />
              <match owner="faction.player" negate="true" />
              <match owner="null" negate="true"/>
              <match_distance object="player.primaryship" max="md.$MaxMissionOfferDistance" />
            </count_stations>
          </check_all>

          <check_all>
            <event_player_mission_opportunity/>
            <check_value value="false"/>
            <!--TODO: Filter what opportunities trigger this mission-->
          </check_all>
        </check_any>
      </conditions>
      <actions>
        <!--***event_cue_signalled case***-->
        <do_if value="event.name == 'event_cue_signalled'">
          <set_value name="$missionstation" exact="static.$missionstations.{md.$RandomIdx}"/>
          <set_value name="$EventOffer" exact="false"/>

          <set_value name="$DebugChance" exact="@event.param"/>
        </do_if>

        <do_elseif value="event.name == 'event_player_mission_opportunity'">
          <set_value name="$missionstation" exact="event.param"/>
          <set_value name="$EventOffer" exact="true"/>

          <set_value name="$DebugChance" exact="0"/>
        </do_elseif>
      </actions>
      <cues>
        <cue name="StartRef" ref="md.GM_Escort_Ships.Start">
          <param name="MissionStation" value="$missionstation" />
          <param name="EventOffer" value="$EventOffer"/>

          <param name="DebugChance" value="$DebugChance"/>
        </cue>
      </cues>
    </cue>

Code: Select all

@mdscript ()
def GM_Escort_Ships ():
    
    @cue (instantiate = True)
    def Force_Generic ():
        if(
            event_cue_signalled ()
        ):
            signal_cue (cue = md.GenericMissions.RemoveAllOffers)
            force (name = GM_Escort_Ships)
    
            @cue (delay = 1s)
            def Force_Generic_Signals ():
                for _ in range(25):
                    signal_cue_instantly (
                        cue = md.GM_Escort_Ships.StartGeneric, 
                        param = 100)
    
    @cue (instantiate = True, namespace = this)
    def StartGeneric ():
        if(
            (
                #Generic Mission Case (If this cue is to be signalled by other sources, add a parameter to differentiate)
                #signal_cue_instantly - event.param = $DebugChance 0 to 100
                event_cue_signalled ()
                and Player_is_not_in_highway()
                
                #No need to look for a destination station just yet. That will be handled in the variation checks
                and count_stations (
                    canhaveofferlocation = tag.mission, 
                    min = 1, 
                    result = missionstations, 
                    space = player.sector, 
                    options = [
                        match_relation (
                            comparison = not, 
                            faction = faction.player, 
                            relation = enemy),
                        match (
                            negate = True, 
                            owner = faction.player),
                        match (
                            negate = True, 
                            owner = None),
                        match_distance (
                            max = md.MaxMissionOfferDistance, 
                            object = player.primaryship),
                    ])
            )
            
            or (
                event_player_mission_opportunity ()
                and False
                #TODO: Filter what opportunities trigger this mission
            )
        ):
            #***event_cue_signalled case***
            if event.name == 'event_cue_signalled':
                missionstation = static.missionstations[md.RandomIdx]
                EventOffer = False
                
                DebugChance = @event.param
            
            elif event.name == 'event_player_mission_opportunity':
                missionstation = event.param
                EventOffer = True
                
                DebugChance = 0
    
            @cue ()
            def StartRef ():
                Cue_Ref("md.GM_Escort_Ships.Start", 
                    MissionStation = missionstation,
                    EventOffer = EventOffer,
                    DebugChance = DebugChance,
                )
Now, this could be cleaned up more visually, but I was aiming for something a little ambitious: by laying out cues as defined functions, they could potentially be dropped into a python model of the MD engine for running unit tests in a simulated environment (through some tricks with generator functions). Not that I plan to set that up (it would take a while), but I like to shoot for hard targets.

Some other things to note:
- This is still spitballed code; I'd probably reorganize it into a proper project if I wanted to keep going (and probably open it to community development).
- I don't know what a lot of the functionality is of the various nodes; my layout decisions could certainly be better with understanding, not to mention more development time.
- Is there documentation on the MD nodes somewhere outside the schema? Maybe with updates for X4? My main reference is an X3:AP pdf I have sitting around (which came from Phil's desktop in 2012).
- For fun, "<check_value value="player.sector"/>" was translated to "Player_is_not_in_highway()" after checking documentation, as an example of how splitting the run-time and coding layers gives opportunities to add clarity. Its a very short hop to Create_One_Eyed_Paranid(you_monster).

nemesis1982
Posts: 812
Joined: Wed, 29. Oct 08, 12:10
x4

Post by nemesis1982 » Tue, 17. Apr 18, 09:56

I think creating a workflow based tool would actually be beneficial for this and might drastically improve readability and time needed to create scripts.

Now I'm not saying you wouldn't be seeing the XML at all. The workflow block would still contain the XML however they'd be reusable if setup right.

Simply throwing something this together shouldn't be to difficult. Making it stable, complete and fool proof that's where the effort comes.
Save game editor XR and CAT/DAT Extractor
Keep in mind that it's still a work in progress although it's taking shape nicely.

If anyone is interested in a new save game editor for X4 and would like to contribute to the creation of one let me know. I do not have sufficient time to create it alone, but if there are enough people who want it and want to contribute we might be able to set something up.

User avatar
LittleBird
Posts: 762
Joined: Mon, 19. Dec 11, 02:02

Post by LittleBird » Tue, 17. Apr 18, 13:58

Ketraar wrote:
LittleBird wrote:- MD learning is very time consuming and it is unrealistic it could attract many players... even with a better documentation.
Here I think you are skewing the notion a bit. I doubt a mission tool will attract new players, it arguably would inspire existing players to create missions sure, but I think those that have the drive to create content usually find a way to do it, with more or less effort.
Not necessarily new players but new content creators who need are lower barrier for entry.
Ketraar wrote: I'd also argue that the MD coding itself is pretty easy to learn, with existing documentation and tools. Cant speak too much about XR MD, but I think its not much different, in that the struggle to "learn MD" is to know how the game ticks.
It is strange that the estimation of the difficulty varies from:
"it took me a long time (i dunno, at least 1year with almost no experience in programming" (JSDD)
to
"MD coding itself is pretty easy to learn, with existing documentation and tools"
Looking at the code presented here I tend to JSDD's view.
Ketraar wrote: Now if we were to just able to magically wish a tool into existence, I'd wish for it to be able to cross ref assets, so that one could say "make a Paranid actor" and it would create all the needed lines for a working NPC, that just needs lines fed, that would be nice.
Do you mean something like the format editor here? Press the button and you have the... well "code" plus structure?
UniTrader wrote:
LittleBird wrote:
Killjaeden wrote: The main problem with it is the considerable time it would take to create this tool and have it run reliably. And it would of course still require people to learn it anyway. It might be quicker to learn than script. But once a beginner understand mission structure and all that - he might discard the tool and use text instead (whatever is more time efficient ).
I disagree in the last point.
The tool would be allways faster and more time efficient. That is its purpose.
But the tool is limited and for more complicated stuff experienced user would switch to coding. So it would be great if the tool could show you the code. This would also helps in learning it.
he meant the effort for egosoft (or whomever) to create such a tool, not the effort for the user which you refer to
You are mistaken. He meant both. And I disagreed with his last point that the code would be more time efficient.
UniTrader wrote: also why create such a Tool in the first place if it can only cover the simpler stuff if you have to switch to the already existing tool if you want to do more?
To get the hang of it. To make the first steps less scary. To allow a wider range of user to create mission content.
Ich bin für die Einführung von Ironie- und Sarkasmustags.
Alle Klarheiten beseitigt!

User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 11741
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar » Tue, 17. Apr 18, 15:21

LittleBird wrote:It is strange that the estimation of the difficulty varies from:
"it took me a long time (i dunno, at least 1year with almost no experience in programming" (JSDD)
to
"MD coding itself is pretty easy to learn, with existing documentation and tools"
Looking at the code presented here I tend to JSDD's view.
Well I disagree. As I said in more detail, learning the structure and function of the MD takes about 10-20h to understand. Create_cue, add conditions, actions, close up stuff, done.

The tricky part is to know how the GAME reacts to it, what are the things you can influence, how to create conversations with NPC, which text is spoken and which is not, etc etc etc. This has little to do MD though as its stuff you would need to know for other modding scenarios, say using the SE. Which is my point, the entry difficulty is high due to the games complexity and the shear amount of stuff that is interconnected and can be influenced.

I'd argue that even a person that has not coded MD one bit will be able to open a Plot file and understand how the plot unfolds just be reading the xml lines. Many non MD coders have extracted information from MD files since the MD came out. This is a good indication that the MD itself is pretty simple to understand.
Do you mean something like the format editor here? Press the button and you have the... well "code" plus structure?
Tbh I dont know, as I said, I'm no programmer, all I can say is what the expected outcome could look like for this wishful-thinking tool.

MFG

Ketraar

Post Reply

Return to “X4: Foundations”