A UI modding adventure

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Mad_Joker
Posts: 274
Joined: Sun, 14. May 06, 11:21
x3

Post by Mad_Joker » Wed, 23. Apr 14, 10:49

Roger L.S. Griffiths wrote:Nice work, but why basically re-implement Wings from X3 as opposed to using the existing command structure in X-Rebirth?
Which would be? The only command structure I'm aware of is "Add to player squad", which is highly lacking IMO.

I'm seriously asking though, since I haven't really spent that much time actually playing the game. If you have any suggestions on how the fleet management should work, please let me know.

User avatar
Sam L.R. Griffiths
Posts: 10522
Joined: Fri, 12. Mar 04, 19:47
x4

Post by Sam L.R. Griffiths » Wed, 23. Apr 14, 11:17

You can assign ships to "commanders" of ships/stations and build a command hierarchy from that. Essentially having squads with-in squads.

Commanders are nominally Captains (for ships), Managers (for stations), and Defence Officers (for both). I think Engineers are also considered commanders but never seen a point to assigning any ships to them personally (unless it can be used to consolidate the usage of construction drones. Architects on SCODAs are also considered commanders for the purpose of trading resources for construction.

The only problems I have noted really in Vanilla are:-
  1. You can only assign (using the vanilla UI) ships to commanders on some of the other ships (e.g. not a Taranis to another Taranis but you can assign say a Balor to a Taranis - the Vanilla rules and reasons for them wrt inter-ship command structure assignment are not 100% clear).
  2. The AI may not behave quite as expected (if you were to assign a trade ship to a captain of another trade ship you would kind of expect them to work as a team where trading is concerned).
Lenna (aka [SRK] The_Rabbit)

"Understanding is a three edged sword... your side, their side... and the Truth!" - J.J. Sheriden, Babylon 5 S4E6 T28:55

"May god stand between you and harm in all the dark places you must walk." - Ancient Egyption Proverb

"When eating an elephant take one bite at a time" - Creighton Abrams

Mad_Joker
Posts: 274
Joined: Sun, 14. May 06, 11:21
x3

Post by Mad_Joker » Wed, 23. Apr 14, 11:40

Well, what you are describing sounds pretty much exactly like what UFO is doing.

In UFO (so far) you would assign a ship to another ship (or rather its pilot/captain) which becomes it's commander, and which in turn can be assigned to another commander etc building a tree-like command hierarchy (just like in the real military).

I'm planning to keep this format, just the way that the hierarchies are formed will change, because the tree form is not very well representable with what the UI allows (at least I couldn't come up with a nice way).

This is how I imagine it to work: You create a fleet and select a ship (which becomes the commander). Then you can assign other ships to this fleet (which basically makes them escort their commander). You can then give this fleet orders, and one such order would be to "Escort Ship". As the target of that command, you could then choose a ship/the commander of another fleet, thereby creating the command hierarchy.

Do you agree with this approach? Any suggestions to make it better?

User avatar
Sam L.R. Griffiths
Posts: 10522
Joined: Fri, 12. Mar 04, 19:47
x4

Post by Sam L.R. Griffiths » Wed, 23. Apr 14, 12:13

Mad_Joker wrote:I'm planning to keep this format, just the way that the hierarchies are formed will change, because the tree form is not very well representable with what the UI allows (at least I couldn't come up with a nice way).
The Vanilla tree structure approach seems to work pretty well to me - it looks ok in both the map and "my ships/stations" views.
Mad_Joker wrote:This is how I imagine it to work: You create a fleet and select a ship (which becomes the commander). Then you can assign other ships to this fleet (which basically makes them escort their commander). You can then give this fleet orders, and one such order would be to "Escort Ship". As the target of that command, you could then choose a ship/the commander of another fleet, thereby creating the command hierarchy.

Do you agree with this approach? Any suggestions to make it better?
*shrug* If it works, it does not really matter in the grand scheme of things. I thought the Vanilla "tree" representation works fine (could do with some refinement perhaps though).
Lenna (aka [SRK] The_Rabbit)

