Page 1 of 3

Re: CAG, EST, CLS port/remake?

Posted: Fri, 25. Jan 19, 03:29
by Requiemfang
morbideth wrote:
Fri, 25. Jan 19, 00:00
Digging into this, I am unsure what to do about resupplying ammunition and drones. Can anyone who played X:Rebirth tell me how it was handled in that game vs X3?
I can't recall really, although if you had ships that had jumpdrives, they would automatically refuel themselves to get the cells required to refill. I can vaguely recall that there was a replenish setting for drones, missiles I am not sure about but I will say that back in X3 they had this setting for missiles, drones and jump fuel.

Re: CAG, EST, CLS port/remake?

Posted: Fri, 25. Jan 19, 08:52
by morbideth
Requiemfang wrote:
Fri, 25. Jan 19, 03:29
I can't recall really, although if you had ships that had jumpdrives, they would automatically refuel themselves to get the cells required to refill. I can vaguely recall that there was a replenish setting for drones, missiles I am not sure about
This was in X:Rebirth? I have X3 installed so I have a reference for that. Sounds like you are saying X:Rebirth was very similar to X3. If so I have to wonder why they changed something that worked fairly well to... well nothing atm.

Re: CAG, EST, CLS port/remake?

Posted: Fri, 25. Jan 19, 15:26
by Requiemfang
morbideth wrote:
Fri, 25. Jan 19, 08:52
Requiemfang wrote:
Fri, 25. Jan 19, 03:29
I can't recall really, although if you had ships that had jumpdrives, they would automatically refuel themselves to get the cells required to refill. I can vaguely recall that there was a replenish setting for drones, missiles I am not sure about
This was in X:Rebirth? I have X3 installed so I have a reference for that. Sounds like you are saying X:Rebirth was very similar to X3. If so I have to wonder why they changed something that worked fairly well to... well nothing atm.
Can't remember exactly I haven't played XR in a while :lol:

Re: CAG, EST, CLS port/remake?

Posted: Fri, 25. Jan 19, 20:36
by BugMeister
hey, nice one..!! 8)

Re: CAG, EST, CLS port/remake?

Posted: Mon, 4. Feb 19, 15:37
by morbideth
Time for another update. CLS MK1 phase one is complete. Not a lot of flashy stuff to show of, so no image this time. I added coloring and "separators", various punctuation ~.|[]{}()_-:\/ that you can use instead of spaces, if you want, when renaming. Most of the upgrades in this version are in terms of library scripts. I wrote a Lua script to make it easier to choose objects from the map, the current method works ok for sectors, but not so much for everything else. Some movement commands to handle delivering goods to TLs, large freighters in X4. That was a lot of work, and brings me to the poll I have added at the top. When moving goods between ships I did not use the vanilla method of dumping the cargo in space as I feel that is a horrible way to do things. Ships that are docked at the same place just transfer wares between themselves same as they can with a station. However, for ships that are not docked, and can't dock with each other, things are a little trickier. X3 had a transporter upgrade that you could buy to handle this, which allowed you to teleport goods between ships if they were within 10km of one another. It was expensive, ~800k iirc. As there is no such upgrade in X4, I am simply requiring teleportation to be researched before allowing you to transfer goods between ships in space. I'm not really happy with this though, as it seems a bit powerful, and research is way too easy. So, my question to you, what should I do about it? I could make a teleporter ware for X4, it wouldn't be hard, but it would only work with CLS. As you already require a software upgrade to be able to run CLS I could just bundle the cost of the transporter in with the cost of the CLS software, increasing its cost by ~800k. That would be pretty easy from my end. The third option is just to leave it like it is, requiring only the research.

I'm off to work on CLS MK2 now. I have decided to do both. It turns out that are fairly different with how they work. I still have not figured out what to do about resupplying ammo and such. Might wait till after the initial release. It depends on how close v2.0 is when I reach that point.

I spent a lot of time trying to add my own commands but could not figure out how to do so. If anyone knows how to do that, please let me know. I assumed it would be like adding a faction, but there is no file for commands. I mean things like command.move for use with <set_command>.

