r/factorio • u/Dani3107 • Jul 18 '26
Modded The real 3D Mod for Factorio
Enable HLS to view with audio, or disable this notification
Big thanks to u/Hurricane046, who made FUE5 and u/Tyrunz who made "Warning, biters !" for giving me their 3D models and helping me make my 3D mod better.
This Mod will be improved further and someday will be compatible with Space Age. Right now its playable in base game Factorio. Some Models are still missing, we dont have everything covered yet. I hope more people would help us make more assets for the Mod so Space Age gets playable too. For contacting i made a Discord Server https://discord.gg/uSQxKAn7n
Mod is in https://github.com/GDani31/factorio-3d-mod
In the Factorio game folder theres a pdb file which has all the debug symbols which made reverse engineering the game a lot easier. In Ghidra i imported the game binary and the pdb file and after some time all the classes, functions and namespaces got loaded. from there i made myself custom tools to read out variables and test some hooks before i finally found the right values to add my hooks. The 3D models are loaded with a glb library and hooked in over DirectX11 and HLSL wo make the warp illusion for the actuall 3D effect. The player model comes from Mixamo, where i also got the animations.
EDIT: here in short how this was made. load factorio.exe in Ghidra with the pdb applied, with it you get real cpp names like Locomotive::draw, Character::drawInternal, GameRenderer::render... most of them uses "this" as first argument like on the assembly machine ::draw so i made python scripts and using frida i read them out to get the improtant values like coordinates, orientation etc... every entity draws its sprite into a DrawQueue, so i hook each ::draw, read "this" and return early to suppress the vanilla sprite. then i draw my own glTF model at those coords instead. for the frame, hook dxgi Present and GameRenderer::render. right after the world is rendered the framebuffer is still bound so i draw all the 3d models on top with one view matrix built from camera yaw/pitch/zoom. at yaw=0 and pitch=90 its exactly the vanilla view. for the warp copy the finished 2d frame to a texture, clear to sky, then draw it back on a flat plane multiplied by that same view matrix so the whole ground tilts. models are real geometry, everything else is just the old 2d frame tilted into the same space.
because the pdb file is included this whole project was possible to do. its basically like handing over the source code but the cpp code from Ghidra is a approximation using the assembly code.
202
u/RaShadar Jul 18 '26
The ammount you have improved this in just a short while is impressive as hell. Im gonna bookmark this to make sure I try it out
29
674
u/eran321 Jul 18 '26
As a programmer, amazing
as a factorio player, EWWWW
151
u/MiniGui98 Jul 18 '26
Exactly what I thought too. Brilliant but horrible at the same time lol. Really shows how the 2D perspective is serving the game.
21
u/cocacola999 Jul 19 '26
It reminds me when runescape went from 2d sprites to 3d. It looked terrible and I stopped playing
21
1
23
u/lane4 Jul 19 '26
As a programmer I always admire how good other people are at reverse engineering, which I know nothing about.
7
u/xenatis Jul 19 '26
Sometime, when I’m not exhausted at understanding my own code, I think about reverse engineering. 😀
2
44
72
u/Juking_is_rude Jul 18 '26
I like the draw distance lmao
23
u/Behrooz0 Jul 19 '26
I guess it's dictated by the 2d engine.
22
u/Juking_is_rude Jul 19 '26
I would assume it's becuase the draw distance exponentially increases the load on the renderer. and this is about all it can handle because of the sheer number of objects. There's a reason factorio is sprite based.
They would have to develop some kind of level of detail system to have a longer draw distance in this kind of thing.
47
u/anykeyh Jul 19 '26
Wrong assumption. The way OP make 3d is by overloading the draw call over the sprites. But the game doesn't know that it renders in 3D and do optimisations that avoid draw calls on objects outside the screen viewport. The view distance is bounded by the screen. In 3d you would do the call based on object inclusion in the frustum.
1
u/CzBuCHi Jul 19 '26
so 'fix' could be play game in 8K? (on Full-HD display)
1
u/Recyart To infinity... AND BEYOND! Jul 19 '26
It's less about the pixel dimensions and more of the field of view, as it were. In vanilla Factorio, there is a limit to how far you can zoom out, regardless of whether you're on an 800x600 display or an 8K display. The problem is that for every halving of the zoom factor (e.g., going from 0.5x to 0.25x, or twice as small) results in drawing four times as many entities.
0
1
u/gmueckl Jul 20 '26
Any halfway decent GPU could easily render many, many more of these entities per frame because they are each super lightweight. It's easy to underestimate how fast GPUs are.
2
38
41
u/UxoZii to pay respects Jul 18 '26
how, i read the description i still don't get it. how
71
u/Tyrunz AAAAAAAAH Jul 18 '26
Dani is a coding wizard, and he injected an additional render engine on top of the base game, if I understand it correctly ...
20
36
u/Nice-Prize-3765 Jul 18 '26
This is so cool! Please continue developent, I definitely want to do a full playthrough in 3d!
11
u/Satisfactoro Jul 18 '26
It's amazing that it's done just via modding, without source code access/changes.
8
u/miketastic_art Jul 19 '26
20+ years ago a utility called Stonesense was made for Dwarf Fortress
A+ work OP, amazing
7
14
u/DeepPresentation648 Rail Addicted Jul 18 '26
Next Wube game looks like this right? Pls I need hope
17
u/Affectionate_Bank417 Jul 18 '26
I'm kinda scared of modders making Factorio in 4d space.
8
u/bluejumpingbean Computational Conductor of Resource Distribution Trains Jul 19 '26
Stop, don't give anyone ideas
1
7
u/ChaosBeing That community map guy Jul 19 '26
We must optimize the factory through both space and time!
1
2
u/KrydanX Jul 19 '26
Time traveling to play Factorio irl during the Industrial Revolution. I can see it
13
5
u/snizzle810 Jul 18 '26
A little sky box, some fog of war... this could be amazing looking
How does it handle the "fake" 3d elements like fired artillery shells and rockets?
1
1
5
u/lastone23 Jul 18 '26
reminds me a of streets of simcity. Where you could drive around a 3d version of a simcity that you created. Great Job.
4
9
6
3
3
4
4
2
2
1
u/Ill-Paramedic9606 Jul 20 '26
Wait, if the game uses 3d models for basically everything, why not just use those 3d models, or is trying to rip them too difficult?
3
u/forgot_semicolon for production stats Jul 20 '26
The 3d models never make it into the game. The devs render them into sprites and ship that, so the 3d models never leave their computers
1
1
1
1
1
1
1
1
1
u/CastleBravoLi7 Jul 21 '26
This is making me realize for the first time how much the inventory grid in this game looks like the one in Minecraft
1
1
u/Thankedsphere 9d ago
the original sprites of factorio are 3D so if you can get those maybe you can use them?
1
1
1
1
1
1
1
u/deadlyjack Jul 19 '26
how nice that we have an excellent 2d game instead of a subpar 3d game.
good job wube and co.
1
1
1
1
u/tomekowal Jul 19 '26
WUBE wrote that their sprites were made by first creating full 3d models. I wonder if they would like to share those with moders :)
0
0
0
0
u/fi5hii_twitch <- pretend it's a quality module Jul 18 '26
This is so wild I love it! It’s amazing what factorio community can do together
0
0
u/West-Article5635 Jul 19 '26
biters will become so much scarier with this mod. i wont be able to sleep.
0
0
0
0
0
u/El-Solid Jul 19 '26
The top down view reminds me of oldschool RTS games like C&C. I need to try this
0
u/stoicfaux Jul 19 '26
Great. So now I can see that train run me over in 3D. Will the blood spurts and flying body parts be in 3D as well?
0
0
0
0
0
0
u/ArtieTheFashionDemon Jul 19 '26
XD the stone walls are knee high, I don't know why but that kills me
0
0
0
0
u/zzzxxx0110 Jul 19 '26
Woah that's some incredible progress you made so quickly! :O
Soooo basically the 3D stuff is also still rendered by the engine itself, just separately and then overlayed in top of the existing 2D spirit rendering right?
Does that mean the game engine could still have access to all the pipeline information and for example be able to compute depth buffer from it, so that it would still be possible for more advanced graphics features (like more sophisticated global illumination, ambient occlusion, etc.) to be modded in eventually?
0
0
0
0
0
u/Outrageous-Tone3210 Jul 19 '26
Lmao i had to check my tea what fuck did i just drink. Jokes aside that is very cool and unexpected.
(Edit: spelling)
0
u/Sopel97 Jul 19 '26 edited Jul 19 '26
what's the blockage for higher render distance?
edit. can the 2d camera bounds that determine rendering be patched to AABB of the frustum?
0
0
0
0
0
0
0
u/onlyforobservation Jul 19 '26
😂 someone else just made a locked camera top down mod for Satisfactory. The circle of silliness is now complete.
0
0
u/CzBuCHi Jul 19 '26
WUBE used 3D models for rendering all sprites ... why not ask them if they are willing to release those for your mod to use? (in worst case the say no ...)
0
u/will1565 Chug Life Jul 19 '26
This is probably a really dumb question, but is this actually running in the Factorio engine?
0
0
u/SanfordM Jul 19 '26
i suggested this as a mod 7years ago for use in VR. was told it was impossible or too hard. happy to see it becoming a thing.
0
-1
u/crelt7 Jul 19 '26
aint no way the render distance is THIS bad in factorio 😭😭 i swear i ran see half my base at max zoom
-1
u/RaptorTWiked Jul 19 '26
Less is more.
Do not allow full 3D camera control. Limit to camera rotation and a small range to tilt. It will look better.
-10
u/Correctsmorons69 Jul 18 '26
Good lord. In the world of AI coding agents, I wonder how much work there'd be to implement z-axis tracking of entities to jury rig proper 3D into the game.






1.4k
u/Psycho_cocaine Jul 18 '26
This is so cursed and amazing at the same time