Runtime Error - Hi-Res animations must be thrown to garbage?

Hi everyone! I have started with Corona and found this pretty good. 

As you know errors are best friends when trying something to work perfectly. If you got error, then you can do better. 

And here is the first time, when error description and googling gave me nothing… And one similar topic here, on the forum also gave me nothing.

Runtime Error: Incorrect number of frames (w,h) = (512,512) without border (0) in texture (w,h) = (1792, 2816). Failed after frame 16 out of 77.

I have rendered four knight model image sheets with «Idle» animations.

The file was attached. I don’t think it is very huge or somehow like that. Thousands of games where about 500 animation frames with expensive quality and 1024*1024 size. 

Maybe Corona «can’t» eat this image? Only small-resolution garbage alowed?

Thankyou in advance! I’m realy confused and error description tells nothing about it’s resolving way ((

make a small standalone demo including your art so we can try to run it and then help you debug it. 

It is too much work to download that image and make use of it.

I do notice you’re wasting a ton of space in that image sheet.  Texture packer would clean that up a lot.

A typical lower-end device today can handle up to a 2048x2048 texture, whereas high-end mobile devices can go as high as 8192 or 1634 which is the same as some desktop machines.

Again, post that sample and I’ll take a look and give you feedback.  Please include the original discrete images too as I’d like to show you what texture packer can do for you.

Image shows how to attach a zipped project.

You can also use this as a starter if you like: https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/askEdStarter.zip

attaching_files.jpg

PS - That error message indicates you are attempting to index a frame in the wrong location on the sheet.  i.e. A math problem somewhere in your code.

Tip On Getting Help:  I would not suggest denigrating Corona while you and ask for help.  It doesn’t help one (me at least) want to help you.  That said, Corona is not a limiting factor here.  It is how you design your game and the hardware you run it on.

The error is because you’re math doesn’t work out. You’re saying your cells are 512x512. You have 7 cells across, so 7 * 512 = 3584 pixels, but the image seems to be 1792 wide.  Can you post your code where you’re loading the image sheet?

Rob

One more note.  If you can’t afford Texture Packer (the best choice) there are other options.
 
You can use this low cost plugin in the interim while using the free or low cost tools: https://marketplace.coronalabs.com/plugin/image-sheet-sprite-helpers
 
I would however, eventually just get Texture Packer.
 
The plugin is compatible with all these tools and allows you to write nearly same code to use the output from each:
+ (PAID but AWESOME) Texture Packer
+ (FREE) ShoeBox
+ (FREE) Free Texture Packer 0.2.4
+ (FREE) Leshy Sprite Tool

Greetings! Sorry my late answer, i had a lot of work today, tired. 

local SheetOptions\_Idle\_1 = { width = 512, height = 512, numFrames = 77  }   local Sheet\_Idle\_1 = graphics.newImageSheet( "Images/Idle\_1.png", SheetOptions\_Idle\_1 )   local Knight\_Animations = {   { name="Idle\_1", sheet=Sheet\_Idle\_1, start=1, count=77,  loopCount=1 } }   local Knight = display.newSprite( Sheet\_Idle\_1, Knight\_Animations )   Knight.x = display.contentWidth/2 Knight.y = display.contentHeight/2   Knight:setSequence("Idle\_1") Knight:play()

Heeeeeeeeeey, I have wrote a tonn of text after closing «code» tag and all this text is gone, what a?

Testing once again

test test test

here is text

here is text

Here all is good…

Also i forgot to say that in simulator all working great!

When you say width = 512, height = 512, are you saying each sprite frame is 512x512? Or are you saying your whole sheet is 512x512?

What is the physical size of your image sheet?

Rob

The sprite sheet is attached in first post, it’s size is 3584 x 5632 (7 columns x 11 rows = 77 frames), each frame is 512 x 512 size, exactly as in my test program. 

Runtime Error: Incorrect number of frames (w,h) = (512,512) without border (0) in texture (w,h) = (1792, 2816). Failed after frame 16 out of 77.

In the error description we see size of texture is 1792 x 2816 and this is realy strange.

On Android, images are limited (downsized) to 2048×2048, even though the maximum texture memory size is higher on the device. The reason is most Android devices don’t have enough heap memory to load the image. We recommend that you don’t load image files larger than 2048×2048.  <<<<< this is I think the problem

Nice post editor here on forum (((((

Can’t do normal editing, can’t write new text after quotes while edit (not first time writing)

Most mobile devices have a limited max texture size. Desktop apps have access to much larger textures. Since the simulator runs on a desktop/laptop, it’s not unreasonable to find 8K or 16K max texture sizes.  As mobile devices get larger screens, the max texture size on some of those devices are increasing as well, but it’s not uncommon to find your app being installed on older devices (in particular for Android) where that max texture size may be limited to 1024x1024.  I don’t know that you’re running into an issue with us downsizing textures to 2048x2048 on Android, but without knowing what device it’s failing on. You didn’t specify that it was failing on a device until just a post or two ago. It would be really helpful to know the device and the version of Android it’s running.

One solution that you may be overlooking is Corona’s support for dynamic images.  Because many people want their apps to run on older devices, we provide a mechanism where you can include different resolution images and Corona will select the best version to use based on the device’s screen size.  For instance, you might want to provide your sprite sheet in 3 sizes, normal which would have 128x128 frames, an @2x version that would have 256x256 frames and an @4x version that would have the 512x512 images.   This is controlled in your config.lua, but you also have to specify the actual width/height of the entire sheet in your image sheet options in addition to the frame width and height.

On to a different but related subject, as @roaminggamer suggested, your sprites are not packed very tightly. There is a lot of empty space around each one. Do you need that? or can you pack them tighter. If they are 512x512, I’d bet you could trim them down to 256x256 just by cutting out all the empty space.

Between optimizing the packing and using dynamic images you can likely address this on most all devices.

Rob

Yes, I will optimise spritesheets and try modified app again on my GalaxyS3. Results will post here, just give me some time. Maybe this will be useful for beginners.

SpritePacker is good tool, but hundred dollars for such small tool is very expensive, especially when you need approx 20 same utilities for different steps, so I will buy it later, not only for tests.

Note: I will be glad to help if you can attach a small test project demoing the issue as a zip file.  

As I asked before, if you do, please also include the original assets so I can show you the benefits of using some texture packing software too.

As I asked before, if you do, please also include the original assets so I can show you the benefits of using some texture packing software too.

With 3MB limit on attached file? 

I see that packed sheet is better.

But from those utilities only Shoe and TexPacker can do the corona code. Shoe is free, but it packing image with errors: the result animation is with noise - frames are not on one line so one frame is higher, another is lower. 

So the only thing that working exactly as need is TexturePacker but it’s expensive.

Then use drop box or some free service.

Also, I PM’d you an alternative way to get that zip to me.

 
 
Three of those tools I listed are free and even without the plugin, you can figure out how to use the output.  Of course for 5 whole dollars you can then use the free tools till you can get TP.
 
Note: I don’t understand your reference to 20 tools.  The only tools++ you need to make and release 2D games are:

  • ( $0 ) Corona - Free and Totally Awesome.
  • ( $80 ) Text Editor (Many Free, including Atom which is great. I use Sublime however: $80 )
  • ( $64 ) Texture Editor (Many Free, including Gimp; I use PSP however because that is what I’ve used for years; $64 )
  • ( $0 ) Sound Generators - sfxr or bfxr both Free.
  • ( $0 ) Sound Editor - For fixing sound files.  I use Audacity which is fee.
  • ( $100 ) Texture Packing Tool - TP is $40 for one year. $100 lifetime.
  • ( $0 ) Google Play License - Free
  • ( $100 ) Annual Apple License - $100

… and I think that is it.  Sure, there are more tools, but if I only had those I could get by.
 
So, a one time cost of $344 and a annual cost of $100 and you’re good to go. 
 
: ) Man, and I mean this in the nicest possible way.  You don’t know how good you have it.  When I got into game dev you couldn’t even get an engine for that.  It was all DIY.
 
Today’s starting game developers are spoiled for choice, ease-of-use, features, targets, active communities, documentation and examples out the wazoo, and all that at almost no cost.

One final note while I wait for that zip file.  
 
The forums editor here is quite good, but I don’t suggest typing long bits of code or even posts in it.   
 
I edit my long code posts elsewhere then paste them.  This avoids the issues you’ve run into, and let’s me do a bang up job on formatting in advance. 
 
As for long text posts, I click the little ‘light-switch’ in the upper-left if I’m feeling paranoid, then grab the whole post raw before posting it.
 
Also, you can lose your post if you accidentally hit the ‘prev page’ button on your mouse or in the browser.  I’ve done it (I think many of us have) and it sucks. 
 
I think once you’ve use the forums here for a while you’ll be good to go.  Meanwhile, happy coding and I’m looking forward to future posts from you showing off you content.
 
Note: Posting stuff to this thread is great as it gets lots of eyeballs: https://forums.coronalabs.com/topic/45387-screenshotsaturday-post-your-screen-shots-here

I reviewed your content and these are my findings.
 

  1. Your sprite sheets are way too big. 
  • Idle_2 is > 8K height - That won’t work except on some high-end desktops.
  • Idle_4 is > 8K height - That won’t work except on some high-end desktops.

Texturing hardware comes in power-of-two sizes.  Ex: 1K x 1K, 2K x 2K, …, 8K x 8K, and highest end 16k x 16k.  While there may be discrete desktop cards above that, 16K x 16K is way above what most mobile devices have.  Far safer is to stay at 4K or below.

In your case, the two textures above require a 16K texture buffer to load.  You’re not going to find that on mobile.

Please note:  There is no common hardware on the market that would handle these sheets and this is not how the pros do it.  They all use tools.

The way to solve this is to break the sheets into smaller sheets that will fit in 4K or below texture buffers.  You can do this manually, but using a tool is far easier.  

  1. I considered trying to fix your sheets, but it was too much work, so I bailed on that.  Instead…

  2. I put your images through texture packer (about 5 minutes of work or less), then modified your example.

https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2018/03/Paladin_With_TexturePacker.zip

(_ video is zoomed way in _)

https://www.youtube.com/watch?v=CBxi4Ffkl8M&feature=youtu.be

In Closing

I strongly suggest you pick up my sprite sheet/sprite helper: https://marketplace.coronalabs.com/plugin/image-sheet-sprite-helpers

It is very easy to use and documented here: https://roaminggamer.github.io/RGDocs/pages/Plugins/texturepackerhelpers/

That way you can use the free tools for now and quickly get this problem resolved.

Hmm, now I see that your helper can read different formats. That’s a good way!

First step I need to optimise sprite sheets.