animation.rotated_offset and rendering.*.rotated_target_offset

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 513
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

animation.rotated_offset and rendering.*.rotated_target_offset

Post by Mylon »

What?
Give modders the capability to make graphics render in a way that rotates properly as the entity rotates.
Why?
Cars need wheels. Wheels have to be offset, but this offset changes as the entity is rotated. rotated_target_offset would prevent this:

Image

Bilka
Factorio Staff
Factorio Staff
Posts: 3133
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: animation.rotated_offset and rendering.*.rotated_target_offset

Post by Bilka »

What is the difference between this and oriented_offset?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 513
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

Re: animation.rotated_offset and rendering.*.rotated_target_offset

Post by Mylon »

Having tinkered with oriented_offset, it doesn't seem to do what I'm intending it to.

If target and orientation_target are the same, then the rendered object isn't rotated about a point as expected. If they're different, then it's rotated about the target based on the position of rotation_target. So for example, making my road train, I can make the wheels fixed to the tank and spin around to look almost like they're under the wagon.

But oriented_offset rotates based on the orientation_target. I need something that rotates based on the target. Sprites/layers also lack this option as I could potentially bake the wheels into the car entity with a rotated_offset.

User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 513
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

Re: animation.rotated_offset and rendering.*.rotated_target_offset

Post by Mylon »

Here's an example of what I'm doing, v is the vehicle (tank), w is the wagon:
Image

What I expect to happen is the wheels to animate as the wagon rotates, but do so such that they remain at the front of the wagon, no matter how that wagon rotates.

What actually happens: The wheels neither animate nor do they move relative to the orientation of the wagon.

Alternate case:

Image
changing orientation target to the vehicle means the wheels animate as expected, but making the wheels point at the vehicle can create some strange looks when the vehicle orientation and the wagon orientation are too far apart.

Bilka
Factorio Staff
Factorio Staff
Posts: 3133
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: animation.rotated_offset and rendering.*.rotated_target_offset

Post by Bilka »

Mylon wrote:
Fri Apr 03, 2020 6:19 pm
If they're different, then it's rotated about the target based on the position of rotation_target. [..]

But oriented_offset rotates based on the orientation_target. I need something that rotates based on the target.
As you correctly stated, the animation rotates based on the position of the orientation_target. With that in mind, using the target as the orientation_target does not make any sense, because the position relative to the target will always be the same -> the offset will always be the same.

Do I understand correctly that you want everything (the animation and the offset) to rotate based on the target orientation, which is currently not possible at all?

As an aside, how do you intend to make the wheels have the correct perspective?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: animation.rotated_offset and rendering.*.rotated_target_offset

Post by darkfrei »

You are need to make it in the data stage, just one layer for the wagon, second layer for it's wheels. Or just use old graphics where it was done together.

https://mods.factorio.com/mod/LandTrains

User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 513
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

Re: animation.rotated_offset and rendering.*.rotated_target_offset

Post by Mylon »

If the horizontal position is rotated with the entity, and the vertical position is offset regardless of rotation, and the animation matches the entity it's attached to, then it should look correct. I may be able to make the wheels rotate to point at the vehicle in front so it looks neat during a turn. Maybe.

Or I could process the images to bake the wheels into the graphics.

Or I could leave them out because most people think it looks amazing with this detail missing. ¯\_(ツ)_/¯

User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 513
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

Re: animation.rotated_offset and rendering.*.rotated_target_offset

Post by Mylon »

I guess is what I want is animation_match=target so something animates as its target does. I think.

Post Reply

Return to “Modding interface requests”