Re: CAG, EST, CLS port/remake?

Posted: Sat, 9. Feb 19, 22:01
by morbideth
Been working on the menu for CLS MK2, here are some preview images:
[ external image ]
[ external image ]
[ external image ]

Re: CAG, EST, CLS port/remake?

Posted: Mon, 11. Feb 19, 07:02
by morbideth
As a bit of a personal challenge, I'm going to try to update this with my progress every day. Let's see if I can keep it up for a week or two.

I added saving and loading to the waypoints, which took a long time due to a couple of hard to find bugs related to variables not being capitalized correctly. Saving allowed me to actually start testing the script. I did some initial testing with some of the simpler tasks. Fly to, stay, unload everything, and load everything works fine with stations, not tested with ships. Also tested load/buy and sell/unload a bit on player stations, founds some bugs and fixed them. Then found an issue with adding ship waypoint wares. Since there were so many wares for ships, everything the ship can carry, I decided to group them into categories shown in the image below. Then add some code to make sure the list stays centered with the top of the menu regardless of which groups you have open. I also moved the check for transporter technology to a MD script that only checks every 10 mins, and added some stuff the MD script to support 'Data storage' planned for phase 2. Finally, I started on the last part of the menu MK 2 needs for phase one, which is the automatic waypoint generation menu. All in all, a lot done.
[ external image ]

Re: CAG, EST, CLS port/remake?

Posted: Mon, 11. Feb 19, 09:33
by NoelSt
Fantastic work! Can't wait for this one :P

Re: CAG, EST, CLS port/remake?

Posted: Tue, 12. Feb 19, 04:45
by morbideth
Challenge Day 2: Added a check in paste task and edit waypoint code to ensure that the transfer amount doesn't exceed the maximum cargo space of the new waypoint destination. Continued work on the automatic waypoint generation menu, most of the options are finished now, just have to do the code to actually generate the waypoints. Found a bug which choosing sectors, just some code I had forgotten to finish. Did some preliminary work to allow you to choose build storages as a waypoint destination while I was looking at the choose object code, just adding a button for it so far. Made a new test save with a bunch of stations in different states of construction to test the former. Think that's everything.

Re: CAG, EST, CLS port/remake?

Posted: Wed, 13. Feb 19, 08:11
by morbideth
Challenge Day 3: Finished adding build storage waypoints, and did a bunch of testing. Continued work on automatic waypoint generation, which was frustrating. There isn't a function in Lua to search for sectors in a given range like there is in aiscripts, so I had to make one. The only way I could see to get the neighboring sectors was to look at the gates, but the getgates function doesn't return highway gates between sectors in the same cluster. After coming up with a workaround for that I found out that the jump distance to sectors in the same cluster is inconsistent. Sometimes it says they are the same, sometimes they are different, even with the same sectors. For instance, if you check the jump distance of Nopileos' Fortune II and VI from Pious Mist II, they are both 1 jump away, according to the FindJumpRoute function. But move 1 jump to Pious Mist XI and now one is 2 jumps and the other is 3 jumps away. It is incredibly frustrating.

Re: CAG, EST, CLS port/remake?

Posted: Thu, 14. Feb 19, 08:11
by morbideth
Challenge Day 4: Improved the renaming code, just found some better ways to do things that will make it easier to port to the other version. Redid all of the right click menus for CLS, added a CLS section, and reorganized everything to make it more user friendly. Added request signal option to the right click menu, and tested it with CLS mk 1. Found some bugs with the changes I make to the research check earlier, some things that did not work as I expected. And some other bugs with the md scripts that had to be cleared up.

Re: CAG, EST, CLS port/remake?

Posted: Fri, 15. Feb 19, 06:03
by morbideth
Challenge Day 5: Continued testing the request signal with mk 2, and ship to ship trading in general. Found lots of bugs and squished them. More bugs with the map menu. A major bug with the execute_custom_trade script function, it doesn't exchange credits when trading with wharfs, etc. Finished the auto waypoint generation code.

Re: CAG, EST, CLS port/remake?

