Construction Planner Continued

by azaghal

Ghosts require player's approval before construction bots are dispatched. This gives the player improved control over what parts of the factory get built, and when.

Utilities
1 year, 6 months ago
1.1
1.58K

b [FIXED] Trees and rocks get permanently marked for deconstruction when using Cut tool on CPC ghosts

1 year, 9 months ago

Amazing mod, I wished something like that was part of the game since I've started playing it. One small bug I found:

I've used the Cut (Ctrl + X) tool to move a ghost blueprint to a different location.

https://i.imgur.com/hlJXS6f.png

It did correctly remove the ghost from the world and placed the blueprint in the clipboard to be pasted somewhere else. It did, however, also mark trees in that area for deconstruction:

https://i.imgur.com/ZIjLDQv.png

While they are marked for deconstruction, the bots don't deconstruct them. Also, I can't remove the deconstruction mark from them using the deconstruction planner.

https://i.imgur.com/kIMEI40.png

They are highlighted when dragging the planer over them, but the deconstruction mark remains when I release the button. The only solution is to deconstruct them manually.

1 year, 9 months ago

Hello and I'm glad you like the mod - ceresward is the original author, and to be honest it was a quite out-of-the-box thinking on his part on how to implement the core of the mod. It's hack-ish, but still interesting. I really wish it was part of the vanilla game as well, since some of the things that are done within the mod are a bit strange :)

Ok, so I can easily reproduce the issue you have faced, and I know what is happening (essentially the deconstruction gets assigned to a unapproved ghost force - that's why you can't do anything to it), but I need to figure out how to best handle it. Funny enough, trees/rocks would be very easy to handle, but cliffs will give me some trouble.

1 year, 9 months ago

I can confirm that the last update also fixed this issue. Thanks for quick update!

1 year, 9 months ago
(updated 1 year, 9 months ago)

There is, however, a related issue. I've used a deconstruction planner filtered to remove ghost entities and in addition to removing ghosts it assigned fish for deconstruction to the unapproved force, because I can't unmark them:
https://i.imgur.com/9G5NqXk.png
Edit
Cliffs as well:
https://i.imgur.com/3Zaagaf.png

1 year, 9 months ago

Hm... Yeah, I think I'll need to maybe need to figure out if I can somehow tell deconstruction planner not to touch entities without a force.

1 year, 9 months ago

The good news is - I have a fix for this, and it would even start taking into account deconstruction filters properly. This would rely on grabbing the deconstruction planner that is held by player, and applying it against the designated area, but using the unapproved ghost force.

The bad news is... Yet again we hit the whole issue with blueprints from library being practically unusable by the mods. So, if you use deconstruction planner from your game/player library, I can't gain access to it. I'll still try to double-check if I can somehow extract filters set in that manner, but I doubt it...

If you're into details, this is a good thread on the forums covering this particular issue:

1 year, 9 months ago

Are you sure it's the same issue? If I understand it correctly, putting the planner into your inventory before using it (and not using it straight from the blueprint library) should work fine, but it doesn't:
https://i.imgur.com/G3VU6iT.mp4
Also, I don't know how the fish mechanics work here, but notice that after using shift + decon planner on them, they're still marked, but they start moving again. It's like they get de-marked (or at least the game tries to unmark them), but something prevents the mark from being removed.

1 year, 9 months ago

What I wanted to say was that I have a fix for the problem you reported that also extends to properly applying filters from deconstruction planner (since I realised that the filters did not work as expected with unapproved ghosts) - but that happens only if deconstruction player is not in the blueprint library.

The caveat with the (easy) fix is that when you deconstruct an area with deconstruction planner from library, the unapproved entities will get added to undo queue one-at-a-time - which was what I really wanted to avoid.

I have one more idea on how to work-around this, but I need to test it out first.

Which brings-up another question - I realised that you might end-up with a lot of fake deconstructions in your game now - have you found a way to fix those? I could probably look into adding at least some console command that would clear deconstructions for the unapproved ghost force perhaps.

1 year, 9 months ago

For now the only way to deal with them is to manually deconstruct said items, I haven't yet found a way to remove the deconstruction mark while keeping the object intact. I'll do some more testing on that.

1 year, 9 months ago

Ok, I'll have to look at implementing a console command for that probably - just something that can fix-up the game as this type of bugs are encountered.

Unfortunately, the whole thing with deconstruction planner is getting a bit more complex, so not sure when I can push out the fix.

1 year, 9 months ago

No problem. Since I couldn't find a better solution to cancel the deconstructions, I wrote a local mini-mod to give me a deconstruction planner belonging to the player.unapproved_ghosts force and I use that. :)

1 year, 9 months ago

Ok, I think I managed to sort-out most of the issues (fingers crossed). There is also a /cp_cleanup command that should be able to take care of fixing some/most of the inconsistencies (although I think there might be some issues with the approval badges in some cases).

There's a big fat warning that will get shown to player when using deconstruction planners from library. From inventory the filtering will work as expected (I think).

Thank you once again for doing all the testing and providing enough information for reproduction steps :)

P.S.
I really need to refactor the code at this point, it's starting to get quite messy...

1 year, 9 months ago

The warning on using decon planners from library works, as do planners I copy / put in the inventory. The console command seems to be working fine, it removes stuck deconstruction marks and doesn't seem to break anything. Thanks!

1 year, 9 months ago

Great, glad to hear that, and thanks for reporting all the bugs and testing things out :)

This thread has been locked.