Page 1 of 1

How do i make animations for entities like car?

Posted: Tue Jul 21, 2015 11:39 am
by FurtherV
I don't know anything about Blender,Cinema4D or Photoshop.

I can program but I can not draw well.

Now how do i make animations for entities like a car?

And how can I rotate textures?

for Example this texture for a tank:

http://www.pic-upload.de/view-27754951/tanki.png.html

Re: How do i make animations for entities like car?

Posted: Tue Jul 21, 2015 5:43 pm
by johanwanderer
Animation works like GIF's, in that you have multiple frames within the image itself (say your image is 200x200, and each frame is 50x50 => 16 frames). The animation is simply a constant switching of successive frames. You can draw each frame by hand if need to.

Re: How do i make animations for entities like car?

Posted: Tue Jul 21, 2015 5:58 pm
by FurtherV
And for a entity like a car i only need to rotate?

Re: How do i make animations for entities like car?

Posted: Tue Jul 21, 2015 6:13 pm
by johanwanderer
Look at the car's entity in data/base/prototypes/entity/entities.lua

It defines the car as having 64 separated directions (broken into 3 files, car-1.png, car-2.png, car-3.png). Each direction has 2 frames of animations (left and right column in each image.)

If I were to do this by hand, I would:
  • Draw the base image for one direction. Save that as a base image, says, img1-1.
  • Draw the animation frames for that direction. Save each frame as an image, says, img1-2 through img1-5
  • Use a graphic program (GIMP, or a command line tool like ImageMagick etc.) to rotate each of those image and produce a new set for each direction.
  • You will end up with frames * directions number of images.
  • Use the same tools to concatenate the images together, horizontally for the frames, and vertically for the directions.
If the resulted file gets too large/unwieldy, you can break it down to smaller stripes like in the car example.

I would probably start out with a smaller amount of frames and directions (maybe 1 frame, 8 directions) before making it really complicated.

Re: How do i make animations for entities like car?

Posted: Tue Jul 21, 2015 6:57 pm
by FurtherV
I think i understand but why is in the car example everything twice? Is this important?

And can i leave space beetween the frames?

Re: How do i make animations for entities like car?

Posted: Tue Jul 21, 2015 7:38 pm
by johanwanderer
FurtherV wrote:I think i understand but why is in the car example everything twice? Is this important?

And can i leave space beetween the frames?
I think that was the animation. The car is actually animating, but there is no differences between the two states. One thing to try (make backup first) is to color everything on the right blue and see if the car flips from white to blue.

As for space between frames, I don't quite understand your question. If each frame is width-x-height pixels, joining them together will simply put the frames together (as in the car pictures). If you like to clearly delineate the frames (i.e. have vertical and horizontal lines to separate them), you may be able to do that using the animation offsets so it skips some part of the frame. I have never done it, so I can't say much more about it.

Re: How do i make animations for entities like car?

Posted: Tue Jul 21, 2015 7:49 pm
by FurtherV
Ok thanks :D

Do you know how I can mix the images together with ImageMagick for Windows?

Re: How do i make animations for entities like car?

Posted: Tue Jul 21, 2015 8:45 pm
by orzelek
Car also has the player color mask somewhere - it's also part of animation I guess. Haven't checked that tho.

Re: How do i make animations for entities like car?

Posted: Wed Jul 22, 2015 3:35 am
by johanwanderer
FurtherV wrote:Ok thanks :D

Do you know how I can mix the images together with ImageMagick for Windows?
Here you go:
http://www.imagemagick.org/script/comma ... php#append

Re: How do i make animations for entities like car?

Posted: Wed Jul 22, 2015 7:04 am
by FurtherV
Thank you very much! But here ist my last Question: Can I leave some free space beetween every Image?

Re: How do i make animations for entities like car?

Posted: Sat Jul 22, 2017 5:39 am
by robertpaulson
is there an alternative to ImageMagick that can append pngs without scripting?? Sorry but when I tried this I got flashbacks of creating pdfs with LaTex....

Re: How do i make animations for entities like car?

Posted: Sat Jul 22, 2017 6:27 am
by d3x0r
[Guide] Making spritesheets with Blender
viewtopic.php?f=34&t=5336

Te message at the end ( viewtopic.php?f=34&t=5336&start=20#p230374 ) has a fully configured factorio_IMagick that sounds like it makes things pretty easy...

Re: How do i make animations for entities like car?

Posted: Sat Jul 22, 2017 1:40 pm
by robertpaulson
d3x0r wrote:[Guide] Making spritesheets with Blender
viewtopic.php?f=34&t=5336

Te message at the end ( viewtopic.php?f=34&t=5336&start=20#p230374 ) has a fully configured factorio_IMagick that sounds like it makes things pretty easy...
thanks, I will try the Blender plugin first. software seems very nice