Posted: Sat, 16. Feb 19, 09:16
by morbideth
Update Day 6: Added tooltips to the waypoint, generate waypoints, and right click menus. Added cancel button for "Quit working at station" option. Updated the MD files of CAG and EST to be consistent with CLS. Updated CAG renaming to include the features introduced in CLS. Added renaming to EST. Removed CAG and CLS from default orders menu.

Re: CAG, EST, CLS port/remake?

Posted: Sun, 17. Feb 19, 05:48
by morbideth
Update Day 7: Began integrating the libraries into the previous two mods: CAG right click menu: reorganized in the same manner as CLS's menu, added tooltips, added section; EST right click menu, ditto, added start option for right clicking on a sector. Integrated choose object library into CAG and EST menus. Added quit working at station option for EST. Added warning for illegal wares in EST. Added trade with illegal wares option to EST. Added group wares by type option to EST.

Re: CAG, EST, CLS port/remake?

Posted: Mon, 18. Feb 19, 12:10
by morbideth
Update Day 8: Updated EST and CAG to use move libraries, began updating CAG and EST's trade code. Ran into some elusive bugs which ate most of my time and I still haven't found the cause.

Re: CAG, EST, CLS port/remake?

Posted: Tue, 19. Feb 19, 11:29
by morbideth
Update Day 9: Finally found the bug from yesterday, I think. Which completes phase one! *golf clap*.

Phase 2 plan:
  • Add trading and logistics skills. Difficulty: Hard?
  • Add "special equipment" allowing you to rearm and resupply. Difficulty: Medium-Hard depending on some things.
  • Dependant upon the above, add support for large freighters. Difficulty: Easy-Hard, depending...
  • Add messages, logs, and relevant settings. Difficulty: Easy, but tedious and time-consuming
  • Add exceptions/blacklisting Difficulty: Moderate
  • Add "Data Storage" allowing you to save settings and load them on another ship. Difficulty: Easy, depending on data conversion
  • Add CLS software, and possibly Trading MK2 software. Difficulty: Easy iff the order requirement check works right, and can be checked in Lua.
The hardest and the most important thing is adding the skills. Truthfully, it doesn't need to be hard; if I do it the same way the original script does it wouldn't be difficult at all. However, that would mean a system separate from the existing skill system, and I think that would be confusing, thus I consider it a last resort. Today I did some initial testing to see what is possible, if all else fails, the last resort my prove the be the only resort. The first attempt at adding skills failed, I didn't have high hopes for that method, full integration, but it was worth a shot. The second method is still being investigated, showing some promise.

In an effort to balance things, I've also looked into how experience is awarded. The original script adds levels based on flight time, but that is with jump drives, so using the same method would be badly skewed if used in X4. In order to keep it consistent, I checked how the game rewards traders (and miners). I set up a loop that simulates giving the pilot experience equivalent to a trader completing a trade with a full cargo hold. The loop ran every 1ms. 2-3 hours later the pilot had only reached level 12, starting from 0... That's ~10 million trades... On second thought, I don't think I'm going to use that method.

The current plan is to release an alpha version at the end of phase two. I won't know for sure until I actually complete phase two and see how it plays, but that is what my goal is atm.

Re: CAG, EST, CLS port/remake?

Posted: Tue, 19. Feb 19, 12:57
by XTC0R
I don't want to interrupt your daily reports.
Just wanted to give you a KUDOS in the name of all the X4 players which are following your thread and progress.

Re: CAG, EST, CLS port/remake?

Posted: Wed, 20. Feb 19, 09:12
by morbideth
XTC0R wrote:
Tue, 19. Feb 19, 12:57
I don't want to interrupt your daily reports.
Just wanted to give you a KUDOS in the name of all the X4 players which are following your thread and progress.
Thanks for the moral support.

Update Day 10: The 2nd method for adding skills proved to be successful, and I have managed to add 'trading' and 'logistics' skills as you can see below. The skills have been integrated into CAG: added promote pilot option; added pay pilot from homebase account option; added/formated flight time, employment time, and total pilot salary; added libraries for calculating payment, calculating experience, then promoting pilots, initializing custom skills, displaying skill levels. Tested CAG with the skills: Found a bug in renaming code when pilot skill is 0, and a rounding error in renaming code. Adding the skills to EST and CLS should follow without much difficulty. Then I'll have to decide which part of phase two to work on next.

