pingpoli.de



GameDev 2019 Week 31 & 32: Fonts

Fonts, Blender 2.8, Tools

25.08.2019 - 20:58
Monday 12.08

As mentioned at the end of the last blogpost the server version did not work properly, so I had to look into it. It took a while to find and turned out to be another one of those really stupid windows linux differences. The building set file only contains a list of building files in the set, so I didn't bother to format it with json and just wrote one file per line. I created that file on my windows machine, which uses \r\n line endings. However, linux uses just \n line endings, so when I uploaded the file to my server, the linux getline function only looks for the linux line endings and splits the file according to them, which gave me a bunch of filenames that ended with a spare \r character at the end and when I tried to open these files, they obviously didn't exist. I even knew about that difference, but just didn't think about that when I created the file. All OSs should just use the same line endings... After I finally found and fixed that bug I also fixed a few more multiplayer related bugs I discovered when testing. When all players used the ready after building button, some flags didn't get reset correctly and two game states could happen at the same time. When players picked different waves with a different number of entities in them, the game got stuck in the spawning state. And finally I fixed a bug that the game got stuck when one player left a multiplayer game.

Tuesday 13.08

After the annoying bug fixes from yesterday I wanted to do something different and finally downloaded the new Blender 2.8. It is drasticly different from Blender 2.79 (I don't get why the new version isn't called 3.0), so I just did some random modelling to try and find where all functions that I use regularly have been moved to and found most of them. It definitly will take some getting used to, but overall I believe it is a good improvement over the old version. Then I loaded an animated model and tried to export it, and they finally added the function I was missing most in the old version: an option to change the axes when exporting a collada file. There are so many weird exceptions in my collada loader to fix the messed up rotations. There is also another option to export the animation as "decomposed", what I assume means to export the key frames as individual x,y,z rotations and translations instead of as matrices. Because of the way my own animation editor works, that would be great if it did that, but when chosing that option the animation doesn't get exported at all, the collada file just doesn't contain an animation node. I may understand the option incorrectly, but it should do something in my opinion, so for now I believe it is bugged. And another thing seems to be messed up in the collada exporter, when I change that option back to matrix all frames are being exported and not just the keyframes. Blender uses 24 fps animations and I have to interpolate between frames anyway, so there isn't really a point to export anything else than just the keyframes.

Wednesday 14.08

Frustrated by the still imperfect collada exporter I looked into other formats again and found that the new Blender added gltf. Like OpenGL it is developed/maintained by Khronos and seems to be a json based format mostly intended for WebGL. Even though it is json, it isn't really human readable though and looks slightly weird to me, so I'm not sure whether I want to write a parser for it. I also looked at bvh again and I like the straight forward skeleton and animation data, but it doesn't contain anything else. I spend the rest of the day thinking about how to improve my animated models, but I couldn't decide, so far a combination of using collada and bvh seems the best to me, but it isn't that great either.

Thursday 15.08 - Sunday 18.08

I created my own font file format, which is mostly a fany bitmap font with some additional metrics. I was using the fft files directly, but apparently the fft files may not always be redistributed even though using the font is fine. Before I was using the freetype library directly to write text, now I am only using it to get some metrics to store in my own format. Fonts metrics are really confusing though, there are so many different metrics that affect how a character is placed in regards to the previous one or how wide it really is. Testing it was rather slow too, because I had to keep loading up the results in photoshop and zoom in on indivual pixels to see if it makes sense and all of that for multiple different fonts, because every font had its own little habbits. Anyway, after a lot of testing my format worked well with multiple different fonts and produced nice looking texts. Because using freetype felt like a lot of overhead I actually tested the speeds of freetype and my own format and my own was about twice as fast to render the same text. And because rendering a text happens fairly often I decided to spend some time to optimize my function. I really like the visual cpu performance measurement tool, I should probably use it more often. Anyway with it I was able to really optimize the function and got it down to 1.7ms, my freetype using function (not optimized though) takes 38.2ms for the same text.

Monday 19.08

Some fonts have characters that are taller or wider than the font size. In my old version those were just cut off, which doesn't look that great. To fit them all properly I made the image character tile size dynamic, which changed the vertical centration of the texts. So when I used the new format in my game the texts were not centered correctly anymore and I had to update all of my engines text functions to work with the new format. After that I changed the fonts in my game to a more fitting one than the default arial it was using before (also I don't think arial is free to use). Except for a few rarely used menu elements which don't react to font changes at the moment and still have to be changed, all texts are now using the new font.



Tuesday 20.08 - Friday 23.08

I worked on the tower creation and balancing tool some more. First I converted it back from sqlite to mysql, because there were no apt-get sqlite packages for ubuntu version and I wanted to work on my laptop. Then I added effects and upgrades to it and added all options for the buildings themselves. I also added building sets to the tool and worked on the export functions, which convert the buildings to the format used in the game. When I was on my PC I made 2 more tower models with the new Blender version and also worked a bit on the image particle system that I use to create animated particle or projectile textures.






by Christian - 25.08.2019 - 20:58


Comments

Social Media:  © pingpoli.de 2020 All rights reservedCookiesImpressum generated in 30 ms