Page 1 of 1
Any Chance to animate Locomotives ...
Posted: Mon Sep 14, 2015 4:54 pm
by YuokiTani
because a setup like
directions = 128,
frame_count = 5,
line_length = 5,
lines_per_file = 8,
will not work, even if i have 640 frames in 15 sheets. if i specify frame_count = 1, it shows(drive) the locomotive correct, but without the additional 5 frame-extra-animation.
i thinked it can work same like the tanks with more frames in 1 line.
Re: Any Chance to animate Locomotives ...
Posted: Tue Sep 15, 2015 1:43 pm
by ssilk
Sounds like a valid bug report... will you create one?
Re: Any Chance to animate Locomotives ...
Posted: Tue Sep 15, 2015 2:13 pm
by YuokiTani
hmm it's not really a bug, because car(tank) and locomotive are different vehicle-entitys. but i thought it can work this way.
so it's maybe intended, not to make a animation of a locomotive beside the rotation. also maybe possible (if you only use diesel-locomotives) use a animation-layer for spinning a top-fan -> but i don't try this because i have made a steam-locomotive animation ^^.
i think it's also uncommon making these animations (15,3 MB for 1 locomotive, 5 frames pro direction = 640 frames total) - and i'am sure i can't exceed the line-length over 8 frames because 2048 px cap. this would make more problems to define this correct (not from makeing or rendering the animation).
so it's not a bug, if the locomotive-entity accept only parameter as programmed.
Re: Any Chance to animate Locomotives ...
Posted: Tue Sep 15, 2015 4:23 pm
by Rseding91
The locomotive entity doesn't currently accept an animation. As you said it would be pretty massive to animate every frame for every rotation (not impossible - just massive).
It wouldn't be hard to make trains support animations but it would probably take excessive amounts of VRAM to even make a single train animate.
Re: Any Chance to animate Locomotives ...
Posted: Wed Sep 16, 2015 3:24 pm
by YuokiTani
it's not a big difference ...
player-sheets ~ 9.8 MB
the sheets for the diesel-locomotive uses ~ 9.4 MB
my sheets for a 5 frame animated steam-locomotive uses 15.3 MB
i think in a future update factorio itself will use a bigger as 10 MB sized animation-sheet for something.
beside that its possible for every other animation go over 10 MB or 20 MB.
is this practicable or useful to have spinning wheels on a locomotive - maybe not - but for me this decide the player if he download the modification. (also a nice engine-tech-demo)
Re: Any Chance to animate Locomotives ...
Posted: Wed Sep 16, 2015 3:43 pm
by Rseding91
It's only that much larger?
You must be doing something different than what I'm thinking. If you animate a rotatable entity using sprites you'd have to have number of rotations * number of frames in the animation images.
So for a train with 32 directions and an animation of 8 frames that's 8 times the file size.
Re: Any Chance to animate Locomotives ...
Posted: Wed Sep 16, 2015 3:59 pm
by keyboardhack
Rseding91 wrote:The locomotive entity doesn't currently accept an animation. As you said it would be pretty massive to animate every frame for every rotation (not impossible - just massive).
It wouldn't be hard to make trains support animations but it would probably take excessive amounts of VRAM to even make a single train animate.
YuokiTani wrote:it's not a big difference ...
player-sheets ~ 9.8 MB
the sheets for the diesel-locomotive uses ~ 9.4 MB
my sheets for a 5 frame animated steam-locomotive uses 15.3 MB
i think in a future update factorio itself will use a bigger as 10 MB sized animation-sheet for something.
beside that its possible for every other animation go over 10 MB or 20 MB.
is this practicable or useful to have spinning wheels on a locomotive - maybe not - but for me this decide the player if he download the modification. (also a nice engine-tech-demo)
Just want to add that waitex player size is 31mb and it doesn't seem to affect performace at all. the only thing it will do is prevent some people from using the mod due to a lack of vram.
Re: Any Chance to animate Locomotives ...
Posted: Wed Sep 16, 2015 5:15 pm
by orzelek
I would guess that taking one set of frames and trying to rotate them is not possible?
That would save a lot of VRAM - not sure if it can be done and still keep graphics looking properly with stuff like shadows.
I'm working with 2D graphics on OpenGL but no animations in there so don't have personal experience.
Re: Any Chance to animate Locomotives ...
Posted: Wed Sep 16, 2015 7:25 pm
by YuokiTani
Rseding91 wrote:It's only that much larger?
You must be doing something different than what I'm thinking. If you animate a rotatable entity using sprites you'd have to have number of rotations * number of frames in the animation images.
So for a train with 32 directions and an animation of 8 frames that's 8 times the file size.
vanilla diesel-locomotive uses 256 directions (256 frames) for a 360° spin (cargo-wagon 128 and mirror)
i use only 128 directions because it's smooth enough and atm 5 frames, but 8 or 16 in 2 lines can be better - so in total i use only 640 frames (want use 128 x 8 = 1024).
a downside is of course that strict north and south direction don't need a animation, because you can't see, but in code harder so it's easier to waste this little memory.
here 2 sheets -
755 KB north and
1.01 MB east -> 15 sheets total ~ 15 MB
on the east sheet you can see the rod that connects the wheels and moves. i'am not sure if a speed multiplier like for sound can also effect the animation-speed.
you can look this
video with 7 different locomotives and 9+ different cargo-wagons - i have no problems with it
notice: i use a fixed frame-size of 256x256 px for easy fitting/positions and more frames per sheet - in trade of shorter shadows
Re: Any Chance to animate Locomotives ...
Posted: Tue Nov 08, 2022 12:08 pm
by Cyberpro_
Hi, a whie ago i made this proff of concept mod that uses a custem srcipt to make trains animateble, if you want i can explain you how it works.
https://mods.factorio.com/mod/Animated_trains It's not perfect, but it doese work.