About the skills: I did end up going with time-based level for the moment. It takes about a couple of game days to go from level 0 to level 15, rough estimate as I haven't sat down and calculated it. I included the vanilla exp rewards when adding exp for the custom skills, so you will still gain piloting, moral, and management skills while running EST, CAG, or CLS. Right now the new skills all start at 0. The original script allowed you to get a pilot with an initial skill level of 1-3 if you started while docked at certain stations. However, X4 does that annoying 'undock before running a new order' thing. I don't know if there is a way around that; too much effort to fool with right now anyway.

[ external image ]

Re: CAG, EST, CLS port/remake?

Posted: Thu, 21. Feb 19, 11:28
by morbideth
Update Day 11: Added skills to EST and CLS. Updated the trader settings menu for both to add the features I added to CAG yesterday. Adjusted the experience calculation for the new skills to be less linear. It now takes slightly less time to get the first levels, but longer for the latter ones. All told, it takes 37.4 hours (game time) to reach level 15 from 0, but only ~20 mins for level 1 from 0. I think that is a good balance, needs more testing though. Adjusted the level based max jump range for EST to start at 1, at level 0, instead of 0, as it was too hard to level up since all the vanilla traders focus on in sector trades.

I've decided the next thing I'm going to work on is going to be messaging/logging, in the hopes that it will make debugging slightly easier. Towards that end, I've started planning out how I am going to do it. I'll go into details in another update.

Re: CAG, EST, CLS port/remake?

Posted: Fri, 22. Feb 19, 15:36
by morbideth
Update Day 12: Added menus for message settings. Added a bunch of text for messages to the language files, and started working on the aiscripts side.

X4 has 4 ways to deliver messages to the player, the logbook, the ticker, subtitles, and coms. Unfortunately, everything but the coms is hidden by the map menu; something that is frequently kept open. Coms forces the map menu to close, but it also breaks seta and is rather intrusive. There isn't really a good way to deliver important info to the player and make sure they see it without being annoying. X3 has a little mail icon that would flash when you had an unread message. This makes it easy to send messages to the player in such a way they could read them at their leisure. The logbook should fulfill that function, but right now, it is set up quite poorly.

The logbook, in general, is a spammy mess that swallows any important messages. Also, it is not convenient to access. If you have more than a handful of ships the logbook quickly fills with minutia. What it needs is some way to filter things, the categories don't do the job. Something like filtering by the sender, group messages by commander, and most importantly a way to TURN MESSAGES OFF. Do I really need to know every single time a ship gets scanned by the police? Maybe if they had something illegal, but not every single time. That quickly fills the logbook with all kinds of meaningless spam. And then there is the spam from miners. Why would I want to know every time a miner delivered cargo to my factory? I only have half a dozen miners in my test save and it is still way too annoying.

But, I'm not planning on rewriting the logbook, I'm just venting. As for how I have set up messages, I've divided things into 3 categories: Notifications (i.e. pilot promoted), Trade messages, and Critical message (things that stop the script from running, i.e. no money). Each setting has options for the four ways to message the player, as appropriate for the category, i.e. only critical messages have an option to com the player, as well as an option to play a sound on receiving the message, in the hopes that, that will allow people to find the messages they want to look at.

One of the difficulties I've encountered is trying to figure out the subtitles, which use the <speak> command. For spoken text, you cannot use the normal way of inserting information into a string, no 'Blah blah %s blah blah'.[$varible]. The <speak> command only accepts the line and pageID as separate arguments, not a string that can be formatted. There is the option to add <name> and <description>, but the information about those two says, "Requires that a name has been defined in the correct format." without any hint of what the 'correct format' is. This is making it a bit difficult to display the messages as I want. I don't even want it to try to speak the text, just display it. I wish there was a dedicated subtitle command, but there doesn't seem to be.