Wizard Dev Log 3, Fireball again
Dev log 3, fireball continued.
I’m sure you remember this from last time. Here’s what’s happening.
Starting with the bottom, this code will execute when anything collides with the center of the fireball (that’s why it’s called CollisionPoint). To prevent the fireball from exploding on spawn, it uses the collided actor to cast to the first person character blueprint. If this cast fails, in other words if the object isn’t the player, the ball takes a damage.
When it takes this one damage, the Damage Macro handles it. The macro has two jobs, reducing health and determining what type of damage was dealt (oh yeah, different spells do different damage types). The health damage function is simple, so I’ll ignore it. The strange method of getting the damage type by using a table of E_DamageType Enums instead of Damage Type Object reference is another symptom of my stupidity. I copied it from a tutorial that claimed to have a way to make different damage types deal different damage, but I couldn’t even follow it. Either way, a table takes damage types and turns them into integers I can use in a Switch on Int node.
Going back three pictures to the part labeled “Damaged,” you’ll see two more functions, Explode Basic and Explode Flame. You can guess what damage type triggers Explode Flame, and everything else just does the basic one. That’s the basic part, time for hell.
The BOOM component is set to visible. Using the M_LaserPointer-Core material, it has a fancy little effect that I could not hope to replicate. Then a 200 radius sphere trace is going to deal damage to everything around it.
Unfortunately, before it can do damage it needs to check if it deals damage to an Earth Pillar, another spell. When it deals fatal damage to one, shards of rock will be launched away from the fireball. Visuals for the shards do not exist yet. The Rot(ate) Vector calculates where the shards will end up, before adding that value to a list housed in Game Mode again. Damage is then applied.
After all damage has been dealt, another sphere trace with a lesser radius looks for the player. If it hits, it will launch the player a bit, multiplying the impact normal of the trace by -1000 to get the velocity. If the trace hits nothing, it doesn’t hit a player, or after it launches, the lifespan is set to 0.5 seconds. I think this is just enough time to let you get a good look at the fancy texture without staying too long.
The other function, Explode Flame, is the exact same with three differences. 1, it shows a bigger, red circle. BOOM_BIG uses the laser pointer material, but I made it red.
Second, it has bigger radiuses for both sphere traces, 200-> 360 and 160 ->270. If you were perceptive enough to see that 0.01 second delay earlier, this is because UE5 is weird. The other spell that does fire damage also launches the player by a lower amount. If you hit a fireball with it, that little knockback would override the fireball’s. Thanks Unreal. Anyway, now it doesn’t, and the knockback practically multiplies, making it feel like Explode Flame has a stronger blast than the normal one despite not, which is useful. Thanks Unreal.
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 6, Brick4 days ago
- Wizard Dev Log 5, Random BS20 days ago
- Wizard Dev Log 4, Lightning Bolt20 days ago
- Wizard Dev Log 2, Aim Assist24 days ago
- Wizard Game Dev Log 1, Fireball25 days ago
Leave a comment
Log in with itch.io to leave a comment.