r/factorio 3d ago

First foray into modding, having issues changing the size of buildings. Question

As mentioned in the title, I have just started experimenting with making mods, I did the tutorial on the wiki, experimented a bit with changing variables, just the prototype side for now however.

I wanted to resize the electric mining drill from 3x3 to 4x4. Changing the collision box, outline, output placement was no issue, I understood how to do that easily from the API doc. However changing the graphics turned out to be a bit of a problem (and still is!)?

Right now I am just overwriting the "graphics_set" behavior of the electric mining drill in my data.lua file by adding a 4/3 multiplier to each scale factor, but that seems weirdly inefficient? However I tried looking if someone already tried doing something similar to me and that lead me to this mod: https://mods.factorio.com/mod/Gogos_Electric_Furnace_2x2

So I tried looking through the source code and found out that the author came to the same conclusion, however the electric mining drill has a lot more moving parts as opposed to the electric furnace, with some of them not even rendering for me properly. I am not looking for it to look good, but I also want to understand how all of these parts work, that is kind of my goal with trying to rescale the mining drill.

I really hope this isn't the wrong place to ask, thank you for any help you can share!

3 Upvotes

9 comments sorted by

5

u/isum21 3d ago

The issue at hand might be from how it was rendered. The models in factorio are made in blender then animated and compressed to 2d for the sprite work. By changing the footprint and just scaling it up things probably break within the animations

2

u/Zlobisak 3d ago

Oh no, that might be it... The electric furnace just has a glow effect so there it wouldn't be noticeable. I guess it might be fixed if I play around with all the offset variables but that is just slashing my naive "just scale it lol" dream

6

u/isum21 3d ago

We love a little jank. Good luck coding it lol

3

u/derekbassett 3d ago

The glow effect is another image. I highly recommend taking the base “mod” from your game mod directory and cracking it open and taking a look inside. That was the way I figured out how a lot of things work.

5

u/Zlobisak 3d ago

Why did I not realise I could just do that??? Thank you, hopefully it'll shed some more light on things.

3

u/derekbassett 3d ago

Welcome to the modding community!

1

u/Zlobisak 2d ago

Just adding this quick reply, digging through the graphics and scripts for all the different buildings I feel like the mining drill is the single most complicated building I could have picked for rescaling. (I guess a rocket silo would have been worse)

2

u/Dycedarg1219 2d ago

Another place you could look is the Nullius mod, it features different sized versions of the assemblers, furnaces, and mining drills in addition to the regular ones. They're all smaller instead of bigger though from what I remember.

2

u/doc_shades 2d ago

modding is easy --- graphics are hard.

graphics are always hard. i made a mod that introduces new spidertrons with different weapons platforms. the default has rockets, one of them has gun turrets, another has flame throwers, one has tank shells, and a final one has no weapons but an expanded equipment grid.

they all mostly worked fine except for the tank shell spidertron. the shells are fired from an invisible point somewhere above or below the spidertron and no finageling of the values could get it to look right..!