Bulk Teleporters

by dorfl

Use spare gigajoules to teleport shipments of items.

Content
3 years ago
0.17 - 1.1
1.99K
Logistics

g Comportible in mod Space Space Exploration?

5 years ago
(updated 5 years ago)

I haven't had time to test this myself yet, but the main problem that I can't fix on my end is that teleporters on different surfaces don't understand interplanetary distances and assume a short distance (maybe based on surface-relative positions).

My proposed solution for this is that you implement a remote interface call to see if any mods can return specific values for surface-to-surface distances. Something like:
-- make a cache table for distances that don't change, should be cleared on configuration changed
global.cache_surface_to_surface_distance = {}

-- when trying to find a surface to surface distance check interfaces for a surface distance implementation
-- surface_from and surface_to are the surface index numbers
if global.cache_surface_to_surface_distance
and global.cache_surface_to_surface_distance[surface_from]
and global.cache_surface_to_surface_distance[surface_from][surface_to] then
return global.cache_surface_to_surface_distance[surface_from][surface_to]
end
local result
for interface, functions in pairs(remote.interfaces) do
if functions["bulkteleport_get_surface_to_surface_distance"] then
local interface_result = remote.call(interface, "bulkteleport_get_surface_to_surface_distance", {surface_from=surface_from, surface_to=surface_to})
if interface_result and interface_result.distance then
if result == nil or interface_result.distance > result.distance then -- use higher value then
result = interface_result
end
end
end
end
local distance = 0
if result and result.distance then
distance = result.distance
if result.cache == true then
global.cache_surface_to_surface_distance[surface_from] = global.cache_surface_to_surface_distance[surface_from]
or {}
global.cache_surface_to_surface_distance[surface_from][surface_to] = distance
end
end

You could potentially extend this sort of system to store data with flags, such as whether the relative positions should be considered (for close parallel surfaces like underground).

5 years ago

Makes sense.

Will have to think about scaling cost for interplanetary distances too. Currently this mod adds a set of teleport recipes with linearly scaled energy_required per kilometre. After 10km it stops scaling because that's already larger than most bases. Interplanetary teleporters might need a special entity with a more expensive set of recipes.

5 years ago

Yes that would make sense.
Currently you need rockets to automatically transfer resources between surfaces and they have a variable fuel cost. The costs can vary a lot, fairly small from planet to orbit, but huge if you're going from distant stars.
For teleporters the entities/costs could probably be grouped into 3 bands: Planetary system (the planet, orbit, moons), Solar system (other planets), and Interstellar. The entity could potentially work like a capacity storing energy and activation_resources, trigger when full and only use a % based on the actual distance.

5 years ago

For now -- because I'm slow :-) -- the latest release simply disables cross-surface teleportation. Dematerializers now refuse to target rematerializers on other planets.

5 years ago

latest version cannot be loaded with space exploration

5 years ago

I had to tweak Space Exploration incompatibility checks in order to test with Bulk Teleporters. It's Earendel's call to determine when to enable BT by default, or at all :-)

5 years ago

hope you will get this fixed... would be a nice alternative to using rockets to send items :) if not too expensive in power ;)

2 years ago

I can still sorta get this to work (haven't tried actual teleporters yet but at least the game starts) but I struggle to detach the technology from SE meddling.
While I understand the point of moving teleportation into the deep lategame I just can't into train setups and use the teleporters there.
Getting the mod to run and the teleporters out of the teleport technology was easy enough (for the latter I just commented out the patch in the postprocesses mod) but for some reason, there's a very persistent Deep Space Science Pack 4 that I can't get away. Any suggestions for that?

2 years ago

@Zahnfeechen You need to disable certain lines in the core mod and post-processing aswell. In general use a tool like NotePad++ to look for all the keywords. ( eg "Teleport"). It's 100% doable.

New response