• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Floating Damage Text

A

anomalous

Guest
I'm working on implementing floating damage text above the heads of enemies, it's an action/rpg so seeing damage feels important. I also have a small healthbar that's visible recently after being damaged, which lets you see relative health.

The issue with the floating text is that in groups or with fast attacks, they overlap entirely, so you can't read it.
So I added collision detect, and the text, on generation, finds on open spot rather than right on top of another one. This works so-so.

However, when it gets to double, triple digits, I'll need a variable mask size to take that into account.
It feels like overkill at this point, anyone have suggestions?
 

NightFrost

Member
I tried tackling this problem a good while ago. I had the floating text stream have a certain default "scroll speed" by which it floated up. When messages needed to be added so fast that they would start overlapping, the speed would go up. It simply calculated how much room was missing for a new line to fit without overlap, and added that to scroll speed. Only when there was enough room for a whole new message to fit, the speed would go back down to default value. I didn't really like the implementation for how jerky the scrolling became, and of course with lots of messages it runs fast enough to be unreadable. The scroll speed changes probably could be smoothed out by lerp()ing intelligently, and have a result that actually looks decent.
 

Schwee

Member
Have you taken a look at similar games and how they handle the issue? I'm guessing the solution relies in just being creative moreso than complex code.
 
Top