Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diggy : Compatibility with Klonan's mining drones #1036

Open
anisghaoui opened this issue Feb 15, 2020 · 13 comments
Open

Diggy : Compatibility with Klonan's mining drones #1036

anisghaoui opened this issue Feb 15, 2020 · 13 comments

Comments

@anisghaoui
Copy link

Hello,
Klonan has this fantastic mod that makes the map exceptionally fun !
2 problems :
1st : the drones destroy the rocks and don't generate the new terrain. I asked him and he kindly implemented a config to ignore the big rocks.

2nd : he suggested that you would make the rocks destroyable by the drones. I don't really understand his point tbh. Here is a link for it :

https://mods.factorio.com/mod/Mining_Drones/discussion/5e2d8b7c0cf772000bfba8f2

Is there any way to have compatibility between your scenarios and the mod ?

@BlueRock2
Copy link
Contributor

Try re-downloading the RedMew scenario as there was a 0.18 diggy patch for it today. I tried the newest version of Diggy and the Mining drones seemed to work. But I didn't test it a long time. With the option selected to not destroy rocks, they only seemed to destroy rocks if they were in their way (like in a congested pathway if other drones and rocks were nearby). In the places rocks did get destroyed I verified new terrain was generated. I witnessed one of them cause a cave collapse and get killed which was a bit humorous.

@anisghaoui
Copy link
Author

anisghaoui commented Feb 16, 2020

They indeed will destroy rocks blocking their paths and rocks that have resources beneath them. I will give you a feedback later today. Thank you.

@anisghaoui
Copy link
Author

I have cloned the most up-to-date git repo. I tested with Klonan's mining drones and having them mining rocks (without ignore them) will not propagate the normal Diggy cave's behaviour.

Robots and explosions on the other hands do work correctly.

@BlueRock2
Copy link
Contributor

BlueRock2 commented Feb 17, 2020

When you say

"will not propagate the normal Diggy cave's behaviour",

can you be a little more specific? Are you seeing the drones not fully destroy rocks? If they do fully destroy a rock, do you see new tiles get placed with additional rocks put on them? Or do you end up with a gap in the rocks where the tiles meet up directly against the void with no new tiles/rocks placed?

@anisghaoui
Copy link
Author

anisghaoui commented Feb 17, 2020

I made this for Klonan : https://imgur.com/CX11sPF

he fixed his mod now to ignore rocks correctly ( I am against his drones destroying the rocks in diggy because it is too dangerous x) ). The behaviour is still incorrect in my opinion. It might not be even necessary to solve it.

@linaori
Copy link
Contributor

linaori commented Feb 17, 2020

The cave opening event doesn't get triggered when an object is destroyed (entity.destroy()), that's usually what's being called in mods to remove a rock after "mining" it. Unless we can start listening to a pre-destroy hook, I don't know how to properly deal with this.

Maybe mods should start triggering a mined or death event of sorts?

@anisghaoui
Copy link
Author

anisghaoui commented Feb 17, 2020

Wait, this is (maybe?) incoherent. If I used grenades, atomic bombs or even my gun to destroy rocks the cave expends. if it is the same event that you subscribed to then it should be the same behaviour.

I agree the solution will not be trivial. I also doubt that the mod has to add anything new.

@BlueRock2
Copy link
Contributor

BlueRock2 commented Feb 17, 2020

Hello Linaori! Haven't seen you active for a while. I just wanted to add an observation that in the video above I didn't see any stone particles being generated during stone damage or destruction either by the drones OR player at the end, so I am doubtful the 0.18 particle fixes were applied when you recorded that.

@linaori
Copy link
Contributor

linaori commented Feb 17, 2020

Wait, this is (maybe?) incoherent. If I used a grenades, atomic bombs or even my gun to destroy rocks the cave expends. if it is the same event that you subscribed to then it should be the same behaviour.

The destroy() function on an entity just removes it. grenades and atomic bombs trigger the on_entity_died event. The destroy was not something we could use in 0.16, which was the last time I did anything with the lua api in factorio.

I agree the solution will not be trivial. I also doubt that the mod has to add anything new.

If a mod does not provide a hook we can listen to, there's no way of knowing that something happened to that rock.

Hello Linaori! Haven't seen you active for a while

Just stalking around, haven't touched factorio in a while.

@BlueRock2
Copy link
Contributor

BlueRock2 commented Feb 17, 2020

Interesting observation # 2: I did the same test as in the video. If I tell them to mine for stone they just destroy the rock and there is no replacement stone placed. If I expose some iron ore and the iron ore is under the rock or the rock is in their way, and they do actual damage to the rock everything works properly.

@BlueRock2
Copy link
Contributor

Ok, so I did one last(I think) test with the mod option to ignore rocks. In this mode, if you choose to mine stone, they will only mine stone off the ground not the large rocks. They could still damage rocks that are in their way or covering stone on the ground, but the damage they do in this mode when they kill a rock works properly in Diggy. If you want to further expand the mine, can still use the construction bots which is probably best anyway because if the drones were to dig too much rock unsupervised they would cause collapses and die. So would this address any remaining concerns you have? The only other issue I found, which would need to be addressed by the mod author is if you wanted the drones to re-scan for new ore every now and then. Currently, once they start mining, they don't appear to be aware of any new ore that might later get uncovered.

@anisghaoui
Copy link
Author

anisghaoui commented Feb 17, 2020

Some explanations :

  • The "ignore rocks" was created expressly on my demand and wish to play diggy with this mod, see : https://mods.factorio.com/mod/Mining_Drones/discussion/5e2d8b7c0cf772000bfba8f2. Both of Klonan and all of you do a great work. Thank you kindly.

  • Yes, it is dangerous to let the drones mine the rocks because of the collapse.

  • Yes, when the drones find resources under a rock/tree, they destroy it,. Klonan commented (in the previous link) that it should be up to Diggy's creators to make the stones killable. I will address him to this conversation soon.

  • As of now, all my concerns are gone and everything is stable. It is just curiosity that keeps me Digging (pun intended).

  • If I remember correctly, Klonan purposely made the depot do a on-recipe-scan in order to decrease UPS usage. Because, in a Vanilla you would often see the whole patch at once.

@SimonFlapse
Copy link
Member

It'd say that the LuaEntity.destroy method is an artificial way of removing an entity from the game. Thus it is not really something that occurs naturally in the game. Using it has its advantages, because it prevents spilling of items like stone, coal and wood.

However it can be seen as a godlike way of manipulating the game environment in the sense that it can overwrite almost all logic, and simply just remove the entity and any traces of existence.

What mod creators who uses LuaEntity.destroy IMHO should do is to set the raise_destroy parameter to true, so that the mod tries to act compatible with any other unknown third part modification.
Maybe, and just maybe, this would allow us to make changes to accommodate mods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants