Game Development Community

Making attacks on server

by Jonathon Schad · in RTS Starter Kit · 05/19/2008 (2:27 pm) · 3 replies

Out of the box the RTS Kit simulates an attack on the client side. This plays the animation and makes the projectile on the client. For numerous reasons I want to move the attack to the server side. How would I go about doing this?

#1
05/20/2008 (8:46 am)
The actual attack is currently performed server side, and the application of damage is performed by the datablock of the attacker (eg see shockerBlock::onAttack) on the server.

On the client side, an animation is played by the attacking unit, and if the attack is non-melee, a fake projectile effect is spawned. No attack logic is done on the client.

Just out of interest, what is it that you want to achieve?
#2
05/20/2008 (6:14 pm)
Does the projectile and attack animation show up on all clients? I don't think they do, but I'm not sure. This would be the reason I would like it to be on the server so all clients would see projectiles and attack animations.
#3
03/03/2009 (11:25 pm)
*bump

I'm seeing something very similar and it is disappointing.

An RTSprojectile ONLY seems to want to render on the hosting machine, not on any client connected machines. Furthermore, explosions will only render on the host machine.

The client machines see their units taking damage from invisible gun fire but it would seem to me that all RTSprojectiles should be scoped to all clients. I'm sure the client players would like to see what is happening just like the host player.

Anyone solved this scoping issue?