How do i make animations for entities like car?

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
FurtherV
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Jul 21, 2015 11:17 am
Contact:

How do i make animations for entities like car?

Post 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

johanwanderer
Fast Inserter
Fast Inserter
Posts: 157
Joined: Fri Jun 26, 2015 11:13 pm

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

Post 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.

FurtherV
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Jul 21, 2015 11:17 am
Contact:

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

Post by FurtherV »

And for a entity like a car i only need to rotate?

johanwanderer
Fast Inserter
Fast Inserter
Posts: 157
Joined: Fri Jun 26, 2015 11:13 pm

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

Post 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.

FurtherV
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Jul 21, 2015 11:17 am
Contact:

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

Post 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?

johanwanderer
Fast Inserter
Fast Inserter
Posts: 157
Joined: Fri Jun 26, 2015 11:13 pm

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

Post 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.

FurtherV
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Jul 21, 2015 11:17 am
Contact:

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

Post by FurtherV »

Ok thanks :D

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

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

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

Post by orzelek »

Car also has the player color mask somewhere - it's also part of animation I guess. Haven't checked that tho.

johanwanderer
Fast Inserter
Fast Inserter
Posts: 157
Joined: Fri Jun 26, 2015 11:13 pm

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

Post 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

FurtherV
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Jul 21, 2015 11:17 am
Contact:

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

Post by FurtherV »

Thank you very much! But here ist my last Question: Can I leave some free space beetween every Image?

robertpaulson
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Sun Jun 18, 2017 2:21 pm
Contact:

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

Post 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....

d3x0r
Filter Inserter
Filter Inserter
Posts: 316
Joined: Sun Jun 04, 2017 8:56 am
Contact:

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

Post 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...

robertpaulson
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Sun Jun 18, 2017 2:21 pm
Contact:

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

Post 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

Post Reply

Return to “Modding discussion”