Starbound

Starbound

103 ratings
Better Crew (Diet-version)
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
171.138 KB
24 Nov, 2022 @ 3:56am
5 Dec, 2023 @ 9:54pm
5 Change Notes ( view )

Subscribe to download
Better Crew (Diet-version)

In 2 collections by Vix
All Vix Mods
24 items
BetterCrew and BetterCrew Patches
5 items
Description
Originally posted by Vix:
I'm solely the uploader.Actually now we're on my fork, since some stuff needed patching in the base mod.
rl_starbound
is the original author of rl_bettercrew[github.com] .
Since it wasn't on the Steam workshop and the license allows it, I took on myself to summarize slightly the description (character limits) and I'm trying to provide basic support from my understanding and usage experience of the mod.
Very important patches for Custom Races:

Important Information
Better crew has evolved! The newest version makes heavier modifications to the lua files.
As it might break compatibility with some mods, the last diet version will stay available here if you need to keep using it. This version is final and won't receive any more udpate, just patches.

The newer full version is there!

DO NOT use both versions at once.

Summary
You recruit twelve NPCs to become your ship's crew, and then what happens onboard? They all mob the teleporter and ignore the rest of your ship.

NPC behaviors in Starbound are quite simplistic, and this becomes most obvious in crew behavior onboard the player's ship.

Better Crew upgrades your Crew from brainless beefcakes to the average chihuahua.

How work:
The ADHD issue
The idea behind this mod is based on the mod "Smart Crew" by metamorphexx. In that mod, each crew type has a hard-coded list of objects that attracts that crew type, and on each behavior tick, each crew member searches the player's ship for each object on their type's list and moves to one such object, if found.

Issue with that is that this search would happen on each behavior tick, for each crew member, for each object in the crew type's list.

In Better Crew, as each object placed into the ship world that contains crew anchors registers itself and its location with the ship's TechStation (S.A.I.L. panel). Be sure to have the patches mentioned above for modded races/ships/furniture!

The need to rest instead of loitering
Normally, no NPC will attempt to sleep in a bed further than 50 blocks or sit in a chair further than 80 blocks from their spawn location, which on the ship is the teleporter.

In Better Crew, the search radius for beds and chairs is 250 blocks for crew members onboard player ships, which should sufficiently cover all vanilla ship classes.
Shipboard Duty Stations and Patrols
While onboard the player's ship, each of the twelve crew types will now be attracted to certain objects, if present. These objects will pull the crew away from their spawn location (i.e., the teleporter). If you have done a good job designing your ship's spaces, this should result in the crew spreading out throughout the ship and moving around in a way that feels natural.
In general, crew are attracted to objects that are related to their occupations.
In Better Crew, it patches over 100 vanilla objects with crew anchor tags.
The bug of having too much determination
Starbound's simplistic behavior logic also hides a significant bug, which is why on some other mods and vanilla, your crew seem to lack brain functions and just derp out for half an hour or more.

