Defold crashing on build

So I added a new animation to my atlas and when I tried to build the percentage would get to about 64% and the editor would crash. When I comment out code to use the animation it still crashes and my atlas is setup properly as far as I can tell (this is my fourth animation, the other three didn’t cause a crash). Other branches work fine but none of them are nearly as updated as the one that’s crashing. Any ideas?

What Editor you use?

Wow, the whole editor crashes when you build? Editor 2? Can you zip the project and share it somehow?

If it big animation then can crush build, but Editor - strangely. Build can crush when not enough memory for load atlases and if not present dicrete video card

What platform are you running on? Do you get any dialog like this with more information about the crash?

(If so, could you share this information with us?)

Sorry for the late reply. I believe I’m using editor 1 and it’s running on Windows 10. I don’t get any notification, the entire thing just closes out. I’m not sure what counts as a big animation. It’s 30 pictures of stick figures like the other 3 animations (that worked before I added this one). Still iffy on how to use stuff like github so I zipped all the files up.
https://drive.google.com/drive/folders/0B88BeokxFN17OGc5UzV6d2FxMm8?usp=sharing
The branch I’m using is called “enemies”.

Whoa, 736 MB? What did you upload? You just need to share the files from your project. If you right-click any file in the Defold editor there is a “show in explorer” option which will open the folder for you. Whichever folder has the game.project file is the root folder for that project.

Didn’t know how far out I should go in projects so I just uploaded everything. Let’s try again.
enemies.zip (7.4 MB)

On line 225 of CombatManager.lua there’s a ‘-’ character (I’m using editor 2 and it pointed out the issue when I tried to build). Apart from that everything is ok and the project builds and runs in editor 2:

I haven’t tried in editor 1 yet, but could you please fix the error I mentioned and try again?

It still crashes. Since you ran it in Editor 2 I tried that as well (love the look by the way). After opening my enemies branch in editor 2 and trying to build it I got this error

Edit: If it’s relevant, I recently fixed a memory error described here (Editor crash: 'java heap space') using LarsSjodin’s solution.

I tried in Editor 1 and get a JavaHeapSpace error for the player.atlas. It doesn’t crash but it fails to build and I’m unable to open the player atlas. Whoa! I just took a look at the contents. The images are huge, 600x800 pixels and there a many of them! No wonder I run out of heap space. You need to resize them to a reasonable size matching the size you intend to render them in.

It not crush - It not enough memory.

You can open config file in Defold directory, in any text editor and add command -Xmx4g(for 4g allocated heap or more 6g for example) in block vmargs = (separate command by comma) and it resolve problem, but try resize images first. (ohh I dont see you PS)

That makes sense. What would you recommend the size to be? I’m probably going to be adding a lot of animations but since they’re just stick figures I could probably make them extra small and then scale them up without losing much quality.

The best idea is to make pictures as small as possible. And as the best option for starting to remove all the transparent pixels, i.e. leave as a matter of fact a rectangular / square sprite framing the image. I hope you undertsand me :slight_smile:

Yeah, all of the images have the transparency removed. Guess I’ll just mess around with the images and find what size works for me. Thanks.

Ok, so I might have been wrong about the loss of quality thing. The size that i want to render the animation at is about 60% of the size my characters currently are. I can go smaller but extreme amounts show a visible loss of quality. For the sake of future proofing, is there a way to do flipbook animation that is less memory intensive? I was planning to have many more sets of animations (about 12 more for the main character alone). Is it possible to just make everything small and then zoom the camera in?

May be need wait patch for build process. It problem present only for first build after start Editor.(Editor create internal cache and make compiled texures). Read my topic about it - Big memory problem with Editor 2 (SOLVED)

May be it help you :slight_smile: Really after build complete and free memory Editor aquired about 1-3Gb memory only for big collection and good work. Build process fast too and use huge memory amount.

About images - try only drop transparent pixels and not change image size.

Is it possible to remove transparent pixels without messing with the position of the images in the animation? Some of my animations have the character more forwards or upwards during key parts of the animation.

I think no. After remove transparent pixels you need correct coordinates for new sprite size.

If you zoom in you’ll end up with blocky pixels.

Nope. This has been requested in DEF-2858 (Trim (crop) alpha for sprites in atlases (DEF-2858))

1 Like