X4 - UI and scripting

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

Assailer
Posts: 445
Joined: Sun, 25. May 14, 17:45
x4

X4 - UI and scripting

Post by Assailer » Wed, 2. Aug 17, 07:47

As a mod-maker, I really wish for on-screen custom buttons (single and toggle) to control my scripts.

As a player, I find the current X:RB UI requires too much menu crawling. Are you able to improve on that? Like keep certain windows pinned? Multiple target windows? Drop the single window only style, and allow multiple windows visible when mouse is available?

Are you planning to keep the XML based script editing?

Any plans for multiplayer like Avorion? I'm OK with Coop only, no need for PvP, so i could fight against stronger enemies with my friends.

Please leave out the 'Ren' only male avatar idea. We need females too! :)

Snafu_X3
Posts: 4244
Joined: Wed, 28. Jan 09, 16:14
x3tc

Re: X4 - UI and scripting

Post by Snafu_X3 » Thu, 3. Aug 17, 02:09

Assailer wrote: Please leave out the 'Ren' only male avatar idea. We need females too! :)
Agreed! Make <player> anonymous so they can be any gender/race as players/modders see fit
Wiki X:R 1st Tit capping
Wiki X3:TC vanilla: Guide to generic missions, Guide to finding & capping Aran
Never played AP; all X3 advice is based on vanilla+bonus pack TC or before: AP has not changed much WRT general advice.

I know how to spell teladiuminumiumium, I just don't know when to stop!

Dom (Wiki Moderator) 8-) DxDiag

User avatar
jack775544
Posts: 1118
Joined: Tue, 13. Dec 11, 09:27
x4

Re: X4 - UI and scripting

Post by jack775544 » Thu, 3. Aug 17, 06:27

Assailer wrote:Are you planning to keep the XML based script editing?
Please no, Please no, Please no, Please no, Please no, Please no, Please no, Please no...

I don't think they would be dropping it though :cry:
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.

j.harshaw
EGOSOFT
EGOSOFT
Posts: 787
Joined: Mon, 23. Nov 15, 19:02

Re: X4 - UI and scripting

Post by j.harshaw » Thu, 3. Aug 17, 12:22

jack775544 wrote:
Assailer wrote:Are you planning to keep the XML based script editing?
Please no, Please no, Please no, Please no, Please no, Please no, Please no, Please no...
What would you replace it with?

God, i hate putting up these disclaimers whenever i say anything. Not saying that we're planning to do one thing or the other. Please don't take this as an indication that we are going one way or the other.

I'm really just curious.

Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 11227
Joined: Sat, 9. Nov 02, 12:45
x4

Post by Xenon_Slayer » Thu, 3. Aug 17, 16:07

I'll be "that guy" to say it then :wink:

Yes, we are keeping the XML based scripting for AI/Missions. UI is still lua script.

j.harshaw
EGOSOFT
EGOSOFT
Posts: 787
Joined: Mon, 23. Nov 15, 19:02

Post by j.harshaw » Thu, 3. Aug 17, 16:09

yes. but i'm still curious.

User avatar
ubuntufreakdragon
Posts: 4341
Joined: Thu, 23. Jun 11, 14:57
x4

Re: X4 - UI and scripting

Post by ubuntufreakdragon » Thu, 3. Aug 17, 16:16

Assailer wrote:As a mod-maker, I really wish for on-screen custom buttons (single and toggle) to control my scripts.
Yes the custom hotkey from X3 need a comeback.
Assailer wrote: As a player, I find the current X:RB UI requires too much menu crawling. Are you able to improve on that? Like keep certain windows pinned? Multiple target windows? Drop the single window only style, and allow multiple windows visible when mouse is available?
I want this extended:
A menu mode and a flight mode and a single key to toggle between those hitting it hides all menus hitting it again restores them(like clicking the lower right corner on newer windows systems), because every time you get attacked you loose all you progress in these complex menus.
For controlers this should be manageable too.
Just overload the toggle menumode button holding it down allows opening new windows with the left stick or rearranging old ones with the right stick.
Oh and please add other features filemanagers have, too. There no big difference between handing files in OS and comanding you property, e.g. drag and drop, ctrl click and shift click for fast selection.
Assailer wrote: Are you planning to keep the XML based script editing?
I wish for a shorter syntax as reading sometimes proves very difficult, e.g. a small translation program that tanslates the xml code into something looking similar to c++/java ist you have two formal descriptions of these languages you can generate a compiler for it.
Assailer wrote: Any plans for multiplayer like Avorion? I'm OK with Coop only, no need for PvP, so i could fight against stronger enemies with my friends.
Coop is fine with me too, I guess a PVP could be rather difficult because of the fleet sizes that could clash, but don't focus it.
Assailer wrote: Please leave out the 'Ren' only male avatar idea. We need females too! :)
Subscribe, and Lars :boron:
My X3 Mods

XRebirth, things left to patch:
In General; On Firing NPC's; In De Vries; Out Of Zone; And the Antiwishlist

Assailer
Posts: 445
Joined: Sun, 25. May 14, 17:45
x4

Post by Assailer » Thu, 3. Aug 17, 20:22

Thanks for the answers!

XML works fine, just wanted to check if changes are coming.

I'm wondering what performance you get with XML based scripting. Is that optimal enough?

Modders like me would welcome certain profiling tools. Any chance to get some support built-in for this? That could help learning which are the expensive API calls, and would allow easier performance tuning.

