Renai Transportation


The most unhinged ways to transport items and yourself around your factory. Fling items around with Thrower Inserters, launch your trains off ramps, and soar through your base on electric ziplines!

Content
a month ago
0.18 - 2.1
59.9K
Transportation Logistics Trains

b crash single player

a month ago

in facrio 2.1.24 linux64 with space age enabled. always on nauvis, never left. this happened after reloading my save, on two consecutive attempts. it's happened a handful of other times in a few days. it happened while i was about 1 screen away, building and modifying in an area that had no renai entites at all. instead i was removing and adding some AAI loaders (the only AAI mod installed) and Elevated Pipes, and Merging Chests, and red belts. each day that it's happened, if i don't do whatever things i was doing that day, and just sit idle instead, the same save doesn't crash. so clearly there's some timing involved. the only overhaul-ish mod in the save is Whistle Stop Revived.

The mod Renai Transportation (2.3.5) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event RenaiTransportation::on_nth_tick(1)
RenaiTransportation/script/ThrowItemFunctions.lua:256: CustomPath requires a path and positive air time
stack traceback:
[C]: in function 'error'
RenaiTransportation/script/ThrowItemFunctions.lua:256: in function 'InvokeThrownItem'
RenaiTransportation/script/ThrowItemFunctions.lua:205: in function 'InvokeThrownItem'
RenaiTransportation/script/ThrowItemFunctions.lua:930: in function 'ResolveThrownItem'
RenaiTransportation/script/event/FlyingItems.lua:29: in function 'handle_items'
RenaiTransportation/script/event/on_tick.lua:12: in function <RenaiTransportation/script/event/on_tick.lua:9>

a month ago

In more attempts, I now have a save file that crashes 21 seconds after load while sitting idle, in 100% of attempts. Lemme know if you need it.

15 days ago

My code bot found it and wrote this patch for the crash. I haven't tested it at all, but it very likely tells what you need to know.

Root cause

Full chain, verified in the pulled copy of RenaiTransportation_2.3.5.zip:

script/ThrowItemFunctions.lua:926-930 — a thrown item lands on a tile containing a HatchRT, but the entity under it rejects the item (can_insert false — inventory full). The mod bounces it off sideways:

local bounce = math.random(10, 20)*0.1
local XBounce = FlyingItem.target.x + (bounce*math.random(-2, 2))
local YBounce = FlyingItem.target.y + (bounce*math.random(-2, 2))

math.random(-2, 2) can return 0. When both axes roll 0 (1-in-25 per bounce), the bounce target equals the start position.

ThrowItemFunctions.lua:204-205 — your save has the startup setting RT Stream Setting = false (provable from your traceback: line 205 only runs in that branch). So the bounce goes through BasicArcPath, which computes AirTime = ceil(distance/speed) = ceil(0/0.25) = 0.

ThrowItemFunctions.lua:256 — the CustomPath branch asserts AirTime > 0 and calls error(). Hard crash on on_nth_tick(1).

Why it's 100% reproducible at 21 s

Factorio's math.random state is part of the save. On reload the identical roll sequence replays, the same zero-offset bounce recurs, and the game dies at the same tick, every time. The "handful of crashes over the past few days" were the same 4%-per-bounce lottery firing live.

Your location is irrelevant: the crash happens at the flying item's landing site, wherever its arc ends — i.e. at some thrower/hatch chain in your base where the destination hatch is full and every arriving item bounces. Each bounce is another 4% roll; with a busy line, dozens of rolls per second → guaranteed crash within seconds of load. No Renai entities near where you were building is expected.

Avoidance / fix

I built a patched zip from a copy (your game tree untouched). Two minimal changes to script/ThrowItemFunctions.lua:

-- BasicArcPath: never produce a 0-tick flight
if (AirTime < 1) then
AirTime = 1
end

-- hatch-reject bounce: never bounce straight up (zero distance)
if (XBounce == FlyingItem.target.x and YBounce == FlyingItem.target.y) then
XBounce = FlyingItem.target.x + bounce
end

With the guard, a zero-distance bounce just re-resolves on the spot and re-rolls the offset next tick — invisible in play, and it also covers the other BasicArcPath caller (the "force" adjustment path).

15 days ago

alternatively you can avoid that crash by turning off the "items tumble in the air" setting (paraphrased). it avoids the crashing code block.

then you can get a different failure, one that maybe is already commonly known and left in on purpose?? if a chest overflows, hatch gets full, belt ramp keeps running, spillage happens as expected, but internal flying items counter climbs out of control, soon killing UPS, maybe crashing out eventually, i didn't stay that long.

15 days ago

btw LOVE THE MOD! thx for doing this. i always use it and avoid playing without it. mostly the throwers, bouncers. maybe a belt ramp here & there.

New response