Continuing on my quest on getting more traditional UI elements in the game engine, I figured to go with the seemingly simple task of combat text. Having the text in-game not only adds some depth and interactivity, but in this case I gave it physics to interact with the static world.
The first big hurdle was that since the text is a physical actor in the world, it gets really small when far away. A simple solution is a algorithm to scale the actual actor based on it’s distance to the owner’s camera. I think it’s kinda strange but I actually like it.
Lighting was another unforeseen hurdle, typically the UI layer isn’t effected by lighting so is always pristine but once you put it in the game then you have problems seeing it in unlit areas. I had to do some material trickery to have it unaffected and still ‘pop’ from the rest of the world. In these clips you’ll notice the text’s reflection on the ground, another cool side-effect of the diegetic approach.
I don’t know if the result is better than just rendering on the UI layer, but I think the physics interactions are unique and just needs some polish to look awesome.