Automatic artillery train

Smart setups of railway stations, intelligent routing, solutions to complex train-routing problems.
Please provide - only if it makes sense of course - a blueprint of your creation.
User avatar
Hares
Filter Inserter
Filter Inserter
Posts: 582
Joined: Sat Oct 22, 2022 8:05 pm
Contact:

Automatic artillery train

Post by Hares »

Sharing my design of automated patrolling artillery train.
Train goes from one artillery position to another until it runs out of ammo, prioritizing train stops it has not visited for longest time.
Blueprint
12-22-2024, 19-06-38.png
12-22-2024, 19-06-38.png (2.59 MiB) Viewed 388 times


How it works?
Pretty damn simple, by the way.
Due to 2.0 train system engine limitation (see: 118475: [2.0.12] Train does not move between stops with same name (MR)), train schedule is required to have stops with different names to advance in the schedule, that's why schedule (and each artillery position) contains "Approach" and "Fire Position" stops tight together. Each "Fire Position" stop has a timer which resets when the train is parked, and increases both stops priority over time (default configuration: +1 priority per minute -- see configuration section below for details).

Train waits on the firing position until it runs out of ammo, or until certain inactivity period has passed. After that, it decides to either go home or visit another artillery position. It will go home if:
  • It is low on fuel (see p.3 in Usage)
  • It is completely out of ammo
  • No artillery position train stops are available
Otherwise, it will visit another artillery position based on priority which represents time since artillery train visited it. "Approach" and "Fire Position" share train limits (==1) and priority, but only the latter will reset the memory cell.

Technically, this system can support multiple artillery trains, but the system was never tested for that. That will require additional adjustments to the rearming train stop including but not limited: adding extra reload stations, adding enabled conditions, setting dynamic limits, and/or adding depotting/waiting bays for it.

Usage
  1. Deploy train & train reload station (they are on the same blueprint). Train comes with schedule & reload interrupt.
  2. Make artillery as long as your rail system can handle (I personally use 1-4-1 train stops, but this system would work with any design). Add inserters to load artillery shells.
  3. Adjust refueling logic to match your rail system. Currently, the train is configured to refuel at specific refueling train stop, but you can refuel it on the hub and merge two interrupt conditions.
  4. Deploy artillery position train stops in the safest spots of your outposts or perimeters as these train stops come with no defense.
  5. Let the fun begin!
Configuration
12-22-2024, 19-24-08.png
12-22-2024, 19-24-08.png (381.2 KiB) Viewed 388 times
This constant combinator uses logistical groups to allow bulk edits of configuration within the entire savefile, and comes with two options:
  • K signal. Defines time interval (in ticks) after which priority of train stop increases.

    Code: Select all

    Priority = <Ticks since train left station> ÷ K
  • T signal. Any non-zero signal here will reset the system -- all priorities will be reset; and artillery train will finish its route and might after that return home.
Last edited by Hares on Mon Dec 30, 2024 2:31 am, edited 2 times in total.
Berndie
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Dec 20, 2023 4:52 pm
Contact:

Re: [2.0.28] Automatic artillery train

Post by Berndie »

I use a closed ring of artillery outposts with overlapping range which are defended. First i don't want pollution strengthen the red ones, second i don't want my factories/mining outposts to draw their attention. Another experience is, that a few rounds now and then "invites" only a few unwanted guests at a time. So defense is easy.

As in SA cannons are more expensive your way of transporting them where they are needed is very convenient. But the best in my eyes is your idea of increasing the priority by time - a perfect solution as the enemies need only attention once in a while. Not too much to create problems at the cannons firing places, not too little to allow them to settle/walk "through" the protected area.

I hope this also helps with the enormous amount of rounds needed when firing range increases from time to time, so that at none of the outpost has too long periods without ammunition. Without this distribution the artillery outposts need a lot of ammunition at the same moment so all are served (repeatedly) within time.

So i will need a logic to discharge only a small number of rounds at every outpost ...
Tertius
Smart Inserter
Smart Inserter
Posts: 1023
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: [2.0.28] Automatic artillery train

Post by Tertius »

Hares wrote: Sun Dec 22, 2024 4:37 pm Due to 2.0 train system engine limitation (see: 118475: [2.0.12] Train does not move between stops with same name (MR)), train schedule is required to have stops with different names to advance in the schedule
This is not necessarily true, here is proof of concept all your outposts definitely all can have the same name and just 1 station, and a train is driving from outpost to outpost and returns to the base only to refill an empty inventory: viewtopic.php?p=651772#p651772

The crucial thing is to set train limit to 1 or 0 to signal a station is requesting a train or not. It doesn't work if you enable/disable the station, although the devs said disabling a station is the same as setting the train limit to 0.
User avatar
Hares
Filter Inserter
Filter Inserter
Posts: 582
Joined: Sat Oct 22, 2022 8:05 pm
Contact:

Re: [2.0.28] Automatic artillery train

Post by Hares »

Tertius wrote: Mon Dec 30, 2024 12:12 am The crucial thing is to set train limit to 1 or 0 to signal a station is requesting a train or not. It doesn't work if you enable/disable the station, although the devs said disabling a station is the same as setting the train limit to 0.
Not exactly. There's second condition for that to be true -- have the station to be configured as interrupt. It won't work if the station is within the schedule.
Tertius
Smart Inserter
Smart Inserter
Posts: 1023
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Automatic artillery train

Post by Tertius »

Ok, then use the interrupt instead of static schedule, if it only works this way.

However, the train operation within the game engine is not perfectly right. If you thoroughly inspect the train behavior, you will see it goes to sleep if every outpost station has limit 0. This is expected. But if one station opens up with limit=1, the train doesn't just wake up and proceed to that station. Instead, it performs its local task again on the current closed station (artillery shooting, then waiting for inactivity in the example), and only then it will proceed to the other open station with the newly created temporary schedule.

I guess this is why the interrupt works, and a static schedule not: at one time there is no entry in the schedule for the current station if used with interrupts. In this scenario, it's good and welcomed behavior the train goes to the next open station, but it's probably more coincidence within the game engine that this works.

I hope it gets fixed in some future update that this behavior is explicitly made so. It's a feature with no downside. And that it will perhaps work the same with deactivated stations as well, since it's strange that deactivating stations doesn't work this way but train limits does.
User avatar
Hares
Filter Inserter
Filter Inserter
Posts: 582
Joined: Sat Oct 22, 2022 8:05 pm
Contact:

Re: Automatic artillery train

Post by Hares »

I think we just need "Allow visitting current station" or "Ignore currently stopped" checkbox.
Post Reply

Return to “Railway Setups”