Available cache cells & font width

Hi!

I have 10 labels, each with a font sized 400, one of which has a pretty thicc outline. I’m getting the error:

Out of available cache cells! Consider increasing cache_width or cache_height for the font.

What would be a reasonable number to increase the cache to? I actually can’t see anything wrong in the game- is this something I can just ignore?

Thanks!

2 Likes

I increased both caches to 100 and now the game crashes when I get the “out of available cache cells!” :thinking:

I have fixed this by using smaller fonts and scaling up on the less important layers :grinning_face_with_smiling_eyes:

1 Like

I don’t know how to play your game but now I’m ready to dance :man_dancing:

1 Like

Wow, that’s big! Can’t you use a distance field font and scale up?

You can read more about the font cache here: Fonts in Defold manual

I’m a bit uncertain what size the font cache is assigned if the cache width and height is set to 0. I’ve briefly looked through the code in font_renderer.cpp but couldn’t quite spot it.

That is how I solved the problem, yes!

That’s great! I’ll be projecting the “game” behind some DJs at two parties next month. I control everything from this massive box I made using a makey makey plugged into a raspberry pi.

It works really well. Can’t wait to try it out.

3 Likes

What would be a reasonable number to increase the cache to?

The glyph cache for the font should hold the number of glyphs you wish to display on screen at anyu given time. For e.g english, you might want capital letters and the digits 0-9, that’s 36 glyphs. The root of 36 is 6, so you want the cache to fit 6x6 cells. Each cell was 400 in height. 6*400 is 2400. Round upwards to nearest power of two, and the texture will be 4k x 4k. You can of make the size different, e.g 4x10 which fits 40 glyphs, and gives you the size 2048x4096

I increased both caches to 100 and now the game crashes when I get the “out of available cache cells!”

The game should’t crash due to this. Please create a ticket with a small repro case project attach, and we can look into it.

1 Like

Sounds very interesting, never thought about using Defold as vfx :slight_smile: Will it be possible to see the result after the party?

1 Like

This is the answer I wanted! But of course, a 4k texture is not reasonable.

This is the answer I needed. Thank you. I forgot that you have to set the texture to DF for the font AND the label, so it wasn’t looking right, but it’s perfect now.

If there are any videos I will upload them. The whole rig, including lights built and programmed by me, looks like this:

Next month I have one session with the full rig (me doing AV and Lights whilst the DJs play) and one session where I’ll be doing the lights and DJing (with no screens/AV).

I am looking forward to seeing how the rig holds up with a 6 hour set.

8 Likes

I love it! Very nice! Makes me want to go out clubbing!

When the next offline event with Defold is coming up, I think I know who the DJ will be! :notes:

2 Likes

That would be great!

My last event was in February. It was called art show one:

And featured two exhibits made with defold, as well as several other projects of mine that are non-digital.

I’ve been creating a lot of weird stuff recently. But in the second part of this year I will be focusing on building up contacts, doing exhibitions where possible, and promoting my work.

5 Likes

Here are a few videos from the party last weekend, which I finally got the chance to use my #madewithdefold animation system.

I’ve said it before, I’ll say it again, Defold is a great tool for building this kind of thing from scratch and having full control over my visuals. Great party too.

3 Likes