FaceDeer / dfcaverns

Replicating Dwarf Fortress' underground flora in Minetest
Other
16 stars 9 forks source link

Crash with df_farming #5

Closed ghost closed 5 years ago

ghost commented 5 years ago

Haven't looked into this yet, just now starting to get into this mod, but am posting the relevant bits here for your information:

2019-02-26 12:28:39: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'df_farming' in callback LuaABM::trigger(): ...../games/Glitchtest/mods/dfcaverns/df_farming/plants.lua:210: attempt to compare nil with number
2019-02-26 12:28:39: ERROR[Main]: stack traceback:
2019-02-26 12:28:39: ERROR[Main]:       ...../games/Glitchtest/mods/dfcaverns/df_farming/plants.lua:210: in function <...../games/Glitchtest/mods/dfcaverns/df_farming/plants.lua:205>

Unrelated, but I still have to read through guide.md and readme.md and make adjustments like, how to remove lava so it doesn't spawn in caverns, if that's possible. For the longest time I had nocaverns on in mgv7_spflags, so I never saw any dfcaverns! Whoops. :D Thanks for this mod, it's very interesting so far.

ghost commented 5 years ago

@FaceDeer

ghost commented 5 years ago

Well I did:

if not node_def.groups.light_sensitive_fungus then return end

and that at least stopped my server from crashing.

FaceDeer commented 5 years ago

A strange crash! That line of code is inside an ABM that should only be triggering for nodes that are part of the light_sensitive_fungus group. So it's contradictory that a node would trigger this ABM and yet have nil for that in its definition. Adding a guard against this eventuality is fine, though, I'll add it to the source (with a slight tweak to avoid looking it up twice for efficiency, always best to keep that in ABMs since they can get called a lot).

There's a couple of ways to prevent lava generation, I should add note of this to the documentation if it's not already in there. The simplest would be to set the mgv7_lava_depth mapgen parameter to -2800 (or wherever you've set the level of the magma sea), this will prevent mapgen from placing blobs of lava in places where it could set fire to anything. Blobs of lava spilling into the underworld layer seems perfectly reasonable to me. :) You may also want to look into the "magma conduits" mod, which I co-developed alongside df_caverns and I think goes quite well with it; it offers more realistic (and spectacular) veins and pipes of magma and df_caverns knows how to "plug" those veins with obsidian when they get close to places they shouldn't be.

the nocaverns flag should actually have no impact on df_caverns, the subterrane mod already forcibly disables default giant caverns in mapgen v7 because the caverns it makes would intersect and conflict with the default mapgen caverns. If default mapgen caverns are being generated anyway then that might actually be a bug I'll need to track down. Are you seeing any giant caverns appearing that have no decor aside from the stalactites and stalagmites that get put in the default tunnels?

ghost commented 5 years ago

I think it was because I had already started the map before adding subterrane, and while mgv7_spflags setting was correct in minetest.conf, it was still set to nocaverns inside map_meta.txt

Thanks for the reply, and the tips you gave me!

On Tue, Feb 26, 2019 at 10:11 PM FaceDeer notifications@github.com wrote:

A strange crash! That line of code is inside an ABM that should only be triggering for nodes that are part of the light_sensitive_fungus group. So it's contradictory that a node would trigger this ABM and yet have nil for that in its definition. Adding a guard against this eventuality is fine, though, I'll add it to the source (with a slight tweak to avoid looking it up twice for efficiency, always best to keep that in ABMs since they can get called a lot).

There's a couple of ways to prevent lava generation, I should add note of this to the documentation if it's not already in there. The simplest would be to set the mgv7_lava_depth mapgen parameter to -2800 (or wherever you've set the level of the magma sea), this will prevent mapgen from placing blobs of lava in places where it could set fire to anything. Blobs of lava spilling into the underworld layer seems perfectly reasonable to me. :) You may also want to look into the "magma conduits https://github.com/minetest-mods/magma_conduits" mod, which I co-developed alongside df_caverns and I think goes quite well with it; it offers more realistic (and spectacular) veins and pipes of magma and df_caverns knows how to "plug" those veins with obsidian when they get close to places they shouldn't be.

the nocaverns flag should actually have no impact on df_caverns, the subterrane mod already forcibly disables default giant caverns in mapgen v7 because the caverns it makes would intersect and conflict with the default mapgen caverns. If default mapgen caverns are being generated anyway then that might actually be a bug I'll need to track down. Are you seeing any giant caverns appearing that have no decor aside from the stalactites and stalagmites that get put in the default tunnels?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/FaceDeer/dfcaverns/issues/5#issuecomment-467706644, or mute the thread https://github.com/notifications/unsubscribe-auth/AWXKYmQVDqLNV3ulUOYadn5D1oXJ179Lks5vRfdpgaJpZM4bSt-R .

FaceDeer commented 5 years ago

No problem. I've submitted code that should theoretically prevent that crash if it comes along again, so I'm going to close this issue.

If you have any non-technical feedback, though, by all means I'd love to hear some of that too. I may be too close to my work to have a good feel for how dfcaverns works on an aesthetic player-facing level. Caverns too sparse, or too crowded? Any particular cavern types need improving or tweaking? Got ideas for things you'd like to see added? General stuff like that may work better on the minetest forum thread for this mod, but figured this was a good opportunity to ask. :)