Tower Defense Starter Kit

Hello **Stormrage256.
We using spline based because tanks moves better in this way imho. We imported it as static mesh because this is only way to replace character to our mesh

UPD: We started from scratch. Imported our tank and made static mesh in blueprint and will animate wheels here. Now how we can replace enemy character?**

[USER=“816769”]Z PRODUCTION[/USER] Awesome! In that case, you won’t have much work to do. Just head over to the BP_EnemyAI_Parent blueprint and reparent it to the Pawn class, This will remove the default capsule collision, skeletal mesh, and character movement components from the blueprint.

Now add a new collision component of your choice through the components tab and make it the root component. Make sure to set its collision settings to be same as that of the capsule collision from default AI parent blueprint.

Then create child blueprints inheriting from the new parent AI class. Add static mesh components as required to these child classes and make sure to set their collision settings to match the default skeletal mesh component settings. As for the character movement component, you won’t be needing it since your AI relies on spline-based paths.

Stormrage256 Hello. Thanks.
So i made like you wrote and seems all correct, checked it couple times. But when i start game i can not see any spawned objects.

Since we can see the health bars, the bots are being spawned. So it might just be an issue with the meshes. Could you share screenshots of the new AI parent and child blueprints?

here is it

Well, have you added static mesh components to all your child AI BPs? If you have, try increasing the scale of the static mesh and raising its z offset to be above the box. I just want to make sure that it’s not under the floor mesh.

they spawned but not moving

I think that’s because you were using the static navmesh based example. Could you try the same on the spline-based map?

Oh, you right. It is work! Great. So will work on units for now. Thanks a lot. Will back to you later. Thanks again!

Glad to hear that it’s fixed.

Hello!

I may have found a bug that i want to report, or would like some help to correct my mistake ^^

So, i tried to modify the “Tower Functions Array” in BP_GameInstance so that one of my tower (let’s say “Laser”) doesnt benefit from one of the functions (let’s say “sell”).

At first it works like intended: function is greyed out and player can’t interact with the button.

But as soon as the tower kills a unit and if, only if, you still have the tower selected, then all the functions become available and you can use “sell” with “laser” on this example.

If you deselect the tower, then it fixes itself, but the bug can still be exploited and the player can use every function as long as he keeps targeting a tower when it kills a unit.
Can you reproduce this bug? Am i doing something wrong? How can i fix it?

Thank you for any help you may provide, and thank you for this great toolkit!

@TGHYEM Thanks for bringing this to my attention. I’ll check it out at my end and let you know how to fix it.

@TGHYEM Hey, I was able to reproduce the bug. Thanks for providing the necessary steps.

So basically what’s happening is that every time an enemy unit dies, the game awards a certain amount of tower resources to the player. And this could have an impact on what tower functions are usable at any point in time. For example, if your Laser Tower requires 180 resources to upgrade, and you have only 175 at your disposal, destroying an enemy unit might net you an additional 10 points, thus providing you with enough resources to upgrade the tower. In order to accommodate this scenario, the tower build/functions buttons are being refreshed everytime the player receives/loses tower resources. And as you have already noticed, even deactivated tower function buttons are getting refreshed.

This issue can be rectified by adding an additional check to determine if a tower function button needs to be refreshed. If you check out Widget_TowerFunctionsButton, you will notice that it has a boolean variable named Activated?. This variable is set at the time of widget creation based on whether the associated tower function is available to the selected tower. If not, it is set to false. So every time, the button is asked to refresh itself, you can just check if it’s in the activated state as shown below:

That should fix the issue you’re facing right now. If it doesn’t, just let me know. Anyways, thanks again for pointing out the bug. The official bug fix update will be submitted to the Marketplace later today.

I tried your fix, and i can confirm it works like a charm! Thank you so much for your prompt reply, really appreciate it!

Glad to hear that it worked. :slight_smile: I’ve submitted a new update with the official bug fix. It should hopefully become available sometime this week.

The v2.3.1 update of Tower Defense Starter Kit has gone live on the Marketplace.

Change Log:

  1. Bug Fix: Disabled Tower Function buttons no longer gets activated when Tower Constructor UI is refreshed.

Hello again! I have a question regarding the modification of enemy characteristics.
As i understand it, enemy attributes are defined in DT_EnemyAIStats. And indeed changing HP, AttackDamage or even PlayerScoreModifier has an effect in game.
Everything works fine except for “MaxMovementSpeed” (and maybe MaxAcceleration, didn’t try that one yet as i don’t really need it).

When you change “MaxMovementSpeed”, the game will display the new value as expected when you select an enemy unit, but the movement speed is not actually changed.
For example, runner’s 'MaxMovementSpeed" is set to 400 by default. If i change it to 200, correct value is displayed but the movement speed remains the same (yeah… can’t really see it in a screenshot :p).


It seems to me that the enemy’s movement speed is determined by the “walk speed”'s value as shown in the next screenshot. But somehow this value is not the same as “speed”'s value, which is itself automatically set in accordance with what the user defined in DT_EnemyAIStats.


It can be changed manually, for sure, but i’d think it defies the main purpose of DT_EnemyAIStats: the ability to change every stat in the same place.
To this end i made a small change in the “Move to Exit Point” function in the “BP_EnemyAI_Parent” to be sure that the enemies are using the value defined in DT_EnemyAIStats.


It may not be the most elegant solution but it works for now. Regardless, i’d be interested in your take about all this. Did i miss something? How would you fix it? Thank you!

Hey, thanks again for pointing out the bug and providing all the details. I was able to reproduce it at my end as well.

The movement speed of AI bots was not getting updated because the ‘MaxSpeed’ variable was only being used to set the spline path movement speed. As a result, changing the data table entries were not having an effect on the map that showcased navmesh based movement. The solution as you’ve already figured out is to set the character movement component’s walk speed manually. But instead of setting it in the ‘Move to Exit Point’ function, I would set it in the construction script itself.

So basically the data table parameters are passed through to an AI bot at spawn (thus setting the Speed value), and this information is used to set the character movement properties while the actor is being created. Since the character component is a predefined system inherited from the character class, we can’t really set its properties directly at spawn. So I guess this is the best we can do in this situation when it comes to having a streamlined solution.

As for the ‘Acceleration’ parameter, it’s being used only for spline-based movement. I’ve updated the variable name to reflect that.

Again, thanks for sharing the issue. I’ll submit the official bug fix update to the Marketplace later today.

Thanks for clearing that up, really appreciate it!

Happy to help! I’ve sent the updated version to the Marketplace team. Should be available for download within the next few days.