• entries
9
18
• views
13272

# Fonts and incremental improvements.

480 views

TL;DR

Since the last update, I've fixed the visual artifacts appearing on the device/emulator. I originally thought it might be an alpha issue but after checking over everything that was not it. I went a little crazy thinking it was something I was doing (e.g., off by one on rect size or position) but it turned out that my spritesheet needed to be a power of two size. That fixed everything.

I also greatly increased performance by increasing the maximum GL buffer size used by the Airplay SDK. Previously I had been getting memory errors, so I just threw in a Iw2DFinishDrawing() call after every single entity until I had time to figure out the real problem. Adding the following to the app.icf file fixed it:
[GX]DataCacheSize=1000000VertCacheSize=10000

Airplay SDK has what appears to be a very nice bitmap fonts API. However, I was afraid of relying on something opaque that has given me a few headaches already for something so simple. Plus, in a game, I felt I might want more control over rendering than the API offered. My implementation is very simple: a spritesheet of characters plus a text file of the character size and each character laid out as it appears in the bitmap. Right now I brute-force search each character to find its position on the spritesheet; it's a simple enough optimization to index coordinates by character on loading. I do require a fixed-pitch font, as opposed to the Airplay SDK's built in fonts library, but really that just simplifies things all around. A wrapper function to render a string outlines the text by rendering it at +1/-1 offsets in black before rendering in the chosen color.

I spent quite a while working on tiles as well. It is exponentially more work to generate semi-detailed pixelart versus throwing down some cubes with outlines. The art style was actually somewhat inspired by "Game Dev Story". After playing it I thought, "I can make this type of artwork." After researching pixel art I had some cube looking stuff, which would have been functional, but I still wanted something better. I'm still learning to do isometric pixel art, and frequently browse sites like pixeljoint and Google images for inspiration and techniques. Recently I came across the TomeTik library which has some cool roguelike pixel art. Since it's free to use, I might be tempted, but everything is wrong-sized and I'm having a lot of fun learning to do the art myself anyways.

I would really prefer to play the game holding the device upright. It is very easy to hold the vertical device with one hand while essentially using your finger as the mouse. Horizontally, it is much more difficult to do. Most people cannot securely hold the device with one hand because their thumb and fingers cannot easily reach both sides of the device. Holding on one side alone is possible but the moment about the axis of the center of force of the fingers is great because of the length of the device, compounded by the force when poking the device with the other hand. This just makes it uncomfortable and fatiguing.

However, my tiles are 34x17. With a device resolution of 320x480, there is a significant bias towards showing vertical area while horizontal area is very narrow. In a roguelike, you generally want a square view of the map. In a horizontal orientation, this is achieved. On an iPhone/iPod 4 the resolution increases to 640x960. In this case, I could render in a smaller (harder to see and point) vertical mode with an additional information display in the extra vertical space. On tablets it doesn't much matter since they are too big to hold with one hand anyways. So, the big problem is, I'm not sure how someone would actually play the game in a horizontal orientation. Perhaps some thumb-friendly controls in the corners, though I personally hate it. I would much, much rather pretend my finger is a mouse. Some games let you switch controls (Dungeon Hunter). I guess I just need to do some experiments on the device.

Sort of. I refined the (mouse-like) controls a bit more for navigating about the map by touching the corners. The next step is to add movable entities into the map rendering and introduce an avatar. It would be really easy to just move around a static figurine but I think most people would prefer something animated since this greatly increases immersion. So, I have to figure out how to draw animated characters.

There are no comments to display.