"Understanding is a three edged sword... your side, their side... and the Truth!" - J.J. Sheriden, Babylon 5 S4E6 T28:55

"May god stand between you and harm in all the dark places you must walk." - Ancient Egyption Proverb

"When eating an elephant take one bite at a time" - Creighton Abrams

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Wed, 23. Apr 14, 12:21

Mad_Joker wrote: Below you can find a WIP update screenshot.

http://static-1.nexusmods.com/15/mods/1 ... 236655.png
Roger L.S. Griffiths wrote:Nice work, but why basically re-implement Wings from X3 as opposed to using the existing command structure in X-Rebirth?
Since his examples demonstrates a way to achieve something that the existing command structure is incapable of (adding multiple Taranis hulls to the same unit), this is an rather odd question.
Roger L.S. Griffiths wrote: The Vanilla tree structure approach seems to work pretty well to me - it looks ok in both the map and "my ships/stations" views.
...
I thought the Vanilla "tree" representation works fine (could do with some refinement perhaps though).
Your earlier posts were about command structure. Replying above in terms of aesthetics and/or integration with existing windows doesn't address a reply to your earlier point about structure.

User avatar
Sam L.R. Griffiths
Posts: 10522
Joined: Fri, 12. Mar 04, 19:47
x4

Post by Sam L.R. Griffiths » Wed, 23. Apr 14, 12:37

@sparky : the existing command structure *should* be capable of the same basic hierarchy (you can assign some ships of the same type to others of the same type - for example Rahanas vessels can be assigned to each other). Working out what the Vanilla restrictions are and why they are there is probably the key to an overall solution that adapts the Vanilla mechanism to achieve the same goal.
Lenna (aka [SRK] The_Rabbit)

"Understanding is a three edged sword... your side, their side... and the Truth!" - J.J. Sheriden, Babylon 5 S4E6 T28:55

"May god stand between you and harm in all the dark places you must walk." - Ancient Egyption Proverb

"When eating an elephant take one bite at a time" - Creighton Abrams

User avatar
YorrickVander
Posts: 2705
Joined: Tue, 29. Oct 13, 21:59
x4

Post by YorrickVander » Wed, 23. Apr 14, 12:46

Roger, respectfully, you should actually try the UFO mod as it currently stands before commenting further mate :) Your posts make it apparent you think this is something new and untested in the manner of making fleets/wings as opposed to some ground breaking work in removing the slow clumsy menu navigation required to access the functions of a truly inspired and much used mod.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Wed, 23. Apr 14, 12:57

Roger L.S. Griffiths wrote:the existing command structure *should* be capable of the same basic hierarchy (you can assign some ships of the same type to others of the same type - for example Rahanas vessels can be assigned to each other). Working out what the Vanilla restrictions are and why they are there is probably the key to an overall solution that adapts the Vanilla mechanism to achieve the same goal.
An inability to do something today is a reason in favour of adding the functionality you questioned that was offered by that screenshot. What we may learn or gain through patches in the future are intangibles. I for one am pleased that people like Mad have been adding new functionality such as this over the past 6 months ahead of Egosoft developments.

Such steps in the right direction are in line with the elephant quote in your bio. Did you simply overlooked that fact the screenshot showed new functionality that you noted is missing from vanilla command structure?

User avatar
Sam L.R. Griffiths
Posts: 10522
Joined: Fri, 12. Mar 04, 19:47
x4

Post by Sam L.R. Griffiths » Wed, 23. Apr 14, 13:49

YorrickVander wrote:Roger, respectfully, you should actually try the UFO mod as it currently stands before commenting further mate :) Your posts make it apparent you think this is something new and untested in the manner of making fleets/wings as opposed to some ground breaking work in removing the slow clumsy menu navigation required to access the functions of a truly inspired and much used mod.
Actually I do (and did) give credit where credit is due, the UI adaptations are ok and shows that some nice UI changes can be done (I would not go so far as to call the UI design inspired - it is basically the same look and feel as X3 wings - but it is good technical work).

