Page 1 of 1

Maximum number of frames

Posted: Thu Jun 04, 2015 12:02 pm
by ThaPear
Is there a maximum number of frames I can specify for a single car-type prototype?

Whenever I try to specify more than 64 frames the game fails to load with the error message "Error while loading entity prototype "name" (car): Invalid StripeIterator"
My layer definition is shown below.
When I change the direction-count to 64 and comment the bottom two image definitions, it works.

Code: Select all

{
          width = 48,
          height = 48,
          frame_count = 2,
          axially_symmetrical = false,
          direction_count = 128,
          shift = {0, -0.1875},
          animation_speed = 8,
          max_advance = 0.2,
          stripes = util.multiplystripes(2,
          {
            {
             filename = "__Mod__/image-1.png",
             width_in_frames = 1,
             height_in_frames = 32,
            },
            {
             filename = "__Mod__/image-2.png",
             width_in_frames = 1,
             height_in_frames = 32,
            },
            {
             filename = "__Mod__/image-3.png",
             width_in_frames = 1,
             height_in_frames = 32,
            },
            {
             filename = "__Mod__/image-4.png",
             width_in_frames = 1,
             height_in_frames = 32,
            },
          })
        },

Re: Maximum number of frames

Posted: Thu Jun 04, 2015 12:14 pm
by jorgenRe
Direction count have to be all height in frames added together so:
32 + 32 + 32 = 96 so for you:
direction_count = 96
THat is what i think is the way to fix it as i see in vanilla the car has
direction_count = 64
When the combined height in frames = 64 (22 + 22 + 20 = 64)

Re: Maximum number of frames

Posted: Thu Jun 04, 2015 1:09 pm
by ThaPear
jorgenRe wrote:Direction count have to be all height in frames added together so:
32 + 32 + 32 = 96 so for you:
direction_count = 96
THat is what i think is the way to fix it as i see in vanilla the car has
direction_count = 64
When the combined height in frames = 64 (22 + 22 + 20 = 64)
Nope, that doesn't work, that gives the same error. With 96 and with 128, depending on if I comment one image out.

Any number 64 and below works, and none above 64 work. So I guess the answer to my question is clear.

Re: Maximum number of frames

Posted: Thu Jun 04, 2015 2:50 pm
by jorgenRe
Hmmm when looking in the entities.lua file i found that:
util.multiplystripes(2
is only present at the mask section, however in the section that looks to be the same as you (except the files used) does not, so i wonder if removing util.multiplystripes(2
and just having:
stripes =
Might be the soloution :)
BTW could you include the whole folder of your mod as two heads are prob better than just 1 :D!

Edit also remember to remove the " ) " from the " }) " nearly at the bottom.

Re: Maximum number of frames

Posted: Thu Jun 04, 2015 8:07 pm
by YuokiTani
i think you don't need the stripe if you can make all into 1 sheet as in the factorio-versions before.
your sheet needs to be only smaller then 2048x2048.

the mess with sheet-splits, separate shadow-sheets comes from multiplayer and the color-overlay. same to tanks, player-graphics.
player-sheet contains 22 x 8 = 176 single frames ... in 1 sheet.

unfortunately all changes undocumented and uncommented.

Re: Maximum number of frames

Posted: Fri Jun 05, 2015 9:18 am
by ThaPear
I revisited the problem today and I have successfully gotten it to work with the following code:
You'll notice the stripe is gone and the frame count is now 1.
It now only fails when using more than 128 frames. So I guess that's the real limit.
Thanks for the help guys.

Code: Select all

{
					width = 144,
					height = 144,
					frame_count = 1,
					axially_symmetrical = false,
					direction_count = 117,
					shift = {0, -0.1875},
					animation_speed = 8,
					max_advance = 0.2,
					stripes =
					{
						{
							filename = "__Mod__/image-1.png",
							width_in_frames = 1,
							height_in_frames = 14,
						},
						{
							filename = "__Mod__/image-2.png",
							width_in_frames = 1,
							height_in_frames = 14,
						},
						{
							filename = "__Mod__/image-3.png",
							width_in_frames = 1,
							height_in_frames = 14,
						},
						{
							filename = "__Mod__/image-4.png",
							width_in_frames = 1,
							height_in_frames = 14,
						},
						{
							filename = "__Mod__/image-5.png",
							width_in_frames = 1,
							height_in_frames = 14,
						},
						{
							filename = "__Mod__/image-6.png",
							width_in_frames = 1,
							height_in_frames = 14,
						},
						{
							filename = "__Mod__/image-7.png",
							width_in_frames = 1,
							height_in_frames = 14,
						},
						{
							filename = "__Mod__/image-8.png",
							width_in_frames = 1,
							height_in_frames = 14,
						},
						{
							filename = "__Mod__/image-9.png",
							width_in_frames = 1,
							height_in_frames = 5,
						},
					}
				},
I'm still using separate spritesheets because I do not know an easy way to change a spritesheet from:
1
2
3
4
5
to:
1 2 3 4
5 6 7 8