RP Art Utilities


Helper functions for using RP Art mods

Internal
14 days ago
1.1 - 2.0
12.4K

g [closed] Request for more turret models if possible

1 year, 3 months ago

I love the models you have created and I am in the process of using them to replace the Rampart Arsenal turrets. Is to too much to ask if you could add some more turret models?

A shotgun turret, maybe similar to the cannon ones, but with something like a shotgun barrel
A smaller tier rocket turret, maybe with only one missile launcher pod, and maybe with no retractable animation
A gun turret with 2 barrels
A turret that could be used as a flamethrower turret maybe
A feature to select alternative colors for the icons of the turrets? That way the same model can be used in different sizes, one 2x2 and a beefier one 3x3 for example.

Some sugestions and mild criticisms:
The barrel of the only gun turret model looks kind of skinny and weak, maybe a thicker and stronger looking barrel would look better.
The turrets with 3 legs look kind of not ideal, and the placement within the selection box seems odd, to much space below. Maybe it would be better to standarize on four legs for all turrets? There seem to be enough variations in the tool you are using to generate them.

1 year, 2 months ago

Hi, I'm sorry it took a few days to answer this. Life's been stressful lately.

Thank you for the compliments, but I purchased the 3D models and then kitbashed them for this. So I can't take credit for all of it. I will say though that rendering them into factorio's format and making it modding friendly (which was entirely for my own benefit) was no easy task. It took literally hundreds of hours to get everything perfect.

Re more turret types:
I'm only making turrets as needed for my main mod, RP Warfare. I made a few extras early on like the tiny gun turret but I don't have more extras planned. Keep in mind that all turrets can be used for any type of weapon so you could use the "sniper turret" as a shotgun one or something.

Re tinted icons:
I might add support for tinting turret icons one day. It should be reasonably easy to do with my rendering framework but I haven't had a concrete reason to add it yet. One trick you can do in the meantime is to layer icons. You can create an icon with just "v2" and then layer it on top of the base icon at runtime using the icons properties. That's how I create different versions of the molten metal turrets in RP Warfare.

Re 3 legged turrets and selection boxes:
You can manually tweak the selection boxes on the prototypes. By default it uses the collision box so tall things will look a little silly. My rendering framework does not handle factorio's weird perspective correctly. It looks isomorphic to the player but it's not. This is especially noticeable on the bases of 3x3 and larger turrets.

1 year, 2 months ago

Thanks for replying. I released my mod here https://mods.factorio.com/mod/rampant-arsenal-patcher if you want to check the code. Any suggestions welcomed.

1 year, 2 months ago

I tried adding an icon to a turret using:

table.insert(turret.icons, {icon = "__rampant-arsenal-patcher__/graphics/shotgun-shell.png", icon_size = 64, icon_mipmaps = 1})

But then the icon of the other turret using the same art changes too. No idea how that is happening.

1 year, 2 months ago

And I fixed the problem with some turrets being drawn too high:

```
local function fix_animation_shift(animation, offset)
rap_log("fix_animation_shift")
animation.layers[1].shift[2] = animation.layers[1].shift[2] + offset
animation.layers[1].hr_version.shift[2] = animation.layers[1].hr_version.shift[2] + offset
animation.layers[2].shift[2] = animation.layers[2].shift[2] + offset
animation.layers[2].hr_version.shift[2] = animation.layers[2].hr_version.shift[2] + offset
animation.layers[3].shift[2] = animation.layers[3].shift[2] + offset
animation.layers[3].hr_version.shift[2] = animation.layers[3].hr_version.shift[2] + offset
if animation.layers[4] ~= nil then
animation.layers[4].shift[2] = animation.layers[4].shift[2] + offset
animation.layers[4].hr_version.shift[2] = animation.layers[4].hr_version.shift[2] + offset
end
end

local function fix_turret_shift(turret, offset)
if turret ~= nil then
rap_log("fix_turret_shift", turret.name)
fix_animation_shift(turret.base_picture, offset)
fix_animation_shift(turret.attacking_animation, offset)
fix_animation_shift(turret.folded_animation, offset)
fix_animation_shift(turret.folding_animation, offset)
fix_animation_shift(turret.preparing_animation, offset)
fix_animation_shift(turret.prepared_animation, offset)
end
end```

1 year, 2 months ago

And I fixed the problem with some turrets being drawn too high:

```> local function fix_animation_shift(animation, offset)
rap_log("fix_animation_shift")
animation.layers[1].shift[2] = animation.layers[1].shift[2] + offset
animation.layers[1].hr_version.shift[2] = animation.layers[1].hr_version.shift[2] + offset
animation.layers[2].shift[2] = animation.layers[2].shift[2] + offset
animation.layers[2].hr_version.shift[2] = animation.layers[2].hr_version.shift[2] + offset
animation.layers[3].shift[2] = animation.layers[3].shift[2] + offset
animation.layers[3].hr_version.shift[2] = animation.layers[3].hr_version.shift[2] + offset
if animation.layers[4] ~= nil then
animation.layers[4].shift[2] = animation.layers[4].shift[2] + offset
animation.layers[4].hr_version.shift[2] = animation.layers[4].hr_version.shift[2] + offset
end
end

local function fix_turret_shift(turret, offset)
if turret ~= nil then
rap_log("fix_turret_shift", turret.name)
fix_animation_shift(turret.base_picture, offset)
fix_animation_shift(turret.attacking_animation, offset)
fix_animation_shift(turret.folded_animation, offset)
fix_animation_shift(turret.folding_animation, offset)
fix_animation_shift(turret.preparing_animation, offset)
fix_animation_shift(turret.prepared_animation, offset)
end
end```

1 year, 2 months ago

Sorry about the duplicate post, it looks like "Edit" is really "Quote and post a new comment"

1 year, 2 months ago

The icons thing is because my code is foolishly returning the exact same icons object when the method is called multiple times. It should return a new copy for each one. I've been meaning to fix that...

I can't incorporate your changes to shift the animations because you're using an arbitrary offset value. I need to be able to recalculate the offset for differently-sized turrets.

The core issue there is that the game grid is rendered as if the camera is directly overhead but all the graphics are rendered at an angle. The devs are very good at hiding this discrepancy but I am not. That's why the assembly machines have a trapezoid shape, it helps hide the perspective.

1 year, 2 months ago

Re: Icons: yes I managed to fix it by deepcopying the turret icon into the item and recipe and only then doing the changes.

Re: Shift, yes, arbitrary. I only modified 2 of them. Will post images tomorrow so you can check out the before and after. The rest of the turrets are fine.

1 year, 1 month ago

I re-read the license terms of the original store and I do NOT think you can use these. I will add a DRM-esq thing to them later today.

1 year, 1 month ago

Use what? The icons? I am not including the icons in my mod.

1 year, 1 month ago

I don't think it can be used as a dependency for other mods. I'm sorry. This is lame. I was trying to be helpful.

It comes down to how the 3D model asset license can be interpreted. My mods do not include any of the original textures, data, models, etc. They include renders of them in original compositions and the data needed to animate them in Factorio's special format. It would be impossible to do simple things with them like change the camera angle or lighting angle. The question is whether the protected part is the original files or the likeness of the model. I interpreted it as protecting the original files, but I could see arguments for the other way. Unity may have updated the store license since then as well, I think I bought the first batch in ~2020.

I think if you bought your own copy of the original 3D models it would be hard to argue they were used incorrectly. That seems to fall under the "multi entity" use case. They're reasonably inexpensive, ~$100 right now and are regularly on sale.

1 year, 1 month ago

Easy solution, I add you as an author in my mod, problem solved.

New response