One slug. Every biter in the line. Bring a lot of batteries, and a lot of ammo.
Heads up: I made this mod with a lot of help from AI. Claude wrote most of the code and text, and the thumbnail and icons are AI-generated. The streak and fog are drawn by script, and the sound was cut from a licensed stock clip. I direct, playtest and tweak every update myself.

Personal Railgun is a 4x4 endgame armor module: a white and gold power pack with a twin-rail cannon on a swivel arm. Every few seconds it looks at every enemy within 50 tiles, works out which line would pass through the most of them, and fires a slug down it. Everything on that line takes the full hit, no matter how far away: a pack of biters, the nest behind them and the worm behind that.
It's slow, it's brutal and it's very expensive to run. Every shot costs a round of railgun ammo and a big chunk of your suit's energy, and the railgun keeps drawing power even when there's nothing to shoot.
How it works
- Automatic: fires on its own at enemies within 50 tiles, once every 3 seconds. No aiming.
- Piercing, no falloff: 1000 physical damage (200 base × 5) to every enemy the slug passes through, all the way out to 50 tiles, boosted by damage research (see below).
- A 2.5-tile-wide slug: anything with any part inside that strip gets hit, so big targets like nests are easy to catch. The streak you see runs right down the middle of it.
- Ammo: every shot uses one round of railgun ammo from your inventory (see Ammo below).
- Power: 5 MJ per shot, from a 6 MJ buffer that recharges at up to 5 MW, plus a constant 150 kW drain while it sits in your grid, shooting or not. Bring big batteries and a serious power source.
- Look and sound: a thin, bright white-blue streak that fades in at the muzzle and out toward full range, leaving a pale trail of fog that drifts apart on the wind, with a heavy crack on every shot. Wider slugs get a wider glow and fog trail.
Smart targeting
The railgun doesn't just shoot the closest biter. Before every shot it tries a line toward each of the nearest enemies, counts how many enemies each line would pass through, and fires down the line that hits the most. Ties go to the closer enemy.
In practice that means it picks out the conga line of biters chasing you, lines up a nest with the worms behind it, and skewers whole packs at once instead of wasting a 1000-damage slug on one small biter.
Ammo
Every shot needs one round of railgun ammo as well as power. The railgun takes it straight from your main inventory, or from the trunk when it's fitted in a car, tank or spidertron. Put the ammo on your quickbar to keep an eye on how many shots you have left.
Which ammo it uses depends on your mods:
| Playing with | Ammo | Shots per item |
|---|---|---|
| Space Age | Railgun ammo | 1 |
| Space Exploration | Railgun ammo (Space Exploration's) | 4 |
| Neither | Railgun slug (added by this mod) | 1 |
Out of ammo? The railgun dims in your equipment grid and shows the red no-ammo icon, just like the Personal Rocket Launcher Equipment. It stops firing, but it keeps drawing its 150 kW, so don't leave an empty one in your suit. It springs back to life within a second of picking up ammo.
The railgun slug is an endgame round: 4 explosives, 4 plastic bars and 4 low density structures (16 s). It only exists when you're playing without Space Age or Space Exploration, so it never doubles up with their railgun ammo.
Research and damage bonuses
| Playing with | Unlocked by | Damage boosted by |
|---|---|---|
| Space Age | Railgun, alongside the railgun turret | Railgun damage research |
| Space Exploration | Railgun (Space Exploration's) | Space Exploration's railgun damage bonus (from physical projectile damage 6 and up) |
| Neither | Personal railgun, after Personal laser defense and Military 4 (500 × red, green, military, blue, purple and yellow science) | Physical projectile damage research |
The railgun itself is deliberately expensive in every setup:
| Recipe | Ingredients | Made in |
|---|---|---|
| Personal railgun | 2 personal laser defense, 50 processing units, 25 low density structures, 1 personal battery MK2 | By hand or any assembler |
| Railgun slug (without Space Age or Space Exploration) | 4 explosives, 4 plastic bars, 4 low density structures | By hand or any assembler |
One per grid (by default)
The railgun is a one-of-a-kind piece. Place a second one in the same grid and it's handed straight back with a warning: "Structural integrity reached. Configure in map settings."
Want a full railgun suit? Turn on Allow more than one railgun per grid in the map settings. Every railgun in the grid then fires, taking turns, so you get a rapid string of shots instead of one at a time. Your batteries and your ammo supply won't thank you.
Your armor and the vehicle you're driving each count as their own grid, so a railgun in each will both fire.
Nest eraser
Want to do something silly? The damage multiplier goes up to 10× and the slug width goes up to 50 tiles, both in the map settings, mid-game. Set 10× and 20 tiles wide and every shot erases a whole strip of biter base: 2000 damage (before research) to everything in a road-wide path, 50 tiles long. Each shot still costs one round and 5 MJ.
Settings
Map settings (can be changed mid-game):
| Setting | Default | What it does |
|---|---|---|
| Allow more than one railgun per grid | Off | Off: a second railgun in the same grid is handed back. On: every railgun in a grid fires, taking turns. |
| Damage multiplier | 5× | 1× to 10×. Multiplies the base damage: 5× is 1000 per shot, 10× is 2000, before research bonuses. |
| Slug width (tiles) | 2.5 | 0.5 to 50. How wide a strip each slug tears through. Smart targeting picks its lines using this width. |
Startup settings (need a restart):
| Setting | Default | What it does |
|---|---|---|
| Base damage per shot | 200 | Physical damage before the damage multiplier and research. |
| Range (tiles) | 50 | How far it looks for enemies and how far each slug travels. |
| Seconds between shots | 3 | Time between shots for each railgun. |
| Energy per shot (MJ) | 5 | Energy each shot takes from your armor. |
| Idle drain (kW) | 150 | Power each railgun draws constantly while it's in a grid. |
Performance
Dirt cheap. The railgun only does real work at the moment it fires: the rest of the time it's a quick check of your grid a few times a second. In testing it peaked at about 0.02 ms per tick, even mid-fight.
Made with AI
AI was used heavily in the production of this mod. The code, documentation and this description were written with Claude (Anthropic's AI assistant). The equipment icon, railgun slug icon, technology icon and thumbnail were generated with Grok. The streak and fog are drawn by script, and the sound was cut from a licensed stock clip. I direct the design, and every version is played, tested and tuned in-game by me before it's released.
Compatibility
- Made for Factorio 2.1.
- Space Age (optional): uses Space Age's railgun ammo, unlocks with the Railgun research and gets Railgun damage research.
- Space Exploration (optional): uses Space Exploration's railgun ammo (all 4 rounds of each one), unlocks with its Railgun research and gets its railgun damage bonus.
- Works on its own too, with its own research and the railgun slug.
- Fits any equipment grid that takes armor modules, plus vehicle grids from overhaul mods that add them. In a vehicle, ammo comes from the vehicle's trunk.
- Fires for the player's armor and the vehicle they're driving. Parked vehicles and remote-driven spidertrons don't fire yet; ask in the Discussion tab if you'd like that.
Credits
- The equipment icon, railgun slug icon, technology icon and thumbnail were made with AI image generation (Grok).
- The streak and fog trail were made procedurally for this mod.
- The shot sound was cut from an Envato Elements asset ("Steampunk Weapons - Tube Gun - shot03"). The sound file is used under the Envato Elements licence and is not covered by the Unlicense.
Source
Code released under the Unlicense (the sound file stays under its Envato Elements licence): https://github.com/afewvowels/WePlayRailgunEquipment
More WePlay mods
Like big personal firepower? Try these too:
- WePlay: Personal Tesla Defense Equipment: a 2×2 armor module that fires chain lightning at nearby enemies. Its custom arcing script makes bolts thrash, fork and follow moving targets, in your pick of six color palettes.
- WePlay: Phase Disruptor: armor equipment that locks wild, wandering energy streams onto nearby enemies. Just don't cross the streams.
- WePlay: Personal Rocket Launcher Equipment: a 3x3 armor module that automatically fires rockets at nearby enemies, loading them straight from your inventory.
See all my mods on my mod portal page.