Simple Mod, Complex Problem: Hauling Debris

Started by Nasikabatrachus, March 01, 2014, 06:42:01 PM

Previous topic - Next topic

Nasikabatrachus

I made a rather simple mod that changes natural rock walls by increasing their hitpoints and making them drop Rock Debris when mined. However, this debris immediately poses a new problem: colonists won't take new mining jobs if a piece of debris is blocking their standing spot. Although I wanted to make mining a more involved process, having to endlessly designate new debris to be hauled away isn't fun. This screenshot shows the mod in action:

http://puu.sh/7fn17.png

The large field of debris outside is what was produced by mining. Inside the mine you see a stonecutting table, which is the closest I can get to automating the process of removing the debris. I tried setting up a dumping stockpile inside the mine with a lower priority than the stockpile outside the mine, but since zones can't be placed on areas occupied by structure like rock walls, in practice it's the same as simply designating new hauling jobs.

So, does anyone have suggestions on making the hauling process more automatic? Ideally, I'd like to be able to mod the home region to have debris hauling as an automatic job, but I can't figure out if that's moddable.  The other solution would be to make rock debris always haulable, so that stockpiles would accept draw in debris automatically. However, seeing little red Xs on all the map's debris would be kind of distracting.

Edit: Additional miscellaneous question: Is it possible to have the rock walls drop rock debris only, say, 50% of the time instead of every time?

Rokiyo

I think part of the issue is that colonists can't stand on debris, they can only pass through it.

If you were to redefine debris to be walkable, that should at least allow the colonists to continue mining. E.g.
Defs\ThingDefs\Various.XML
<ThingDef ParentName="DebrisBase">
<defName>DebrisRock</defName>
<label>Rock debris</label>
<passability>Standable</passability>
<textureFolderPath>Things/Building/DebrisRock</textureFolderPath>
</ThingDef>


You could also take a peek at how Metal is defined and try changing rock debris to act a bit more like metal... Trying stuff like this seem like a good place to start:

Defs\ThingDefs\Resources.XML

<comps>
<li><compClass>CompForbiddable</compClass></li>
</comps>
<alwaysHaulable>true</alwaysHaulable>

Nasikabatrachus

Thanks for the pointers. For me, the biggest barrier to modding is figuring out the organization and tag usage, so this was very helpful.

Tynan

The trouble with auto-hauling debris is that the map is covered with them; your guys would be hauling hundreds of pieces from all over the map.

I suppose you could forbid them all (adding the Forbiddable comp), but the're be a performance hit for scanning all those forbidden rocks every time they look for a haul target.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

daft73

What about a wheelbarrow mod?.. It's not automatic, but it could lesson the amount of trips: say 5-10 per haul.
Could be a craftable, 5metal/2stone or something.

Nasikabatrachus

I redefined rock debris to be standable, and it seems to work well enough and seems like the most sensible solution I can implement. I'm not sure it gives me the feeling I want, though; I'd still like to be able to modify the Home Region, or mod in a new region, that sets debris hauling jobs automatically. In any case, I'll be testing the original mod and the standable debris version with Cleo to see how they change the whole "dig in and hide in the mountain" strategy. Should be fun.

I did encounter an error when loading the walkable debris version into a save with the first version:

"Object reference not set to an instance of an object"

Can this kind of thing can be fixed, or is it simply incompatible with the save?