r/howdidtheycodeit • • Jul 07 '26

Question MOBAs - The spells, statuses,...

Hello,

I've been wondering about how games like Dota 2, LoL, Deadlock are implemented.

These games need to handle extreme variety of statuses/effects. Each spell can have different behaviours (e.g. can stun, temporarily move the target to air, push them, apply stacking effects, apply poison, freeze the enemy,...), which can further be affected by certain modifiers (resistances).

How does one code a system, that can both handle the stats (simple modifiers to atomic statistics - like speed, health), active effects (stun) or the spells themselves (with different targets, area of effect, duration, conditions for initiation, stop conditions,....)?

Is this similar to systemic design of immersive sim games like Thief, System Shock and so on?

How does one organize the concepts efficiently and handle their ordering/communication,...?

41 Upvotes

11 comments sorted by

View all comments

Show parent comment

3

u/brecrest Jul 08 '26

This is the correct place to start. When DotA was being made, roughly half of the spells and effects were based on basic interactions built into the WC3 engine, and the other half were based on interactions built out of the scripting language that WC3 shipped with more or less from scratch and in ways that were absolutely never intended to be possible using the tools and scripting language provided.

The answer for "How do you make it all interact smoothly" is that you don't. The emergent interactions of the abilities and effects, arising from race conditions, edge cases, etc, are, on a fundamental mechanical level, what made mobas etc what they were and why people enjoy them deep down. Those irregularities in how things work depending on circumstance etc are what create the mechanical depth and complexity of good moba gameplay, and you will not be able to emulate it purposefully - it will feel tacky and overdesigned if you try.

t. Was on the beta team for dota for a hot minute back in the late oughties.