# 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?

## Comments

• 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

Thanks for the reply though
• Finding one will be the interesting work cause most that need it in MS .NET get it either from DX or XNA where you have high end opted ones present.

Good thing is there are articles like http://www.gamedev.net/reference/articl ... le1095.asp which will definitely help you to create an own one. Potentially ODE already contains such a thing.

As for the stored information: Vector3 for rotation is a bit troublesome, cause euler angles suffer from gimbal lock (see article above), even matrices suffer from gimbal lock. For that reason, rotations are normally represented as quaternions
• I found something that may be exactly what im looking for
Its a 3d class written in c++:
http://www.fastgraph.com/makegames/3dro ... dsrce.html
DO you guys think that it looks like that its what I need? If then I will convert what I need to c# and give it a try.
• ✭✭
Another idea: move the projectile item with a move operation. Other players will see it moving with their interest area and can do a collision detection. They can notify the server when a collision happens. You can also attach a second interest area to the projectile item to make sure that the shooting player sees who is hit. Using this method allows the shooting player to do a collision detection as well.
Sign In or Register to comment.