Section Production Progress

Hi again Dan, I love how engaged you are. Not much left in the section, however we will cover a lot more in the next section which we will encourage you to come back an apply to BattleTank.

I might be a bit late, but i just made it to the AutoMortar.

Is there still a mortar meshed model needed ?

I did one in the last hour and textured it somehow, i would like to give it to the course for free.
Model, mesh and texture were all done by myself.
It comes in 3 seperated objects: Foundation, rotating support and the gun with attached ammo-box.
Since i use a very old version of AC3D, it is an obj-file.
Maybe someone with Blender knowledge can unwrap it, gives it a better texture and ambient occlusion plus export in the right format ?

Here is a picture:

Awesome, just upload to a file sharing service like Dropbox or similar and link here . Thanks!

Mortar battery in action:

I encounted a problem. Using the visibility trace channel means you will also hit UI widgets meaning it was possible for me to try to aim for my own even though it was set so only other tanks could see mine causing weird barrel movements. To fix, instead of using ECC_Visibility for the trace channel use ECC_Camera, though the easier fix for you regarding editing the section would probably just to change the property of the Widget instead, so you overlap visibility instead of blocking it.

The problem was that it left health bars that looked empty to the player but actually had a very small fractional amount of health. Of course there are other ways to solve this, @DanM, but we found the health point system to be the simplest conceptually.

Surely the simplest solution is just doing < 1 or what I described above, depends how big you intend to have the widget I guess.

There are many possible solutions. I felt that using a constant wasn’t as clear. The size of the widget was another factor so I didn’t want that to affect the constant.

By constant I assume you mean, what you are checking against CurrentHealth, in which case both do that, just the one presented in the lectures needlessly casts to ints as well as needlessly clamping.

Actually by constant I meant the < 1. What you choose to make it less than is arbitrary and depends on the size of the UI.

…Which is what you are checking against CurrentHealth.
Your code:

if (CurrentHealth <= 0)

My code:

if (CurrentHealth <= 0.f)

The problem we had with that was if we subtract 0.2f on each damage, we would end up with a non dead tank with a basically zero health bar. It didn’t look good. To solve this with floats you would need if (CurrentHealth <= SomeSmallFloatConstant). We felt it was neater to use quantised health points.

I just grabbed the latest commit to check how the varying code looks, and this is what the shipped version looks like

So apparently your method didn’t actually solve the problem.

Edit: So it looks like that was actually dead and I was expecting it would be destroyed rather than detatched, after also realising the default starting health was changed in the BP I set that to 100 and the projectile damage to 99 and 98, they both look like that, only < 97 would you actually notice the bar. In the end I still think don’t see a reason for just not simply doing a standard < or <= possibly with a FMath::IsNearlyEqual if needed.

Edit 2: Also if you’re going to be taking 0.2f damage, rounding to ints would mean you would never do damage.

You’re absolutely right and I think that both solutions are valid. I think there’s very little in it and it comes down to preference.

Sorry by this I meant 20 integer damage points, 0.2f float damage.

I don’t understand. 0.2f float damage would be 0 interger damage according to the code.

int32 DamagePoints = FPlatformMath::RoundToInt(DamageAmount);

Edit: Still strugling to understand the logic here, having the damage system using ints or floats won’t change the problem you said you were having.

Yet neither solution would solve the problem…

Hi,

a friend of mine ( Username Hex in this forum ) did some texture magic, scaled it perfectly and this is the result:

Here is the downloadlink:

Mortar Mesh, Textures and Materials

Content is all made by Hex and L-Tec and free to use without any limitiations.

Have fun.

2 Likes

It’s just a game design decision as to whether you want discrete damage or continuous. Obviously continuous is easy to do as it’s built in. This section also shows you how you could leverage that system to provide a discrete system.

But as you say neither really solves the health bar issue. Perhaps that could be solved by saying that there’s always a fixed percentage of the bar which shows up full when nearly out of health but then goes to zero when the tank dies. Or perhaps the bar disappears entirely when a tank dies.

Privacy & Terms