game design, code, writing, art and music

English По-русски

Engine updates: Vector graphics, menus, text hotloading

I still haven't really decided what my next game is going to be, so I've spent a few days just improving some of the tools in my engine.

I've added the ability to generate some vector shapes, which can then be used in generating flexible UI elements. In the past, this stuff had to be prepared in a graphical editor beforehand.

Now the engine can create customizable circles, triangles, and rounded rectangles, which are cached and re-used whenever possible. Rounded rectangles use nine-slice scaling, so the same texture can be used to create boxes of different sizes without stretching the corners.

One texture can be used to create multiple rectangles of different sizes.
One texture can be used to create multiple rectangles of different sizes.

This feature in combination with my recent text system improvements makes it easy to create HUD and menu elements that can be scaled to any resolution without blurring.

I've redone all of the menu elements using these dynamic vector shapes, changed the layouts of the menu pages to be more compact, and added a scrollbar (previously, the content was paged). All menus can be navigated using the mouse, keyboard, or gamepad.

Graphics menu using the new dynamic vector shapes.
Graphics menu using the new dynamic vector shapes.

I've also replaced the boring old FPS counter with a nicer one, which displays more information and plots some graphs.

Display of FPS, memory usage and tickrate.
Display of FPS, memory usage and tickrate.

The text system has been improved further. Text is now automatically hotloaded whenever the translations file is updated, and the UI elements are updated instantly. The UI elements can subscribe to global text changes and update themselves whenever the text has changed. This way localization can be done in real time. After translating 3 of my previous games to a different language, I can already see a tool like this being very useful to me in the future.

The instant hotloading feature was actually intended to be used for a different purpose. I wanted to add an in-game language selector, which would update all of the text fields in the game in real time. However, I later found out that I can just use the Steamworks API to get the player's language when the game is launched, so I ended up using that instead.

Subscribe

Receive a notification on your device whenever there's a new blog post available, in order to:

Follow the development process of my next game.

Get notified of articles about the art and tech of designing games and engines.

Receive updates about changes to my games.

Subscription is free and takes just one click!