Update #12 - Custom Fonts, Settings, Dialogue UI, and Pathfinding

Here I am, once again. It's Friday, which means it's time for another blog post. Onwards!

Custom Fonts

This is the format XNA uses (and most other programs) to read .png images as fonts. I removed it, but there is always a magenta background with transparent blocks for the letters.

This is the format XNA uses (and most other programs) to read .png images as fonts. I removed it, but there is always a magenta background with transparent blocks for the letters.

The typical way to draw text in XNA is to load the fonts through a custom content importer called a Spritefont. However, little did I know until recently that you can draw your own fonts and load them almost the exact same way. In the picture above, you can see how the symbols are laid out. All I really needed to do was transform an existing font into .bmp format using separate software, add my own twist to it, and then add other details like outlining and gradients. You'll see the font in action below.

Settings UI

The "Display" tab.

While a very necessary user interface to have, most players will usually only open this a few times through an entire playthrough. I'll describe the settings below.

  • Display. This tab contains options for changing the screen resolution, fullscreen, vsync, gamma, and other options.
  • Audio. This tab has options for changing the master, sound effect, ambiance, and music volume.
  • Controls. This tab lets you change the keyboard controls of the game.
  • Stats. A fun tab that shows the player various statistics, like "total deaths", "maps visited", and other information. I may end up moving this to a separate "Player Info" UI.

There is still some minor stuff I need to add in, like icons to represent the different tabs.

Dialogue UI

Example: Getting an item from the Island Merchant.

Example: Getting an item from the Island Merchant.

A pretty generic game dialogue interface. You click a button to begin conversing, they say words, you say words... repeat. I can have the character check if the player has an item, give the player a new rumor, take money, and other similar actions. It's not quite to the level I want it just yet, but it's getting there. I'll need to add saving and better option limiting, then I can it's on the level of Skyrim's dialogue. If not in code complexity, than in perceived functionality.

Pathfinding

A* pathfinding algorithm with diagonal movement, corner cutting prevention, higher cost tiles, and lots of walls.

A* pathfinding algorithm with diagonal movement, corner cutting prevention, higher cost tiles, and lots of walls.

This took up the majority of my week, but I'm glad I have a better understanding of pathfinding. The purpose of A*(A-Star) pathfinding is for monsters and animals to find the lowest cost route from their position to the goal, and is perhaps the most popular method of pathfinding in 2D games. If you want to read more about this, here is one of the best articles I've read on the subject (complete with animations, too!). In the picture above, light gray tiles are open, dark gray tiles are walls, and red tiles have a higher cost to travel over. The red tiles can represent a swamp or river where movement is slower, and will discourage creatures from travel through them. However, if there is no other way, the creature will take the slower route.

Site Improvements

I've been slowly updating the website when I can, and have changed over from using the default Squarespace commenting system to Disqus. If you don't have an account for Disqus, it's free and the a majority of websites use it. Some other styling features like image borders.

Male character template

Male character template

Lastly, I've been working on the character template for both the player classes and characters. Hopefully I'll be able to move away from those convenient but ugly gray blobs soon! It's the animation part that I'm not very good at yet.


That's the end of my past two weeks. I'm currently planning the crafting UI(s), so expect that next week.

If you have any ideas, constructive criticism, or just want to tell me how much you hate my game, you can: Send me an email, tweet @TheShyyGuy, comment on the facebook page, or respond here!

Until next week!
Shyy Guy