[Solved] Project not compiling on Flash

Hi,
I was working on my game, when I noticed that a new version of OpenFL, Lime (if I remember correcly) and SWF had been published. I updated the libraries, opened FlashDevelop again, and continued making my game. After a while, instead of compiling on Flash, my IDE printed this error message on console;

Called from ? line 1
Called from CommandLineTools.hx line 1359
Called from CommandLineTools.hx line 25
Called from CommandLineTools.hx line 126
Called from CommandLineTools.hx line 579
Called from lime/project/PlatformTarget.hx line 70
Called from lime/tools/platforms/FlashPlatform.hx line 224
Called from lime/tools/helpers/FlashHelper.hx line 816
Called from lime/tools/helpers/FlashHelper.hx line 629
Called from format/swf/Writer.hx line 59
Called from format/swf/Writer.hx line 1255
Called from format/swf/Writer.hx line 1163
Called from format/swf/Writer.hx line 1121
Called from /usr/lib/haxe/std/haxe/io/Output.hx line 168
Uncaught exception - Overflow
Build halted with errors.

Any ideas what could cause this?

Question can also be found on Stack Overflow.

Was this caused by including too many assets? :smile:

There is a known memory limit right now when writing for the Flash target, it’s a lot better than it was before, but it could be pushed further with some work

I got this error right now. Is the problem really with the count of the assets? The problem is happening if I add the specific font - Grixel™ Acme 9 Regular ( direct_link , http://www.grixel.gr) .

Haxe 3.2.0-rc2, Lime 2.3.3 OpenFl 3.0.3

I also found this http://www.openfl.org/archive/community/programming-haxe/uncaught-exception-overflow-when-compiling-project/ seems the problem with fonts was solved early, but now it is back.

Perhaps it’s something to do with the trademark character

I am deleted that character and nothing changed. Any help?

removing the font does fix it?

Of course! Without that concrete problematic font Flash compiles fine.

I wonder if it’s a bug in the format library, or if we’re just reaching an asset size limit. What happens if you copy this asset into something like the “AddingText” sample, and try and use it there, so it’s just a simple base project, with only this font. Would help to isolate which one it is

Oh, I totally missed info about where the overflow error is happened :sweat_smile: But I can tell that error message is exactly the same like in first post, and with “AddingText” sample with the problematic font it also works the same way - Overflow exception.

The value of ascent property
o.writeInt16(data.layout.ascent);
(on moment of error) is out of bounds Int16 type - that the reason for exception. But the value of ascent property for the problematic font, which I can see in editor (like FontForge), is within the Int16 range.

What happens if you trace it? What does it give you?

Neko can be a little funny about data types, perhaps it converted to an Int32 internally, I wonder if there is a way to force it

Nothing happened when I trace it. I added traces but no info in the console log for both FlashDevelop and cmd.

Oh, try Sys.println ("Hello!"); instead, and lime rebuild tools in order to make sure the tools are rebuilt in order to include your changes

I did rebuild tools and now trace() is working. Same problem with the font - big value for the ascent property. Console prints 33280 (0x8200), and obviously, this is out of Int16 range. I found temporary solution:
instead of this

o.writeInt16(data.layout.ascent);

I do this

o.writeInt16(Std.int(Math.min(Math.max( -0x8000, data.layout.ascent), 0x8000-1)));

And now no errors with the compilation. Moreover - I see that font in the textfield.

I wonder if the value is supposed to wrap, or clamp. Perhaps it’s a bad font value, and it’s overflowing already. Whatever seems best, we should definitely do a pull against the “format” library with the fix :slight_smile:

May be need to fix something there ? Because before it all values for that font is normal, but after - outside Int16. So, I don’t know, why it does what it does (I mean 1024 * 20 and same ), but problem somewhere there.