[MOD] Professional Crew V. 1.20

The place to discuss scripting and game modifications for X4: Foundations.

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

Neloth23
Posts: 71
Joined: Thu, 13. Jul 17, 18:31
x4

[MOD] Professional Crew V. 1.20

Post by Neloth23 »

Professional Crew v1.20 for X4 Foundations 3.0 and Split Vendetta DLC

Important!

As of version 1.20, I will not longer develop this mod. The reason is that a much more interesting mod has recently been published. I strongly recommend that you check Mackan's Faster Crew Leveling!


Download link: https://www.nexusmods.com/x4foundations ... escription

1. Description

Do you find it illogical to give command of a fully armed destroyer to a toddler? Do you wish your newly recruited traders were able to understand the very concept of trading on their own? Well, look no further!

This mod enables recruiting of professional crew on any ship you buy. Service crew and marines will be more costly (between 10 000 and 30 000 credits, depending on your standing with the related faction) to compensate a little (nothing I can do for captains as they don't seem to have any recruitment fee).

I've also boosted NPC stats, to hopefully reduce AI issues, as low skill pilots get a worse AI according to X4 scripts.

The mod comes in two flavours:
  • The "Mild" version with crew ranging from 2 1/3 to 4 stars in their related skill and morale;
  • The "Employee of the jazura" version with crew ranging from 3 to 4 2/3 stars in their related skill and morale.
Can be used with an existing save, but may require time before the boosted crew are available.

Split Vendetta is supported.

2. Purpose of the mod

Let's face it, this mod is a crude cheat in order to bypass this tedious and IMO illogical game mechanic. I hope Egosoft will turn the HR aspect of the game into something engaging, and that my mod will no longer be necessary in the future.

I will think about ways to make this mod less cheaty and more interesting, but as i am far from being a great coder, I don't want to make promises I can't keep.

3. Installation

  • CREATE A BACKUP OF YOUR SAVES (Just in case...)
  • Extract the files from the archive
  • Copy the "professional_crew" folder in the "extensions" repertory located in the main game directory (where the game executable is). For example : C:\Program Files (x86)\GOG Galaxy\Games\X4 Foundations\extensions or C:\Games\Steam\steamapps\common\X4 Foundations\extensions. You'll have to create the extensions folder if you do not have one already.
  • The mod should now appear in the extensions menu of your game.
4. Uninstallation

Delete the "professional_crew" folder from your "extensions" repertory.
Last edited by Neloth23 on Tue, 7. Apr 20, 21:03, edited 2 times in total.
Neloth23
Posts: 71
Joined: Thu, 13. Jul 17, 18:31
x4

Re: [MOD] Professional Crew

Post by Neloth23 »

Version History

1.00
  • Initial release

1.10
  • Fixed case of Split service crew not getting the right number of stars.

1.20
  • Lowered the level of service crew and marines to make them less cheaty.
Last edited by Neloth23 on Tue, 7. Apr 20, 21:04, edited 2 times in total.
Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: [MOD] Professional Crew

Post by Max Bain »

Sounds good. Especially the improved AI thing :).

Still I think that X4 needs a more fun solution to this problem. Crew management could become a bigger aspect if it would make some fun and would not be just frustrating and tedious.
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link
Neloth23
Posts: 71
Joined: Thu, 13. Jul 17, 18:31
x4

Re: [MOD] Professional Crew

Post by Neloth23 »

Max Bain wrote: Thu, 2. Apr 20, 22:44 Sounds good. Especially the improved AI thing :).
The AI improvement might be subtle for NPCs, as they seemed to have decent stats. I just hope I'll stop seeing dervish destroyers at least...
Max Bain wrote: Thu, 2. Apr 20, 22:44 Still I think that X4 needs a more fun solution to this problem. Crew management could become a bigger aspect if it would make some fun and would not be just frustrating and tedious.
I couldn't agree more. I really hope Egosoft will rework their system to make it more fun. There's a lot of potential there.
User avatar
Rimak
Posts: 13
Joined: Fri, 30. Nov 18, 20:49
x4

Re: [MOD] Professional Crew

Post by Rimak »

Thank you for this. Do you think of expanding this mod into things like paying extra to get a certain level when buying a ship?
Neloth23
Posts: 71
Joined: Thu, 13. Jul 17, 18:31
x4

Re: [MOD] Professional Crew

Post by Neloth23 »

