Multiple NPC Assignment(i.e. Engineers)

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

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

Alandauron
Posts: 163
Joined: Tue, 21. Mar 17, 17:24
x4

Multiple NPC Assignment(i.e. Engineers)

Post by Alandauron »

Hey everyone! I'm new to this forum but am a modder from other games, I picked up X: Rebirth ages ago but only just recently started playing the game, missed out on the older games but have had an interest in them for a very long time. As a modder I tend to stick to just one game for quite awhile which is probably why I never started playing this one lol.

I've been doing a good deal of reading on the forums and checking out existing mods and I want to start out by saying this seems to be an amazing community with some great works to show. I'll admit that I haven't read everything but I have spent the past couple days skimming through the many posts on here looking to see if something has already been implemented that I'm tempted to work on myself.

I haven't found a standalone mod that allows multiple NPCs(of the same type) to be assigned to one craft but I also noticed there are a few major overhauls where this might be included. What I want to see is, as an example, the assignment of more than one engineer(or other NPCs) to larger ships and stations. The tasks would be divided up something like:

Engineers:
  • -Engines
    -Hull
    -Shields
    -Weapons
Defense Officers:
  • -Ships
    -Drones
Marine Officers: (I noticed a mod for fleetwide
  • -Smaller squads of 10-25(5 man squads)
    -Leadership stars impact number of squads(1 & 2 = 2 squads, 1 addtl squad per star)
    -Allow different maximums on ships depending on size
I have other ideas as well but this is probably what I want to start with for now and will build into more difficult things as I go. The Engineer is really what I want to start with as a first priority, I see the Engineer as more of a lead Engineer but for larger ships I feel that the responsibilities would be divided up for better efficiency.

If anyone knows of any mods that have similar works to the above stated I would love to hear about them, would be great for giving me a starting point to build off.[/list]
w.evans
Posts: 2963
Joined: Tue, 18. Nov 14, 16:23
x4

Post by w.evans »

Interesting. And possible, i would think.

By itself, having more than one crew member of a particular type (say, engineer) aboard a ship is no problem. You just put him aboard. i think the more interesting bit is having the work divided among more than one entity.

Easiest implementation i could think of would be to run an engineer ai script on just the one engineer that's actually assigned to the ship as engineer, and have that script (or some other script such as an md script or the captain's script) detect more engineers coming aboard and adjusting itself accordingly. You'd lose the parallelization possible from having multiple dedicated scripts acting on the multiple entities, although a similar effect can be achieved from a single script. A series of interrupt handlers can, for example, detect a surface element being brought back to working order and reassign the member of the engineering crew that was working on it to the next critical subsystem while also detecting the hull being repaired completely and reassigning that engineer, the main script keeping track of things being repaired (more likely damaged things being no longer damaged) and being updated accordingly. You'd have to handle crew members coming aboard and leaving though.

Dividing turret and drone control between two defence officers should be similarly doable, but i'm not sure what the benefit would be since drones are largely autonomous. (DOs just program them and send them off.) They'd probably be working off of similar, if not the same, target lists and using the same mechanisms for detecting targets. Possible performance hit if you have them use those mechanisms twice each cycle for the two different purposes. You might think of a way how it could make sense though.

The marine officer bit is a bit more difficult since it looks like a lot of it is in the C++ code. The actual mechanics of boarding is in an md script which is accessible to us, but, for example, having more than one object be boarded at one time isn't possible at the moment, i think. (i'd ask Marvin Martian though, if i were you. He's made a lot of very surprising work in that regard.)

Oh, and welcome aboard!

edit: reread your post and noticed that you were thinking of having marine officer skill affect number of marines a ship can field. Pretty sure that number of marines a ship can carry is defined on the ship, so don't think that can be affected by crew skill. It is possible, however, to have crew skill affect the number of marines that can be fielded per boarding op, although i can anticipate some grumbling if you can hire 50 marines but only field 10 unless you can make it convincing!
Alandauron
Posts: 163
Joined: Tue, 21. Mar 17, 17:24
x4

Post by Alandauron »

