Contract Bridge - Purpose of 4 diamonds bid by West
I expect a lot of this is due to the players not knowing what they, or their opponents, are playing.  I don't know if the other players are bots or human, but if bots, the bidding is odd.
The SAYC book doesn't talk about balancing much, but it does say about direct overcalls:
&quot;Overcalls show 8–16 points (double and bid the long suit with a stronger hand)&quot;
&quot;Jump overcalls are preemptive, showing the same value as an opening bid at the
same level&quot;
So I don't think anybody understood your 3C bid, and I think that causes a lot of confusion.  But you're nowhere near the only one.
I would read this auction (all players playing SAYC):

1S: 11-21, 5+S
P: nothing to say (legitimately.  You will see some people saying you have to get in here with a double, especially if you can correct 2C by partner to 2D without showing extra strength, a convention known as Equal Length conversion.  But it's ugly, and &quot;standard&quot; is pass).
P: bad hand (usually &lt; 6 HCP, weaker hands with support may still bid)
3C: not exactly a preempt, in balance, but a &quot;only plays in clubs, trying to freeze out opener&quot;.  x KTx Ax KQTxxxx or the like.
3D: I have shape, 5=4 or 5=5, and enough extra that I think I can play opposite your horrible hand.
P: Still nothing to say.  Reading Joe's comment, he's probably right that she should double this, though (for penalty). But it's likely that she thinks you have a real preempt, and the only tricks your side is taking is in her hand, and it's not enough.
3H: Yeah, my hand is worth zero tricks in your suits and two or three in mine, let's hope your hand has tricks for me.
X: I don't know what's going on, but this is a misfit and I have tricks.  Maybe I'm 1=4=1=7?
4D: I lied to begin with, I'm 5=6 not 5=4, and I'm panicking.
X: They aren't making this, partner, someone's finally bid my suit.

Out of the actual bidding with the actual hands, I like North, and, I guess, East.
Why did West open 1S and not 1D? He's bidding on shape not strength, lying about the shape because of the 5-card major is going to cause trouble like this hand.  It's also going to lead to 4S with 6D on with a different hand in partner. There's an argument for passing this and hoping to get in with a two-suited bid next round, as well, but if you open, you have to open 1D.  Yes, you can get into trouble with an auction where bidding spades shows reverse strength (good 16), but starting with spades causes this problem.
I'm guessing 3D is &quot;hmm, I've totally misdescribed my hand, I need to show my diamond suit.&quot;  Never mind he knows they have max 15 high and potentially no fit.  Sure, you have a good preempt, but your partner has the rest of the cards, and no bid - so probably &quot;my suit&quot;.
I don't mind 3H, because she's right - we're in trouble, and it plays a couple tricks better in the weak hand's long suit.  She doesn't know that partner has nowhere near the hand he claims to.  But I'm not doubled yet; I'd probably pass 3D and see if we can get out for 100 a trick.
Your second double is not takeout - for what suit? They've bid the other three.
4D is pure panic.  He knows that he has mis-described his hand to partner and they're in trouble.  He should still pass and hope to get out (and he won't).
A more common auction playing SAYC would be:
1D-p-p-X
1S-2H-p-3C
p-3S (looking for stopper)-p-3NT (I have one)
All pass.
There's a lot of ways this could go - West could pass the double; North could think he was too strong for just 2H; South could insist on clubs rather than look for NT (or look for slam, potentially and go past 3NT); in a non-YC game (or by pairs who &quot;play&quot; SAYC, but don't actually know what the book says), East could bid 2H over 1D Weak Jump Shift;...
I might be resulting getting to the only contract that makes, and it is truly unfortunate that 5C, never mind 6, goes down because East's hand is too good.
I expect a lot of minus scores on this hand, some very large ones and some North-South as well.  Misfits are always exciting, and very hard to bid, and sometimes get deeper into &quot;nothing makes&quot; territory before people learn to stop.  It's a common maxim: &quot;When you know you're in a misfit, pass.&quot;
Finally, another of those common maxims is &quot;don't bid your values twice&quot;.  If you really thought that 3C showed 16 or so and a semi-solid suit, then when 3H comes to you, you have nothing more to show.  Pass.  Partner with this hand will double 3H for the same 1100 (and somebody will double 3S or 4D if they run); with say xxx Qxx QTxxx xx (giving opener AKxxx Kx AKxxx x, a quite reasonable hand for 1S, then 3D), they'll hope it goes down one and that any plus is a good score.