In online games like World of Warcraft, a single spell cast involves four separate client-server communications: the client performs local predictive checks (range, facing, resources), the server responds with a spell start message that drives the cast bar and windup animations, the server sends a spell go message upon completion to trigger the projectile and impact effects, and finally the server sends a separate damage packet that the client displays as combat text and health reduction. The client never independently calculates damage or determines spell outcomes—it simply displays what the server tells it, ensuring game state consistency across all players.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
One Fireball, Four Packets - Rebuilding WoW in Unity #13Added:
Welcome back to Rebuilding Wow in Unity.
This is devlog number 13.
This week, there's just one feature and I want to go deep on it.
Casting a spell.
You press a button, a fireball winds up, launches, and lands on your target.
Simple.
You've done it thousands of times.
Except it isn't simple.
Behind that one fireball, there are four separate conversations with the server.
And the client, the thing you're actually looking at, never once works out how much damage you did.
Let me show you the whole thing working.
Then, let me pull it apart.
Here it is, start to finish.
I press the button and my character begins the cast.
The windup animation, a glow gathering in the hands, the cast bar appears and fills.
The instant it's full, a fireball launches, arcs across to the target, and detonates where it hits.
A moment later, the damage lands and the health drops.
The visuals aren't approximations.
Every spell in Wow carries a chain of references in the game's own data files, pointers to the spell effects for the windup, the missile, and the impact.
I read that chain and play it back.
So, what you're watching is the real fireball straight from the original assets.
Overall, it looks like one thing is happening, but in reality, there's four.
Let's take them one at a time.
So, it all starts with the player pressing an ability.
When I press the button, the client does a little homework before it bothers the server.
Are you in range? Are you facing the target? Is this a spell that even needs a target?
If any of those fail, the cast stops right here, and you get that familiar red error text on screen saying, "You're not facing the right way." for example.
One check I haven't fully wired up yet is the resource cost. So, mana, energy, rage.
On the real client, if you can't afford a spell, the button greys out, and you get an instant "Not enough mana." error message.
Um mine doesn't do that part yet. So, for now it attempts to send that cast anyway, and lets the server bounce it back. Uh so, something to tidy up.
But, it's a nice illustration of the split that runs through this whole thing.
The client does the cheap, local, predictive checks.
Uh range, facing, cool down.
And the server stays the final word on everything that actually counts.
Say the checks pass.
The request goes out, and the server answers with a spell start message.
This is the one that drives the cast bar.
And that's the bit worth sitting on for a second.
The client isn't timing your cast. It doesn't decide that a fireball takes 3 and 1/2 seconds, for example.
The server says, "Start, and here's how long." And the bar fills to match.
Everything you see from this point, the wind up pose, the glow held in the hands, the bar creeping across the screen, is the client reacting to that one message.
It runs the clock locally, but the server is the one that sets its length.
Just painting what it was told.
Then one of two things happen.
If the cast completes, the server sends spell go.
The finish animation plays. There's a flash as the spell releases and the projectile launches and homes in on the target.
The moment it arrives, the impact effect fires where it lands.
Or if it's a spell you cast on yourself, that impact just plays on you instead.
Alternatively, if the cast breaks, you move your interrupted or you know, failure message comes back instead.
The cast bar collapses, the animation drops back to standing, and no projectile ever leaves.
Either way, the client never guesses the ending.
It winds up and then it waits to be told which one it got.
You've probably seen this yourself.
Cast something on a high latency connection and your character stays locked in the cast animation for a moment even after the bar has filled and vanished.
That's this exactly.
The client has done its part and now it's just standing there waiting to be told how it ended.
Now that the spell was successful and the fireball hits, it leaves the question, where's the damage?
That impact effect you watched, the explosion on the target, it's pure decoration.
The actual damage, the number, the health that drops, arrives in a completely separate packet.
A different message on its own that says, "This unit took this much damage."
The client reads it, prints the combat text, and watches the health bar drain.
So, the spell's visual and the spell's effect are two different things.
Sent at two different times.
The client paints the fireball.
The server, and only the server, decides what it did.
The thing you're looking at never computes a single point of damage. It just gets told and shows you.
That's the whole fireball. One button, four messages, and a client that's being told what to show along the way.
That's it for this week. One feature all the way down.
I've wanted to do a single system breakdown like this for a while. A few of you have asked for exactly this, and more of the how and less of the what.
So, if this is the kind of thing that you want more of, let me know.
There's a lot of the client built like this, and I'm happy to keep pulling threads.
Alternatively, if you prefer more of the what and less of the how, leave a comment also.
Thank you, as always, for the support, and I'll see you in the next one.
Related Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 views•2026-05-28
How agent o11y differs from traditional o11y — Phil Hetzel, Braintrust
aiDotEngineer
450 views•2026-05-28
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanation💯✅
LearnwithSahera
1K views•2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 views•2026-05-29
Search Algorithms Explained in 60 Seconds! 🤖💨
samarthtuliofficial
218 views•2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 views•2026-05-30
Introduction to Problem Solving Part - 1 | Lecture 1 | Intermediate DSA
ascensionix
107 views•2026-05-29
So What's Odin Lang Even Good For
TechOverTea
131 views•2026-06-01