When I get the time I will have a look at UFO but I know there have been reports of it actually breaking some of the base AI which put me off (possibly resolved now - the reports were a while ago). Besides which, I like to participate in the public beta testing so my main games have been kept vanilla (except for one brief look at some cosmetic mods - which did not last).

In addition - as a rule, I like to find the limits of the Vanilla game before I make a personal judgement about what I think needs to be changed/modded (and more importantly how I feel it should be changed - I do not subscribe to the school of thought along the lines of "it was good enough for the older X games so it is good enough for X-Rebirth") - I have not quite completed that assessment yet as I have been doing other things and not had as much time to play X-Rebirth as much as I would have really liked (insufficient additional play time to mess around with mods and modding properly).

Regardless of what UFO does or does not do, it does not change the basis of my original query - which never really got answered. But the OP did explain their intent well enough, which is good enough as far as I am concerned.
Lenna (aka [SRK] The_Rabbit)

"Understanding is a three edged sword... your side, their side... and the Truth!" - J.J. Sheriden, Babylon 5 S4E6 T28:55

"May god stand between you and harm in all the dark places you must walk." - Ancient Egyption Proverb

"When eating an elephant take one bite at a time" - Creighton Abrams

Mad_Joker
Posts: 274
Joined: Sun, 14. May 06, 11:21
x3

Post by Mad_Joker » Wed, 23. Apr 14, 14:23

Indeed, what I am creating here (and did with UFO) is far from perfect.

However, right now I am doing this UI work mostly as an exercise for myself to get familiar with the UI modding and so that I can later share my experiences. Once everybody knows how to mod the UI, maybe somebody else will come up with better solutions to the problems I tried to tackle.

Also, Roger's posts have convinced me, that I need to get back into the game and actually explore all the possibilities the existing UIs already offer, before I continue with my UI work for UFO. I have pretty much started this without much thought on what was already there or how it would interact with the core game mechanics, but rather made it as a standalone component. Maybe that approach needs re-thinking.

Also, like I said I am always open to any suggestions you have to improve my mods.

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Wed, 23. Apr 14, 14:45

From comparing the video at 02:05 and the WIP screenshot, I have the impression that some control over columns is possible. Nice one.

Perhaps a column could relate to the special position of the ship in the fleet. Either for information or a selectable option. For example, I spotted a K with 30 Xenon Fighters arranged in 6 rows of 5 in a ring around the top, bottom and sides of the ship. It looked lovely although the fighters were the all same. With regards our fleets, we might prefer specific hull types at different positions. I’ve not tried UFO yet so sorry if I am suggesting something that has been discussed already.

Mad_Joker
Posts: 274
Joined: Sun, 14. May 06, 11:21
x3

Post by Mad_Joker » Wed, 23. Apr 14, 15:05

Sparky Sparkycorp wrote:From comparing the video at 02:05 and the WIP screenshot, I have the impression that some control over columns is possible. Nice one.

Perhaps a column could relate to the special position of the ship in the fleet. Either for information or a selectable option. For example, I spotted a K with 30 Xenon Fighters arranged in 6 rows of 5 in a ring around the top, bottom and sides of the ship. It looked lovely although the fighters were the all same. With regards our fleets, we might prefer specific hull types at different positions. I’ve not tried UFO yet so sorry if I am suggesting something that has been discussed already.
Well, the game has a concept of formations already (which I assume the xenon ships you saw were using). UFO doesn't allow to choose formations yet (since I found the radial menu to cumbersome for the amount of possible formations (20 or so)). But with the new UI modding capabilities it should be possible to have a nice formation selector (though most likely just through a list, though it would be awesome to have a graphical drag & drop formation designer).

BerserkKnight's new MCE allows you to choose the formation afaik if you need a mod that can already do that.

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Wed, 23. Apr 14, 15:12

OK, thanks for the reply and the formation selector idea sound's nice.

TheDeliveryMan
Posts: 705
Joined: Sat, 10. Dec 11, 03:10
x4

Post by TheDeliveryMan » Wed, 23. Apr 14, 23:57

