LuaPlayer::set_controller -> cutscene: Option to remove or control movement 'curve', eg to make movement speed linear.

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
TheBloke
Fast Inserter
Fast Inserter
Posts: 123
Joined: Mon Dec 03, 2018 2:48 am
Contact:

LuaPlayer::set_controller -> cutscene: Option to remove or control movement 'curve', eg to make movement speed linear.

Post by TheBloke »

I'm enjoying using LuaPlayer::set_controller { type = defines.controllers.custscene ... } to create movements around the map. I'm currently using it to create transitions and visual effects for some video tutorials.

I'm running into one issue: the cutscene controller always applies a 'curve' to the movement speed. It does not move linearly, but moves slower at the start and end of each movement. This is called "easing" in software like After Effects and Bender; the cutscene controller is in effect applying an ease-in at the start of the movement and an ease-out towards the end.

This is making it more difficult for me to integrate certain cutscene movements into my videos in an ideal (read: anal) way. Because the movement is not a linear speed, it becomes more complex for me to match the speed of the cutscene movement to other movements happening in my footage, or to apply my own movement curve.
Request: add option to waypoints table of cutscene controller to make movement linear
A simple solution would be to add a new field to the waypoint table :

Code: Select all

linear_movement = boolean.  Default false.

Example usage: 
set_controller { type = defines.controllers.cutscene, waypoints = { 
    { position = {0,0}, transition_time = 10, time_to_wait = 240, zoom = 0.001 },   
    { position = {0,0}, transition_time = 360, time_to_wait = 120, zoom = 1.7, linear_movement = true } 
  }, chart_mode_cutoff = 0.4, final_transition_time = 60 
}  
  • False = same behaviour as now, with an ease-in and ease-out always applied according to current logic.
  • True = This movement is linear. If I pan a distance of 1000 tiles in 10 seconds, it moves 100 tiles each second. If I zoom from 0.1 to 1.0 in 3 seconds, the zoom changes 0.3 each second.
This would allow me to set movements to linear when I wanted a greater degree of control over movement speed, which I could achieve externally by varying the speed of my recorded footage.

In fact, having the ability to set individual movements to be linear would also allow users some ability to create their own custom movement curves, even without external editing software. By chaining together multiple linear_movement waypoints of varying durations, the user could in effect approximate any animation curve. For example, if I wanted to move 1000 tiles with a long ease-out, I could specify waypoint 1 to move 800 tiles in 2 seconds, then waypoint 2 to move 200 tiles in 4 seconds. The smoothness of the curve could be improved by adding even more waypoints. That can't be achieved acceptably at the moment because of the baked in easing on each waypoint.


Thanks very much.

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: LuaPlayer::set_controller -> cutscene: Option to remove or control movement 'curve', eg to make movement speed linea

Post by posila »

Hello, your request is not invalid, I am here to just give you well-meaning unsolicited advice.

You don't need cutscene controller. You can just hige all gui and teleport god controller (or some other controller) around. That's how the trailer was made. And even though there was easing in the 2016 version of the trailer, it was all done Lua side. (Little bit of trivia: the original, 2014 version was much easier to sync movement with items on belt as they were entities back then and Lua side it could just rememenber reference to one item-entity and teleport to its position every tick)

User avatar
TheBloke
Fast Inserter
Fast Inserter
Posts: 123
Joined: Mon Dec 03, 2018 2:48 am
Contact:

Re: LuaPlayer::set_controller -> cutscene: Option to remove or control movement 'curve', eg to make movement speed linea

Post by TheBloke »

Hi posila,

Thanks a lot for taking the time to reply. Advice from you is never unsolicited :)

Yes of course, this is what I should have already tried. For some reason I thought it wouldn't be as smooth as the cutscene controller provides, and that replicating chart_mode_cutoff might be a problem. But now I've actually experimented with it I see it can work perfectly.

It just goes to show how easy it is to get focused on the wrong thing. A couple of weeks ago I went as far as to spend time learning about and experimenting with After Effects' motion tracking system, just so I could keep some layers static on top of Factorio footage that was recorded with the cutscene controller and its eased movement. Oh well, at least now I have some experience of using that tool! :)

That's cool to hear how you made the trailers, they're really good.

Regarding my request: I will definitely now work around it by re-creating the moves with my own linear code. I think the request would still be useful in general, as it'd be neater and cleaner for any future user to be able to use the cutscene controller for all moves, without needing their own code. But as it's not hard to work around it, it's for sure only really a nice-to-have. I'm sure there are more important things that could be worked on before this, especially as it's kind of a niche request anyway.

Thanks again.

XYZT
Inserter
Inserter
Posts: 28
Joined: Fri Jun 07, 2019 3:40 pm
Contact:

Re: LuaPlayer::set_controller -> cutscene: Option to remove or control movement 'curve', eg to make movement speed linea

Post by XYZT »

posila wrote:
Thu Oct 10, 2019 9:41 am
You can just hige all gui and teleport god controller (or some other controller) around.
Hi, can you elaborate on how one can hide all GUI while using the god controller?

Post Reply

Return to “Modding interface requests”