What is the Best Way to Create a Boss Battle?

I am currently trying to create a bossbattle for my game. I have no clue where to start though. I have all the ideas prepared the ready to go. How could I execute this?

Hey, happy birthday!

Generally, boss battles will operate on recursive functions and I assume you’ll want attacks to execute randomly.

You’ll be utilising the TweenService a lot during development and it’ll be a good backbone for making them later.

I recommend dropping all your attacks in functions and making parts Tween to different places, while attributing damage or other things to those parts in separate scripts or even in the same script. If you want to do it in the same script, I recommend you utilise the coroutine function in order to make sure code does not cancel on itself from a fluke.

If I wanted to make a function for some attacks, I’d do it something like this:

local Attacks = {}

Attacks['Attack1'] = function()
    -- Insert attack functions and other things you want
end

Attacks['Attack2'] = function()
    -- Insert attack functions and other things you want
end

--[[ 
    Insert how you want the attacks to play out here; you could use a while loop or make them
    go recursively and wait for the other attacks to finish before doing others
]]

I won’t write code for you unfortunately, as I don’t think that’s the way to go with helping developers evolve.
Either way, this is somewhat the groundwork of what I’d do, as someone who has a lot of experience in Lua, but hasn’t made a boss battle before.
You’ll be working with a lot of things, so I’d say take it slow, do your research and test more than what seems enough.

Best of luck and happy coding!

1 Like

When creating these functions, wont you have to go out and animate each type of attack?

I suppose so, yeah.

I can’t really think of any other ways to do it, but anyone else can provide anything they want to.

You can make the entire animation one and then trigger attacks at certain points, but that may make the boss battle really readable by players.

It obviously depends on how difficult / easy / random you want your boss to be.

If you want to have one entire attack cycle that maybe gets faster as the boss loses health, you can jam it all into one function then make the current attack dependent on the animation’s time position.

Of course, it’s all down to your interpretation as you make it.

That is the problem. I do not know how to animate. Which would make it harder on my side :frowning:

1 Like

Are you working in a team of developers? If so, do you have an in-house animator?

I wish I had a team. Nonetheless… friends

But, the animator I currently have is default roblox animator.

In hindsight, you don’t have to animate all of the attacks if you put the boss character in something like a flying ship that drops down bombs or something like that.

You can get around animating by taking shortcuts and it won’t really have that bad of an effect on the boss battle.

but I could still use the functions that you said?

If you take ‘Survive The Disasters 2’ for instance, one of their ‘disasters’ is just a UFO with a beam that goes across the map in directions based on player positions.

You can replicate something like that.

Of course!

It’ll all work in the same fashion, animations or not.

I’d recommend Moon Animator, honestly.
It has a lot more features and functionality over the default roblox animator, in my opinion. And, I’m not even an animator.

1 Like

When I see Moon Animators UI, I immediately uninstall the plugin. For me, its too advanced

Yeah, that’s fair.

If I can endorse you to give it a try, I will, though!
It is honestly so much better than ROBLOX’s in-house animator by both personal and outside anecdotes.

Here’s a video I just searched up, feel free to take a look if you haven’t already:

Of course, if you don’t want to use it, for simple purposes such as boss battle animations, ROBLOX’s animator will do the job that Moon Animator can also do.

I saw that video for Moon Animator. That was the reason why I uninstalled it. He made it seems complicated and I just gaveup.

Ahh, okay.
Well, you can avoid complicated animation if you wanna by using bosses that don’t really require animations and instead just tweens.

Inverse kinematics can be used as a replacement of some animations, but for other attacks, it has to be done by hand.

Inverse kinematics? I dont understand

Just google it, here’s an example:

Are you looking to make a boss fight but the player has to use tools (crossbow, bow, etc) or are you looking to make a passive boss fight where you just get that perfect chance to hit the enemy (Field Trip Z boss fights are an example of passive boss fights). Anyways, here is what you will need to do.

this module caters to passive boss fights, throughout the time

local BossFightModule = {}
BossFightModule.__index = BossFightModule

function BossFightModule.CollectBossFightInformation(Boss, time, totalportions)
local self = setmetatable({}, BossFightModule)

self.Boss = Boss
self.time = time
self.totalportions = totalportions
self.individualportiontime  = self.time/self.totalportions



return self
end


function BossFightModule:StartTime()
for i = self.time, 0, -1 do
self.time = i
     end
end

function BossFightModule:PortionEnd()
self.Boss.Humanoid.Health = self.Boss.Humanoid.Health - self.Boss.Humanoid.Health/self.portions
end


Because you are probably aware of oop and modules, I don’t really need to put in how to implement it. Though, if you want to learn how to implement it, you can reply to this post. This is of course not including things like animating, which it is not that hard to implement (but you don’t have to do it at all)

1 Like