SpriteParameters::rotation

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 391
Joined: Tue Jul 08, 2014 10:06 am
Contact:

SpriteParameters::rotation

Post by LuziferSenpai »

Hey,

it would be nice if we could define a rotation for a sprite, so that we dont need to provide different angles or rotations of something.
I personly would use this for a mod, that would automaticly make 3 more equipment pieces for each one, for each direction.

Another use case:

When doing new pipe visualizations, I could just do the dot in the middle and then one arm at the top.
After that, I can easily just rotate the arm as I need, so with that I would reduce file size.

For example:
visualization-arm-north.png
visualization-arm-north.png (674 Bytes) Viewed 368 times
Would turn into this, with a rotation of 1 or something like that.
visualization-arm-east.png
visualization-arm-east.png (4.98 KiB) Viewed 368 times
Greetz,

Luzifer
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai
User avatar
Oktokolo
Filter Inserter
Filter Inserter
Posts: 894
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

Re: SpriteParameters::rotation

Post by Oktokolo »

That's a nice modder QoL feature and could also help make big mods with tons of animations less of a VRAM hog.
Should probably be an angle in radians for easy scripting in prototype phase.
User avatar
ElectroMagnetic
Burner Inserter
Burner Inserter
Posts: 17
Joined: Fri Jan 10, 2025 10:57 pm
Contact:

Re: SpriteParameters::rotation

Post by ElectroMagnetic »

+1 good idea
Quality spoilage :any-quality:
Feel free to move my posts or declare them off topic(I won't get mad)
I overuse parentheses(If you couldn't tell) :D
I'm still stuck automating chem. science (This signature will be updated as I progress)
Muche
Smart Inserter
Smart Inserter
Posts: 1006
Joined: Fri Jun 02, 2017 6:20 pm
Contact:

Re: SpriteParameters::rotation

Post by Muche »

Wouldn't that trade lower VRAM usage for higher CPU/GPU processing usage, i.e. lower FPS?
I mean, something has to rotate those pictures at some point in time.
Kiplacon
Burner Inserter
Burner Inserter
Posts: 14
Joined: Tue Jan 16, 2018 8:14 pm
Contact:

Re: SpriteParameters::rotation

Post by Kiplacon »

Muche wrote: Mon Feb 03, 2025 10:53 pm Wouldn't that trade lower VRAM usage for higher CPU/GPU processing usage, i.e. lower FPS?
I mean, something has to rotate those pictures at some point in time.
The main benefit is that you could make more flexible graphics with just one sprite instead of making unique sprites for everything. You would still be loading the rotated frames while the game is loading, so performance-wise it's theoretically all the same once the game is running. The idea is that it'd be a procedural alternative to making unique sprites for every application. One example is that I want to make an animation that's just a sprite spinning around its center. Right now I would have to make a sprite sheet that has every frame of rotation I want for the animation. If I could instead specify that frame X of the animation is the given sprite rotated 10 degrees times X repeated for 35 frames, it would make simple animations and sprites like this more flexible.
User avatar
Oktokolo
Filter Inserter
Filter Inserter
Posts: 894
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

Re: SpriteParameters::rotation

Post by Oktokolo »

Muche wrote: Mon Feb 03, 2025 10:53 pm Wouldn't that trade lower VRAM usage for higher CPU/GPU processing usage, i.e. lower FPS?
I mean, something has to rotate those pictures at some point in time.
GPUs are optimized to rotate, skew, and stretch texture coordinates while applying them to planes in a 3D space. No need to use the CPU for that. Just have the sprite's plane rotate, and the GPU will do the same it does now. There is no hardware optimization in the GPU for the edge case of someone making a 2D game.
curiosity
Filter Inserter
Filter Inserter
Posts: 616
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: SpriteParameters::rotation

Post by curiosity »

Post Reply

Return to “Modding interface requests”