Wizard Dev Log 6, Brick
Hi again. I've been swamped with uni, so I haven't made much progress on the game. With my first round of midterms done, I should have extra time to make a few more posts. I was inspired by this post when working, along with the coin from Ultrakill.
I just think it’s much funnier for a wizard to throw a brick than shoot a gun.
Ok so basically, the brick does damage based on its velocity, which is based on the player’s velocity. To do this, I add the player’s horizontal velocity to the brick as soon as it spawns. Most of the code for spawning is from the first person starter content, so you can find it yourself easily.
On spawn, it sets up the game mode reference for future use and takes the current velocity’s magnitude to be scaled, clamped, and rounded.
You may think that rounding to an integer and before instantly making it a float is a waste. You’re probably right. Anyway, that delay is like the one in the fireball, allowing other forces to act before getting in the queue. I used to have this check right as it impacts something, but that was a stupid idea. The damage would randomly be higher or lower because the velocity would be sampled after physics resolved. Sampling it at the start is the better option. Dividing by 50 ended up being the sweet spot, putting the damage at 40 without movement. That’s better than the wind blade, but worse than the flame blast. If you throw the brick at high speeds and hit, you’ll be rewarded with a good amount more damage, but not quite enough to invalidate everything. All the numbers will need tweaking of course, but the general power dynamic of wind blade being weak but fast firing, flame blast being powerful but with low reach, and brick being in the middle is what I’m aiming for.
This should look familiar, as I had a very similar set up for the fireball. Depending on the damage type taken, the brick could do three things currently. If hit with fire, the niagara system will activate, giving it a trail of fire. I used a guide by https://www.youtube.com/@GabrielAguiarProd for the fire, which I highly recommend. It also multiplies the end damage dealt, so the change isn’t purely visual. If earth damage is somehow dealt to a flying brick, nothing happens, but if a wind spell hits it, it instead acts like a coin from ultrakill because I’m unoriginal.
It finds the nearest enemy, makes sure it’s within a rather big radius, and fires directly at it. You know how this works.
This is another simple part. The first picture is just code inherited from BP_FirstPersonProjectile, with some checks to make sure the brick is alive and not hitting the player.
You can also reason through this next part. You can see that the damage is multiplied as stated before, usually by 1 for no real change. The main interesting part is that if it does hit an enemy, a variable tracking how much mana should be given to the player is changed.
The last part manages what happens on the brick’s death. It has two important goals: letting the smoke clear without suddenly disappearing and giving mana to the player. It also sets the brick to dead but who cares.
The “Mana Recovered” variable has a default of 0, but depending on what other events have triggered it may recover more. The other nodes are more complicated, but add up for an effect where on hit, the brick is destroyed as the fire niagara system is allowed to finish before the actor is deleted. Like, comment, subscribe, hit that bell
Wizard Game but bad
It's ultrakill but sucks and with spells
Status | Prototype |
Author | ACultLeader |
Genre | Shooter, Action, Platformer |
Tags | Singleplayer, Unreal Engine |
More posts
- Wizard Dev Log 5, Random BS18 days ago
- Wizard Dev Log 4, Lightning Bolt19 days ago
- Wizard Dev Log 3, Fireball again23 days ago
- Wizard Dev Log 2, Aim Assist23 days ago
- Wizard Game Dev Log 1, Fireball24 days ago
Leave a comment
Log in with itch.io to leave a comment.