Xenon_Slayer
EGOSOFT
EGOSOFT
Posts: 11227
Joined: Sat, 9. Nov 02, 12:45
x4

Post by Xenon_Slayer » Thu, 3. Aug 17, 20:42

I expect the performance would be similar regardless of which format the script is. The XML is parsed on loading the game, so after that point, it doesn't really have any bearing. Our AI and MD systems are very event driven, so not much happens until it is supposed to happen. It's the execution of the script actions which is where performance can take a hit. Of course, there have been optimisations in the script engine to help. One of which was an early-out for expressions e.g.

Code: Select all

<do_if value="$NPC.exists and $NPC.owner == faction.argon"/>
With the early-out optimisation, if the $NPC.exists fails, then the owner check will not occur.

For the most part though, it's what happens withing the expressions/actions themselves which can cause the most performance impact. This usually leads to optimisations elsewhere in the engine rather than in the scripts or script engine.

Assailer
Posts: 445
Joined: Sun, 25. May 14, 17:45
x4

Post by Assailer » Fri, 4. Aug 17, 06:34

Thanks!

API calls like finding entities or pathing will cause most of the slow downs in scripts. Is there any way to measure how much time scripts spend inside these costy functions?

X4 could automatically generate and save variables for all script instances like __minTime, __maxTime, __avgTime, __schedules

Then, loading the save game into an editor to investigate the gathered performance data could reveal issues with custom scripts. This could be behind by a global variable, which by default is off for normal games.

Some simple scripts can get really slow when you have hundreds of ships if one puts loops inside loops and deep inside using expensive functions. What i generally try to do right now, is to count how many times i run expensive calls and voluntarily give up after 20 expensive calls for 1-2 seconds, before resuming the loops for the remaining who knows how many.

Sometimes i'm wondering if that is making any difference at all, and somewhere else is where the slowdown happens. With performance measurement i could fix at least my scrips :)

User avatar
jack775544
Posts: 1118
Joined: Tue, 13. Dec 11, 09:27
x4

Re: X4 - UI and scripting

Post by jack775544 » Fri, 4. Aug 17, 09:55

j.harshaw wrote:
jack775544 wrote:
Assailer wrote:Are you planning to keep the XML based script editing?
Please no, Please no, Please no, Please no, Please no, Please no, Please no, Please no...
What would you replace it with?

God, i hate putting up these disclaimers whenever i say anything. Not saying that we're planning to do one thing or the other. Please don't take this as an indication that we are going one way or the other.

I'm really just curious.
My day job is programming with Python so I am biased in that regard haha.

Honestly though I think something inspired by HTTP servers in most modern programming languages (Python + Flask, C# + ASP.NET or something else along those lines) since they very much have to deal with event driven programming and I think that they do it in a fairly elegant way.

Overall I found the XML scripts in XR to be rather verbose and at times a bit unreadable.
Out of curiosity, did you ever look into integrating a mainstream scripting language like Python as a scripting engine tool instead of rolling your own?
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
Moderator (DevNet)
Moderator (DevNet)
Posts: 8916
Joined: Fri, 21. May 04, 17:15
x4

Post by Ketraar » Fri, 4. Aug 17, 10:11

The problem most people that are rather trained in programming forget that many modders (like myself) have ZERO programming skills and still would like to keep modding without having to turn it into a full time job or require degree to do it. So I for one am glad they switched to xml verbose, but somewhat "casual" structure and allow non programmers to do stuff. :-)

MFG

Ketraar

Assailer
Posts: 445
Joined: Sun, 25. May 14, 17:45
x4

Re: X4 - UI and scripting

Post by Assailer » Fri, 4. Aug 17, 10:36

jack775544 wrote:
j.harshaw wrote:
jack775544 wrote: Overall I found the XML scripts in XR to be rather verbose and at times a bit unreadable.
Out of curiosity, did you ever look into integrating a mainstream scripting language like Python as a scripting engine tool instead of rolling your own?
XML allows nice patching features and i think it is important to keep, but adding python besides LUA would be great! :)
Last edited by Assailer on Fri, 4. Aug 17, 14:20, edited 1 time in total.

Moncada
Posts: 109
Joined: Fri, 4. May 12, 14:49
xrvr

Post by Moncada » Fri, 4. Aug 17, 10:39

I agree with Ketraar that the "casual" way it is now good.

User avatar
Killjaeden
Posts: 5148
Joined: Sun, 3. Sep 06, 18:19
x3tc

Post by Killjaeden » Sat, 5. Aug 17, 01:21

it's awefull to look at and difficult to read at a glance due to the excessive use of special characters and pointless repeating...

Another reason why (regardless of me liking/ not liking XR gameplay) i would never consider modding it... xml gives me eyecancer.
Different formatting to basically every other mainstream programming language.

X3 SE code was much more readable than this <comment/> <make_italic/> <text="mess"/></make_italic></comment>

The base principles of scripting one still has to learn, so i dont see how xml is somehow more user or modder friendly there. When you dont expose stuff like pointers and instancing and whatever most mainstream languages are extremely simple to read. (without resorting to spamming the same lines all over and over like xml does.

XML stays readable if you remove all tabs, new lines and spaces. Yes. But who codes or reads like that? Nobody in his right mind. So if you use proper readable formatting anyway, xml is forcing you to carry dead weights through your entire script.
Last edited by Killjaeden on Sat, 5. Aug 17, 01:37, edited 1 time in total.
Image
XTC Mod Team Veteran. My current work:
Image

Post Reply

Return to “X4: Foundations”