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

Diggers dont like other_worlds atmosphere #43

Closed
GreenXenith opened this issue Feb 4, 2019 · 6 comments
Closed

Diggers dont like other_worlds atmosphere #43

GreenXenith opened this issue Feb 4, 2019 · 6 comments

Comments

@GreenXenith
Copy link
Contributor

Front(!) diggers crash the server when trying to dig in otherworlds atmosphere with same error we've been dealing with (failed to access inv in utils). (!)Doesnt happen with diggers aligned with controller...

@GreenXenith
Copy link
Contributor Author

@FaceDeer after this incident digtrons are crashing regularly... I do hope you have a fix.

@FaceDeer
Copy link
Member

FaceDeer commented Feb 10, 2019

Just downloaded and installed other_worlds to test. I made a quick attempt down at ground level, building a simple Digtron with a digger facing forward, but it worked okay. I assume this needs to be at some other altitude where there's a different atmosphere?

Edit: I teleported up to +7000 y and found a reddish "asteroid" operating a Digtron there didn't crash anything either.

If this is the same error that the other issues are about, a crash trying to access an inventory that doesn't exist, might it be a coincidence that it happened in other_worlds atmosphere? If it wasn't crashing before but has started now without any actual code changes perhaps it's something else on your system that changed, like perhaps there isn't as much memory available for Minetest due to some other program running, and it's causing whatever is responsible for the other bug to start manifesting itself for you.

@GreenXenith
Copy link
Contributor Author

GreenXenith commented Feb 10, 2019

@FaceDeer Literal atmosphere node. Its a white-tinted thing covering larger asteroids. For example, the testing setup I have:
image

And it's not a coincidence; I can reproduce consistently.

@FaceDeer
Copy link
Member

FaceDeer commented Feb 11, 2019

Ah, I didn't see any of that atmosphere stuff around the first asteroids I found, but flying around a bit got me some to test with. I've found the problem, and it's not technically in the Digtron mod. The other_worlds mod has a "register_on_dignode" method that generates asteroid atmosphere in place of any node that's been dug adjacent to existing asteroid atmosphere, so that if you dig a hole on an asteroid's surface the atmosphere will fill it.

The problem is that Digtron is technically digging itself out of existence and then writing itself back into existence displaced in the direction it's traveling. This callback is triggering and overwriting the Digtron with atmosphere mid-dig-cycle, which results in a crash since Digtron's code doesn't know that its components have ceased to exist and it continues to try operating on the metadata it thinks should be there. That's similar to the strangeness happening with the other crashes, but in this case the cause is actually in mod code rather than some obscure engine problem.

You can see this effect most clearly if you try operating a Digtron immediately beside a block of comet atmosphere. The atmosphere "reaches out" and overwrites the Digtron even though the Digtron is not entering it.

You can make a quick patch to other_worlds to stop the crash. In "asteroid_layer_helpers.lua", go down to line 91 and replace the existing line:

	if minetest.find_node_near(pos, 1, {"asteroid:atmos"}) then

with:

	if minetest.get_node_group(oldnode.name, "digtron") == 0 and minetest.find_node_near(pos, 1, {"asteroid:atmos"}) then

The downside is that now Digtron is able to actually dig the atmosphere, leaving a channel through it and taking it into inventory as if it was digging through stone. I assume this is not ideal. :)

I'll ponder further how to deal with this. It's actually kind of nice having a reliable way of killing Digtron like this, I might be able to add safety checks to at least prevent server crashes even though I probably can't save the Digtron itself.

@BuckarooBanzay
Copy link
Member

ping, is this still an issue?

@BuckarooBanzay
Copy link
Member

just tried this with TenPlus1's fork of other_worlds and it does not crash anymore, however: the atmos node can now be dug: https://notabug.org/TenPlus1/other_worlds/issues/3 :/

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

No branches or pull requests

3 participants