NathaU / factorio-subsurface

https://mods.factorio.com/mod/Subsurface
MIT License
2 stars 5 forks source link

AAI miners having unexpected interactions and crashing the game #16

Closed green8751 closed 7 months ago

green8751 commented 7 months ago

_autosave2.zip

as mentioned in my issue on factorio.com, they appear to learch, and then either take damage, get instantly destroyed, or get massively acerated, what i think is happening, after a little more thought, is they are being drawn onto the "rock" they are mining, and depending on how many objects its colliding with, and how the getting pushed out happens, they either take a massive amount of damage, or get over acerated deeper past the existing walls, and then got accelerated outside the existing part of the map by collisions before/as the new pocket formed.

autosave is last one i gave, and right before the first got destroyed by driving it forward, later ones were after clearing out land to the left mostly by hand, there is ore there, which may matter, although i think i destroyed a second one in the prosses. 3rd one got yeted after telling it to move diagonally across the ore and into the wall with a path planner (not a looping path, it was just a straight line)

NathaU commented 7 months ago

First thing, I got this error when I picked the Unit Remote Controller from inventory directly after laoding the save: __Subsurface__/scripts/aai-miners.lua:34: attempt to index local 'miner_data' (a nil value) Does this affect yours too? Did you install the mod after savegame creation?

angrypidgeon123 commented 7 months ago

Yea I used a red AAI miner (in 1.0.3) and just crashed. If the code didn't change it will crash in newer versions as well. Updated the mod and now have other issues, testing...

In 1.0.7 it doesn't crash anymore but has different issues as described in original post namely:

  1. moving on the surface is very slow (1.9Km/h)
  2. mining is very fast compared to moving (100Km/h), can't tell for sure because it jitters between moving slow and mining. Mining should be slower than moving and certainly not 100 Km/h, perhaps walking speed (~6Km/h)
  3. reverse it doesn't work at all except once it went like 1000 Km/h in reverse until I hit a wall or something, probably accelerated by ongoing mining then quick reversing

I suggest uploading a working version with older code until fixing it

EDIT: I also updated AAI miner

NathaU commented 7 months ago

It has been an issue with unexpected behaviour of the friction value. At one point friction accelerates the vehicle instead of slowing it down. There will be a git commit soon. The speed depends on the miner level, mk1 will be much slower than mk5

angrypidgeon123 commented 7 months ago

Applied the changes, now mining is 1.9Km/h, making player mining virtually unplayable even with Mk4 (4.5Km/h) :D and driving is 9.5Km/h-18Km/h. Only sending miners on paths is doable

NathaU commented 7 months ago

For me it is ok, not undoable, faster with higher vehicle tiers and better fuels (try uranium fuel)

green8751 commented 7 months ago

only mod i remember adding after worldgen is trail tree farm, i am not seeing any errors in my backup of the log from before the crash