Rimak wrote: Fri, 3. Apr 20, 17:09 Thank you for this. Do you think of expanding this mod into things like paying extra to get a certain level when buying a ship?
I'd love to do that. I'm not sure I'll be able to code this, so I won't promise anything, but I'll definitely give it a try.
Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: [MOD] Professional Crew

Post by Max Bain »

Something I would love to see is that the skill is depending on the ship size and maybe class. For example S ships should not have high skilled pilots and crew but when you pay several millions into an L or XL ship, the pilot should at least have 3 maybe 4 stars right from the start.
Maybe
S - average 2 stars
M - average 3 stars
L - average 3.5 stars
and XL average 4 stars

Crew could be always a bit lower (maybe 1 star lower than the captain)
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link
Neloth23
Posts: 71
Joined: Thu, 13. Jul 17, 18:31
x4

Re: [MOD] Professional Crew

Post by Neloth23 »

Max Bain wrote: Fri, 3. Apr 20, 17:50 Something I would love to see is that the skill is depending on the ship size and maybe class. For example S ships should not have high skilled pilots and crew but when you pay several millions into an L or XL ship, the pilot should at least have 3 maybe 4 stars right from the start.
Maybe
S - average 2 stars
M - average 3 stars
L - average 3.5 stars
and XL average 4 stars

Crew could be always a bit lower (maybe 1 star lower than the captain)
Yeah, that would make sense. And ideally we could also hire elite pilots for S ships, but they would be very expensive.

Technically, I would have to create specific pilots for each size/class. That, I think I can do. The tricky part is that I need to access the script that determines how pilots/crew are assigned to a ship during construction. I haven't found that one yet, so I'll keep digging through the game files. Again no promises, as I've never attempted scripting something like this, but I'll give it my best shot.
DeadAirRT
Posts: 1124
Joined: Fri, 25. Jan 19, 03:26
x4

Re: [MOD] Professional Crew

Post by DeadAirRT »

Ships.xml people.xml and characters.xml

When i get around to testing my implementation, I'll let you know if it works or how to do it
Neloth23
Posts: 71
Joined: Thu, 13. Jul 17, 18:31
x4

Re: [MOD] Professional Crew

Post by Neloth23 »

DeadAirRT wrote: Sat, 4. Apr 20, 02:05 Ships.xml people.xml and characters.xml

When i get around to testing my implementation, I'll let you know if it works or how to do it
Thanks for your help! I had left ships.xml aside as I thought it only applied to NPC ships, not to player ones.
Neloth23
Posts: 71
Joined: Thu, 13. Jul 17, 18:31
x4

Re: [MOD] Professional Crew V. 1.10

Post by Neloth23 »

Small fix added.

1.10
  • Fixed case of Split service crew not getting the right number of stars.
DeadAirRT
Posts: 1124
Joined: Fri, 25. Jan 19, 03:26
x4

Re: [MOD] Professional Crew

Post by DeadAirRT »

Neloth23 wrote: Sat, 4. Apr 20, 03:47
DeadAirRT wrote: Sat, 4. Apr 20, 02:05 Ships.xml people.xml and characters.xml

When i get around to testing my implementation, I'll let you know if it works or how to do it
Thanks for your help! I had left ships.xml aside as I thought it only applied to NPC ships, not to player ones.
I believe it has to do with the factions from characters and tags from ships. I made npc crews use higher quality pilots and crews based on ship. Haven't had a chance to check the pilots that come with buying them when player.faction is applied to the higher level pilots (veteran fighter and elite)
Neloth23
Posts: 71
Joined: Thu, 13. Jul 17, 18:31
x4

Re: [MOD] Professional Crew

Post by Neloth23 »

DeadAirRT wrote: Sat, 4. Apr 20, 04:20 I believe it has to do with the factions from characters and tags from ships. I made npc crews use higher quality pilots and crews based on ship. Haven't had a chance to check the pilots that come with buying them when player.faction is applied to the higher level pilots (veteran fighter and elite)
Sounds interesting. I'll mess around with those files and see where it leads me. Thanks again for your help!
MrXoT
Posts: 33
Joined: Wed, 2. Jan 19, 13:05
x4

Re: [MOD] Professional Crew V. 1.10

Post by MrXoT »

maybe add buy pilots/marines/crew only from stations manually(when you dock and walk on station)?
its very cheaty when you have 100+ marines with 3 stars on you ship.
Neloth23
Posts: 71
Joined: Thu, 13. Jul 17, 18:31
x4

Re: [MOD] Professional Crew V. 1.10

