A scaled text object freezes my game and crashes BLENDER

I cannot figure out what is going on. The game is very simple; it’s all logic bricks, no Python. It’s for my young grandson. Basically it presents two random single digit numbers to add ( and a way to get the next two numbers ), a provision for him to make a guess ( by counting button presses ), and a way to reveal the correct answer. Everything is controlled by pressing buttons using the mouse.

I have it working correctly and I want to add some score keeping. So I add a text object. I can add the text object, or move it, or rotate it, and then play the game and all is well. But if I try to scale the text object and then play, things lock up. I can hear the proper sounds ( when the buttons are pressed ) and the music but nothing else works and I cannot exit the game unless I “X” out blender.

To play the game, the “NEXT” button should always get another two numbers to add. The right arrow button should count the number of mouse clicks ( which is your answer to the addition ). The left arrow button will subtract from your answer if you happen to make too many right button clicks. The down arrow button reveals the correct answer.

I want to add a text object to the game and I am able to do so as long as I don’t scale it. Scaling a text object and then playing the game somehow freezes it. Any ideas would be welcome.

AndyMathExeV1.18.blend (805 KB)

adding a text and scaling it doesnt make it crash for me.

scaling text is rasterizer’s job i think, maybe your computer cant handle more (dont know much about it tho)

I tested it too, no problem here. I also ran it through an updated blender version with a debugger, no weird signals.
It’s a case of software not rhyming with magic but still being the same.

Leralass and pgi, thank you for checking my blend file and reporting what you found. The computer I’m using is an HP 700 Envy desktop ( Intel i7-4770 processor ) that originally had a WIN7 OS; I put WINDOWS 10 on it several months back. It’s possible that, at the time, WIN10 used a generic driver for the lntel integrated graphics processor. In any case, last night I found that a new ( as of June 2016 ) WIN10 graphics driver was available. I will install that and report back. Thanks again.

Well, I found out that WIN10 automatically updates drivers and the current graphics driver is indeed the latest. I’ll try a few other things ( maybe go back to the previous driver ) now that I know it’s not some random mistake I’ve made in BLENDER or a BLENDER bug.

We can’t know for sure it’s not a bug that shows himself only with a very specific hardware-software combination. Usually when I find one of these weird problems I try to re-create the game from scratch, starting with the problematic feature and a few times it actually worked.

pgi, If it helps determine anything here are screen shots from before

and after scaling

The buttons do not work except that I can hear the correct sounds. Note that two numbers are messed up. Thanks for your interest.

Actually I have worked around this problem, which occurred several times during the game “development”. What I did the last time the problem occurred was to eliminate problem objects until I had a working version ( the blend file above ) and then add an object ( the text object ) to cause the problem.

The latest version of the game that works is satisfactory ( grandson Andy likes it ). But I keep running into this same strange problem whenever I add something to the game.

Well, there’s definitely something wrong with the text rendering functions, either because they are wrong or because the driver doesn’t like them.
Note that you can always use an image based font, either via the “Text” option in the material settings (and the most absurd font-encoding format ever know to the human kind) or with a simple custom made texture. I can show you a quick example if you like.

1 Like

Yes, thank you. I’m always interested in different ways to get the same ( or a similar ) result.

It’s almost like I’ve exceeded some buffer or array and overwritten memory devoted to the text rendering ( and other ) functions. However, removing the object, saving the game, quitting blender and then reloading blender and running the game, doesn’t fix it. So, I guess it’s not a buffer problem. It stays with the blender file.

I should probably also mention that I use the 64 bit Blender but it doesn’t matter because when I tried the 32 bit Blender the same problem occurred.

What about using UPBGE? They rewritten the text object in the UpBge.

I have uploaded the blend here:


It’s really a basic idea, you make a quad for each letter in a hidden layer - which is quite fast to do using a texture, planar subdivision and a few translations, then you simply compose a string by adding letter after letter. Perhaps surprisingly, one can do a lot stuff with that simple idea - like bidirectional text, lay out the text along a path, rich text and so on. That requires more code than the few lines of the example.
You can replace the embedded image with another one, as long as the layout of the letters is the same (size can change), it will paint the requested string.

pgi, that’s clever and useful not only for fonts but for general mapping. I can already think of a way to use it in my grandson’s game. Thanks. The technique reminds me of the bitmap font images – but easier to understand ( after I read your code ). How did you get your character quads? I assume you started with a bitmap font.

Akira_San, this is the first I’ve heard of UPBGE. I’ll check it out. Thanks for the suggestion.

You can make the quads in any way possible as long as they have the following properties:

  1. the origin of the geometry must be (0,0,0);
  2. the edges of the quad must be 2 units wide;
  3. the name of the quad must be Plane.INDEX, where index is a three digit number starting with 001 for the first character of the ascii subset that goes from the space symbol to the tilde symbol (so Plane.001 for space, Plane.002 for !, Plane.003 for ", and so on)

Changes to 2 and 3 requires changes to the script, 1 could be avoided with a longer script.

That’s the objective. The fastest way I found to do it by hand is the following:

  1. create a Plane centered at the origin;
  2. apply a scale factor of 16 (S, type “16”)
  3. unwrap it (tab, type “u”, enter, tab)
  4. add a multiresolution modifier, select simple, press “subdivide” 4 times, press “apply”
  5. name the object “Plane”
  6. enter edit mode (tab), starting with the quad in the upper-right corner, for each face separate it into a new object (select face, p, enter), until you reach the tilde quad
  7. delete the Plane object
  8. select all “Plane.XXX” objects and set the origin to the center of mass (menu Object, transform, Origin to Center of Mass)

It looks a time consuming task but it actually takes three minutes top.
The font texture itself is made with Inkscape, once you set up the position of the letters once you can change the font and, with a bit of adjustments, you have the texture.

Thank you pgi, for all your help.