A UI modding adventure

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

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

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!!

User avatar
BigBANGtheory
Posts: 3168
Joined: Sun, 23. Oct 05, 12:13
x4

Post by BigBANGtheory » Tue, 29. Apr 14, 17:18

Mad_Joker wrote: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).
That's the holy grail a proper Graphical User Interface, people like to work with GUIs and context sensitive menus. That's how you get complex commands from your head to the AI objects quickly and efficiently. If it takes you more than 5-10 seconds you're back into X3 menu hell again.

If anyone can make sense of the zone maps decompiled that there is where a convergence of your efforts will yield the best results imho.

Its good work Mad Joker, you are definitely leading the way on this.

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

Post by Mad_Joker » Tue, 29. Apr 14, 20:09

BigBANGtheory wrote:
Mad_Joker wrote: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).
That's the holy grail a proper Graphical User Interface, people like to work with GUIs and context sensitive menus. That's how you get complex commands from your head to the AI objects quickly and efficiently. If it takes you more than 5-10 seconds you're back into X3 menu hell again.

If anyone can make sense of the zone maps decompiled that there is where a convergence of your efforts will yield the best results imho.

Its good work Mad Joker, you are definitely leading the way on this.
Actually, by now I have a much more clear picture and sadly have to say I am rather disappointed in what the UI can do and what it can't (maybe I am doing it just wrong, who knows?).

One example of something which I believe impossible is drop-downs or combo boxes. Also, the map you mentioned is not created in LUA, but somewhere in the C++ game code I guess. In the UI code, the only things I can do is to add the map to my menus and then display an object (e.g. sector, ship, station) on it. So pretty much only things the existing map can already do (which by the way is a 1.5k lines mess; I think creating multiple specific map screens instead of one monolithic structure would have been better).

All that being said, I think it's still possible to create UI's which allow you to do things quickly. For example, my UFO UIs (which I hope to release next weekend at the latest) allow me to create a new fleet, add some ships and then tell the new fleet to go to a target zone in offensive stance in about 20 seconds, which I think is already much much better than we had so far. But I am pretty sure, that once other more talented people start designing UIs, there are still better things to achieve.

Ayporos
Posts: 26
Joined: Sat, 28. Dec 13, 07:42

Post by Ayporos » Tue, 29. Apr 14, 20:29

Mad_Joker wrote: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?
Having fleets commanded to escort other fleets is a very nice feature.
The biggest thing to improve here, imo, would be to maybe set specific ship roles (within a fleet) reflected by maybe an icon or text indicating which role/command it is currently executing.

So after each fleet/ship name you could have another box with text indicating its current command/role. This could be either pure text ("escort Fleet/Ship A"; "Patrol system.sector"; "Defend Station.X") with clickable links to details page of ship/sector.station.. or maybe you could insert general thumbnails indicating role which can be hovered over for exact information (like, hover over the 'patrol' icon to show you a alt-text telling you where it is patrolling) and you could then click the icon to alter/issue a command/role.

Basically I think it's important that you can, at a glance, see what each ship/fleet is doing and possibly also -where- the ship/fleet is located (for a ship this could be where its commander is, for a ship obviously where the ship is)... as an extra bonus it would be nice to -if this is possible- include (for combat ships) if it is currently engaged in combat and with which/what ship.

For trading ships said 'info' could reflect which wares it is buying/selling and where.. but that'd rely on proper integration with a trading system extension.

A possible point of interest might also be to include stations in this list, under a main station 'fleet' perhaps? expandable to show each owned station and further expandable to show ships assigned to said stations.

jeroll3d
Posts: 665
Joined: Thu, 26. Jun 08, 02:28
x3ap

Post by jeroll3d » Tue, 29. Apr 14, 22:40

Owww...nice wprk Mad_joker

:)
Entusiasta da série X3! The best game.

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

Post by Mad_Joker » Wed, 30. Apr 14, 11:09

Ayporos wrote:Having fleets commanded to escort other fleets is a very nice feature.
The biggest thing to improve here, imo, would be to maybe set specific ship roles (within a fleet) reflected by maybe an icon or text indicating which role/command it is currently executing.

So after each fleet/ship name you could have another box with text indicating its current command/role. This could be either pure text ("escort Fleet/Ship A"; "Patrol system.sector"; "Defend Station.X") with clickable links to details page of ship/sector.station.. or maybe you could insert general thumbnails indicating role which can be hovered over for exact information (like, hover over the 'patrol' icon to show you a alt-text telling you where it is patrolling) and you could then click the icon to alter/issue a command/role.

Basically I think it's important that you can, at a glance, see what each ship/fleet is doing and possibly also -where- the ship/fleet is located (for a ship this could be where its commander is, for a ship obviously where the ship is)... as an extra bonus it would be nice to -if this is possible- include (for combat ships) if it is currently engaged in combat and with which/what ship.

For trading ships said 'info' could reflect which wares it is buying/selling and where.. but that'd rely on proper integration with a trading system extension.

A possible point of interest might also be to include stations in this list, under a main station 'fleet' perhaps? expandable to show each owned station and further expandable to show ships assigned to said stations.
A lot of very good suggestions. Let me address the points one by one.

1) About specific roles per ship in fleet: My current approach is very similar to what you are describing, but more on the fleet level, instead of ship level. Someone mentioned that my fleets look more like wings, and that might indeed be true. For now, each fleet has one role or command (currently only "Move to Zone" and "Escort Ship" are available), and all ships in the fleet will follow that order. In the future, one might introduce an additional level, and make fleets consist of wings, which consist of single ships. Then you would give the fleet a high level order (e.g. "Patrol Zone X") and each wing a more specific order (e.g. "Engage enemies", "Support", "Refuel" etc.).

Tooltips like you are imagining are currently not possible, or rather not possible with reasonable effort (I think I know a way, but I would have to bend the code pretty darn much for it).

2) See what everybody is doing at a glance:

Right now in the UI, the current command is shown after the fleet name:

Code: Select all

Fleet 1                        Command: Move to Zone Steady Mole
And for ships, the current hull, shields, and the location in the form "Cluster / Sector / Zone" is shown. For NPCs it shows the current stance. I am at work right now, so I can't post a screenshot, but I'll try to remember to post a new screenshot this evening.

What you say about being in combat sounds interesting. I'm thinking about making the name of the fleet flash in red if the fleet is engaged in combat (this should hopefully not be too hard to achieve). Not sure if I can make it on ship level though.

UFO already has (and will keep) real-time status reports, where information about which fleet is engaging how many enemies and where is shown on the event monitor.

3) Trading ships:

Currently, there is no special handling for trading ships. It's rather the opposite, since trading ships have to be in the player squad and have their own special script, which makes it impossible for them to interact with UFO since it starts its own scripts on each fleet ship. This is something that could be added in the future, where you can flag a ship as a trader, and still add it to the fleet without any scripts being started, as to show what it's buying/selling.

Right now, I would recommend interaction with traders only by making fleets escort them.

4) Stations:

I like the idea of having a "station fleet", which would be a normal fleet, except that it's commander would be a station, not a ship. Alternatively, there could simply be a fleet command called "Protect Station", but that would not take advantage of the defence officer that is on the station.



Like I said, lots of good ideas, keep 'em coming.

Post Reply

Return to “X Rebirth - Scripts and Modding”