Post by Neloth23 »

MrXoT wrote: Sat, 4. Apr 20, 19:28 maybe add buy pilots/marines/crew only from stations manually(when you dock and walk on station)?
its very cheaty when you have 100+ marines with 3 stars on you ship.
Yeah, that is my backup plan, in case I can't do it via the ship construction menu. The only problem is that if you order 50 ships at once, changing captains manually won't be much fun. But I might not have any other option.

That being said, such an idea already exists in Litauen's Recruitment service mod. So far it works only for argons, but maybe he'll extend it to other races and my mod will no longer be needed?

I'm thinking about nerfing engineers and marines a bit, as they seem to be a lesser pain to manage than pilots anyway (and seem to level a bit better?). I'll try to find a better balancing in the next version to reduce the cheatiness.
Neloth23
Posts: 71
Joined: Thu, 13. Jul 17, 18:31
x4

Re: [MOD] Professional Crew V. 1.10

Post by Neloth23 »

A little long update.

First, the bad news. I didn't find a way to add specific pilots to player bought ships. So I won't be able to give more experienced pilots to larger ships unfortunately, or allow player to choose more experienced pilots during construction.

But, I have thought about what I could do, and I think I came up with a new version of my mod, which would be much less of a cheat and therefore a lot more interesting. Here's what I would do:
  • Bring crew stats back to vanilla levels... (no please don't shoot me yet, read a little further... then you can still blast me to oblivion...)
  • Lower the requirements for auto-traders to 2 stars (see, that's not all bad!)
  • Rework entirely the way experience gain is managed (this is the most important part, more on that in a minute)
That way, I would preserve Egosoft's original design, but I would scale it to a much less annoying level, because you would actually be able to see your pilots level up without having to hunt down every seminar out there.

Now, to give more details.

The experience system in X4 basically uses a ratio to determine how much XP a pilot gains depending on the task performed. For more info on the ratio itself, I can recommend Mackan's analysis in this thread. The ratio give very little XP at a time. In addition, certain activities possess a limit to the XP they deliver. For example, a normal trade run will give piloting XP up to 3 stars, after which the pilot will no longer gain XP.

So, here's how I propose to rebalance this XP system:
  • First I'd change the limit system, to either bring it to a much higher level cap (say 4 stars, or higher, instead or 3 for basic activities), or downright remove it;
  • Then, I would modify the values of the ratio, so that XP would increase much faster. Don't expect to gain 5 stars in one trade run, but I think we could find a reasonable level, so that we actually see our pilots level up in time as they execute their tasks.
  • Finally, I'd remove the XP loss that exists in certain situation. I doesn't make much sense to me that your destroyer captain should become dumber as you just told him/her to wait in order to plan for an ambush, for instance.
I'm thinking about releasing a beta version of this mod on the forum. Depending on your feedback, I could then adjust the values in the scripts to reach a balance that (hopefully) satisfies the most people.

The important thing, is that I already tested the basis of such a mod, and that I can make it work.

Lastly I'm sorry that I won't be able to do something more complicated (I've seen excellent suggestions, that I'd love to see in the game), but, as I realised, this clearly would be beyond my coding capabilities.

Thanks for taking the time to read this long-winded post, and I hope to have your feedback on all this!

P.S.: I will maintain the older, cheaty version of the mod available. I will also tweak it a little in an upcoming version, to reduce the cheatyness of marines and service crew.
Mackan
Posts: 143
Joined: Thu, 1. Aug 13, 05:59
xr

Re: [MOD] Professional Crew V. 1.10

Post by Mackan »

Hey, I recently published a level rate mod on the Steam workshop (link) and I noticed just now you were working on something similar. Was thinking we could share notes on findings so far, discuss potential changes and how to go about implementing them.

The mod I made is very simple and essentially only modifies falloff values and level caps in experiences.xml. In its current form it's more intended as a quick band-aid fix for the current situation rather than an overhaul. If you have higher ambitions I would be happy to help wherever I can rather than working on the same thing separately. :)

A couple of observations from relying solely on experiences.xml edits:
  • From what I can tell, auto miners do not actually gain levels from mining.
Rather, they are essentially auto traders and only gain levels from trading. The issue with this is that they are very susceptible to have their trades categorized as "bad trades". Having a bunch of miners in the same sector for the only purpose of leveling up pilots will quickly fill up the local factories, making pretty much every trade considered "bad" as the sell price will likely be as low as it can be at all times. A "bad" trade still gives piloting levels, just with a cap of 3 stars. But by default it also gives a penalty to morale. Thus they are unlikely become eligible for auto trading in a reasonable time frame.

I have no problem with penalizing auto traders for bad trades but for miners it doesn't make much sense as every trade will be a net profit no matter the price. This can't really be fixed just with experiences.xml edits without also affecting normal traders.
  • I increased level rates for station managers.
Probably should not have done that lol, managers power level straight to 5 stars very easily even with only slight changes to falloff values. Unsure how one should handle managers in general. Right now traders level up their managing skills but I consider high level pilots too valuable to be used as entry level managers. Maybe the solution here is to severely nerf level rates for managing across the board but buff the level gain from manager seminars (3 levels per seminar instead of 1 for example). As the quantity of managers needed is very low it might not be that ham-fisted to balance them around seminars.
  • Leveling by combat might be harder for L and XL ship captains.
I still need to test this more, but I suspect ship kills with turrets are not considered for leveling unless the captain is specifically targeting that enemy through a kill order. If this is the case I'm unsure right now how to fix it or if it can be fixed at all.
  • Morale changes should probably be played around with loose and fast.
Having played around with rate changes for a while now I think that morale should probably be treated almost as its own mechanic rather than just another skill. Like making it extremely easy to level morale but also make it easier to lose it such as when idling. Maybe also adding even more conditions for morale loss, such as taking hull damage etc. High morale could also be made to increase level up rates for example. Like changing the factor of apply_experience to (morale / main skill) or something similar. It could potentially get annoying but it opens up an incentive to use existing service crew with high morale as pilots for new ships.
  • Adjusting rates is a bit tricky in general when only relying on experiences.xml edits.
The leveling system is nestled into multiple scripts with a lot of custom checks and conditions. For this reason, changes made to values in experiences.xml don't always have predictable or desired results, such as in the example with auto miners.

A bigger overhaul to the leveling system will likely require tampering with a lot of AI scripts which can get tricky fast. Like if you wanted to introduce more pronounced soft caps for example you would have to do so in the AI scripts with multi-rolls while also adding more categories to experiences.xml. Egosoft have already done this with hard kills and is a good reference to how this could work. It rolls both the easy and hard category for pilots below 3 stars, giving a more accentuated leveling curve. Having this system for other activities such as trading is probably desirable, where leveling noticeably slows down after each star obtained. With only falloff edits you can't really achieve this.
Neloth23
Posts: 71
Joined: Thu, 13. Jul 17, 18:31
x4

Re: [MOD] Professional Crew V. 1.10

Post by Neloth23 »

Hey,
Seems you did exactly what I was aiming for! :)

I wasn't going to go further than modifying falloff and limit values in experiences.xml and lowering the auto trade threshold. The only slight difference would be that I would not have modified the levels for managers, as I thought they were ok in vanilla. I think your approach to morale is more interesting than what I would have done as I would have removed negative values. Otherwise, our mods would have been similar.

As it would be pointless for me to make the same mod as you, I'll stop the development of mine. I'll also put a link to your mod on my forum and nexus page, as I think your version will be much more interesting than what I previously did.

I don't really know if I can be of any help to you, as I'm no great coder and I was much slower than you, but if there's anything I can do, it would be my pleasure. I agrre that a complete overhaul would be ideal, but frankly, I would never have the capabilities to venture myself in such a huge and complex task.

Lastly, if I may put a little request, as a GOG user, I didn't manage to download your mod. Would you perhaps consider releasing it on Nexus also?

Thank you and congratulations for releasing this mod! I think you're going to make a lot of players happy (myself included)! :D
Mackan
Posts: 143
Joined: Thu, 1. Aug 13, 05:59
xr

Re: [MOD] Professional Crew V. 1.20

Post by Mackan »

Hmm, I'm not a big fan of Nexus. I'll consider looking into it but for now I've made a forum thread with a no-Steam download: viewtopic.php?f=181&t=424312

Honestly, as far as collaboration goes I consider feedback, suggestions and discussion just as valuable as code contribution so don't let inexperience discourage you (I'm not a programmer by trade either :))! Ideally a mod like this would be a community effort regardless as the aim is to make changes that most people would consider interesting and valuable alternatives to vanilla. As crew leveling is very time intensive to test I can't really do it adequately on my own, so having someone who is already somewhat familiar with how the system works provide thoughts and feedback would be of great help!

Return to “X4: Foundations - Scripts and Modding”