# Server Item Movement

edited August 2010
So basically when you make a shooting game, and then you shoot a projectile that goes forward infinitely, how you code in the server the instructions to move the object forward? I know that I need to do some matrix calculation and get direction coordenates and all that, but all I find in the internet is specific to an engine or something that is at least half made.

A good example of what I want to achieve is the function in unity that is called MoveForward
When you call that function the gameObject starts moving always pointing to the direction that you rotate it, if it is going parallel to the ground on the X axys and then you rotate it 90 degrees upwards, it then faces up and starts moving on the Y axys untill rotated and pointed to another direction again.

I want that because when I shoot a missle in my game I want the server to tell it to keep moving in the direction it is facing. I already have the position and rotation coordinates stored in my item, what else do I need?

• You will either want to write it yourself (the book 3d math primer for graphics and game development is top for it) or find a .NET library for the purpose.
you will need to store position and rotation (quaternion) at very least to do that.

In addition you need to update the projectile or better all dynamic object at discrete timesteps (the same that is used to send out player positions etc), the scheduling mechanism offered through the lower layer functionalities in Photon is optimal for that.

But there is one major point you / we are omitting here: the movement calculation is basically worthless without collision, cause the server will not know of any hit or anything alike.
For collision the easiest approach like is ODE.NET, just cause it exists and is pure collision, no overhead.
• dreamora wrote:
You will either want to write it yourself (the book 3d math primer for graphics and game development is top for it) or find a .NET library for the purpose.
You have no idea how glad I would be if there was one library that would fit.
If anyone is familiar with any library for that I would love to know about, I will post that in unity forums too, someone there might know about that.
dreamora wrote:
you will need to store position and rotation (quaternion) at very least to do that.
Im already storing it in Vector3 position and rotation, does that help?

I will check OLE.net right now