w.evans wrote:Easiest implementation i could think of would be to run an engineer ai script on just the one engineer that's actually assigned to the ship as engineer, and have that script (or some other script such as an md script or the captain's script) detect more engineers coming aboard and adjusting itself accordingly. You'd lose the parallelization possible from having multiple dedicated scripts acting on the multiple entities, although a similar effect can be achieved from a single script. A series of interrupt handlers can, for example, detect a surface element being brought back to working order and reassign the member of the engineering crew that was working on it to the next critical subsystem while also detecting the hull being repaired completely and reassigning that engineer, the main script keeping track of things being repaired (more likely damaged things being no longer damaged) and being updated accordingly. You'd have to handle crew members coming aboard and leaving though.
For the Engineering I was considering making a static amount automatically done without an Engineer with some pretty severe limitations:
  • -shields recharge at half rate
    -hull only repaired to maximum of 50%
    -repair rate extremely slow
    -etc.
The initial [Lead] Engineer would take away the penalties of having no crew member. Once again I think of this as having someone in charge that more or less knows what they're doing, these are huge ships and facilities, afterall, one person couldn't maintain them by themselves even with automated robot help lol. Each Engineer after that would be assigned to a more specific leadership role with all the major systems. The real issue will come with creating or re-purposing the UI to be able to change the crew member assigned to each role so you don't have to assign them in a "correct" order.
w.evans wrote:Dividing turret and drone control between two defence officers should be similarly doable, but i'm not sure what the benefit would be since drones are largely autonomous. (DOs just program them and send them off.) They'd probably be working off of similar, if not the same, target lists and using the same mechanisms for detecting targets. Possible performance hit if you have them use those mechanisms twice each cycle for the two different purposes. You might think of a way how it could make sense though.
For this I was thinking something simple, first DO would always be assigned to turret and allow x number of drones(very limited at first) and the second(possibly third) would allow launching of more drones simultaneously. I could of course just create a different crew type that specializes in multitasking multiple drones at once where the amount of stars can increase the number. A hard stop on launching drones would need to be applied if there is only one DO or the second DO has a low rating on the required skill.
w.evans wrote:The marine officer bit is a bit more difficult since it looks like a lot of it is in the C++ code. The actual mechanics of boarding is in an md script which is accessible to us, but, for example, having more than one object be boarded at one time isn't possible at the moment, i think. (i'd ask Marvin Martian though, if i were you. He's made a lot of very surprising work in that regard.)

Oh, and welcome aboard!

edit: reread your post and noticed that you were thinking of having marine officer skill affect number of marines a ship can field. Pretty sure that number of marines a ship can carry is defined on the ship, so don't think that can be affected by crew skill. It is possible, however, to have crew skill affect the number of marines that can be fielded per boarding op, although i can anticipate some grumbling if you can hire 50 marines but only field 10 unless you can make it convincing!
I actually wasn't looking to be able to board more than one ship at a time, I like that you have to pretty much stay on top of the ship(unless every turret is destroyed and don't have a hacking drone) in order to have a successful boarding attempt. I was more thinking in terms of small unit leadership, needing more MOs in order to successfully capture larger ships and even stations(saw there was a mod for that as well).

I also want to:
  • -make recruiting dependent on already having a MO
    -adding the ability to station MOs on other ships in your fleet
    -tying the amount of marines you can hire to the amount of MOs in current fleet
    -running checks before boarding and adding a UI on how many MOs to deploy(sending an MO will send Marines attached)
    -making boarding larger ships/stations balanced against a new system like this
    -adding MOs to stations and CVs for defense(can enemies do boarding?)
    -if enemies don't currently board add that in maybe
    -etc.
This is why I want to start with the Engineer and then move on from there, even though the DO changes would be the easiest I feel that a rework for the Engineer is really more interesting than one for the DO personally.

As of right now I'm just trying to figure out the command/dialog options and how to read the XML scripts, I've been working with UScript and modding XCom EU/EW(not XCom 2). While the modding in this game looks like it will be much easier I still have to learn exactly how everything functions. Essentially first goal is to make the "work here" command open up a UI that lists the different systems on the ship/station.

