saaadel, the jumps described are the result of the controller not being compared prior to position in this function (and any usage of position is affected with the introduction of remote_view). changing position and physical_position wont make a difference in that vein ( i tested it ).
local adjust_follow_behavior = function(player)
local player_data = script_data.player_data[player.index]
if not player_data then return end
local count = 0
local guys = {}
if not player.controller_type == player.physical_controller_type then return end -- add here
local surface = player.surface
as for teleporting to different surfaces there is a different function for that though I have not tested it in game.
function Companion:return_to_player()
if not self.player.valid then return end
if self.player.surface ~= self.entity.surface then
return -- the old script views this as odd and terminates.
end
however a few lines down it teleports if distance is too great, so why not do the same? the script also assumes companions will be constrained to surfaces. this may be intentional but will cause problems now since adjust_follow_behavior is run per tick.
if self.player.surface ~= self.entity.surface then
self.entity.surface = self.player.surface
self:teleport(self.player.position, self.entity.surface)
I see no reason this could not also be done in the adjust_follow_behavior function....
If you want I'm on the factorio discord and can help you or the mod author make these "necessary" modifications.