Basically, an NPC behavior fires moveToPosition with some coordinates, and the NPC plans a route to those coordinates (via a call to Starbound's C++ API) and moves there. If the game cannot plan a route from the NPC's to its destination (e.g., if the location is behind a locked door), the NPC just stands there and waits, presumably in case a route opens up in the future. There is no built-in timeout functionality in moveToPosition. An NPC stuck waiting will continue to wait indefinitely, or until a higher priority behavior is triggered (e.g., combat, or the player interacting with them). Some uses of moveToPosition were wrapped inside of a timeout behavior, but the majority were not.

Resulting in NPC Freezing.
In Better Crew, this has been fixed.
Doors.
Issue is that, you might like your racial ship doors. But moving around your ship, manually opening and closing doors is annoying, so you wire proximity sensors on either side of each door.
Which to the game's path finding, counts as a closed&locked door., because something is wired to the input node, even with a proximity sensor. So NPCs would only go through doors if they happened to wander close enough to open then, then the game would see the door as an opened locked door, and consider pathfinding through it, and stop doing so as soon as the door closes again.

In Better Crew, the solution chosen was to make all racial ship doors to open automatically. You should be mindful of this issue for all non-automatically opening doors still though. Note that the game's path-finding logic is in its C++ code, so modders cannot fix this directly, and have to hack around it.

Compatibility Notes
Note to other mod authors:A full list of which objects attract which crew types can be found by reading this mod's source code, particularly by looking in all of the *.object.patch files for the key crewAnchorTags. In general, crew are attracted to objects that are related to their occupations, and this mod patches 100+ base game objects with crew anchor tags.
(You may add the field crewAnchorTags to your own objects, if you wish to use this mod in combination with your own. The value is a JSON list of strings, with each string being one of the crewmember NPC types that should be attracted to the object.)
Modified Lua
This mod modifies behavior files and Lua scripts, and there is no truly safe way to modify those. If this mod is combined with any other mod that modifies the same behavior files, the result is likely to be broken NPC behaviors. If this mod is combined with any other mod that modifies any of the following Lua functions, then conflicts will happen:
  • /npcs/bmain.lua: setNpcItemSlot
  • /scripts/actions/npc.lua: swapItemSlots
  • /scripts/actions/query.lua: findLoungable
  • /scripts/actions/reaction.lua: playBehaviorReaction
As a general rule of thumb, you should assume that this mod is not compatible with any other mod that significantly alters NPC behavior.

This mod might not be compatible with BYOS, or any other mod that adds similar functionality, such as Frackin Universe.

Miscellaneous Bug Fixes and Tweaks
Running out of space, check Change Notes!
32 Comments
Vix  [author] 27 Nov, 2023 @ 7:36am 
@The Collector Cat it should work better, assuming you don't forget the two important "mega patches" !
The Full version isn't more crashy, just more likely to have incompatibilities ^^'
BITney, The Pixel Heister 27 Nov, 2023 @ 7:18am 
For the moment ill use the Diet Version, cause i returned into Starbound and i have like 30+ duplicate errors and i prefer a less crashy version of everything xD, ill go try the better crew original version when ill debug all the errors and finally can play. Btw, i uninstalled smart crew to try this one, hope it works better.
Vix  [author] 26 Nov, 2023 @ 10:36pm 
@The Collector Cat well, the diet version goes up to version 1.2.0. Full version picks up from 1.2.0a to 1.4.0 as of now, and these subsequent versions have fixed a few bugs, added quality of life improvements and, for the medic, a little combat mechanic improvement.

The diet version (frozen at 1.2.0) is still around because 1.2.0a would break stuff for some people, and if the Full one works for you, you can pretty much ignore the diet version.


Which ever you end up picking, I would advise you to also get the Race MegaPatch and the Crew Anchor MegaPatch (they are compatible with both, unlike the Range Patch which is Full version only), as the Race Patch is necessary for BetterCrew to function on non-vanilla ships/ non vanilla SAIL panels, and the Crew Anchor MegaPatch is about making crew aknowledge the existence of modded furniture/ crafting stations.
BITney, The Pixel Heister 26 Nov, 2023 @ 4:34pm 
Im thinking of installing the diet version or the original, which should i choose looking forward?
Vix  [author] 12 Nov, 2023 @ 12:01pm 
@Master Dink yeah seems like you have an issue that is related to an other mod (modded ship? custom crew scripts for weapons? something else?), as for killing crew within the ship... don't Lava Balloons damage them?
Master Dink 12 Nov, 2023 @ 9:47am 
so i have been trying these crew mods out to make them stop sitting in the captains chair and none have worked. idk why the hell they do it but they sit in the cock pit all the time right on the chair so i cant move my ship and the worst part is the one that does it the most is the tailor. If there are mods that let me kill my crewmates and they respawn on tele let me know.
Vix  [author] 29 Oct, 2023 @ 5:31am 
@Trogdude thank you for your research! I'll add it to the list of incompatible mods!
Trogdude 29 Oct, 2023 @ 12:26am 
I have found the incompatibility; The Borderlands Random Shields mod
Link: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2064881027
Trogdude 15 Oct, 2023 @ 12:21pm 
Never mind it wasn't any of those.
Trogdude 15 Oct, 2023 @ 11:56am 
I believe I have found the culprit, some private and adult oriented mods. So I guess I'll toss those and see if that fixes it.