Also I'm still really enjoying playing the game, though I have made a couple small tweaks, loving the CV bridge mod and the "more crew" was essential for me because the constant trips to stations was more tedious than interesting. I wish I knew how to do artsy stuffs so I could make "Transport" vessels that are used strictly for carrying crew around. This would also require the docking mod I saw though because I would use it only when trying to capture ships and such. Right now I use a CV but it would be nice to have something that is heavily armored with a slow normal speed but that can do short bursts where it moves extremely quick(ship stays on outskirts of battle then boosts in to drop off Marines).

Alternatively you could use Transports to carry extra crew and these ships would dock whenever you dock giving the same effect as having more space on the Skunk but without making it look like you force your crew to sleep on top of one another.

Thanks so much for the welcome and I hope to be able to contribute in time! XCom EU/EW is my primary right now because a friend and I are working on something big, but this will likely become a personal passion of mine for several years to come.
JESS 246
Posts: 574
Joined: Mon, 3. Jul 06, 03:24
x3

Post by JESS 246 »

Hi Alandauron

I've said something about this a long time ago in a ideas post as why would any large ship or station have just one engineer and my idea was we should have a master engineer hume oversee all work and assign him/her the other engineers like as we recruit marines in the form of a couple of standard engineers in control of drones and as many as you can like 5-20 plus sub engineers doing all general work as you would have in the real world also all the items we pickup in the skunks inventory like scrap metals, ship parts etc we allocate as much as we can to the engineers to help with the repairs or the overseer trade for parts as long as we allocate funds.

The same goes the defence officer large ships/stations and why not have a trade officer for all the large ships with the exception of single crewed ships where the castain dose all on larger ships there should be more crew like say how the star trek ships are crewed there is no logic to why there are only 3 crew on cap ships and stations with the exception of the special crews.

It;s a good idea if you are planing to make a mod based on this concept good luck if you do.
Alandauron
Posts: 163
Joined: Tue, 21. Mar 17, 17:24
x4

Post by Alandauron »

JESS 246 wrote:I've said something about this a long time ago in a ideas post as why would any large ship or station have just one engineer and my idea was we should have a master engineer hume oversee all work and assign him/her the other engineers like as we recruit marines in the form of a couple of standard engineers in control of drones and as many as you can like 5-20 plus sub engineers doing all general work as you would have in the real world also all the items we pickup in the skunks inventory like scrap metals, ship parts etc we allocate as much as we can to the engineers to help with the repairs or the overseer trade for parts as long as we allocate funds.
I like this, when I am working on the Engineer rework I'll look into also adding a Engineer to the Recruiting Officer, will have to do some thinking on what impact it makes on the performance of the ship/station. The reason they did it [one Engineer per vessel] is likely related to gameplay, it becomes tricky to have multiple units have purpose but also not become too powerful. In regards to having even more than just a few Engineers we get into needing to balance more than just CVs and Stations but instead reworking the entire combat system in order to make the recruited Engineers have a decent purpose but not make your ship/station too powerful.

In regards to what you said, I haven't really looked at the impact of Engineers on the construction and other maintenance type drones, but I guess that would be something that could be considered when thinking of balancing a "sub-engineer" of sorts.

Another thought is that maybe only stations receive the "sub-engineers" but CVs just utilize worker drones in place of them. Definitely something to consider though. Glad to see someone interested, but I do need to warn you to not expect anything anytime soon. I have to figure out how everything functions and start playing around before I'll be able to make any meaningful changes.
JESS 246
Posts: 574
Joined: Mon, 3. Jul 06, 03:24
x3

Post by JESS 246 »

Hi Alandauron

I'm clad you like the input and this is a way to go, yes i do understand it dose take a lot of thinking and balance to make it work and there are a many good modders out there that may be willing to assist.

Bear in mind that how we get the Marine officer and recruits is the possible place to start.

Look forward to ongoing results and further info in this crew concept mod.

Return to “X Rebirth - Scripts and Modding”