Mad_Joker wrote:Also, I am definitely planning to release a tutorial on UI modding so that others can start with it as well, but I can't promise when this will be, since I want to get my own mod's UIs done first.
Looking forward to it! I'm working on something similar to external commodity logistics from the X3 bonus pack. There's not much point in releasing this without a proper UI to set up freighter routes.

User avatar
wysiwyg
Posts: 585
Joined: Thu, 26. Feb 04, 00:08
x4

Post by wysiwyg » Thu, 24. Apr 14, 00:22

The main problems I have with the current vanilla fleet setup mechanics is that one has to comm every captain you want to assign to a superior and go through the whole "convo with Yisha and the two captains" nonsense to achieve one addition to one's squad - hmmmmm! (unless I've missed something and this can all be bypassed!)

@mad_joker - what tools are you using to recompile the lua code? I've successfully decompiled the .xpl files with Night Nords's excellent python lua tool. I was just interested in what you recommend as a compiler. I'm fairly new to lua so still getting my head around it. Looking forward to seeing some of your work under the hood and in practice when it's ready.

Mad_Joker
Posts: 274
Joined: Sun, 14. May 06, 11:21
x3

Post by Mad_Joker » Thu, 24. Apr 14, 00:34

wysiwyg wrote:@mad_joker - what tools are you using to recompile the lua code? I've successfully decompiled the .xpl files with Night Nords's excellent python lua tool. I was just interested in what you recommend as a compiler. I'm fairly new to lua so still getting my head around it. Looking forward to seeing some of your work under the hood and in practice when it's ready.
I am using LuaJIT for compiling. The official site doesn't have a pre-compiled version though, so you'll have to compile one yourself (the site has instructions how to do this).

In my modding guide I plan to add a suite of tools as well, which will contain all of the compiler stuff as well as an exe to compile and pack your mod (there are some things you need to be careful of with that).

About Lua: I also never had used Lua before I started with this, but if you did any JavaScript, Lua is rather easy to get into. The only thing I noticed you should be aware of is that there is a colon and a dot operator in Lua, which both compile to the same byte code, which means during decompilation it will always be decompiled to the dot operator. The colon is practically identical to using dot and passing the calling object as the first argument. Below is an example:

Code: Select all

object.method(object, ...) == object:method(...)
This means you will for example often see code like

Code: Select all

setup.addSimpleRow(setup, ...)
in the original code, which should rather be read as

Code: Select all

setup:addSimpleRow(...)
which makes the code more readable imo.

Hafe vun modding!

User avatar
wysiwyg
Posts: 585
Joined: Thu, 26. Feb 04, 00:08
x4

Post by wysiwyg » Thu, 24. Apr 14, 00:38

Many thanks for the fast reply and tips - much appreciated.
Cheers
Wysi :)

Deleted User

Post by Deleted User » Sun, 27. Apr 14, 15:15

you're awesome man :)

Mad_Joker
Posts: 274
Joined: Sun, 14. May 06, 11:21
x3

Post by Mad_Joker » Sun, 27. Apr 14, 18:36

I am progressing well with the UI for UFO and the framework. Only thing missing is basic fleet commands. I am planning to implement two commands:

1) Escort ship
2) Move to Zone.

Command 2 will also take of the function of the old "Attack Zone" command, since what you can do is just put your fleet's stances to "Aggressive" and then tell them to move to a zone.

Yesterday and today I re-wrote pretty much all of UFO's scripts. It's funny how your perspective changes when you come back to your code after a couple of months. I have radically simplified the code, sometimes getting rid of 50% of the lines.

Oh, and for those of you who are interested: I believe I have just fixed the 'sliding ship' problem UFO was suffering from for a long time now.

So, stay tuned.

Calca
Posts: 127
Joined: Wed, 12. Mar 03, 23:10
x4

Post by Calca » Mon, 28. Apr 14, 14:06

:thumb_up: :thumb_up: :thumb_up: :thumb_up: :thumb_up:

great news!!

Post Reply

Return to “X Rebirth - Scripts and Modding”