Combat Text, Health Bars, and Ship Death

Published July 12, 2015
Advertisement

Personal Update:


So this was my first week of focused game development. I took a break from the laminate floors and just worked on my game. About half-way through my first full dedicated day, an old friend/co-worker calls me to tell me about a game development job opening up at his company that he thinks I'd be perfect for. It's good money, and 90% work from home too. The only drawback I know about so far is that it wouldn't be MY cool turn-based space game. Instead, it would be educational games targeted towards younger kids. tongue.png

At first, I was dismissing it out of hand. But the more I thought about it, the better and better it sounded. It would mean dedicating less time to my game, but it would also put me closer to retirement. My interview is on Tuesday, but I'm not sure what I'll decide if I'm offered the job. Woe is me and my first-world problems...

Dev Update:


I spent the early part of the week cleaning up my combat text code and trying a few different techniques until I had something I was happy with. Getting text to look nice is not NEARLY as straight-forward as it should be. I might add a few more features and try to publish it on the asset store for a few bucks.

While I was headbutting Unity into producing pretty text, my wife worked through some health bar tutorials and got some decent graphics going there. I had to help her with some of the code but it was surprisingly helpful for her to work through the early steps while I concentrated on other things. By the time I had wrapped up my floating combat text, I was ready to plug in the health bars. I added an animating effect to them so it wasn't just an instant update.

Destroying the ship game object on death was easy, but it just disappearing was lame. So I iterated through the child hierarchy, split apart all the components, and added random force and rotation to each piece. So far, I think it's looking pretty cool.

I'm not sure what I'll be doing next week. Monday, I'll be preparing for my interview. If I get offered the job, I'll be focusing nearly all my efforts on HTML5 game development so that I'm better equipped to start my new job. If I'm not offered the job, I'm not sure which feature I'll work on next. Particle effects, shields, different weapons, different ship types, movement.



Tip from your uncle Eck:


World Canvas text has lots of issues. The canvas is MASSIVE and "normal" sized fonts (10-18 pt) look like pixelated garbage. Lots of posts say the "solution" is to use HUGE fonts (128-136 pt) and scale it down by 1/100th. To me this feels like a hacky-ass work aroundand there's also some graphical artifacts doing it this way.

WorldCanvasText.jpg
Take a look at the horizontal line in the k. It also makes shadows/outlines look like garbage (not shown). I'm sure there is a better solution with world-space canvases, I'm just not sure what it is. Instead I used an overlay canvas and just spawn it at the appropriate spot.
2 likes 12 comments

Comments

Eck

It's tough to make out in the screenshot, but that blurry bit of white above the k in hacky is very visible in the game. There's also a vertical line to the right of the k. Bleh.

July 13, 2015 04:44 AM
unbird

Your atlas "bleeds". When not using pixel perfect rendering (bilinear filtering) you need to grant your tiles/glyphs gap borders. One can also see a harsher cut at some left or right borders e.g. with h or m.

July 13, 2015 10:26 PM
Eck

Pixel Perfect is an option for Screen Space - Overlay and Screen Space - Camera, but unfortunately not for World Space canvases.

I tried messing with the Dynamic Pixels Per Unit and Reference Pixels Per Unit settings of the world canvas, but that seemed to make it worse for the scaled down version no matter what I tried. It made the massively sized 14 pt font look better though.

I don't see where I can set "bilinear filtering".

July 14, 2015 03:14 PM
unbird

I don't know how to set that in Unity but it looks enabled: One can tell from the big rendered text ([url="https://en.wikipedia.org/wiki/Bilinear_filtering"]wiki[/url]). It's also what graphics hardware can do and what you usually want for overlays/billboards, yes.

I can't give you links about the problem, neither how to tackle it with Unity, sorry. But it really looks like a bleed from one glyph to another. Could you upload the glyph texture ?

Edit: Hmmm, I wasn't quite right about one thing though. To tackle the cutoff one probably needs an expand those atlas rectangles - and even bigger gaps then.

July 14, 2015 04:40 PM
Eck

I can't upload the glyph atlas because this is all just built-in, default Unity components with the default Arial font. If it's a glyph-bleeding problem, it's Unity's fault! :) I haven't done anything weird at all with this setup and from what I've read (lots) its a problem with the world-space canvas.

If you can't tell me how to tackle it in Unity, unfortunately you can't help me get a world-canvas solution working. :/ I'm happy enough with my overlay canvas. It just seems like this should be much simpler than it is.

Thanks for your effort though.

July 14, 2015 05:17 PM
Eck

I went and did one more bout of searching and it looks like someone released a free asset for rendering 3d text: Typogenic. Apparently the solution was to implement a technique called "signed-distance field rendering" used in Team Fortress 2 and documented in this Valve paper.

Here are links to Typogenic:

https://www.assetstore.unity3d.com/en/#!/content/19182

http://forum.unity3d.com/threads/typogenic-advanced-text-rendering-free.254978/

I'll do some research and probably post back next week or the week after.
July 14, 2015 05:32 PM
Orymus3

I'm intrigued :)

(competing with you!:

https://youtu.be/F4zDYAv3YKw

)

July 15, 2015 01:23 AM
Eck

Pffft. Moving ships? That's just showboating!

I like the screen shake and ka-boom on ship-death. My health bars blow yours away!

What's up with all the Tetris blocks over your ship portrait? We can switch to chat messages now.

July 15, 2015 06:29 PM
ferrous

Hey guys, I like both of your games so far, and I'm glad to see a bit of your conversation. I'm also making a turn based strategy game, though with ground vehicles, so slightly different. I'll have to get off my duff and update my unity link.

Anyway, Eck, have you thought about fading out your components as they fly out on ship destruction? Also, I like your animated health bar.

July 16, 2015 05:10 PM
ferrous

I'm intrigued smile.png

(competing with you!:

https://youtu.be/F4zDYAv3YKw

)

How do your movement arrows work? It looked like the direction of the arrow didn't line up with the final position of the ship at the end of it's turn.

July 16, 2015 05:12 PM
Eck

Hey guys, I like both of your games so far, and I'm glad to see a bit of your conversation. I'm also making a turn based strategy game, though with ground vehicles, so slightly different. I'll have to get off my duff and update my unity link.

Anyway, Eck, have you thought about fading out your components as they fly out on ship destruction? Also, I like your animated health bar.

Thanks for the suggestion and praise. smile.png I'll be looking into object fade before too long. I'm trying to work mostly on game mechanics, but I like to throw in cool effects every so often to make sure I can support it. I've been focusing on the business side of things this week (blech).

July 17, 2015 01:58 PM
Eck

I'm intrigued smile.png

(competing with you!:

https://youtu.be/F4zDYAv3YKw

)

How do your movement arrows work? It looked like the direction of the arrow didn't line up with the final position of the ship at the end of it's turn.

I'd like to guess, but Orymus3 can answer. It looks like the arrows are only partly related. I'm guessing that he's recording the world coordinates of the mouse cursor for his move orders. And then the ships start turning to face/move forward to try and reach that point. Since the turn-rate is limited, the ships can't always turn fast enough to reach their destination. It looks like the arrows are an indication of what direction and how far away the destination move point is.

July 17, 2015 02:03 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement